capi-sensor: sync with SPIN tizen_2.4 22/49822/1 accepted/tizen/mobile/20151114.082259 accepted/tizen/tv/20151114.082415 accepted/tizen/wearable/20151114.082542 submit/tizen/20151113.112518
authorHongkuk, Son <hongkuk.son@samsung.com>
Tue, 20 Oct 2015 11:51:43 +0000 (20:51 +0900)
committerHongkuk, Son <hongkuk.son@samsung.com>
Tue, 20 Oct 2015 11:52:52 +0000 (20:52 +0900)
Signed-off-by: Hongkuk, Son <hongkuk.son@samsung.com>
Change-Id: I9717ada136cf433586dc9450f25727af28d97b70

doc/sensor_doc.h
include/sensor.h
src/sensor.cpp

index 73f26b724aac8c4d1c1d7dc0fc14a58f43c161e3..9140390b8d985bdb5da6d4540a50f7390383b018 100644 (file)
@@ -61,7 +61,7 @@
  *
  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
  *
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
  *
 */
 
  *
  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
  *
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
  *
  */
 
  *
  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
  *
- * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tools/native-tools/manifest-text-editor#feature"><b>Feature Element</b>.</a>
  *
  *
  */
index e884c634766ee97b7b69f62376de2f79208da7b7..26a4e4000cff79d7b20a83d8a8b585e000cbed74 100644 (file)
@@ -417,6 +417,10 @@ int sensor_listener_unset_accuracy_cb(sensor_listener_h listener);
 
 /**
  * @brief Gets sensor data.
+ * @details    This function may fail (return #SENSOR_ERROR_OPERATION_FAILED) if it is called before the sensor is ready.
+ *                     In case of interval-driven sensors,
+ *                     it is recommended to call the function after at least one sensor event is delivered.
+ *                     Otherwise, applications can retry to call this function to be sure that the sensor is ready.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in]   listener    The listener handle
@@ -428,6 +432,7 @@ int sensor_listener_unset_accuracy_cb(sensor_listener_h listener);
  * @retval      #SENSOR_ERROR_INVALID_PARAMETER    Invalid parameter
  * @retval      #SENSOR_ERROR_NOT_SUPPORTED        The sensor type is not supported in the current device
  * @retval      #SENSOR_ERROR_IO_ERROR             I/O error
+ * @retval      #SENSOR_ERROR_OPERATION_FAILED     Operation failed
  *
  * @pre In order to read sensor data, an application should call sensor_listener_start().
  */
@@ -435,6 +440,11 @@ int sensor_listener_read_data(sensor_listener_h listener, sensor_event_s *event)
 
 /**
  * @brief Changes the interval at sensor measurements.
+ * @details    The specified interval is only a suggested interval between sensor measurements.
+ *                     You will get at least one sensor measurement within the interval you specify,
+ *                     but the actual interval between sensor measurements can be affected by other applications and the system.
+ *                     To reduce the system overhead, it is recommended to set the longest interval that you can,
+ *                     because the system usually chooses the shortest interval among all intervals specified.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in]   listener       The listener handle
@@ -471,7 +481,7 @@ int sensor_listener_set_max_batch_latency(sensor_listener_h listener, unsigned i
 
 /**
  * @brief Changes the option of the sensor.
- * @details If it is default, sensor data cannot be recieved when the LCD is off and in the power save mode.
+ * @details If it is default, sensor data cannot be received when the LCD is off and in the power save mode.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in]   listener        The listener handle
index c214e38f60d322be17f6745f09f60387bc717b0e..754f0144909fd315d73898b6758c89375b5c8e4d 100644 (file)
@@ -522,12 +522,22 @@ int sensor_listener_set_max_batch_latency(sensor_listener_h listener, unsigned i
        if (listener->magic != SENSOR_LISTENER_MAGIC)
                return SENSOR_ERROR_INVALID_PARAMETER;
 
-       if (!sensord_change_event_max_batch_latency(listener->id, max_batch_latency))
+#ifdef BATCH_SUPPORT
+       int type;
+       unsigned int event_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))
                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)