From 690392eb48fdefc72d43b03794a6266c353e3946 Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Thu, 26 Feb 2015 12:37:38 +0530 Subject: [PATCH] Updating test automation files to support Gaming RV Updating auto_test and tc-common test automation files to support Gaming RV virtual sensor Change-Id: Ib8466cbe6683a1bb2eba3ec602d7892f5b80ad35 --- test/src/auto_test.c | 3 +++ test/src/tc-common.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/test/src/auto_test.c b/test/src/auto_test.c index dfe322f..971b171 100644 --- a/test/src/auto_test.c +++ b/test/src/auto_test.c @@ -229,6 +229,9 @@ int main(int argc, char **argv) result = check_sensor_api(GEOMAGNETIC_RV_RAW_DATA_EVENT, interval); fprintf(fp, "Geomagnetic Rotation Vector - RAW_DATA_REPORT_ON_TIME - %d\n", result); + result = check_sensor_api(GAMING_RV_RAW_DATA_EVENT, interval); + fprintf(fp, "Gaming Rotation Vector - RAW_DATA_REPORT_ON_TIME - %d\n", result); + result = check_sensor_api(TEMPERATURE_RAW_DATA_EVENT, interval); fprintf(fp, "Temperature - RAW_DATA_REPORT_ON_TIME - %d\n", result); diff --git a/test/src/tc-common.c b/test/src/tc-common.c index edee1ba..2d1f263 100644 --- a/test/src/tc-common.c +++ b/test/src/tc-common.c @@ -45,6 +45,7 @@ void usage() printf("[linear_accel] "); printf("[rotation_vector] "); printf("[geomagnetic_rv] "); + printf("[gaming_rv] "); printf("[light]\n"); printf("event:"); printf("[RAW_DATA_REPORT_ON_TIME]\n"); @@ -109,6 +110,10 @@ unsigned int get_event_driven(sensor_type_t sensor_type, char str[]) if (strcmp(str, "RAW_DATA_REPORT_ON_TIME") == 0) return GEOMAGNETIC_RV_RAW_DATA_EVENT; break; + case GAMING_RV_SENSOR: + if (strcmp(str, "RAW_DATA_REPORT_ON_TIME") == 0) + return GAMING_RV_RAW_DATA_EVENT; + break; default: return -1; } @@ -155,6 +160,9 @@ void callback(sensor_t sensor, unsigned int event_type, sensor_data_t *data, voi case GEOMAGNETIC_RV_SENSOR: printf("Geomagnetic RV [%lld] [%6.6f] [%6.6f] [%6.6f] [%6.6f]\n\n", data->timestamp, data->values[0], data->values[1], data->values[2], data->values[3]); break; + case GAMING_RV_SENSOR: + printf("Gaming RV [%lld] [%6.6f] [%6.6f] [%6.6f] [%6.6f]\n\n", data->timestamp, data->values[0], data->values[1], data->values[2], data->values[3]); + break; default: return; } @@ -215,6 +223,10 @@ int main(int argc, char **argv) sensor_type = GEOMAGNETIC_RV_SENSOR; event = GEOMAGNETIC_RV_RAW_DATA_EVENT; } + else if (strcmp(argv[1], "gaming_rv") == 0) { + sensor_type = GAMING_RV_SENSOR; + event = GAMING_RV_RAW_DATA_EVENT; + } else if (strcmp(argv[1], "light") == 0) { sensor_type = LIGHT_SENSOR; event = LIGHT_EVENT_LUX_DATA_REPORT_ON_TIME; -- 2.7.4