summaryrefslogtreecommitdiff
path: root/src/modules/eeze
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-04-18 00:26:24 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-04-18 00:30:04 +0900
commit6ccae99bd1efb013c3401857405e0b65fe9102f1 (patch)
tree55adf67596783dd15b3d0a1c904af1e1a8874f0b /src/modules/eeze
parent8a19bb4b29ce0500e1da8ffcbb9c1ce030d9a0c0 (diff)
let's fix eeze sensors to not segv on shutdown.. dup registered fake
(udev registered it as fake)... and in the process i found that we probably double free as sensor is calloced in the module and AGAIN in eeze sensor core... oh and symbols probably might lak from modules.. so static them up yo.
Diffstat (limited to 'src/modules/eeze')
-rw-r--r--src/modules/eeze/sensor/fake/fake.c17
-rw-r--r--src/modules/eeze/sensor/tizen/tizen.c99
-rw-r--r--src/modules/eeze/sensor/udev/udev.c23
3 files changed, 71 insertions, 68 deletions
diff --git a/src/modules/eeze/sensor/fake/fake.c b/src/modules/eeze/sensor/fake/fake.c
index d8ff37ba01..ee07b982de 100644
--- a/src/modules/eeze/sensor/fake/fake.c
+++ b/src/modules/eeze/sensor/fake/fake.c
@@ -22,9 +22,9 @@ static int _eeze_sensor_fake_log_dom = -1;
22#endif 22#endif
23#define ERR(...) EINA_LOG_DOM_ERR(_eeze_sensor_fake_log_dom, __VA_ARGS__) 23#define ERR(...) EINA_LOG_DOM_ERR(_eeze_sensor_fake_log_dom, __VA_ARGS__)
24 24
25Eeze_Sensor_Module *esensor_module; 25static Eeze_Sensor_Module *esensor_module;
26 26
27Eina_Bool 27static Eina_Bool
28fake_init(void) 28fake_init(void)
29{ 29{
30 /* For the fake module we prepare a list with all potential sensors. Even if 30 /* For the fake module we prepare a list with all potential sensors. Even if
@@ -45,13 +45,13 @@ fake_init(void)
45/* We don't have anything to clear when we get unregistered from the core here. 45/* We don't have anything to clear when we get unregistered from the core here.
46 * This is different in other modules. 46 * This is different in other modules.
47 */ 47 */
48Eina_Bool 48static Eina_Bool
49fake_shutdown(void) 49fake_shutdown(void)
50{ 50{
51 return EINA_TRUE; 51 return EINA_TRUE;
52} 52}
53 53
54Eina_Bool 54static 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;
@@ -101,7 +101,7 @@ fake_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
101 return EINA_TRUE; 101 return EINA_TRUE;
102} 102}
103 103
104Eina_Bool 104static Eina_Bool
105fake_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)
106{ 106{
107 Eeze_Sensor_Obj *obj = NULL; 107 Eeze_Sensor_Obj *obj = NULL;
@@ -177,7 +177,7 @@ fake_async_read(Eeze_Sensor_Type sensor_type, void *user_data EINA_UNUSED)
177 * entry point to anything in this module. After setting ourself up we register 177 * entry point to anything in this module. After setting ourself up we register
178 * into the core of eeze sensor to make our functionality available. 178 * into the core of eeze sensor to make our functionality available.
179 */ 179 */
180Eina_Bool 180static Eina_Bool
181sensor_fake_init(void) 181sensor_fake_init(void)
182{ 182{
183 183
@@ -214,7 +214,7 @@ sensor_fake_init(void)
214/* Cleanup when the module gets unloaded. Unregister ourself from the core to 214/* Cleanup when the module gets unloaded. Unregister ourself from the core to
215 * avoid calls into a not loaded module. 215 * avoid calls into a not loaded module.
216 */ 216 */
217void 217static void
218sensor_fake_shutdown(void) 218sensor_fake_shutdown(void)
219{ 219{
220 Eeze_Sensor_Obj *sens; 220 Eeze_Sensor_Obj *sens;
@@ -223,10 +223,11 @@ sensor_fake_shutdown(void)
223 EINA_LIST_FREE(esensor_module->sensor_list, sens) 223 EINA_LIST_FREE(esensor_module->sensor_list, sens)
224 free(sens); 224 free(sens);
225 225
226 eina_log_domain_unregister(_eeze_sensor_fake_log_dom);
227
226 free(esensor_module); 228 free(esensor_module);
227 esensor_module = NULL; 229 esensor_module = NULL;
228 230
229 eina_log_domain_unregister(_eeze_sensor_fake_log_dom);
230 _eeze_sensor_fake_log_dom = -1; 231 _eeze_sensor_fake_log_dom = -1;
231} 232}
232 233
diff --git a/src/modules/eeze/sensor/tizen/tizen.c b/src/modules/eeze/sensor/tizen/tizen.c
index 0d4bbb1b2f..b6f44aa483 100644
--- a/src/modules/eeze/sensor/tizen/tizen.c
+++ b/src/modules/eeze/sensor/tizen/tizen.c
@@ -20,9 +20,9 @@ static int _eeze_sensor_tizen_log_dom = -1;
20#endif 20#endif
21#define ERR(...) EINA_LOG_DOM_ERR(_eeze_sensor_tizen_log_dom, __VA_ARGS__) 21#define ERR(...) EINA_LOG_DOM_ERR(_eeze_sensor_tizen_log_dom, __VA_ARGS__)
22 22
23Eeze_Sensor_Module *esensor_module; 23static Eeze_Sensor_Module *esensor_module;
24/* Tizen sensor handle */ 24/* Tizen sensor handle */
25sensor_h sensor_handle; 25static sensor_h sensor_handle;
26 26
27/* The Tizen sensor type ENUM has shown to not be stable regarding its 27/* The Tizen sensor type ENUM has shown to not be stable regarding its
28 * numbering scheme so we better translate between the Tizen types and the 28 * numbering scheme so we better translate between the Tizen types and the
@@ -168,7 +168,7 @@ tizen_to_eeze(sesnor_type_e type)
168/* We receive the timestamp in nanoseconds from the Tizen system lib. Convert 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. 169 * it to seconds as floating point value which is used in our public API.
170 */ 170 */
171double 171static double
172clock_convert(unsigned long long timestamp) 172clock_convert(unsigned long long timestamp)
173{ 173{
174 return ((double)timestamp) / 1000000000.0; 174 return ((double)timestamp) / 1000000000.0;
@@ -183,7 +183,7 @@ clock_convert(unsigned long long timestamp)
183 * new data is available and then stop the sensor server to safe power. It will be 183 * new data is available and then stop the sensor server to safe power. It will be
184 * started again the next time data gets requested. 184 * started again the next time data gets requested.
185 */ 185 */
186void 186static void
187accelerometer_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 187accelerometer_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
188{ 188{
189 Eeze_Sensor_Obj *obj = NULL; 189 Eeze_Sensor_Obj *obj = NULL;
@@ -203,7 +203,7 @@ accelerometer_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy,
203 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ACCELEROMETER)); 203 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ACCELEROMETER));
204} 204}
205 205
206void 206static void
207gravity_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 207gravity_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
208{ 208{
209 Eeze_Sensor_Obj *obj = NULL; 209 Eeze_Sensor_Obj *obj = NULL;
@@ -223,7 +223,7 @@ gravity_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float
223 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GRAVITY)); 223 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GRAVITY));
224} 224}
225 225
226void 226static void
227linear_acceleration_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 227linear_acceleration_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
228{ 228{
229 Eeze_Sensor_Obj *obj = NULL; 229 Eeze_Sensor_Obj *obj = NULL;
@@ -243,7 +243,7 @@ linear_acceleration_cb(unsigned long long timestamp, sensor_data_accuracy_e accu
243 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));
244} 244}
245 245
246void 246static void
247device_orientation_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float yaw, 247device_orientation_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float yaw,
248 float pitch, float roll, void *user_data) 248 float pitch, float roll, void *user_data)
249{ 249{
@@ -264,7 +264,7 @@ device_orientation_cb(unsigned long long timestamp, sensor_data_accuracy_e accur
264 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));
265} 265}
266 266
267void 267static void
268magnetic_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 268magnetic_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
269{ 269{
270 Eeze_Sensor_Obj *obj = NULL; 270 Eeze_Sensor_Obj *obj = NULL;
@@ -284,7 +284,7 @@ magnetic_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float
284 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MAGNETIC)); 284 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MAGNETIC));
285} 285}
286 286
287void 287static void
288orientation_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float azimuth, float pitch, float roll, void *user_data) 288orientation_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float azimuth, float pitch, float roll, void *user_data)
289{ 289{
290 Eeze_Sensor_Obj *obj = NULL; 290 Eeze_Sensor_Obj *obj = NULL;
@@ -304,7 +304,7 @@ orientation_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, fl
304 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ORIENTATION)); 304 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ORIENTATION));
305} 305}
306 306
307void 307static void
308gyroscope_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 308gyroscope_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
309{ 309{
310 Eeze_Sensor_Obj *obj = NULL; 310 Eeze_Sensor_Obj *obj = NULL;
@@ -324,7 +324,7 @@ gyroscope_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, floa
324 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GYROSCOPE)); 324 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GYROSCOPE));
325} 325}
326 326
327void 327static void
328light_cb(unsigned long long timestamp, float lux, void *user_data) 328light_cb(unsigned long long timestamp, float lux, void *user_data)
329{ 329{
330 Eeze_Sensor_Obj *obj = NULL; 330 Eeze_Sensor_Obj *obj = NULL;
@@ -343,7 +343,7 @@ light_cb(unsigned long long timestamp, float lux, void *user_data)
343 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LIGHT)); 343 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LIGHT));
344} 344}
345 345
346void 346static void
347proximity_cb(unsigned long long timestamp, float distance, void *user_data) 347proximity_cb(unsigned long long timestamp, float distance, void *user_data)
348{ 348{
349 Eeze_Sensor_Obj *obj = NULL; 349 Eeze_Sensor_Obj *obj = NULL;
@@ -362,7 +362,7 @@ proximity_cb(unsigned long long timestamp, float distance, void *user_data)
362 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_PROXIMITY)); 362 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_PROXIMITY));
363} 363}
364 364
365void 365static void
366snap_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user_data) 366snap_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user_data)
367{ 367{
368 Eeze_Sensor_Obj *obj = NULL; 368 Eeze_Sensor_Obj *obj = NULL;
@@ -381,7 +381,7 @@ snap_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user_data
381 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));
382} 382}
383 383
384void 384static void
385shake_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *user_data) 385shake_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *user_data)
386{ 386{
387 Eeze_Sensor_Obj *obj = NULL; 387 Eeze_Sensor_Obj *obj = NULL;
@@ -400,7 +400,7 @@ shake_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *user_d
400 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));
401} 401}
402 402
403void 403static void
404panning_cb(unsigned long long timestamp, int x, int y, void *user_data) 404panning_cb(unsigned long long timestamp, int x, int y, void *user_data)
405{ 405{
406 Eeze_Sensor_Obj *obj = NULL; 406 Eeze_Sensor_Obj *obj = NULL;
@@ -420,7 +420,7 @@ panning_cb(unsigned long long timestamp, int x, int y, void *user_data)
420 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));
421} 421}
422 422
423void 423static void
424panning_browse_cb(unsigned long long timestamp, int x, int y, void *user_data) 424panning_browse_cb(unsigned long long timestamp, int x, int y, void *user_data)
425{ 425{
426 Eeze_Sensor_Obj *obj = NULL; 426 Eeze_Sensor_Obj *obj = NULL;
@@ -440,7 +440,7 @@ panning_browse_cb(unsigned long long timestamp, int x, int y, void *user_data)
440 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));
441} 441}
442 442
443void 443static void
444tilt_cb(unsigned long long timestamp, int x, int y, void *user_data) 444tilt_cb(unsigned long long timestamp, int x, int y, void *user_data)
445{ 445{
446 Eeze_Sensor_Obj *obj = NULL; 446 Eeze_Sensor_Obj *obj = NULL;
@@ -460,7 +460,7 @@ tilt_cb(unsigned long long timestamp, int x, int y, void *user_data)
460 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));
461} 461}
462 462
463void 463static void
464facedown_cb(unsigned long long timestamp, void *user_data) 464facedown_cb(unsigned long long timestamp, void *user_data)
465{ 465{
466 Eeze_Sensor_Obj *obj = NULL; 466 Eeze_Sensor_Obj *obj = NULL;
@@ -480,7 +480,7 @@ facedown_cb(unsigned long long timestamp, void *user_data)
480 */ 480 */
481} 481}
482 482
483void 483static void
484directcall_cb(unsigned long long timestamp, void *user_data) 484directcall_cb(unsigned long long timestamp, void *user_data)
485{ 485{
486 Eeze_Sensor_Obj *obj = NULL; 486 Eeze_Sensor_Obj *obj = NULL;
@@ -500,7 +500,7 @@ directcall_cb(unsigned long long timestamp, void *user_data)
500 */ 500 */
501} 501}
502 502
503void 503static void
504smart_alert_cb(unsigned long long timestamp, void *user_data) 504smart_alert_cb(unsigned long long timestamp, void *user_data)
505{ 505{
506 Eeze_Sensor_Obj *obj = NULL; 506 Eeze_Sensor_Obj *obj = NULL;
@@ -520,7 +520,7 @@ smart_alert_cb(unsigned long long timestamp, void *user_data)
520 */ 520 */
521} 521}
522 522
523void 523static void
524no_move_cb(unsigned long long timestamp, void *user_data) 524no_move_cb(unsigned long long timestamp, void *user_data)
525{ 525{
526 Eeze_Sensor_Obj *obj = NULL; 526 Eeze_Sensor_Obj *obj = NULL;
@@ -540,7 +540,7 @@ no_move_cb(unsigned long long timestamp, void *user_data)
540 */ 540 */
541} 541}
542 542
543void 543static void
544doubletap_cb(unsigned long long timestamp, void *user_data) 544doubletap_cb(unsigned long long timestamp, void *user_data)
545{ 545{
546 Eeze_Sensor_Obj *obj = NULL; 546 Eeze_Sensor_Obj *obj = NULL;
@@ -560,7 +560,7 @@ doubletap_cb(unsigned long long timestamp, void *user_data)
560 */ 560 */
561} 561}
562 562
563void 563static void
564accelerometer_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 564accelerometer_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
565{ 565{
566 Eeze_Sensor_Obj *obj = NULL; 566 Eeze_Sensor_Obj *obj = NULL;
@@ -582,7 +582,7 @@ accelerometer_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accur
582 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ACCELEROMETER)); 582 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ACCELEROMETER));
583} 583}
584 584
585void 585static void
586gravity_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 586gravity_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
587{ 587{
588 Eeze_Sensor_Obj *obj = NULL; 588 Eeze_Sensor_Obj *obj = NULL;
@@ -604,7 +604,7 @@ gravity_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, f
604 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GRAVITY)); 604 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GRAVITY));
605} 605}
606 606
607void 607static void
608linear_acceleration_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 608linear_acceleration_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
609{ 609{
610 Eeze_Sensor_Obj *obj = NULL; 610 Eeze_Sensor_Obj *obj = NULL;
@@ -626,7 +626,7 @@ linear_acceleration_read_cb(unsigned long long timestamp, sensor_data_accuracy_e
626 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));
627} 627}
628 628
629void 629static void
630device_orientation_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float yaw, 630device_orientation_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float yaw,
631 float pitch, float roll, void *user_data) 631 float pitch, float roll, void *user_data)
632{ 632{
@@ -649,7 +649,7 @@ device_orientation_read_cb(unsigned long long timestamp, sensor_data_accuracy_e
649 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));
650} 650}
651 651
652void 652static void
653magnetic_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 653magnetic_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
654{ 654{
655 Eeze_Sensor_Obj *obj = NULL; 655 Eeze_Sensor_Obj *obj = NULL;
@@ -671,7 +671,7 @@ magnetic_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy,
671 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MAGNETIC)); 671 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MAGNETIC));
672} 672}
673 673
674void 674static void
675orientation_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float azimuth, float pitch, float roll, void *user_data) 675orientation_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float azimuth, float pitch, float roll, void *user_data)
676{ 676{
677 Eeze_Sensor_Obj *obj = NULL; 677 Eeze_Sensor_Obj *obj = NULL;
@@ -693,7 +693,7 @@ orientation_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accurac
693 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ORIENTATION)); 693 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_ORIENTATION));
694} 694}
695 695
696void 696static void
697gyroscope_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data) 697gyroscope_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy, float x, float y, float z, void *user_data)
698{ 698{
699 Eeze_Sensor_Obj *obj = NULL; 699 Eeze_Sensor_Obj *obj = NULL;
@@ -715,7 +715,7 @@ gyroscope_read_cb(unsigned long long timestamp, sensor_data_accuracy_e accuracy,
715 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GYROSCOPE)); 715 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_GYROSCOPE));
716} 716}
717 717
718void 718static void
719light_read_cb(unsigned long long timestamp, float lux, void *user_data) 719light_read_cb(unsigned long long timestamp, float lux, void *user_data)
720{ 720{
721 Eeze_Sensor_Obj *obj = NULL; 721 Eeze_Sensor_Obj *obj = NULL;
@@ -736,7 +736,7 @@ light_read_cb(unsigned long long timestamp, float lux, void *user_data)
736 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LIGHT)); 736 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_LIGHT));
737} 737}
738 738
739void 739static void
740proximity_read_cb(unsigned long long timestamp, float distance, void *user_data) 740proximity_read_cb(unsigned long long timestamp, float distance, void *user_data)
741{ 741{
742 Eeze_Sensor_Obj *obj = NULL; 742 Eeze_Sensor_Obj *obj = NULL;
@@ -757,7 +757,7 @@ proximity_read_cb(unsigned long long timestamp, float distance, void *user_data)
757 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_PROXIMITY)); 757 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_PROXIMITY));
758} 758}
759 759
760void 760static void
761snap_read_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user_data) 761snap_read_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user_data)
762{ 762{
763 Eeze_Sensor_Obj *obj = NULL; 763 Eeze_Sensor_Obj *obj = NULL;
@@ -778,7 +778,7 @@ snap_read_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user
778 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));
779} 779}
780 780
781void 781static void
782shake_read_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *user_data) 782shake_read_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *user_data)
783{ 783{
784 Eeze_Sensor_Obj *obj = NULL; 784 Eeze_Sensor_Obj *obj = NULL;
@@ -799,7 +799,7 @@ shake_read_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *u
799 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));
800} 800}
801 801
802void 802static void
803doubletap_read_cb(unsigned long long timestamp, void *user_data) 803doubletap_read_cb(unsigned long long timestamp, void *user_data)
804{ 804{
805 Eeze_Sensor_Obj *obj = NULL; 805 Eeze_Sensor_Obj *obj = NULL;
@@ -819,7 +819,7 @@ doubletap_read_cb(unsigned long long timestamp, void *user_data)
819 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));
820} 820}
821 821
822void 822static void
823panning_read_cb(unsigned long long timestamp, int x, int y, void *user_data) 823panning_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
824{ 824{
825 Eeze_Sensor_Obj *obj = NULL; 825 Eeze_Sensor_Obj *obj = NULL;
@@ -841,7 +841,7 @@ panning_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
841 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));
842} 842}
843 843
844void 844static void
845panning_browse_read_cb(unsigned long long timestamp, int x, int y, void *user_data) 845panning_browse_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
846{ 846{
847 Eeze_Sensor_Obj *obj = NULL; 847 Eeze_Sensor_Obj *obj = NULL;
@@ -863,7 +863,7 @@ panning_browse_read_cb(unsigned long long timestamp, int x, int y, void *user_da
863 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));
864} 864}
865 865
866void 866static void
867tilt_read_cb(unsigned long long timestamp, int x, int y, void *user_data) 867tilt_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
868{ 868{
869 Eeze_Sensor_Obj *obj = NULL; 869 Eeze_Sensor_Obj *obj = NULL;
@@ -885,7 +885,7 @@ tilt_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
885 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));
886} 886}
887 887
888void 888static void
889facedown_read_cb(unsigned long long timestamp, void *user_data) 889facedown_read_cb(unsigned long long timestamp, void *user_data)
890{ 890{
891 Eeze_Sensor_Obj *obj = NULL; 891 Eeze_Sensor_Obj *obj = NULL;
@@ -905,7 +905,7 @@ facedown_read_cb(unsigned long long timestamp, void *user_data)
905 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));
906} 906}
907 907
908void 908static void
909directcall_read_cb(unsigned long long timestamp, void *user_data) 909directcall_read_cb(unsigned long long timestamp, void *user_data)
910{ 910{
911 Eeze_Sensor_Obj *obj = NULL; 911 Eeze_Sensor_Obj *obj = NULL;
@@ -925,7 +925,7 @@ directcall_read_cb(unsigned long long timestamp, void *user_data)
925 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));
926} 926}
927 927
928void 928static void
929smart_alert_read_cb(unsigned long long timestamp, void *user_data) 929smart_alert_read_cb(unsigned long long timestamp, void *user_data)
930{ 930{
931 Eeze_Sensor_Obj *obj = NULL; 931 Eeze_Sensor_Obj *obj = NULL;
@@ -945,7 +945,7 @@ smart_alert_read_cb(unsigned long long timestamp, void *user_data)
945 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));
946} 946}
947 947
948void 948static void
949no_move_read_cb(unsigned long long timestamp, void *user_data) 949no_move_read_cb(unsigned long long timestamp, void *user_data)
950{ 950{
951 Eeze_Sensor_Obj *obj = NULL; 951 Eeze_Sensor_Obj *obj = NULL;
@@ -970,7 +970,7 @@ no_move_read_cb(unsigned long long timestamp, void *user_data)
970 * might take quite some time depending on the sensor and how it is connected to 970 * might take quite some time depending on the sensor and how it is connected to
971 * the system. Normally it is better to use the asynchronous reading functions. 971 * the system. Normally it is better to use the asynchronous reading functions.
972 */ 972 */
973Eina_Bool 973static Eina_Bool
974eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj) 974eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
975{ 975{
976 sensor_data_accuracy_e accuracy; 976 sensor_data_accuracy_e accuracy;
@@ -1095,7 +1095,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
1095 1095
1096// FIXME ho to handle this without explicit callback setting 1096// FIXME ho to handle this without explicit callback setting
1097#if 0 1097#if 0
1098Eina_Bool 1098static Eina_Bool
1099eeze_sensor_tizen_cb_set(Eeze_Sensor *handle, Eeze_Sensor_Type sensor_type, void *cb_function, void *user_data) 1099eeze_sensor_tizen_cb_set(Eeze_Sensor *handle, Eeze_Sensor_Type sensor_type, void *cb_function, void *user_data)
1100{ 1100{
1101 sensor_type_e type; 1101 sensor_type_e type;
@@ -1198,7 +1198,7 @@ eeze_sensor_tizen_cb_set(Eeze_Sensor *handle, Eeze_Sensor_Type sensor_type, void
1198 * event. The public API function does actually return right away with the cached 1198 * event. The public API function does actually return right away with the cached
1199 * data. This is handled in the core and not in the different modules though. 1199 * data. This is handled in the core and not in the different modules though.
1200 */ 1200 */
1201Eina_Bool 1201static Eina_Bool
1202eeze_sensor_tizen_async_read(Eeze_Sensor_Type sensor_type, void *user_data) 1202eeze_sensor_tizen_async_read(Eeze_Sensor_Type sensor_type, void *user_data)
1203{ 1203{
1204 sensor_type_e type; 1204 sensor_type_e type;
@@ -1315,7 +1315,7 @@ eeze_sensor_tizen_sensors_find(void)
1315} 1315}
1316 1316
1317/* Cleanup when getting the shutdown callback from core */ 1317/* Cleanup when getting the shutdown callback from core */
1318Eina_Bool 1318static Eina_Bool
1319eeze_sensor_tizen_shutdown(void) 1319eeze_sensor_tizen_shutdown(void)
1320{ 1320{
1321 Eeze_Sensor_Obj *obj; 1321 Eeze_Sensor_Obj *obj;
@@ -1337,7 +1337,7 @@ eeze_sensor_tizen_shutdown(void)
1337/* Callback from core once we registered as a module. Create the Tizen sensor 1337/* Callback from core once we registered as a module. Create the Tizen sensor
1338 * handle and find all available sensors. 1338 * handle and find all available sensors.
1339 */ 1339 */
1340Eina_Bool 1340static Eina_Bool
1341eeze_sensor_tizen_init(void) 1341eeze_sensor_tizen_init(void)
1342{ 1342{
1343 1343
@@ -1362,7 +1362,7 @@ eeze_sensor_tizen_init(void)
1362 * entry point to anything in this module. After setting ourself up we register 1362 * entry point to anything in this module. After setting ourself up we register
1363 * into the core of eeze sensor to make our functionality available. 1363 * into the core of eeze sensor to make our functionality available.
1364 */ 1364 */
1365Eina_Bool 1365static Eina_Bool
1366sensor_tizen_init(void) 1366sensor_tizen_init(void)
1367{ 1367{
1368 1368
@@ -1396,7 +1396,7 @@ sensor_tizen_init(void)
1396/* Cleanup when the module gets unloaded. Unregister ourself from the core to 1396/* Cleanup when the module gets unloaded. Unregister ourself from the core to
1397 * avoid calls into a not loaded module. 1397 * avoid calls into a not loaded module.
1398 */ 1398 */
1399void 1399static void
1400sensor_tizen_shutdown(void) 1400sensor_tizen_shutdown(void)
1401{ 1401{
1402 Eeze_Sensor_Obj *sens; 1402 Eeze_Sensor_Obj *sens;
@@ -1407,10 +1407,11 @@ sensor_tizen_shutdown(void)
1407 EINA_LIST_FREE(esensor_module->sensor_list, sens) 1407 EINA_LIST_FREE(esensor_module->sensor_list, sens)
1408 free(sens); 1408 free(sens);
1409 1409
1410 eina_log_domain_unregister(_eeze_sensor_tizen_log_dom);
1411
1410 free(esensor_module); 1412 free(esensor_module);
1411 esensor_module = NULL; 1413 esensor_module = NULL;
1412 1414
1413 eina_log_domain_unregister(_eeze_sensor_tizen_log_dom);
1414 _eeze_sensor_tizen_log_dom = -1; 1415 _eeze_sensor_tizen_log_dom = -1;
1415} 1416}
1416 1417
diff --git a/src/modules/eeze/sensor/udev/udev.c b/src/modules/eeze/sensor/udev/udev.c
index 3a24fde4b4..e958b06a6b 100644
--- a/src/modules/eeze/sensor/udev/udev.c
+++ b/src/modules/eeze/sensor/udev/udev.c
@@ -18,11 +18,11 @@ static int _eeze_sensor_udev_log_dom = -1;
18#endif 18#endif
19#define ERR(...) EINA_LOG_DOM_ERR(_eeze_sensor_udev_log_dom, __VA_ARGS__) 19#define ERR(...) EINA_LOG_DOM_ERR(_eeze_sensor_udev_log_dom, __VA_ARGS__)
20 20
21Eeze_Sensor_Module *esensor_module; 21static Eeze_Sensor_Module *esensor_module;
22 22
23Eina_List *devices; 23static Eina_List *devices;
24 24
25Eina_Bool 25static Eina_Bool
26udev_init(void) 26udev_init(void)
27{ 27{
28 /* We only offer a temperature sensor right now */ 28 /* We only offer a temperature sensor right now */
@@ -35,7 +35,7 @@ udev_init(void)
35 return EINA_TRUE; 35 return EINA_TRUE;
36} 36}
37 37
38Eina_Bool 38static Eina_Bool
39udev_shutdown(void) 39udev_shutdown(void)
40{ 40{
41 char *data; 41 char *data;
@@ -46,7 +46,7 @@ udev_shutdown(void)
46 return EINA_TRUE; 46 return EINA_TRUE;
47} 47}
48 48
49double 49static double
50_udev_read(void) 50_udev_read(void)
51{ 51{
52 Eina_List *l; 52 Eina_List *l;
@@ -88,7 +88,7 @@ _udev_read(void)
88 return temp; 88 return temp;
89} 89}
90 90
91Eina_Bool 91static Eina_Bool
92udev_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj) 92udev_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
93{ 93{
94 Eeze_Sensor_Obj *obj = NULL; 94 Eeze_Sensor_Obj *obj = NULL;
@@ -122,7 +122,7 @@ udev_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
122 return EINA_TRUE; 122 return EINA_TRUE;
123} 123}
124 124
125Eina_Bool 125static Eina_Bool
126udev_async_read(Eeze_Sensor_Type sensor_type, void *user_data EINA_UNUSED) 126udev_async_read(Eeze_Sensor_Type sensor_type, void *user_data EINA_UNUSED)
127{ 127{
128 Eeze_Sensor_Obj *obj = NULL; 128 Eeze_Sensor_Obj *obj = NULL;
@@ -157,7 +157,7 @@ udev_async_read(Eeze_Sensor_Type sensor_type, void *user_data EINA_UNUSED)
157 * entry point to anything in this module. After setting ourself up we register 157 * entry point to anything in this module. After setting ourself up we register
158 * into the core of eeze sensor to make our functionality available. 158 * into the core of eeze sensor to make our functionality available.
159 */ 159 */
160Eina_Bool 160static Eina_Bool
161sensor_udev_init(void) 161sensor_udev_init(void)
162{ 162{
163 163
@@ -183,7 +183,7 @@ sensor_udev_init(void)
183 esensor_module->read = udev_read; 183 esensor_module->read = udev_read;
184 esensor_module->async_read = udev_async_read; 184 esensor_module->async_read = udev_async_read;
185 185
186 if (!eeze_sensor_module_register("fake", esensor_module)) 186 if (!eeze_sensor_module_register("udev", esensor_module))
187 { 187 {
188 ERR("Failed to register udev module."); 188 ERR("Failed to register udev module.");
189 return EINA_FALSE; 189 return EINA_FALSE;
@@ -194,7 +194,7 @@ sensor_udev_init(void)
194/* Cleanup when the module gets unloaded. Unregister ourself from the core to 194/* Cleanup when the module gets unloaded. Unregister ourself from the core to
195 * avoid calls into a not loaded module. 195 * avoid calls into a not loaded module.
196 */ 196 */
197void 197static void
198sensor_udev_shutdown(void) 198sensor_udev_shutdown(void)
199{ 199{
200 Eeze_Sensor_Obj *sens; 200 Eeze_Sensor_Obj *sens;
@@ -203,10 +203,11 @@ sensor_udev_shutdown(void)
203 EINA_LIST_FREE(esensor_module->sensor_list, sens) 203 EINA_LIST_FREE(esensor_module->sensor_list, sens)
204 free(sens); 204 free(sens);
205 205
206 eina_log_domain_unregister(_eeze_sensor_udev_log_dom);
207
206 free(esensor_module); 208 free(esensor_module);
207 esensor_module = NULL; 209 esensor_module = NULL;
208 210
209 eina_log_domain_unregister(_eeze_sensor_udev_log_dom);
210 _eeze_sensor_udev_log_dom = -1; 211 _eeze_sensor_udev_log_dom = -1;
211} 212}
212 213