Updating test files to support the tilt sensor 56/39456/1
authorRamasamy <ram.kannan@samsung.com>
Fri, 15 May 2015 10:07:10 +0000 (19:07 +0900)
committerRamasamy <ram.kannan@samsung.com>
Fri, 15 May 2015 10:07:14 +0000 (19:07 +0900)
- Adding support for tilt sensor in all test files

Change-Id: I7107668a844204b7087a5a89d7ca21aa9ece3e93

test/src/api-test.c
test/src/check-sensor.c
test/src/sensor-test.c

index 0ecea23..599041a 100644 (file)
@@ -220,6 +220,9 @@ int main(int argc, char **argv)
        result = check_sensor_api(ORIENTATION_RAW_DATA_EVENT, interval);
        fprintf(fp, "Orientation - RAW_DATA_REPORT_ON_TIME - %d\n", result);
 
+       result = check_sensor_api(TILT_RAW_DATA_EVENT, interval);
+       fprintf(fp, "Tilt - RAW_DATA_REPORT_ON_TIME - %d\n", result);
+
        result = check_sensor_api(PRESSURE_RAW_DATA_EVENT, interval);
        fprintf(fp, "Pressure - RAW_DATA_REPORT_ON_TIME - %d\n", result);
 
index aa15e34..9bba712 100644 (file)
@@ -57,6 +57,9 @@ void printpollinglogs(sensor_type_t type,sensor_data_t data)
        case(ORIENTATION_SENSOR):
                printf("Orientation [%lld] [%6.6f] [%6.6f] [%6.6f]\n\n", data.timestamp, data.values[0], data.values[1], data.values[2]);
                break;
+       case(TILT_SENSOR):
+               printf("Tilt [%lld] [%6.6f] [%6.6f]\n\n", data.timestamp, data.values[0], data.values[1]);
+               break;
        case(GRAVITY_SENSOR):
                printf("Gravity [%lld] [%6.6f] [%6.6f] [%6.6f]\n\n", data.timestamp, data.values[0], data.values[1], data.values[2]);
                break;
@@ -112,6 +115,10 @@ int get_event(sensor_type_t sensor_type, char str[])
                if (strcmp(str, "RAW_DATA_EVENT") == 0)
                        return ORIENTATION_RAW_DATA_EVENT;
                break;
+       case TILT_SENSOR:
+               if (strcmp(str, "RAW_DATA_EVENT") == 0)
+                       return TILT_RAW_DATA_EVENT;
+               break;
        case GRAVITY_SENSOR:
                if (strcmp(str, "RAW_DATA_EVENT") == 0)
                        return GRAVITY_RAW_DATA_EVENT;
@@ -165,6 +172,9 @@ void callback(sensor_t sensor, unsigned int event_type, sensor_data_t *data, voi
        case ORIENTATION_SENSOR :
                printf("Orientation [%lld] [%6.6f] [%6.6f] [%6.6f]\n", data->timestamp, data->values[0], data->values[1], data->values[2]);
                break;
+       case TILT_SENSOR :
+               printf("Tilt [%lld] [%6.6f] [%6.6f]\n", data->timestamp, data->values[0], data->values[1]);
+               break;
        case GRAVITY_SENSOR:
                printf("Gravity [%lld] [%6.6f] [%6.6f] [%6.6f]\n", data->timestamp, data->values[0], data->values[1], data->values[2]);
                break;
index 5c5c3c1..99ea138 100644 (file)
@@ -38,6 +38,7 @@ void usage()
        printf("[temperature] ");
        printf("[geomagnetic] ");
        printf("[orientation] ");
+       printf("[tilt] ");
        printf("[gravity] ");
        printf("[linear_accel] ");
        printf("[rotation_vector] ");
@@ -95,6 +96,10 @@ int main(int argc, char **argv)
                 sensor_type = ORIENTATION_SENSOR;
                 event = ORIENTATION_RAW_DATA_EVENT;
        }
+       else if (strcmp(argv[1], "tilt") == 0) {
+                sensor_type = TILT_SENSOR;
+                event = TILT_RAW_DATA_EVENT;
+       }
        else if (strcmp(argv[1], "gravity") == 0) {
                 sensor_type = GRAVITY_SENSOR;
                 event = GRAVITY_RAW_DATA_EVENT;