use ds1820.c from /dev directory
This commit is contained in:
parent
90885f2168
commit
65341d8d3b
|
@ -127,9 +127,6 @@ uint8_t dht11_temp=0, dht11_hum=0;
|
||||||
|
|
||||||
#include "dev/key.c" // todo: move platform /dev
|
#include "dev/key.c" // todo: move platform /dev
|
||||||
#include "dev/led.c"
|
#include "dev/led.c"
|
||||||
#if REST_RES_DS1820
|
|
||||||
#include "dev/ds1820.c"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
@ -169,7 +166,8 @@ info_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_
|
||||||
|
|
||||||
// mybutton
|
// mybutton
|
||||||
/*A simple actuator example. read the key button status*/
|
/*A simple actuator example. read the key button status*/
|
||||||
RESOURCE(button, METHOD_GET | METHOD_PUT , "sensors/button", "title=\"Button\";rt=\"button\"");
|
//RESOURCE(button, METHOD_GET | METHOD_PUT , "sensors/button", "title=\"Button\";rt=\"button\"");
|
||||||
|
RESOURCE(button, METHOD_GET | METHOD_PUT , "sensors/button", "title=\"Button\";rt=\"button\";if=\"sensor\"");
|
||||||
void
|
void
|
||||||
button_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
button_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
{
|
{
|
||||||
|
@ -218,7 +216,7 @@ button_handler(void* request, void* response, uint8_t *buffer, uint16_t preferre
|
||||||
}
|
}
|
||||||
|
|
||||||
/*A simple actuator example, post variable mode, relay is activated or deactivated*/
|
/*A simple actuator example, post variable mode, relay is activated or deactivated*/
|
||||||
RESOURCE(led1, METHOD_GET | METHOD_PUT , "aktors/led1", "title=\"Led1\";rt=\"led\"");
|
RESOURCE(led1, METHOD_GET | METHOD_PUT , "aktors/led1", "title=\"Led1\";rt=\"led\";if=\"aktor\"");
|
||||||
void
|
void
|
||||||
led1_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
led1_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
{
|
{
|
||||||
|
@ -286,7 +284,7 @@ led1_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_
|
||||||
|
|
||||||
#if REST_RES_DS1820
|
#if REST_RES_DS1820
|
||||||
/*A simple getter example. Returns the reading from ds1820 sensor*/
|
/*A simple getter example. Returns the reading from ds1820 sensor*/
|
||||||
RESOURCE(ds1820, METHOD_GET, "sensors/temp", "title=\"Temperatur DS1820\";rt=\"temperature-c\"");
|
RESOURCE(ds1820, METHOD_GET, "sensors/temp", "title=\"Temperatur DS1820\";rt=\"temperature-c\";if=\"sensor\"");
|
||||||
void
|
void
|
||||||
ds1820_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
ds1820_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
{
|
{
|
||||||
|
@ -335,7 +333,7 @@ ds1820_handler(void* request, void* response, uint8_t *buffer, uint16_t preferre
|
||||||
|
|
||||||
#if REST_RES_DHT11
|
#if REST_RES_DHT11
|
||||||
/*A simple getter example. Returns the reading from ds1820 sensor*/
|
/*A simple getter example. Returns the reading from ds1820 sensor*/
|
||||||
RESOURCE(dht11, METHOD_GET, "sensors/hum", "title=\"Humidity DHT11\";rt=\"humidity-%\"");
|
RESOURCE(dht11, METHOD_GET, "sensors/hum", "title=\"Humidity DHT11\";rt=\"humidity-%\";if=\"sensor\"");
|
||||||
void
|
void
|
||||||
dht11_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
dht11_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
{
|
{
|
||||||
|
@ -837,7 +835,7 @@ sub_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_s
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#if REST_RES_LEDS
|
#if REST_RES_LEDS
|
||||||
/*A simple actuator example, depending on the color query parameter and post variable mode, corresponding led is activated or deactivated*/
|
/*A simple actuator example, depending on the color query parameter and post variable mode, corresponding led is activated or deactivated*/
|
||||||
RESOURCE(leds, METHOD_POST | METHOD_PUT , "actuators/leds", "title=\"LEDs: ?color=r|g|b, POST/PUT mode=on|off\";rt=\"Control\"");
|
RESOURCE(leds, METHOD_POST | METHOD_PUT , "actuators/leds", "title=\"LEDs: ?color=r|g|b, POST/PUT mode=on|off\";rt=\"Control\";if=\"aktor\"");
|
||||||
|
|
||||||
void
|
void
|
||||||
leds_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
leds_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
|
@ -887,7 +885,7 @@ leds_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#if REST_RES_TOGGLE
|
#if REST_RES_TOGGLE
|
||||||
/* A simple actuator example. Toggles the red led */
|
/* A simple actuator example. Toggles the red led */
|
||||||
RESOURCE(toggle, METHOD_GET | METHOD_PUT | METHOD_POST, "actuators/toggle", "title=\"Red LED\";rt=\"Control\"");
|
RESOURCE(toggle, METHOD_GET | METHOD_PUT | METHOD_POST, "actuators/toggle", "title=\"Red LED\";rt=\"Control\";if=\"aktor\"");
|
||||||
void
|
void
|
||||||
toggle_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
toggle_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
{
|
{
|
||||||
|
@ -899,7 +897,7 @@ toggle_handler(void* request, void* response, uint8_t *buffer, uint16_t preferre
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#if REST_RES_LIGHT && defined (PLATFORM_HAS_LIGHT)
|
#if REST_RES_LIGHT && defined (PLATFORM_HAS_LIGHT)
|
||||||
/* A simple getter example. Returns the reading from light sensor with a simple etag */
|
/* A simple getter example. Returns the reading from light sensor with a simple etag */
|
||||||
RESOURCE(light, METHOD_GET, "sensors/light", "title=\"Photosynthetic and solar light (supports JSON)\";rt=\"LightSensor\"");
|
RESOURCE(light, METHOD_GET, "sensors/light", "title=\"Photosynthetic and solar light (supports JSON)\";rt=\"LightSensor\";if=\"sensor\"");
|
||||||
void
|
void
|
||||||
light_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
light_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
{
|
{
|
||||||
|
@ -942,7 +940,7 @@ light_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#if REST_RES_TEMPERATURE && defined (PLATFORM_HAS_TEMPERATURE)
|
#if REST_RES_TEMPERATURE && defined (PLATFORM_HAS_TEMPERATURE)
|
||||||
/* A simple getter example. Returns the reading from light sensor with a simple etag */
|
/* A simple getter example. Returns the reading from light sensor with a simple etag */
|
||||||
RESOURCE(temperature, METHOD_GET, "sensors/cputemp", "title=\"Temperature status\";rt=\"temperature-c\"");
|
RESOURCE(temperature, METHOD_GET, "sensors/cputemp", "title=\"Temperature status\";rt=\"temperature-c\";if=\"sensor\"");
|
||||||
void
|
void
|
||||||
temperature_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
temperature_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
{
|
{
|
||||||
|
@ -977,7 +975,7 @@ temperature_handler(void* request, void* response, uint8_t *buffer, uint16_t pre
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
#if REST_RES_BATTERY && defined (PLATFORM_HAS_BATTERY)
|
#if REST_RES_BATTERY && defined (PLATFORM_HAS_BATTERY)
|
||||||
/* A simple getter example. Returns the reading from light sensor with a simple etag */
|
/* A simple getter example. Returns the reading from light sensor with a simple etag */
|
||||||
RESOURCE(battery, METHOD_GET, "sensors/battery", "title=\"Battery status\";rt=\"Battery\"");
|
RESOURCE(battery, METHOD_GET, "sensors/battery", "title=\"Battery status\";rt=\"Battery\";if=\"sensor\"");
|
||||||
void
|
void
|
||||||
battery_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
battery_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
{
|
{
|
||||||
|
@ -1012,7 +1010,7 @@ battery_handler(void* request, void* response, uint8_t *buffer, uint16_t preferr
|
||||||
|
|
||||||
#if defined (PLATFORM_HAS_RADIO) && REST_RES_RADIO
|
#if defined (PLATFORM_HAS_RADIO) && REST_RES_RADIO
|
||||||
/* A simple getter example. Returns the reading of the rssi/lqi from radio sensor */
|
/* A simple getter example. Returns the reading of the rssi/lqi from radio sensor */
|
||||||
RESOURCE(radio, METHOD_GET, "sensor/radio", "title=\"RADIO: ?p=lqi|rssi\";rt=\"RadioSensor\"");
|
RESOURCE(radio, METHOD_GET, "sensor/radio", "title=\"RADIO: ?p=lqi|rssi\";rt=\"RadioSensor\";if=\"sensor\"");
|
||||||
|
|
||||||
void
|
void
|
||||||
radio_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
radio_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||||
|
|
|
@ -118,9 +118,6 @@
|
||||||
|
|
||||||
#include "dev/key.c" // todo: move platform /dev
|
#include "dev/key.c" // todo: move platform /dev
|
||||||
#include "dev/led.c"
|
#include "dev/led.c"
|
||||||
#if REST_RES_DS1820
|
|
||||||
#include "dev/ds1820.c"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ CONTIKI_TARGET_SOURCEFILES += contiki-main.c params.c node-id.c
|
||||||
CONTIKI_TARGET_SOURCEFILES += temperature-sensor.c adc.c button-sensor.c sensors.c slip_uart0.c slip.c
|
CONTIKI_TARGET_SOURCEFILES += temperature-sensor.c adc.c button-sensor.c sensors.c slip_uart0.c slip.c
|
||||||
#Needed for DHT11 humidity sensor
|
#Needed for DHT11 humidity sensor
|
||||||
CONTIKI_TARGET_SOURCEFILES += dht11.c
|
CONTIKI_TARGET_SOURCEFILES += dht11.c
|
||||||
|
#Needed for DS18S20 temperature sensor
|
||||||
|
CONTIKI_TARGET_SOURCEFILES += ds1820.c
|
||||||
|
|
||||||
CONTIKIAVR=$(CONTIKI)/cpu/avr
|
CONTIKIAVR=$(CONTIKI)/cpu/avr
|
||||||
CONTIKIBOARD=.
|
CONTIKIBOARD=.
|
||||||
|
|
Loading…
Reference in a new issue