From: Kibak Yoon Date: Mon, 16 Feb 2015 07:25:48 +0000 (+0900) Subject: capi-sensor: add sensor types for HRM sensor X-Git-Tag: submit/tizen_tv/20150226.040306~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c3bf3d2a968f73a1c8defed2e131c55019c7164;p=platform%2Fcore%2Fapi%2Fsensor.git capi-sensor: add sensor types for HRM sensor Heart Rate Monitor Sensor type is added and supported. added the following types: - SENSOR_HRM - SENSOR_HRM_LED_GREEN - SENSOR_HRM_LED_IR - SENSOR_HRM_LED_RED Signed-off-by: Kibak Yoon Change-Id: I5faf535c5c229809ff45ce53844a48f0bca7ff18 --- diff --git a/doc/sensor_doc.h b/doc/sensor_doc.h index 4a9ab19..bf3b708 100644 --- a/doc/sensor_doc.h +++ b/doc/sensor_doc.h @@ -46,6 +46,10 @@ * - http://tizen.org/feature/sensor.linear_acceleration\n * - http://tizen.org/feature/sensor.rotation_vector\n * - http://tizen.org/feature/sensor.gravity\n + * - http://tizen.org/feature/sensor.heart_rate_monitor\n + * - http://tizen.org/feature/sensor.hrm_led_green\n + * - http://tizen.org/feature/sensor.hrm_led_ir\n + * - http://tizen.org/feature/sensor.hrm_led_red\n * * It is recommended to design feature related codes in your application for reliability.\n * @@ -80,6 +84,10 @@ * - http://tizen.org/feature/sensor.linear_acceleration\n * - http://tizen.org/feature/sensor.rotation_vector\n * - http://tizen.org/feature/sensor.gravity\n + * - http://tizen.org/feature/sensor.heart_rate_monitor\n + * - http://tizen.org/feature/sensor.hrm_led_green\n + * - http://tizen.org/feature/sensor.hrm_led_ir\n + * - http://tizen.org/feature/sensor.hrm_led_red\n * * It is recommended to design feature related codes in your application for reliability.\n * @@ -113,6 +121,10 @@ * - http://tizen.org/feature/sensor.linear_acceleration\n * - http://tizen.org/feature/sensor.rotation_vector\n * - http://tizen.org/feature/sensor.gravity\n + * - http://tizen.org/feature/sensor.heart_rate_monitor\n + * - http://tizen.org/feature/sensor.hrm_led_green\n + * - http://tizen.org/feature/sensor.hrm_led_ir\n + * - http://tizen.org/feature/sensor.hrm_led_red\n * * It is recommended to design feature related codes in your application for reliability.\n * diff --git a/include/sensors.h b/include/sensors.h index ccd291e..f35c32d 100644 --- a/include/sensors.h +++ b/include/sensors.h @@ -134,6 +134,10 @@ typedef enum SENSOR_ULTRAVIOLET, /**< Ultraviolet sensor */ SENSOR_TEMPERATURE, /**< Temperature sensor */ SENSOR_HUMIDITY, /**< Humidity sensor */ + SENSOR_HRM, /**< Heart Rate Monitor sensor */ + SENSOR_HRM_LED_GREEN, /**< HRM (LED Green) sensor */ + SENSOR_HRM_LED_IR, /**< HRM (LED IR) sensor */ + SENSOR_HRM_LED_RED, /**< HRM (LED RED) sensor */ SENSOR_LAST, /**< End of sensor enum values */ SENSOR_CUSTOM = 10000 /**< Custom sensor */ } sensor_type_e; @@ -156,6 +160,8 @@ typedef enum * @brief Checks whether a given sensor type is available on a device. * @details Availability of a sensor should be checked first because this sensor may not be supported on the device. * @since_tizen 2.3 + * @remarks For getting a handle of HRM Sensor(including HRM_LED_GREEN, HRM_LED_IR and HRM_LED_RED) + * the privilege should be set to, %http://tizen.org/privilege/healthinfo. * * @param[in] type The sensor type to check * @param[out] supported If @c true this sensor type is supported, @@ -173,6 +179,8 @@ int sensor_is_supported(sensor_type_e type, bool *supported); /** * @brief Gets a specific sensor handle. * @since_tizen 2.3 + * @remarks For getting a handle of HRM Sensor(including HRM_LED_GREEN, HRM_LED_IR and HRM_LED_RED) + * the privilege should be set to, %http://tizen.org/privilege/healthinfo. * * @param[in] type The sensor type * @param[out] sensor The sensor handle diff --git a/src/sensor.cpp b/src/sensor.cpp index aaf974d..37f9457 100644 --- a/src/sensor.cpp +++ b/src/sensor.cpp @@ -59,6 +59,10 @@ sensor_type_t _TYPE[] = { ULTRAVIOLET_SENSOR, TEMPERATURE_SENSOR, HUMIDITY_SENSOR, + BIO_HRM_SENSOR, + BIO_LED_GREEN_SENSOR, + BIO_LED_IR_SENSOR, + BIO_LED_RED_SENSOR, }; static int sensor_connect (sensor_h sensor, sensor_listener_h listener)