Activate battery and temperature resources

if they are supported by the platform.
This commit is contained in:
Cristiano De Alti 2015-09-21 23:20:45 +02:00
parent ba3c167cef
commit 6e91cb3a39

View File

@ -79,11 +79,17 @@ extern resource_t res_leds, res_toggle;
#include "dev/light-sensor.h" #include "dev/light-sensor.h"
extern resource_t res_light; extern resource_t res_light;
#endif #endif
/*
#if PLATFORM_HAS_BATTERY #if PLATFORM_HAS_BATTERY
#include "dev/battery-sensor.h" #include "dev/battery-sensor.h"
extern resource_t res_battery; extern resource_t res_battery;
#endif #endif
#if PLATFORM_HAS_TEMPERATURE
#include "dev/temperature-sensor.h"
extern resource_t res_temperature;
#endif
/*
extern resource_t res_battery;
#endif
#if PLATFORM_HAS_RADIO #if PLATFORM_HAS_RADIO
#include "dev/radio-sensor.h" #include "dev/radio-sensor.h"
extern resource_t res_radio; extern resource_t res_radio;
@ -141,11 +147,15 @@ PROCESS_THREAD(er_example_server, ev, data)
rest_activate_resource(&res_light, "sensors/light"); rest_activate_resource(&res_light, "sensors/light");
SENSORS_ACTIVATE(light_sensor); SENSORS_ACTIVATE(light_sensor);
#endif #endif
/*
#if PLATFORM_HAS_BATTERY #if PLATFORM_HAS_BATTERY
rest_activate_resource(&res_battery, "sensors/battery"); rest_activate_resource(&res_battery, "sensors/battery");
SENSORS_ACTIVATE(battery_sensor); SENSORS_ACTIVATE(battery_sensor);
#endif #endif
#if PLATFORM_HAS_TEMPERATURE
rest_activate_resource(&res_temperature, "sensors/temperature");
SENSORS_ACTIVATE(temperature_sensor);
#endif
/*
#if PLATFORM_HAS_RADIO #if PLATFORM_HAS_RADIO
rest_activate_resource(&res_radio, "sensors/radio"); rest_activate_resource(&res_radio, "sensors/radio");
SENSORS_ACTIVATE(radio_sensor); SENSORS_ACTIVATE(radio_sensor);