summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-04-16 13:16:55 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2013-04-16 13:21:28 +0100
commit763bdd161814ea885e754585dc388737cf19cf42 (patch)
treecb7a4398c0293c9aef03bff57b9b21bde9c44fb5 /src/lib/eeze
parent3ccc7e7cf825d111b709bdec8574f3541d08f350 (diff)
eeze/sensor: Switch timestamp to relative values coming.
Switch from absolut microseconds since epoch to a monotonic clock with realtive values. Switch from unsigned long long to double. This aligns it with how we present time in efl. ecore_time_get is used when possible. For the tizen modules we convert the the epoch timestamp we get into a double. This is still a working monotone clock source. As this will be released the first time with 1.8 we don't have any API break here.
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/Eeze_Sensor.h9
-rw-r--r--src/lib/eeze/eeze_sensor.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/eeze/Eeze_Sensor.h b/src/lib/eeze/Eeze_Sensor.h
index 0575287186..a1d3327376 100644
--- a/src/lib/eeze/Eeze_Sensor.h
+++ b/src/lib/eeze/Eeze_Sensor.h
@@ -132,7 +132,8 @@ EAPI int EEZE_SENSOR_EVENT_TEMPERATURE;
132 * Object for a sensor type. Keeps information about the type and holds the 132 * Object for a sensor type. Keeps information about the type and holds the
133 * data for the accessor functions. As this information gets also updated by 133 * data for the accessor functions. As this information gets also updated by
134 * asynchronous reads it might be a good idea to check the timestamp value to 134 * asynchronous reads it might be a good idea to check the timestamp value to
135 * see when the data has been updated. The timestamp is given in microseconds. 135 * see when the data has been updated. The timestamp is given as floating point
136 * value in seconds.
136 * 137 *
137 * You are not supposed to access the raw data values from here but use the 138 * You are not supposed to access the raw data values from here but use the
138 * getter functions for it. Using the raw values from this struct might break 139 * getter functions for it. Using the raw values from this struct might break
@@ -145,7 +146,7 @@ typedef struct _Eeze_Sensor_Obj
145 Eeze_Sensor_Type type; /**< Sensor type see #Eeze_Sensor_Type */ 146 Eeze_Sensor_Type type; /**< Sensor type see #Eeze_Sensor_Type */
146 int accuracy; /**< Accuracy of the sensor value */ 147 int accuracy; /**< Accuracy of the sensor value */
147 float data[3]; /**< Sensor data depending on the sensor type */ 148 float data[3]; /**< Sensor data depending on the sensor type */
148 unsigned long long timestamp; /**< Timestamp of data read */ 149 double timestamp; /**< Timestamp of data read */
149 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 */
150} Eeze_Sensor_Obj; 151} Eeze_Sensor_Obj;
151 152
@@ -255,11 +256,11 @@ EAPI Eina_Bool eeze_sensor_x_get(Eeze_Sensor_Obj *sens, float *x);
255 * 256 *
256 * Access function to get the timestamp property from the sensor object. It 257 * Access function to get the timestamp property from the sensor object. It
257 * allows you to determine if the values have been updated since the last time 258 * allows you to determine if the values have been updated since the last time
258 * you requested them. 259 * you requested them. Timestamp is given as a floating point value in seconds.
259 * 260 *
260 * @since 1.8 261 * @since 1.8
261 */ 262 */
262EAPI Eina_Bool eeze_sensor_timestamp_get(Eeze_Sensor_Obj *sens, unsigned long long *timestamp); 263EAPI Eina_Bool eeze_sensor_timestamp_get(Eeze_Sensor_Obj *sens, double *timestamp);
263 264
264/** 265/**
265 * @brief Read out sensor data 266 * @brief Read out sensor data
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index f4269018dc..3af42937e9 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -256,7 +256,7 @@ eeze_sensor_x_get(Eeze_Sensor_Obj *sens, float *x)
256} 256}
257 257
258EAPI Eina_Bool 258EAPI Eina_Bool
259eeze_sensor_timestamp_get(Eeze_Sensor_Obj *sens, unsigned long long *timestamp) 259eeze_sensor_timestamp_get(Eeze_Sensor_Obj *sens, double *timestamp)
260{ 260{
261 if (!sens) return EINA_FALSE; 261 if (!sens) return EINA_FALSE;
262 262