Updating test files to support HRM led red sensor 78/45078/9
authorRamasamy <ram.kannan@samsung.com>
Fri, 31 Jul 2015 08:33:30 +0000 (17:33 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Mon, 7 Sep 2015 05:07:44 +0000 (22:07 -0700)
Updated test files for HRM led red sensor.

Change-Id: I8bb1300cd70b9805dcdaf7787c51dfce18fb4430

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

index 29cde57..fb772c6 100644 (file)
@@ -244,6 +244,9 @@ int main(int argc, char **argv)
        result = check_sensor_api(ULTRAVIOLET_RAW_DATA_EVENT, interval);
        fprintf(fp, "ULTRAVIOLET - RAW_DATA_REPORT_ON_TIME - %d\n", result);
 
+       result = check_sensor_api(BIO_LED_RED_RAW_DATA_EVENT, interval);
+       fprintf(fp, "BIO_LED_RED - RAW_DATA_REPORT_ON_TIME - %d\n", result);
+
        printf("Logs printed in ./auto_test.output\n");
        fclose(fp);
        return 0;
index 75855c4..bcaf5be 100644 (file)
@@ -60,6 +60,9 @@ void printpollinglogs(sensor_type_t type,sensor_data_t data)
        case(ULTRAVIOLET_SENSOR):
                printf("Ultraviolet [%lld] [%6.6f]\n", data.timestamp, data.values[0]);
                break;
+       case(BIO_LED_RED_SENSOR):
+               printf("Bio_LED_Red [%lld] [%6.6f]\n", data.timestamp, data.values[0]);
+               break;
        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;
@@ -128,6 +131,10 @@ int get_event(sensor_type_t sensor_type, char str[])
                if (strcmp(str, "RAW_DATA_EVENT") == 0)
                        return ULTRAVIOLET_RAW_DATA_EVENT;
                break;
+       case BIO_LED_RED_SENSOR:
+               if (strcmp(str, "RAW_DATA_EVENT") == 0)
+                       return BIO_LED_RED_RAW_DATA_EVENT;
+               break;
        case ORIENTATION_SENSOR:
                if (strcmp(str, "RAW_DATA_EVENT") == 0)
                        return ORIENTATION_RAW_DATA_EVENT;
@@ -197,6 +204,9 @@ void callback(sensor_t sensor, unsigned int event_type, sensor_data_t *data, voi
        case ULTRAVIOLET_SENSOR:
                printf("Ultraviolet [%lld] [%6.6f]\n", data->timestamp, data->values[0]);
                break;
+       case BIO_LED_RED_SENSOR:
+               printf("Bio_LED_Red [%lld] [%6.6f]\n", data->timestamp, data->values[0]);
+               break;
        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;
index 7cb7514..610bd0b 100644 (file)
@@ -46,6 +46,7 @@ void usage()
        printf("[geomagnetic_rv] ");
        printf("[gaming_rv] ");
        printf("[ultraviolet] ");
+       printf("[bio_led_red] ");
        printf("[light]\n");
        printf("[uncal_gyro]");
        printf("event:");
@@ -143,6 +144,10 @@ int main(int argc, char **argv)
                 sensor_type = UNCAL_GYROSCOPE_SENSOR;
                 event = UNCAL_GYRO_RAW_DATA_EVENT;
        }
+       else if (strcmp(argv[1], "bio_led_red") == 0) {
+                sensor_type = BIO_LED_RED_SENSOR;
+                event = BIO_LED_RED_RAW_DATA_EVENT;
+       }
        else {
                 usage();
        }