From 6e91cb3a3919a153cd65c08baf39f5142867e248 Mon Sep 17 00:00:00 2001 From: Cristiano De Alti Date: Mon, 21 Sep 2015 23:20:45 +0200 Subject: [PATCH] Activate battery and temperature resources if they are supported by the platform. --- examples/er-rest-example/er-example-server.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/er-rest-example/er-example-server.c b/examples/er-rest-example/er-example-server.c index 41a07a501..d8e1c79b2 100644 --- a/examples/er-rest-example/er-example-server.c +++ b/examples/er-rest-example/er-example-server.c @@ -79,11 +79,17 @@ extern resource_t res_leds, res_toggle; #include "dev/light-sensor.h" extern resource_t res_light; #endif -/* #if PLATFORM_HAS_BATTERY #include "dev/battery-sensor.h" extern resource_t res_battery; #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 #include "dev/radio-sensor.h" extern resource_t res_radio; @@ -141,11 +147,15 @@ PROCESS_THREAD(er_example_server, ev, data) rest_activate_resource(&res_light, "sensors/light"); SENSORS_ACTIVATE(light_sensor); #endif -/* #if PLATFORM_HAS_BATTERY rest_activate_resource(&res_battery, "sensors/battery"); SENSORS_ACTIVATE(battery_sensor); #endif +#if PLATFORM_HAS_TEMPERATURE + rest_activate_resource(&res_temperature, "sensors/temperature"); + SENSORS_ACTIVATE(temperature_sensor); +#endif +/* #if PLATFORM_HAS_RADIO rest_activate_resource(&res_radio, "sensors/radio"); SENSORS_ACTIVATE(radio_sensor);