summaryrefslogtreecommitdiff
path: root/legacy/eeze
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@datenfreihafen.org>2012-09-21 14:56:47 +0000
committerStefan Schmidt <stefan@datenfreihafen.org>2012-09-21 14:56:47 +0000
commit5dc29874f12eafa631fa078e57d497e4837c55dd (patch)
tree05ff5851bb029a797a81ca95228a56f492e61508 /legacy/eeze
parentc35df671484240c3336ed9bb0361b6c0cd12eec8 (diff)
eeze/sensor: Fill in more properties in the tizen plugin.
Fill in timestamp values where provided and adjust accuracy to -1 if undefined. 0 means bad accuracy here. SVN revision: 76970
Diffstat (limited to 'legacy/eeze')
-rw-r--r--legacy/eeze/src/modules/eeze_sensor_tizen.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/legacy/eeze/src/modules/eeze_sensor_tizen.c b/legacy/eeze/src/modules/eeze_sensor_tizen.c
index d7c9383c0d..ae74f6f865 100644
--- a/legacy/eeze/src/modules/eeze_sensor_tizen.c
+++ b/legacy/eeze/src/modules/eeze_sensor_tizen.c
@@ -359,7 +359,7 @@ light_read_cb(unsigned long long timestamp, float lux, void *user_data)
359 ERR("No matching sensor object found in list."); 359 ERR("No matching sensor object found in list.");
360 return; 360 return;
361 } 361 }
362 obj->accuracy = 0; 362 obj->accuracy = -1;
363 obj->data[0] = lux; 363 obj->data[0] = lux;
364 obj->timestamp = timestamp; 364 obj->timestamp = timestamp;
365 ecore_event_add(EEZE_SENSOR_EVENT_LIGHT, obj, NULL, NULL); 365 ecore_event_add(EEZE_SENSOR_EVENT_LIGHT, obj, NULL, NULL);
@@ -379,7 +379,7 @@ proximity_read_cb(unsigned long long timestamp, float distance, void *user_data)
379 ERR("No matching sensor object found in list."); 379 ERR("No matching sensor object found in list.");
380 return; 380 return;
381 } 381 }
382 obj->accuracy = 0; 382 obj->accuracy = -1;
383 obj->data[0] = distance; 383 obj->data[0] = distance;
384 obj->timestamp = timestamp; 384 obj->timestamp = timestamp;
385 ecore_event_add(EEZE_SENSOR_EVENT_PROXIMITY, obj, NULL, NULL); 385 ecore_event_add(EEZE_SENSOR_EVENT_PROXIMITY, obj, NULL, NULL);
@@ -399,6 +399,7 @@ snap_read_cb(unsigned long long timestamp, sensor_motion_snap_e snap, void *user
399 ERR("No matching sensor object found in list."); 399 ERR("No matching sensor object found in list.");
400 return; 400 return;
401 } 401 }
402 obj->accuracy = -1;
402 obj->data[0] = snap; 403 obj->data[0] = snap;
403 obj->timestamp = timestamp; 404 obj->timestamp = timestamp;
404 ecore_event_add(EEZE_SENSOR_EVENT_SNAP, obj, NULL, NULL); 405 ecore_event_add(EEZE_SENSOR_EVENT_SNAP, obj, NULL, NULL);
@@ -418,6 +419,7 @@ shake_read_cb(unsigned long long timestamp, sensor_motion_shake_e shake, void *u
418 ERR("No matching sensor object found in list."); 419 ERR("No matching sensor object found in list.");
419 return; 420 return;
420 } 421 }
422 obj->accuracy = -1;
421 obj->data[0] = shake; 423 obj->data[0] = shake;
422 obj->timestamp = timestamp; 424 obj->timestamp = timestamp;
423 ecore_event_add(EEZE_SENSOR_EVENT_SHAKE, obj, NULL, NULL); 425 ecore_event_add(EEZE_SENSOR_EVENT_SHAKE, obj, NULL, NULL);
@@ -437,6 +439,7 @@ panning_read_cb(unsigned long long timestamp, int x, int y, void *user_data)
437 ERR("No matching sensor object found in list."); 439 ERR("No matching sensor object found in list.");
438 return; 440 return;
439 } 441 }
442 obj->accuracy = -1;
440 obj->data[0] = x; 443 obj->data[0] = x;
441 obj->data[1] = y; 444 obj->data[1] = y;
442 obj->timestamp = timestamp; 445 obj->timestamp = timestamp;
@@ -457,6 +460,7 @@ facedown_read_cb(unsigned long long timestamp, void *user_data)
457 ERR("No matching sensor object found in list."); 460 ERR("No matching sensor object found in list.");
458 return; 461 return;
459 } 462 }
463 obj->timestamp = timestamp;
460 ecore_event_add(EEZE_SENSOR_EVENT_FACEDOWN, obj, NULL, NULL); 464 ecore_event_add(EEZE_SENSOR_EVENT_FACEDOWN, obj, NULL, NULL);
461 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_FACEDOWN)); 465 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_FACEDOWN));
462} 466}
@@ -474,6 +478,7 @@ doubletap_read_cb(unsigned long long timestamp, void *user_data)
474 ERR("No matching sensor object found in list."); 478 ERR("No matching sensor object found in list.");
475 return; 479 return;
476 } 480 }
481 obj->timestamp = timestamp;
477 ecore_event_add(EEZE_SENSOR_EVENT_DOUBLETAP, obj, NULL, NULL); 482 ecore_event_add(EEZE_SENSOR_EVENT_DOUBLETAP, obj, NULL, NULL);
478 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_DOUBLETAP)); 483 sensor_stop(sensor_handle, eeze_to_tizen(EEZE_SENSOR_TYPE_MOTION_DOUBLETAP));
479} 484}
@@ -513,6 +518,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
513 obj->data[0] = x; 518 obj->data[0] = x;
514 obj->data[1] = y; 519 obj->data[1] = y;
515 obj->data[2] = z; 520 obj->data[2] = z;
521 obj->timestamp = 0;
516 break; 522 break;
517 523
518 case SENSOR_MAGNETIC: 524 case SENSOR_MAGNETIC:
@@ -521,6 +527,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
521 obj->data[0] = x; 527 obj->data[0] = x;
522 obj->data[1] = y; 528 obj->data[1] = y;
523 obj->data[2] = z; 529 obj->data[2] = z;
530 obj->timestamp = 0;
524 break; 531 break;
525 532
526 case SENSOR_ORIENTATION: 533 case SENSOR_ORIENTATION:
@@ -529,6 +536,7 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
529 obj->data[0] = azimuth; 536 obj->data[0] = azimuth;
530 obj->data[1] = pitch; 537 obj->data[1] = pitch;
531 obj->data[2] = roll; 538 obj->data[2] = roll;
539 obj->timestamp = 0;
532 break; 540 break;
533 541
534 case SENSOR_GYROSCOPE: 542 case SENSOR_GYROSCOPE:
@@ -537,18 +545,21 @@ eeze_sensor_tizen_read(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *lobj)
537 obj->data[0] = x; 545 obj->data[0] = x;
538 obj->data[1] = y; 546 obj->data[1] = y;
539 obj->data[2] = z; 547 obj->data[2] = z;
548 obj->timestamp = 0;
540 break; 549 break;
541 550
542 case SENSOR_LIGHT: 551 case SENSOR_LIGHT:
543 sensor_light_read_data(sensor_handle, &lux); 552 sensor_light_read_data(sensor_handle, &lux);
544 obj->accuracy = 0; 553 obj->accuracy = -1;
545 obj->data[0] = lux; 554 obj->data[0] = lux;
555 obj->timestamp = 0;
546 break; 556 break;
547 557
548 case SENSOR_PROXIMITY: 558 case SENSOR_PROXIMITY:
549 sensor_proximity_read_data(sensor_handle, &distance); 559 sensor_proximity_read_data(sensor_handle, &distance);
550 obj->accuracy = 0; 560 obj->accuracy = -1;
551 obj->data[0] = distance; 561 obj->data[0] = distance;
562 obj->timestamp = 0;
552 break; 563 break;
553 564
554 default: 565 default: