remove codes related to random value generating
authorJeonghoon Park <jh1979.park@samsung.com>
Thu, 19 Jul 2018 08:03:24 +0000 (17:03 +0900)
committerJeonghoon Park <jh1979.park@samsung.com>
Thu, 19 Jul 2018 08:03:24 +0000 (17:03 +0900)
src/co2.c

index 895e82b..bc1ca47 100644 (file)
--- a/src/co2.c
+++ b/src/co2.c
 #include "sensor-data.h"
 #include "co2-sensor.h"
 
-//#define TEST_RANDOM_VAL_GEN
-
-#ifdef TEST_RANDOM_VAL_GEN
-#include <time.h>
-#include <stdlib.h>
-#define RAND_VAL_MIN 0
-#define RAND_VAL_MAX_CO2 1023
-#endif /* TEST_RANDOM_VAL_GEN */
-
 #define JSON_PATH "device_def.json"
 #define SENSOR_URI_CO2 "/capability/airQualitySensor/main/0"
 #define SENSOR_KEY_CO2 "airQuality"
@@ -57,32 +48,6 @@ typedef struct app_data_s {
 
 static app_data *g_ad = NULL;
 
-#ifdef TEST_RANDOM_VAL_GEN
-static int rand_read_co2_sensor(unsigned int *out_value)
-{
-       unsigned int val = 0;
-
-       val = RAND_VAL_MIN + rand() / (RAND_MAX / (RAND_VAL_MAX_CO2 - RAND_VAL_MIN + 1) + 1);
-       *out_value = val;
-
-       return 0;
-}
-#endif
-
-static int read_co2_sensor(unsigned int *out_value)
-{
-       int ret = 0;
-       retv_if(!out_value, -1);
-
-#ifdef TEST_RANDOM_VAL_GEN
-       ret = rand_read_co2_sensor(out_value);
-#else /* TEST_RANDOM_VAL_GEN */
-       ret = co2_sensor_read(SENSOR_CH_CO2, out_value);
-#endif /* TEST_RANDOM_VAL_GEN */
-
-       return ret;
-}
-
 static Eina_Bool __get_co2(void *data)
 {
        int ret = 0;
@@ -102,7 +67,7 @@ static Eina_Bool __get_co2(void *data)
                service_app_exit();
        }
 
-       ret = read_co2_sensor(&value);
+       ret = co2_sensor_read(SENSOR_CH_CO2, &value);
        retv_if(ret != 0, ECORE_CALLBACK_RENEW);
 
        count++;