summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-04-19 09:55:02 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2013-04-22 15:58:28 +0100
commitc2da27328bff555f75ab336f280688f05b4abc40 (patch)
treeab5458c0afadbb4ed9ec3e07c2cffacdbfb617f2 /src/lib/eeze
parent116013320a941357a925441928ea7e10ed6c0ebd (diff)
eeze/sensor: Simplify object handling in async paths.
This follows the simplified handling of sensor object we are already doing for the sync paths. Its a bit more complicated here as we need to pass all data through the module specific async handling. But the result should be the same.
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/Eeze_Sensor.h4
-rw-r--r--src/lib/eeze/eeze_sensor.c2
-rw-r--r--src/lib/eeze/eeze_sensor_private.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/eeze/Eeze_Sensor.h b/src/lib/eeze/Eeze_Sensor.h
index a1d3327376..67783760ec 100644
--- a/src/lib/eeze/Eeze_Sensor.h
+++ b/src/lib/eeze/Eeze_Sensor.h
@@ -148,6 +148,7 @@ typedef struct _Eeze_Sensor_Obj
148 float data[3]; /**< Sensor data depending on the sensor type */ 148 float data[3]; /**< Sensor data depending on the sensor type */
149 double timestamp; /**< Timestamp of data read */ 149 double timestamp; /**< Timestamp of data read */
150 Eina_Bool continuous_flow; /**< FUTURE USE: Continuous flow of sensor read out */ 150 Eina_Bool continuous_flow; /**< FUTURE USE: Continuous flow of sensor read out */
151 void *user_data; /**< Data pointer used for passing data to the asynchronous callback */
151} Eeze_Sensor_Obj; 152} Eeze_Sensor_Obj;
152 153
153#ifdef __cplusplus 154#ifdef __cplusplus
@@ -297,6 +298,9 @@ EAPI Eina_Bool eeze_sensor_read(Eeze_Sensor_Obj *sens);
297 * physical sensor. That might be a long time depending on the hardware and its 298 * physical sensor. That might be a long time depending on the hardware and its
298 * interface. 299 * interface.
299 * 300 *
301 * The extra data passed in as user_data here will be available in the user_data
302 * pointer of the sensor object when the ecore event arrives.
303 *
300 * @since 1.8 304 * @since 1.8
301 */ 305 */
302EAPI Eina_Bool eeze_sensor_async_read(Eeze_Sensor_Obj *sens, void *user_data); 306EAPI Eina_Bool eeze_sensor_async_read(Eeze_Sensor_Obj *sens, void *user_data);
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index da12a1226e..7dee614b62 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -295,7 +295,7 @@ eeze_sensor_async_read(Eeze_Sensor_Obj *sens, void *user_data)
295 module = _highest_priority_module_get(); 295 module = _highest_priority_module_get();
296 if (!module) return EINA_FALSE; 296 if (!module) return EINA_FALSE;
297 if (module->async_read) 297 if (module->async_read)
298 return module->async_read(sens->type, user_data); 298 return module->async_read(sens, user_data);
299 299
300 return EINA_FALSE; 300 return EINA_FALSE;
301} 301}
diff --git a/src/lib/eeze/eeze_sensor_private.h b/src/lib/eeze/eeze_sensor_private.h
index 3ba6198d8e..759925af23 100644
--- a/src/lib/eeze/eeze_sensor_private.h
+++ b/src/lib/eeze/eeze_sensor_private.h
@@ -56,7 +56,7 @@ typedef struct _Eeze_Sensor_Module
56{ 56{
57 Eina_Bool (*init)(void); /**< Pointer to module init function */ 57 Eina_Bool (*init)(void); /**< Pointer to module init function */
58 Eina_Bool (*shutdown)(void); /**< Pointer to module shutdown function */ 58 Eina_Bool (*shutdown)(void); /**< Pointer to module shutdown function */
59 Eina_Bool (*async_read)(Eeze_Sensor_Type sensor_type, void *user_data); /**< Pointer to module async_read function */ 59 Eina_Bool (*async_read)(Eeze_Sensor_Obj *obj, void *user_data); /**< Pointer to module async_read function */
60 Eina_Bool (*read)(Eeze_Sensor_Obj *obj); /**< Pointer to module read function */ 60 Eina_Bool (*read)(Eeze_Sensor_Obj *obj); /**< Pointer to module read function */
61 Eina_List *sensor_list; /**< List of sensor objects attached to the module */ 61 Eina_List *sensor_list; /**< List of sensor objects attached to the module */
62} Eeze_Sensor_Module; 62} Eeze_Sensor_Module;