Updated to match the new sensors API

This commit is contained in:
nifi 2010-01-18 11:13:40 +00:00
parent ef8d3c1bbd
commit 3a5dd23ace

View File

@ -28,7 +28,7 @@
* *
* This file is part of the uIP TCP/IP stack. * This file is part of the uIP TCP/IP stack.
* *
* $Id: ajax-cgi.c,v 1.3 2009/05/11 17:38:29 adamdunkels Exp $ * $Id: ajax-cgi.c,v 1.4 2010/01/18 11:13:40 nifi Exp $
* *
*/ */
@ -102,8 +102,8 @@ httpd_cgi_add(struct httpd_cgi_call *c)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#if CONTIKI_TARGET_SKY #if CONTIKI_TARGET_SKY
#include "dev/sht11.h" #include "dev/sht11-sensor.h"
#include "dev/light.h" #include "dev/light-sensor.h"
#endif /* CONTIKI_TARGET_SKY */ #endif /* CONTIKI_TARGET_SKY */
static static
@ -123,12 +123,16 @@ PT_THREAD(sensorscall(struct httpd_state *s, char *ptr))
PSOCK_WAIT_UNTIL(&s->sout, timer_expired(&t));*/ PSOCK_WAIT_UNTIL(&s->sout, timer_expired(&t));*/
#if CONTIKI_TARGET_SKY #if CONTIKI_TARGET_SKY
SENSORS_ACTIVATE(sht11_sensor);
SENSORS_ACTIVATE(light_sensor);
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"t(%d);h(%d);l1(%d);l2(%d);", "t(%d);h(%d);l1(%d);l2(%d);",
sht11_temp(), sht11_sensor.value(SHT11_SENSOR_TEMP),
sht11_humidity(), sht11_sensor.value(SHT11_SENSOR_HUMIDITY),
sensors_light1(), light_sensor.value(LIGHT_SENSOR_PHOTOSYNTHETIC);
sensors_light2()); light_sensor.value(LIGHT_SENSOR_TOTAL_SOLAR));
SENSORS_DEACTIVATE(sht11_sensor);
SENSORS_DEACTIVATE(light_sensor);
#else /* CONTIKI_TARGET_SKY */ #else /* CONTIKI_TARGET_SKY */
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"t(%d);h(%d);l1(%d);l2(%d);", "t(%d);h(%d);l1(%d);l2(%d);",