From: Hongkuk, Son Date: Wed, 23 Dec 2015 10:45:47 +0000 (+0900) Subject: capi-sensor: fix sensor_listener_set_max_batch_latency() X-Git-Tag: submit/tizen/20151224.012206^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5191ca075991f43b3852143a20e8ee348d52bef;p=platform%2Fcore%2Fapi%2Fsensor.git capi-sensor: fix sensor_listener_set_max_batch_latency() Previously, it was skipped to call sensord_change_event_max_batch_latency(). Now modify to call sensord_change_event_max_batch_latency(). This returns SENSOR_ERROR_NONE. Signed-off-by: Hongkuk, Son Change-Id: I3598549decd019feb94badab73f5b4df5b3edbbe --- diff --git a/src/sensor.cpp b/src/sensor.cpp index 128f822..2b1f638 100644 --- a/src/sensor.cpp +++ b/src/sensor.cpp @@ -533,6 +533,10 @@ int sensor_listener_set_interval(sensor_listener_h listener, unsigned int interv int sensor_listener_set_max_batch_latency(sensor_listener_h listener, unsigned int max_batch_latency) { + int id; + int type; + unsigned int event_id; + _D("called sensor_set_max_batch_latency : listener[0x%x], max_batch_latency[%d]", listener, max_batch_latency); if (!listener) @@ -541,22 +545,16 @@ int sensor_listener_set_max_batch_latency(sensor_listener_h listener, unsigned i if (listener->magic != SENSOR_LISTENER_MAGIC) return SENSOR_ERROR_INVALID_PARAMETER; -#ifdef BATCH_SUPPORT - int type; - unsigned int event_id; - + id = listener->id; type = (int)listener->type; event_id = type << SENSOR_SHIFT_TYPE | 0x1; - if (!sensord_change_event_max_batch_latency(listener->id, event_id, max_batch_latency)) + if (!sensord_change_event_max_batch_latency(id, event_id, max_batch_latency)) return SENSOR_ERROR_NOT_SUPPORTED; _D("success sensor_set_max_batch_latency"); return SENSOR_ERROR_NONE; -#else - return SENSOR_ERROR_NOT_SUPPORTED; -#endif /* BATCH_SUPPORT */ } int sensor_listener_set_option(sensor_listener_h listener, sensor_option_e option)