add leds and battery
This commit is contained in:
parent
a4b1e0138a
commit
248a1e3882
3 changed files with 26 additions and 12 deletions
|
@ -73,17 +73,18 @@ extern resource_t
|
|||
res_sub,
|
||||
res_b1_sep_b2;
|
||||
#if PLATFORM_HAS_LEDS
|
||||
#include "dev/leds.h"
|
||||
extern resource_t res_leds, res_toggle;
|
||||
#endif
|
||||
#if PLATFORM_HAS_LIGHT
|
||||
#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_RADIO
|
||||
#include "dev/radio-sensor.h"
|
||||
extern resource_t res_radio;
|
||||
|
@ -94,6 +95,14 @@ extern resource_t res_sht11;
|
|||
#endif
|
||||
*/
|
||||
|
||||
void
|
||||
hw_init()
|
||||
{
|
||||
#if defined (PLATFORM_HAS_LEDS)
|
||||
leds_off(LEDS_RED);
|
||||
#endif
|
||||
}
|
||||
|
||||
PROCESS(er_example_server, "Erbium Example Server");
|
||||
AUTOSTART_PROCESSES(&er_example_server);
|
||||
|
||||
|
@ -117,6 +126,7 @@ PROCESS_THREAD(er_example_server, ev, data)
|
|||
PRINTF("IP+UDP header: %u\n", UIP_IPUDPH_LEN);
|
||||
PRINTF("REST max chunk: %u\n", REST_MAX_CHUNK_SIZE);
|
||||
|
||||
hw_init();
|
||||
/* Initialize the REST engine. */
|
||||
rest_init_engine();
|
||||
|
||||
|
@ -130,28 +140,29 @@ PROCESS_THREAD(er_example_server, ev, data)
|
|||
/* rest_activate_resource(&res_chunks, "test/chunks"); */
|
||||
/* rest_activate_resource(&res_separate, "test/separate"); */
|
||||
rest_activate_resource(&res_push, "test/push");
|
||||
/* rest_activate_resource(&res_event, "sensors/button"); */
|
||||
/* rest_activate_resource(&res_event, "s/button"); */
|
||||
/* rest_activate_resource(&res_sub, "test/sub"); */
|
||||
/* rest_activate_resource(&res_b1_sep_b2, "test/b1sepb2"); */
|
||||
#if PLATFORM_HAS_LEDS
|
||||
/* rest_activate_resource(&res_leds, "actuators/leds"); */
|
||||
rest_activate_resource(&res_toggle, "actuators/toggle");
|
||||
/* rest_activate_resource(&res_leds, "a/leds"); */
|
||||
rest_activate_resource(&res_toggle, "a/toggle");
|
||||
#endif
|
||||
#if PLATFORM_HAS_LIGHT
|
||||
rest_activate_resource(&res_light, "sensors/light");
|
||||
rest_activate_resource(&res_light, "s/light");
|
||||
SENSORS_ACTIVATE(light_sensor);
|
||||
#endif
|
||||
/*
|
||||
|
||||
#if PLATFORM_HAS_BATTERY
|
||||
rest_activate_resource(&res_battery, "sensors/battery");
|
||||
rest_activate_resource(&res_battery, "s/battery");
|
||||
SENSORS_ACTIVATE(battery_sensor);
|
||||
#endif
|
||||
/*
|
||||
#if PLATFORM_HAS_RADIO
|
||||
rest_activate_resource(&res_radio, "sensors/radio");
|
||||
rest_activate_resource(&res_radio, "s/radio");
|
||||
SENSORS_ACTIVATE(radio_sensor);
|
||||
#endif
|
||||
#if PLATFORM_HAS_SHT11
|
||||
rest_activate_resource(&res_sht11, "sensors/sht11");
|
||||
rest_activate_resource(&res_sht11, "s/sht11");
|
||||
SENSORS_ACTIVATE(sht11_sensor);
|
||||
#endif
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue