#include <glib.h>
#include <stdlib.h>
#include <stdio.h>
-#include <sensor.h>
+#include <sensor_internal.h>
#include <stdbool.h>
static GMainLoop *mainloop;
{
printf("Usage : ./accelerometer <event> <interval>(optional)\n\n");
printf("event:\n");
- printf("ROTATION_CHECK\n");
+
printf("RAW_DATA_REPORT_ON_TIME\n");
- printf("CALIBRATION_NEEDED\n");
- printf("SET_HORIZON\n");
- printf("SET_WAKEUP\n");
- printf("ORIENTATION_DATA_REPORT_ON_TIME\n");
- printf("LINEAR_ACCELERATION_DATA_REPORT_ON_TIME\n");
- printf("GRAVITY_DATA_REPORT_ON_TIME\n\n");
+
printf("interval:\n");
printf("The time interval should be entered based on the sampling frequency supported by accelerometer driver on the device in ms.If no value for sensor is entered default value by the driver will be used.\n");
}
return 0;
}
- if (strcmp(argv[1], "ROTATION_CHECK") == 0) {
- event = ACCELEROMETER_EVENT_ROTATION_CHECK;
- }
- else if (strcmp(argv[1], "RAW_DATA_REPORT_ON_TIME") == 0) {
+ if (strcmp(argv[1], "RAW_DATA_REPORT_ON_TIME") == 0) {
event = ACCELEROMETER_EVENT_RAW_DATA_REPORT_ON_TIME;
}
- else if (strcmp(argv[1], "CALIBRATION_NEEDED") == 0) {
- event = ACCELEROMETER_EVENT_CALIBRATION_NEEDED;
- }
- else if (strcmp(argv[1], "SET_HORIZON") == 0) {
- event = ACCELEROMETER_EVENT_SET_HORIZON;
- }
- else if (strcmp(argv[1], "SET_WAKEUP") == 0) {
- event = ACCELEROMETER_EVENT_SET_WAKEUP;
- }
- else if (strcmp(argv[1], "ORIENTATION_DATA_REPORT_ON_TIME") == 0) {
- event = ACCELEROMETER_EVENT_ORIENTATION_DATA_REPORT_ON_TIME;
- }
- else if (strcmp(argv[1], "LINEAR_ACCELERATION_DATA_REPORT_ON_TIME") == 0) {
- event = ACCELEROMETER_EVENT_LINEAR_ACCELERATION_DATA_REPORT_ON_TIME;
- }
- else if (strcmp(argv[1], "GRAVITY_DATA_REPORT_ON_TIME") == 0) {
- event = ACCELEROMETER_EVENT_GRAVITY_DATA_REPORT_ON_TIME;
- }
+
else {
printformat();
free(event_condition);
}
if (argc == 3)
event_condition->cond_value1 = atof(argv[2]);
-
+
handle = sf_connect(type);
result = sf_register_event(handle, event, event_condition, callback, NULL);