double co2_sensor_value_to_voltage(unsigned int value);
/* Not implemented, please see c source code */
-int co2_sensor_voltage_to_ppm(double voltage);
-int co2_sensor_value_to_ppm(unsigned int value);
+unsigned int co2_sensor_voltage_to_ppm(double voltage);
+unsigned int co2_sensor_value_to_ppm(unsigned int value);
#endif /* __CO2_SENSOR_H__ */
}
/* Not implemented, please see c source code */
-int co2_sensor_voltage_to_ppm(double voltage)
+unsigned int co2_sensor_voltage_to_ppm(double voltage)
{
int ppm = 0;
return ppm;
}
-int co2_sensor_value_to_ppm(unsigned int value)
+unsigned int co2_sensor_value_to_ppm(unsigned int value)
{
/* You can use this function after implementing co2_sensor_voltage_to_ppm() function */
return co2_sensor_voltage_to_ppm(co2_sensor_value_to_voltage(value));
#include "sensor-data.h"
#include "co2-sensor.h"
-#define JSON_PATH "device_def.json"
+#define JSON_NAME "device_def.json"
#define SENSOR_URI_CO2 "/capability/airQualitySensor/main/0"
#define SENSOR_KEY_CO2 "airQuality"
#define SENSOR_KEY_RANGE "range"
return -1;
}
- snprintf(app_json_path, sizeof(app_json_path), "%s%s", app_res_path, JSON_PATH);
-
if (0 != st_things_set_configuration_prefix_path(app_res_path, app_data_path)) {
_E("st_things_set_configuration_prefix_path() failed!!");
free(app_res_path);
free(app_data_path);
return -1;
}
+ free(app_data_path);
+ snprintf(app_json_path, sizeof(app_json_path), "%s%s", app_res_path, JSON_NAME);
free(app_res_path);
- free(app_data_path);
if (0 != st_things_initialize(app_json_path, &easysetup_complete)) {
_E("st_things_initialize() failed!!");