Updating accelerometer test file for compatibility with changes in public code 03/30703/3
authorVibhor Gaur <vibhor.gaur@samsung.com>
Mon, 24 Nov 2014 12:05:55 +0000 (17:35 +0530)
committerVibhor Gaur <vibhor.gaur@samsung.com>
Thu, 27 Nov 2014 06:16:58 +0000 (11:46 +0530)
Change-Id: I601ca6fb00d046fcf8fb38cfb17cd6bd7f13a2e4

test/src/accelerometer.c

index 1c0e540..09028e4 100644 (file)
@@ -20,7 +20,7 @@
 #include <glib.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sensor.h>
+#include <sensor_internal.h>
 #include <stdbool.h>
 
 static GMainLoop *mainloop;
@@ -35,14 +35,9 @@ void printformat()
 {
        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");
 }
@@ -64,30 +59,10 @@ int main(int argc,char **argv)
                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);
@@ -95,7 +70,7 @@ int main(int argc,char **argv)
        }
        if (argc == 3)
                event_condition->cond_value1 = atof(argv[2]);
-       
+
        handle = sf_connect(type);
        result = sf_register_event(handle, event, event_condition, callback, NULL);