Add condition in calling set batch latency 82/269182/1
authorTaeminYeom <taemin.yeom@samsung.com>
Tue, 11 Jan 2022 05:57:19 +0000 (14:57 +0900)
committerTaemin Yeom <taemin.yeom@samsung.com>
Tue, 11 Jan 2022 07:11:48 +0000 (07:11 +0000)
-If user didn't set batch latency, not call

Change-Id: Id8511bebf8a6dd60d3a67b996440c9fabb1963b4
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
include/sensor_internal.h
src/client/sensor_internal.cpp

index 9c9a16d..26a2918 100644 (file)
 
 #include <stdbool.h>
 #include <sys/types.h>
+#include <limits.h>
 
 /*header for common sensor type*/
 #include <sensor_types.h>
 #include <sensor_deprecated.h>
 #include <sensor_internal_deprecated.h>
 
+const unsigned int SENSOR_BATCH_LATENCY_DEFAULT = UINT_MAX;
+
 #ifdef __cplusplus
 extern "C"
 {
index f185e94..312b303 100644 (file)
@@ -599,7 +599,8 @@ API bool sensord_start(int handle, int option)
                listener->set_interval(interval);
 
        batch_latency = listener->get_max_batch_latency();
-       listener->set_max_batch_latency(batch_latency);
+       if (batch_latency != SENSOR_BATCH_LATENCY_DEFAULT)
+               listener->set_max_batch_latency(batch_latency);
 
        _D("Start[%d] with the interval[%d] batch_latency[%d]",
                listener->get_id(), interval, batch_latency);