summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/bin/eeze/eeze_sensor_test.c26
-rw-r--r--src/lib/eeze/Eeze_Sensor.h9
-rw-r--r--src/lib/eeze/eeze_sensor.c2
-rw-r--r--src/modules/eeze/sensor/fake/fake.c11
-rw-r--r--src/modules/eeze/sensor/tizen/tizen.c103
-rw-r--r--src/tests/eeze/eeze_suite.c4
6 files changed, 80 insertions, 75 deletions
diff --git a/src/bin/eeze/eeze_sensor_test.c b/src/bin/eeze/eeze_sensor_test.c
index 3e800204e9..56eae9f850 100644
--- a/src/bin/eeze/eeze_sensor_test.c
+++ b/src/bin/eeze/eeze_sensor_test.c
@@ -21,7 +21,7 @@ event_cb(void *data EINA_UNUSED, int ev_type, void *event)
21 Eeze_Sensor_Obj *sens = NULL; 21 Eeze_Sensor_Obj *sens = NULL;
22 float x, y, z; 22 float x, y, z;
23 int acc; 23 int acc;
24 unsigned long long timestamp; 24 double timestamp;
25 25
26 sens = event; 26 sens = event;
27 if (!sens) printf("can't find sensor!\n"); 27 if (!sens) printf("can't find sensor!\n");
@@ -31,16 +31,16 @@ event_cb(void *data EINA_UNUSED, int ev_type, void *event)
31 if (ev_type == EEZE_SENSOR_EVENT_ACCELEROMETER) 31 if (ev_type == EEZE_SENSOR_EVENT_ACCELEROMETER)
32 { 32 {
33 if (!eeze_sensor_xyz_get(sens, &x, &y, &z)) printf("fail get xyz\n"); 33 if (!eeze_sensor_xyz_get(sens, &x, &y, &z)) printf("fail get xyz\n");
34 printf("Accelerometer callback: accuracy %i, x %f, y %f, z %f at time: %lli\n", acc, x, y, z, timestamp); 34 printf("Accelerometer callback: accuracy %i, x %f, y %f, z %f at time: %f\n", acc, x, y, z, timestamp);
35 } 35 }
36 else if (ev_type == EEZE_SENSOR_EVENT_FACEDOWN) 36 else if (ev_type == EEZE_SENSOR_EVENT_FACEDOWN)
37 printf("Facedown callback at time: %lli\n", timestamp); 37 printf("Facedown callback at time: %f\n", timestamp);
38 else if (ev_type == EEZE_SENSOR_EVENT_DOUBLETAP) 38 else if (ev_type == EEZE_SENSOR_EVENT_DOUBLETAP)
39 printf("Doubletap callback at time: %lli\n", timestamp); 39 printf("Doubletap callback at time: %f\n", timestamp);
40 else if (ev_type == EEZE_SENSOR_EVENT_SHAKE) 40 else if (ev_type == EEZE_SENSOR_EVENT_SHAKE)
41 { 41 {
42 if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n"); 42 if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n");
43 printf("Shake callback: accuracy %i, x %f at time: %lli\n", acc, x, timestamp); 43 printf("Shake callback: accuracy %i, x %f at time: %f\n", acc, x, timestamp);
44 } 44 }
45 45
46 return ECORE_CALLBACK_PASS_ON; 46 return ECORE_CALLBACK_PASS_ON;
@@ -52,7 +52,7 @@ main(void)
52 Eeze_Sensor_Obj *sens; 52 Eeze_Sensor_Obj *sens;
53 float x, y, z; 53 float x, y, z;
54 int acc; 54 int acc;
55 unsigned long long timestamp; 55 double timestamp;
56 56
57 /* Init the subsystems we use to make sure they are ready to use. */ 57 /* Init the subsystems we use to make sure they are ready to use. */
58 ecore_init(); 58 ecore_init();
@@ -74,7 +74,7 @@ main(void)
74 /* Here we read the timestamp the data was read out from the physical 74 /* Here we read the timestamp the data was read out from the physical
75 * sensor. Can be used to detect how old the readout it.*/ 75 * sensor. Can be used to detect how old the readout it.*/
76 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n"); 76 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n");
77 printf("Magnetic output: accuracy %i, x %f, y %f, z %f at time: %lli\n", acc, x, y, z, timestamp); 77 printf("Magnetic output: accuracy %i, x %f, y %f, z %f at time: %f\n", acc, x, y, z, timestamp);
78 /* Free the sensor when we do not longer use it. */ 78 /* Free the sensor when we do not longer use it. */
79 eeze_sensor_free(sens); 79 eeze_sensor_free(sens);
80 } 80 }
@@ -87,7 +87,7 @@ main(void)
87 if (!eeze_sensor_xyz_get(sens, &x, &y, &z)) printf("fail get xyz\n"); 87 if (!eeze_sensor_xyz_get(sens, &x, &y, &z)) printf("fail get xyz\n");
88 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n"); 88 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n");
89 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n"); 89 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n");
90 printf("Acceleromter output: accuracy %i, x %f, y %f, z %f at time: %lli\n", acc, x, y, z, timestamp); 90 printf("Acceleromter output: accuracy %i, x %f, y %f, z %f at time: %f\n", acc, x, y, z, timestamp);
91 eeze_sensor_free(sens); 91 eeze_sensor_free(sens);
92 } 92 }
93 else 93 else
@@ -99,7 +99,7 @@ main(void)
99 if (!eeze_sensor_xyz_get(sens, &x, &y, &z)) printf("fail get xyz\n"); 99 if (!eeze_sensor_xyz_get(sens, &x, &y, &z)) printf("fail get xyz\n");
100 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n"); 100 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n");
101 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n"); 101 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n");
102 printf("Orientation output: accuracy %i, x %f, y %f, z %f at time: %lli\n", acc, x, y, z, timestamp); 102 printf("Orientation output: accuracy %i, x %f, y %f, z %f at time: %f\n", acc, x, y, z, timestamp);
103 eeze_sensor_free(sens); 103 eeze_sensor_free(sens);
104 } 104 }
105 else 105 else
@@ -111,7 +111,7 @@ main(void)
111 if (!eeze_sensor_xyz_get(sens, &x, &y, &z)) printf("fail get xyz\n"); 111 if (!eeze_sensor_xyz_get(sens, &x, &y, &z)) printf("fail get xyz\n");
112 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n"); 112 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n");
113 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n"); 113 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n");
114 printf("Gyroscope output: accuracy %i, x %f, y %f, z %f at time: %lli\n", acc, x, y, z, timestamp); 114 printf("Gyroscope output: accuracy %i, x %f, y %f, z %f at time: %f\n", acc, x, y, z, timestamp);
115 eeze_sensor_free(sens); 115 eeze_sensor_free(sens);
116 } 116 }
117 else 117 else
@@ -123,7 +123,7 @@ main(void)
123 if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n"); 123 if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n");
124 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n"); 124 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n");
125 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n"); 125 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n");
126 printf("Proximity output: accuracy %i, distance %f at time: %lli\n", acc, x, timestamp); 126 printf("Proximity output: accuracy %i, distance %f at time: %f\n", acc, x, timestamp);
127 eeze_sensor_free(sens); 127 eeze_sensor_free(sens);
128 } 128 }
129 else 129 else
@@ -135,7 +135,7 @@ main(void)
135 if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n"); 135 if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n");
136 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n"); 136 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n");
137 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n"); 137 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n");
138 printf("Light output: accuracy %i, lux %f at time: %lli\n", acc, x, timestamp); 138 printf("Light output: accuracy %i, lux %f at time: %f\n", acc, x, timestamp);
139 eeze_sensor_free(sens); 139 eeze_sensor_free(sens);
140 } 140 }
141 else 141 else
@@ -153,7 +153,7 @@ main(void)
153 if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n"); 153 if (!eeze_sensor_x_get(sens, &x)) printf("fail get x\n");
154 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n"); 154 if (!eeze_sensor_accuracy_get(sens, &acc)) printf("fail get accuracy\n");
155 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n"); 155 if (!eeze_sensor_timestamp_get(sens, &timestamp)) printf("fail get timestamp\n");
156 printf("Light output: accuracy %i, lux %f at time: %lli\n", acc, x, timestamp); 156 printf("Light output: accuracy %i, lux %f at time: %f\n", acc, x, timestamp);
157 eeze_sensor_free(sens); 157 eeze_sensor_free(sens);
158 } 158 }
159 else 159 else
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
diff --git a/src/modules/eeze/sensor/fake/fake.c b/src/modules/eeze/sensor/fake/fake.c
index 231f367227..d8ff37ba01 100644
--- a/src/modules/eeze/sensor/fake/fake.c
+++ b/src/modules/eeze/sensor/fake/fake.c
@@ -55,7 +55,6 @@ Eina_Bool
55fake_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj) 55fake_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
56{ 56{
57 Eeze_Sensor_Obj *obj = NULL; 57 Eeze_Sensor_Obj *obj = NULL;
58 struct timeval tv;
59 58
60 obj = eeze_sensor_obj_get(sensor_type); 59 obj = eeze_sensor_obj_get(sensor_type);
61 if (obj == NULL) 60 if (obj == NULL)
@@ -78,8 +77,7 @@ fake_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
78 obj->data[0] = 7; 77 obj->data[0] = 7;
79 obj->data[1] = 23; 78 obj->data[1] = 23;
80 obj->data[2] = 42; 79 obj->data[2] = 42;
81 gettimeofday(&tv, NULL); 80 obj->timestamp = ecore_time_get();
82 obj->timestamp = ((tv.tv_sec * 1000000) + tv.tv_usec);
83 break; 81 break;
84 82
85 case EEZE_SENSOR_TYPE_LIGHT: 83 case EEZE_SENSOR_TYPE_LIGHT:
@@ -88,8 +86,7 @@ fake_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
88 case EEZE_SENSOR_TYPE_TEMPERATURE: 86 case EEZE_SENSOR_TYPE_TEMPERATURE:
89 obj->accuracy = -1; 87 obj->accuracy = -1;
90 obj->data[0] = 7; 88 obj->data[0] = 7;
91 gettimeofday(&tv, NULL); 89 obj->timestamp = ecore_time_get();
92 obj->timestamp = ((tv.tv_sec * 1000000) + tv.tv_usec);
93 break; 90 break;
94 91
95 default: 92 default:
@@ -108,7 +105,6 @@ Eina_Bool
108fake_async_read(Eeze_Sensor_Type sensor_type, void *user_data EINA_UNUSED) 105fake_async_read(Eeze_Sensor_Type sensor_type, void *user_data EINA_UNUSED)
109{ 106{
110 Eeze_Sensor_Obj *obj = NULL; 107 Eeze_Sensor_Obj *obj = NULL;
111 struct timeval tv;
112 108
113 obj = eeze_sensor_obj_get(sensor_type); 109 obj = eeze_sensor_obj_get(sensor_type);
114 if (obj == NULL) 110 if (obj == NULL)
@@ -122,8 +118,7 @@ fake_async_read(Eeze_Sensor_Type sensor_type, void *user_data EINA_UNUSED)
122 obj->data[0] = 7; 118 obj->data[0] = 7;
123 obj->data[1] = 23; 119 obj->data[1] = 23;
124 obj->data[2] = 42; 120 obj->data[2] = 42;
125 gettimeofday(&tv, NULL); 121 obj->timestamp = ecore_time_get();
126 obj->timestamp = ((tv.tv_sec * 1000000) + tv.tv_usec);
127 122
128 switch (sensor_type) 123 switch (sensor_type)
129 { 124 {
diff --git a/src/modules/eeze/sensor/tizen/tizen.c b/src/modules/eeze/sensor/tizen/tizen.c
index 9dfe34d7f7..0d4bbb1b2f 100644
--- a/src/modules/eeze/sensor/tizen/tizen.c
+++ b/src/modules/eeze/sensor/tizen/tizen.c
@@ -165,6 +165,15 @@ tizen_to_eeze(sesnor_type_e type)
165 } 165 }
166} 166}
167 167
168/* We receive the timestamp in nanoseconds from the Tizen system lib. Convert
169 * it to seconds as floating point value which is used in our public API.
170 */
171double
172clock_convert(unsigned long long timestamp)
173{
174 return ((double)timestamp) / 1000000000.0;
175}
176
168/* All following callback function work with the same scheme. 177/* All following callback function work with the same scheme.
169 * They are callbacks coming in from the tizen system sensor library. With the 178 * They are callbacks coming in from the tizen system sensor library. With the
170 * data we receive we update the matching sensor object to always have the 179 * data we receive we update the matching sensor object to always have the
@@ -189,7 +198,7 @@ accelerometer_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy,
189 obj->data[0] = x; 198 obj->data[0] = x;
190 obj->data[1] = y; 199 obj->data[1] = y;
191 obj->data[2] = z; 200 obj->data[2] = z;
192 obj->timestamp = timestamp; 201 obj->timestamp = clock_convert(timestamp);
193 ecore_event_add(EEZE_SENSOR_EVENT_ACCELEROMETER, obj, NULL, NULL); 202 ecore_event_add(EEZE_SENSOR_EVENT_ACCELEROMETER, obj, NULL, NULL);
194 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ACCELEROMETER)); 203 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ACCELEROMETER));
195} 204}
@@ -209,7 +218,7 @@ gravity_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float
209 obj->data[0] = x; 218 obj->data[0] = x;
210 obj->data[1] = y; 219 obj->data[1] = y;
211 obj->data[2] = z; 220 obj->data[2] = z;
212 obj->timestamp = timestamp; 221 obj->timestamp = clock_convert(timestamp);
213 ecore_event_add(EEZE_SENSOR_EVENT_GRAVITY, obj, NULL, NULL); 222 ecore_event_add(EEZE_SENSOR_EVENT_GRAVITY, obj, NULL, NULL);
214 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GRAVITY)); 223 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GRAVITY));
215} 224}
@@ -229,7 +238,7 @@ linear_acceleration_cb(unsigned long long timestamp, sensor_data_accuracy_e accu
229 obj->data[0] = x; 238 obj->data[0] = x;
230 obj->data[1] = y; 239 obj->data[1] = y;
231 obj->data[2] = z; 240 obj->data[2] = z;
232 obj->timestamp = timestamp; 241 obj->timestamp = clock_convert(timestamp);
233 ecore_event_add(EEZE_SENSOR_EVENT_LINEAR_ACCELERATION, obj, NULL, NULL); 242 ecore_event_add(EEZE_SENSOR_EVENT_LINEAR_ACCELERATION, obj, NULL, NULL);
234 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LINEAR_ACCELERATION)); 243 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LINEAR_ACCELERATION));
235} 244}
@@ -250,7 +259,7 @@ device_orientation_cb(unsigned long long timestamp, sensor_data_accuracy_e accur
250 obj->data[0] = yaw; 259 obj->data[0] = yaw;
251 obj->data[1] = pitch; 260 obj->data[1] = pitch;
252 obj->data[2] = roll; 261 obj->data[2] = roll;
253 obj->timestamp = timestamp; 262 obj->timestamp = clock_convert(timestamp);
254 ecore_event_add(EEZE_SENSOR_EVENT_DEVICE_ORIENTATION, obj, NULL, NULL); 263 ecore_event_add(EEZE_SENSOR_EVENT_DEVICE_ORIENTATION, obj, NULL, NULL);
255 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_DEVICE_ORIENTATION)); 264 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_DEVICE_ORIENTATION));
256} 265}
@@ -270,7 +279,7 @@ magnetic_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float
270 obj->data[0] = x; 279 obj->data[0] = x;
271 obj->data[1] = y; 280 obj->data[1] = y;
272 obj->data[2] = z; 281 obj->data[2] = z;
273 obj->timestamp = timestamp; 282 obj->timestamp = clock_convert(timestamp);
274 ecore_event_add(EEZE_SENSOR_EVENT_MAGNETIC, obj, NULL, NULL); 283 ecore_event_add(EEZE_SENSOR_EVENT_MAGNETIC, obj, NULL, NULL);
275 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MAGNETIC)); 284 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MAGNETIC));
276} 285}
@@ -290,7 +299,7 @@ orientation_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, fl
290 obj->data[0] = azimuth; 299 obj->data[0] = azimuth;
291 obj->data[1] = pitch; 300 obj->data[1] = pitch;
292 obj->data[2] = roll; 301 obj->data[2] = roll;
293 obj->timestamp = timestamp; 302 obj->timestamp = clock_convert(timestamp);
294 ecore_event_add(EEZE_SENSOR_EVENT_ORIENTATION, obj, NULL, NULL); 303 ecore_event_add(EEZE_SENSOR_EVENT_ORIENTATION, obj, NULL, NULL);
295 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ORIENTATION)); 304 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ORIENTATION));
296} 305}
@@ -310,7 +319,7 @@ gyroscope_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, floa
310 obj->data[0] = x; 319 obj->data[0] = x;
311 obj->data[1] = y; 320 obj->data[1] = y;
312 obj->data[2] = z; 321 obj->data[2] = z;
313 obj->timestamp = timestamp; 322 obj->timestamp = clock_convert(timestamp);
314 ecore_event_add(EEZE_SENSOR_EVENT_GYROSCOPE, obj, NULL, NULL); 323 ecore_event_add(EEZE_SENSOR_EVENT_GYROSCOPE, obj, NULL, NULL);
315 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GYROSCOPE)); 324 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GYROSCOPE));
316} 325}
@@ -329,7 +338,7 @@ light_cb(unsigned long long timestamp, float lux, void *user_data)
329 /* We have to set this ourselves because we don't get it for this type */ 338 /* We have to set this ourselves because we don't get it for this type */
330 obj->accuracy = -1; 339 obj->accuracy = -1;
331 obj->data[0] = lux; 340 obj->data[0] = lux;
332 obj->timestamp = timestamp; 341 obj->timestamp = clock_convert(timestamp);
333 ecore_event_add(EEZE_SENSOR_EVENT_LIGHT, obj, NULL, NULL); 342 ecore_event_add(EEZE_SENSOR_EVENT_LIGHT, obj, NULL, NULL);
334 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LIGHT)); 343 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LIGHT));
335} 344}
@@ -348,7 +357,7 @@ proximity_cb(unsigned long long timestamp, float distance, void *user_data)
348 /* We have to set this ourselves because we don't get it for this type */ 357 /* We have to set this ourselves because we don't get it for this type */
349 obj->accuracy = -1; 358 obj->accuracy = -1;
350 obj->data[0] = distance; 359 obj->data[0] = distance;
351 obj->timestamp = timestamp; 360 obj->timestamp = clock_convert(timestamp);
352 ecore_event_add(EEZE_SENSOR_EVENT_PROXIMITY, obj, NULL, NULL); 361 ecore_event_add(EEZE_SENSOR_EVENT_PROXIMITY, obj, NULL, NULL);
353 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_PROXIMITY)); 362 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_PROXIMITY));
354} 363}
@@ -367,7 +376,7 @@ snap_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user_data
367 /* We have to set this ourselves because we don't get it for this type */ 376 /* We have to set this ourselves because we don't get it for this type */
368 obj->accuracy = -1; 377 obj->accuracy = -1;
369 obj->data[0] = snap; 378 obj->data[0] = snap;
370 obj->timestamp = timestamp; 379 obj->timestamp = clock_convert(timestamp);
371 ecore_event_add(EEZE_SENSOR_EVENT_SNAP, obj, NULL, NULL); 380 ecore_event_add(EEZE_SENSOR_EVENT_SNAP, obj, NULL, NULL);
372 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SNAP)); 381 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SNAP));
373} 382}
@@ -386,7 +395,7 @@ shake_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *user_d
386 /* We have to set this ourselves because we don't get it for this type */ 395 /* We have to set this ourselves because we don't get it for this type */
387 obj->accuracy = -1; 396 obj->accuracy = -1;
388 obj->data[0] = shake; 397 obj->data[0] = shake;
389 obj->timestamp = timestamp; 398 obj->timestamp = clock_convert(timestamp);
390 ecore_event_add(EEZE_SENSOR_EVENT_SHAKE, obj, NULL, NULL); 399 ecore_event_add(EEZE_SENSOR_EVENT_SHAKE, obj, NULL, NULL);
391 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SHAKE)); 400 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SHAKE));
392} 401}
@@ -406,7 +415,7 @@ panning_cb(unsigned long long timestamp, int x, int y, void *user_data)
406 obj->accuracy = -1; 415 obj->accuracy = -1;
407 obj->data[0] = x; 416 obj->data[0] = x;
408 obj->data[1] = y; 417 obj->data[1] = y;
409 obj->timestamp = timestamp; 418 obj->timestamp = clock_convert(timestamp);
410 ecore_event_add(EEZE_SENSOR_EVENT_PANNING, obj, NULL, NULL); 419 ecore_event_add(EEZE_SENSOR_EVENT_PANNING, obj, NULL, NULL);
411 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_PANNING)); 420 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_PANNING));
412} 421}
@@ -426,7 +435,7 @@ panning_browse_cb(unsigned long long timestamp, int x, int y, void *user_data)
426 obj->accuracy = -1; 435 obj->accuracy = -1;
427 obj->data[0] = x; 436 obj->data[0] = x;
428 obj->data[1] = y; 437 obj->data[1] = y;
429 obj->timestamp = timestamp; 438 obj->timestamp = clock_convert(timestamp);
430 ecore_event_add(EEZE_SENSOR_EVENT_PANNING_BROWSE, obj, NULL, NULL); 439 ecore_event_add(EEZE_SENSOR_EVENT_PANNING_BROWSE, obj, NULL, NULL);
431 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_PANNING_BROWSE)); 440 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_PANNING_BROWSE));
432} 441}
@@ -446,7 +455,7 @@ tilt_cb(unsigned long long timestamp, int x, int y, void *user_data)
446 obj->accuracy = -1; 455 obj->accuracy = -1;
447 obj->data[0] = x; 456 obj->data[0] = x;
448 obj->data[1] = y; 457 obj->data[1] = y;
449 obj->timestamp = timestamp; 458 obj->timestamp = clock_convert(timestamp);
450 ecore_event_add(EEZE_SENSOR_EVENT_TILT, obj, NULL, NULL); 459 ecore_event_add(EEZE_SENSOR_EVENT_TILT, obj, NULL, NULL);
451 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_TILT)); 460 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_TILT));
452} 461}
@@ -464,7 +473,7 @@ facedown_cb(unsigned long long timestamp, void *user_data)
464 } 473 }
465 /* We have to set this ourselves because we don't get it for this type */ 474 /* We have to set this ourselves because we don't get it for this type */
466 obj->accuracy = -1; 475 obj->accuracy = -1;
467 obj->timestamp = timestamp; 476 obj->timestamp = clock_convert(timestamp);
468 ecore_event_add(EEZE_SENSOR_EVENT_FACEDOWN, obj, NULL, NULL); 477 ecore_event_add(EEZE_SENSOR_EVENT_FACEDOWN, obj, NULL, NULL);
469 /* We are not stopping the sensor here because we want to keep it as a motion 478 /* We are not stopping the sensor here because we want to keep it as a motion
470 * event coming in at any time. 479 * event coming in at any time.
@@ -484,7 +493,7 @@ directcall_cb(unsigned long long timestamp, void *user_data)
484 } 493 }
485 /* We have to set this ourselves because we don't get it for this type */ 494 /* We have to set this ourselves because we don't get it for this type */
486 obj->accuracy = -1; 495 obj->accuracy = -1;
487 obj->timestamp = timestamp; 496 obj->timestamp = clock_convert(timestamp);
488 ecore_event_add(EEZE_SENSOR_EVENT_DIRECT_CALL, obj, NULL, NULL); 497 ecore_event_add(EEZE_SENSOR_EVENT_DIRECT_CALL, obj, NULL, NULL);
489 /* We are not stopping the sensor here because we want to keep it as a motion 498 /* We are not stopping the sensor here because we want to keep it as a motion
490 * event coming in at any time. 499 * event coming in at any time.
@@ -504,7 +513,7 @@ smart_alert_cb(unsigned long long timestamp, void *user_data)
504 } 513 }
505 /* We have to set this ourselves because we don't get it for this type */ 514 /* We have to set this ourselves because we don't get it for this type */
506 obj->accuracy = -1; 515 obj->accuracy = -1;
507 obj->timestamp = timestamp; 516 obj->timestamp = clock_convert(timestamp);
508 ecore_event_add(EEZE_SENSOR_EVENT_SMART_ALERT, obj, NULL, NULL); 517 ecore_event_add(EEZE_SENSOR_EVENT_SMART_ALERT, obj, NULL, NULL);
509 /* We are not stopping the sensor here because we want to keep it as a motion 518 /* We are not stopping the sensor here because we want to keep it as a motion
510 * event coming in at any time. 519 * event coming in at any time.
@@ -524,7 +533,7 @@ no_move_cb(unsigned long long timestamp, void *user_data)
524 } 533 }
525 /* We have to set this ourselves because we don't get it for this type */ 534 /* We have to set this ourselves because we don't get it for this type */
526 obj->accuracy = -1; 535 obj->accuracy = -1;
527 obj->timestamp = timestamp; 536 obj->timestamp = clock_convert(timestamp);
528 ecore_event_add(EEZE_SENSOR_EVENT_NO_MOVE, obj, NULL, NULL); 537 ecore_event_add(EEZE_SENSOR_EVENT_NO_MOVE, obj, NULL, NULL);
529 /* We are not stopping the sensor here because we want to keep it as a motion 538 /* We are not stopping the sensor here because we want to keep it as a motion
530 * event coming in at any time. 539 * event coming in at any time.
@@ -544,7 +553,7 @@ doubletap_cb(unsigned long long timestamp, void *user_data)
544 } 553 }
545 /* We have to set this ourselves because we don't get it for this type */ 554 /* We have to set this ourselves because we don't get it for this type */
546 obj->accuracy = -1; 555 obj->accuracy = -1;
547 obj->timestamp = timestamp; 556 obj->timestamp = clock_convert(timestamp);
548 ecore_event_add(EEZE_SENSOR_EVENT_DOUBLETAP, obj, NULL, NULL); 557 ecore_event_add(EEZE_SENSOR_EVENT_DOUBLETAP, obj, NULL, NULL);
549 /* We are not stopping the sensor here because we want to keep it as a motion 558 /* We are not stopping the sensor here because we want to keep it as a motion
550 * event coming in at any time. 559 * event coming in at any time.
@@ -568,7 +577,7 @@ accelerometer_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accur
568 obj->data[0] = x; 577 obj->data[0] = x;
569 obj->data[1] = y; 578 obj->data[1] = y;
570 obj->data[2] = z; 579 obj->data[2] = z;
571 obj->timestamp = timestamp; 580 obj->timestamp = clock_convert(timestamp);
572 ecore_event_add(EEZE_SENSOR_EVENT_ACCELEROMETER, obj, NULL, NULL); 581 ecore_event_add(EEZE_SENSOR_EVENT_ACCELEROMETER, obj, NULL, NULL);
573 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ACCELEROMETER)); 582 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ACCELEROMETER));
574} 583}
@@ -590,7 +599,7 @@ gravity_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, f
590 obj->data[0] = x; 599 obj->data[0] = x;
591 obj->data[1] = y; 600 obj->data[1] = y;
592 obj->data[2] = z; 601 obj->data[2] = z;
593 obj->timestamp = timestamp; 602 obj->timestamp = clock_convert(timestamp);
594 ecore_event_add(EEZE_SENSOR_EVENT_GRAVITY, obj, NULL, NULL); 603 ecore_event_add(EEZE_SENSOR_EVENT_GRAVITY, obj, NULL, NULL);
595 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GRAVITY)); 604 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GRAVITY));
596} 605}
@@ -612,7 +621,7 @@ linear_acceleration_read_cb(unsigned long long timestamp, sensor_data_accuracy_e
612 obj->data[0] = x; 621 obj->data[0] = x;
613 obj->data[1] = y; 622 obj->data[1] = y;
614 obj->data[2] = z; 623 obj->data[2] = z;
615 obj->timestamp = timestamp; 624 obj->timestamp = clock_convert(timestamp);
616 ecore_event_add(EEZE_SENSOR_EVENT_LINEAR_ACCELERATION, obj, NULL, NULL); 625 ecore_event_add(EEZE_SENSOR_EVENT_LINEAR_ACCELERATION, obj, NULL, NULL);
617 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LINEAR_ACCELERATION)); 626 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LINEAR_ACCELERATION));
618} 627}
@@ -635,7 +644,7 @@ device_orientation_read_cb(unsigned long long timestamp, sensor_data_accuracy_e
635 obj->data[0] = yaw; 644 obj->data[0] = yaw;
636 obj->data[1] = pitch; 645 obj->data[1] = pitch;
637 obj->data[2] = roll; 646 obj->data[2] = roll;
638 obj->timestamp = timestamp; 647 obj->timestamp = clock_convert(timestamp);
639 ecore_event_add(EEZE_SENSOR_EVENT_DEVICE_ORIENTATION, obj, NULL, NULL); 648 ecore_event_add(EEZE_SENSOR_EVENT_DEVICE_ORIENTATION, obj, NULL, NULL);
640 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_DEVICE_ORIENTATION)); 649 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_DEVICE_ORIENTATION));
641} 650}
@@ -657,7 +666,7 @@ magnetic_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy,
657 obj->data[0] = x; 666 obj->data[0] = x;
658 obj->data[1] = y; 667 obj->data[1] = y;
659 obj->data[2] = z; 668 obj->data[2] = z;
660 obj->timestamp = timestamp; 669 obj->timestamp = clock_convert(timestamp);
661 ecore_event_add(EEZE_SENSOR_EVENT_MAGNETIC, obj, NULL, NULL); 670 ecore_event_add(EEZE_SENSOR_EVENT_MAGNETIC, obj, NULL, NULL);
662 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MAGNETIC)); 671 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MAGNETIC));
663} 672}
@@ -679,7 +688,7 @@ orientation_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accurac
679 obj->data[0] = azimuth; 688 obj->data[0] = azimuth;
680 obj->data[1] = pitch; 689 obj->data[1] = pitch;
681 obj->data[2] = roll; 690 obj->data[2] = roll;
682 obj->timestamp = timestamp; 691 obj->timestamp = clock_convert(timestamp);
683 ecore_event_add(EEZE_SENSOR_EVENT_ORIENTATION, obj, NULL, NULL); 692 ecore_event_add(EEZE_SENSOR_EVENT_ORIENTATION, obj, NULL, NULL);
684 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ORIENTATION)); 693 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ORIENTATION));
685} 694}
@@ -701,7 +710,7 @@ gyroscope_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy,
701 obj->data[0] = x; 710 obj->data[0] = x;
702 obj->data[1] = y; 711 obj->data[1] = y;
703 obj->data[2] = z; 712 obj->data[2] = z;
704 obj->timestamp = timestamp; 713 obj->timestamp = clock_convert(timestamp);
705 ecore_event_add(EEZE_SENSOR_EVENT_GYROSCOPE, obj, NULL, NULL); 714 ecore_event_add(EEZE_SENSOR_EVENT_GYROSCOPE, obj, NULL, NULL);
706 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GYROSCOPE)); 715 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GYROSCOPE));
707} 716}
@@ -722,7 +731,7 @@ light_read_cb(unsigned long long timestamp, float lux, void *user_data)
722 /* We have to set this ourselves because we don't get it for this type */ 731 /* We have to set this ourselves because we don't get it for this type */
723 obj->accuracy = -1; 732 obj->accuracy = -1;
724 obj->data[0] = lux; 733 obj->data[0] = lux;
725 obj->timestamp = timestamp; 734 obj->timestamp = clock_convert(timestamp);
726 ecore_event_add(EEZE_SENSOR_EVENT_LIGHT, obj, NULL, NULL); 735 ecore_event_add(EEZE_SENSOR_EVENT_LIGHT, obj, NULL, NULL);
727 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LIGHT)); 736 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LIGHT));
728} 737}
@@ -743,7 +752,7 @@ proximity_read_cb(unsigned long long timestamp, float distance, void *user_data)
743 /* We have to set this ourselves because we don't get it for this type */ 752 /* We have to set this ourselves because we don't get it for this type */
744 bj->accuracy = -1; 753 bj->accuracy = -1;
745 obj->data[0] = distance; 754 obj->data[0] = distance;
746 obj->timestamp = timestamp; 755 obj->timestamp = clock_convert(timestamp);
747 ecore_event_add(EEZE_SENSOR_EVENT_PROXIMITY, obj, NULL, NULL); 756 ecore_event_add(EEZE_SENSOR_EVENT_PROXIMITY, obj, NULL, NULL);
748 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_PROXIMITY)); 757 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_PROXIMITY));
749} 758}
@@ -764,7 +773,7 @@ snap_read_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user
764 /* We have to set this ourselves because we don't get it for this type */ 773 /* We have to set this ourselves because we don't get it for this type */
765 obj->accuracy = -1; 774 obj->accuracy = -1;
766 obj->data[0] = snap; 775 obj->data[0] = snap;
767 obj->timestamp = timestamp; 776 obj->timestamp = clock_convert(timestamp);
768 ecore_event_add(EEZE_SENSOR_EVENT_SNAP, obj, NULL, NULL); 777 ecore_event_add(EEZE_SENSOR_EVENT_SNAP, obj, NULL, NULL);
769 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SNAP)); 778 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SNAP));
770} 779}
@@ -785,7 +794,7 @@ shake_read_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *u
785 /* We have to set this ourselves because we don't get it for this type */ 794 /* We have to set this ourselves because we don't get it for this type */
786 obj->accuracy = -1; 795 obj->accuracy = -1;
787 obj->data[0] = shake; 796 obj->data[0] = shake;
788 obj->timestamp = timestamp; 797 obj->timestamp = clock_convert(timestamp);
789 ecore_event_add(EEZE_SENSOR_EVENT_SHAKE, obj, NULL, NULL); 798 ecore_event_add(EEZE_SENSOR_EVENT_SHAKE, obj, NULL, NULL);
790 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SHAKE)); 799 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SHAKE));
791} 800}
@@ -805,7 +814,7 @@ doubletap_read_cb(unsigned long long timestamp, void *user_data)
805 } 814 }
806 /* We have to set this ourselves because we don't get it for this type */ 815 /* We have to set this ourselves because we don't get it for this type */
807 obj->accuracy = -1; 816 obj->accuracy = -1;
808 obj->timestamp = timestamp; 817 obj->timestamp = clock_convert(timestamp);
809 ecore_event_add(EEZE_SENSOR_EVENT_DOUBLETAP, obj, NULL, NULL); 818 ecore_event_add(EEZE_SENSOR_EVENT_DOUBLETAP, obj, NULL, NULL);
810 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_DOUBLETAP)); 819 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_DOUBLETAP));
811} 820}
@@ -827,7 +836,7 @@ panning_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
827 obj->accuracy = -1; 836 obj->accuracy = -1;
828 obj->data[0] = x; 837 obj->data[0] = x;
829 obj->data[1] = y; 838 obj->data[1] = y;
830 obj->timestamp = timestamp; 839 obj->timestamp = clock_convert(timestamp);
831 ecore_event_add(EEZE_SENSOR_EVENT_PANNING, obj, NULL, NULL); 840 ecore_event_add(EEZE_SENSOR_EVENT_PANNING, obj, NULL, NULL);
832 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_PANNING)); 841 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_PANNING));
833} 842}
@@ -849,7 +858,7 @@ panning_browse_read_cb(unsigned long long timestamp, int x, int y, void *user_da
849 obj->accuracy = -1; 858 obj->accuracy = -1;
850 obj->data[0] = x; 859 obj->data[0] = x;
851 obj->data[1] = y; 860 obj->data[1] = y;
852 obj->timestamp = timestamp; 861 obj->timestamp = clock_convert(timestamp);
853 ecore_event_add(EEZE_SENSOR_EVENT_PANNING_BROWSE, obj, NULL, NULL); 862 ecore_event_add(EEZE_SENSOR_EVENT_PANNING_BROWSE, obj, NULL, NULL);
854 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_PANNING_BROWSE)); 863 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_PANNING_BROWSE));
855} 864}
@@ -871,7 +880,7 @@ tilt_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
871 obj->accuracy = -1; 880 obj->accuracy = -1;
872 obj->data[0] = x; 881 obj->data[0] = x;
873 obj->data[1] = y; 882 obj->data[1] = y;
874 obj->timestamp = timestamp; 883 obj->timestamp = clock_convert(timestamp);
875 ecore_event_add(EEZE_SENSOR_EVENT_TILT, obj, NULL, NULL); 884 ecore_event_add(EEZE_SENSOR_EVENT_TILT, obj, NULL, NULL);
876 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_TILT)); 885 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_TILT));
877} 886}
@@ -891,7 +900,7 @@ facedown_read_cb(unsigned long long timestamp, void *user_data)
891 } 900 }
892 /* We have to set this ourselves because we don't get it for this type */ 901 /* We have to set this ourselves because we don't get it for this type */
893 obj->accuracy = -1; 902 obj->accuracy = -1;
894 obj->timestamp = timestamp; 903 obj->timestamp = clock_convert(timestamp);
895 ecore_event_add(EEZE_SENSOR_EVENT_FACEDOWN, obj, NULL, NULL); 904 ecore_event_add(EEZE_SENSOR_EVENT_FACEDOWN, obj, NULL, NULL);
896 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_FACEDOWN)); 905 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_FACEDOWN));
897} 906}
@@ -911,7 +920,7 @@ directcall_read_cb(unsigned long long timestamp, void *user_data)
911 } 920 }
912 /* We have to set this ourselves because we don't get it for this type */ 921 /* We have to set this ourselves because we don't get it for this type */
913 obj->accuracy = -1; 922 obj->accuracy = -1;
914 obj->timestamp = timestamp; 923 obj->timestamp = clock_convert(timestamp);
915 ecore_event_add(EEZE_SENSOR_EVENT_DIRECT_CALL, obj, NULL, NULL); 924 ecore_event_add(EEZE_SENSOR_EVENT_DIRECT_CALL, obj, NULL, NULL);
916 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_DIRECT_CALL)); 925 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_DIRECT_CALL));
917} 926}
@@ -931,7 +940,7 @@ smart_alert_read_cb(unsigned long long timestamp, void *user_data)
931 } 940 }
932 /* We have to set this ourselves because we don't get it for this type */ 941 /* We have to set this ourselves because we don't get it for this type */
933 obj->accuracy = -1; 942 obj->accuracy = -1;
934 obj->timestamp = timestamp; 943 obj->timestamp = clock_convert(timestamp);
935 ecore_event_add(EEZE_SENSOR_EVENT_SMART_ALERT, obj, NULL, NULL); 944 ecore_event_add(EEZE_SENSOR_EVENT_SMART_ALERT, obj, NULL, NULL);
936 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SMART_ALERT)); 945 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_SMART_ALERT));
937} 946}
@@ -951,7 +960,7 @@ no_move_read_cb(unsigned long long timestamp, void *user_data)
951 } 960 }
952 /* We have to set this ourselves because we don't get it for this type */ 961 /* We have to set this ourselves because we don't get it for this type */
953 obj->accuracy = -1; 962 obj->accuracy = -1;
954 obj->timestamp = timestamp; 963 obj->timestamp = clock_convert(timestamp);
955 ecore_event_add(EEZE_SENSOR_EVENT_NO_MOVE, obj, NULL, NULL); 964 ecore_event_add(EEZE_SENSOR_EVENT_NO_MOVE, obj, NULL, NULL);
956 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_NO_MOVE)); 965 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_NO_MOVE));
957} 966}
@@ -999,7 +1008,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
999 obj->data[0] = x; 1008 obj->data[0] = x;
1000 obj->data[1] = y; 1009 obj->data[1] = y;
1001 obj->data[2] = z; 1010 obj->data[2] = z;
1002 obj->timestamp = 0; 1011 obj->timestamp = ecore_time_get();
1003 break; 1012 break;
1004 1013
1005 case SENSOR_GRAVITY: 1014 case SENSOR_GRAVITY:
@@ -1008,7 +1017,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1008 obj->data[0] = x; 1017 obj->data[0] = x;
1009 obj->data[1] = y; 1018 obj->data[1] = y;
1010 obj->data[2] = z; 1019 obj->data[2] = z;
1011 obj->timestamp = 0; 1020 obj->timestamp = ecore_time_get();
1012 break; 1021 break;
1013 1022
1014 case SENSOR_LINEAR_ACCELERATION: 1023 case SENSOR_LINEAR_ACCELERATION:
@@ -1017,7 +1026,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1017 obj->data[0] = x; 1026 obj->data[0] = x;
1018 obj->data[1] = y; 1027 obj->data[1] = y;
1019 obj->data[2] = z; 1028 obj->data[2] = z;
1020 obj->timestamp = 0; 1029 obj->timestamp = ecore_time_get();
1021 break; 1030 break;
1022 1031
1023 case SENSOR_DEVICE_ORIENTATION: 1032 case SENSOR_DEVICE_ORIENTATION:
@@ -1026,7 +1035,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1026 obj->data[0] = yaw; 1035 obj->data[0] = yaw;
1027 obj->data[1] = pitch; 1036 obj->data[1] = pitch;
1028 obj->data[2] = roll; 1037 obj->data[2] = roll;
1029 obj->timestamp = 0; 1038 obj->timestamp = ecore_time_get();
1030 break; 1039 break;
1031 1040
1032 case SENSOR_MAGNETIC: 1041 case SENSOR_MAGNETIC:
@@ -1035,7 +1044,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1035 obj->data[0] = x; 1044 obj->data[0] = x;
1036 obj->data[1] = y; 1045 obj->data[1] = y;
1037 obj->data[2] = z; 1046 obj->data[2] = z;
1038 obj->timestamp = 0; 1047 obj->timestamp = ecore_time_get();
1039 break; 1048 break;
1040 1049
1041 case SENSOR_ORIENTATION: 1050 case SENSOR_ORIENTATION:
@@ -1044,7 +1053,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1044 obj->data[0] = azimuth; 1053 obj->data[0] = azimuth;
1045 obj->data[1] = pitch; 1054 obj->data[1] = pitch;
1046 obj->data[2] = roll; 1055 obj->data[2] = roll;
1047 obj->timestamp = 0; 1056 obj->timestamp = ecore_time_get();
1048 break; 1057 break;
1049 1058
1050 case SENSOR_GYROSCOPE: 1059 case SENSOR_GYROSCOPE:
@@ -1053,7 +1062,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1053 obj->data[0] = x; 1062 obj->data[0] = x;
1054 obj->data[1] = y; 1063 obj->data[1] = y;
1055 obj->data[2] = z; 1064 obj->data[2] = z;
1056 obj->timestamp = 0; 1065 obj->timestamp = ecore_time_get();
1057 break; 1066 break;
1058 1067
1059 case SENSOR_LIGHT: 1068 case SENSOR_LIGHT:
@@ -1061,7 +1070,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1061 /* As we do not get any accuracy value from the system we go with -1 */ 1070 /* As we do not get any accuracy value from the system we go with -1 */
1062 obj->accuracy = -1; 1071 obj->accuracy = -1;
1063 obj->data[0] = lux; 1072 obj->data[0] = lux;
1064 obj->timestamp = 0; 1073 obj->timestamp = ecore_time_get();
1065 break; 1074 break;
1066 1075
1067 case SENSOR_PROXIMITY: 1076 case SENSOR_PROXIMITY:
@@ -1069,7 +1078,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1069 /* As we do not get any accuracy value from the system we go with -1 */ 1078 /* As we do not get any accuracy value from the system we go with -1 */
1070 obj->accuracy = -1; 1079 obj->accuracy = -1;
1071 obj->data[0] = distance; 1080 obj->data[0] = distance;
1072 obj->timestamp = 0; 1081 obj->timestamp = ecore_time_get();
1073 break; 1082 break;
1074 1083
1075 default: 1084 default:
diff --git a/src/tests/eeze/eeze_suite.c b/src/tests/eeze/eeze_suite.c
index 71c7213bbd..904dd2597e 100644
--- a/src/tests/eeze/eeze_suite.c
+++ b/src/tests/eeze/eeze_suite.c
@@ -363,7 +363,7 @@ START_TEST(eeze_test_sensor_read)
363 int ret = 0; 363 int ret = 0;
364 float x, y, z; 364 float x, y, z;
365 int acc; 365 int acc;
366 unsigned long long timestamp; 366 double timestamp;
367 Eina_Bool rc = EINA_FALSE; 367 Eina_Bool rc = EINA_FALSE;
368 368
369 ecore_init(); 369 ecore_init();
@@ -499,7 +499,7 @@ event_cb(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
499{ 499{
500 Eeze_Sensor_Obj *sens = NULL; 500 Eeze_Sensor_Obj *sens = NULL;
501 int acc; 501 int acc;
502 unsigned long long timestamp; 502 double timestamp;
503 Eina_Bool rc = EINA_FALSE; 503 Eina_Bool rc = EINA_FALSE;
504 504
505 sens = event; 505 sens = event;