CFLAGS += $(THREADS_MSP430_INCLUDE_DIRS)
CFLAGS += $(THREADS_CC2420_INCLUDE_DIRS)
CFLAGS += $(THREADS_TELOS_INCLUDE_DIRS)
+
+ #Since Telosb has some sensors not on other platforms, this helps us figure out
+ #what components should be included
+ ifneq ($(filter telosb,$(MAKECMDGOALS)),)
+ CFLAGS += -DPLATFORM_TELOSB
+ endif
endif
ifneq ($(filter mica2,$(MAKECMDGOALS)),)
CFLAGS += $(THREADS_ATM128_INCLUDE_DIRS)
CFLAGS += $(THREADS_CC2420_INCLUDE_DIRS)
CFLAGS += $(THREADS_SHIMMER_INCLUDE_DIRS)
endif
-
#include "tosthread_leds.h"
#include "tosthread_amradio.h"
#include "tosthread_blockstorage.h"
+#include "tosthread_logstorage.h"
+#include "tosthread_configstorage.h"
#include "tosthread_threadsync.h"
#include "tosthread_amserial.h"
#include "tosthread_queue.h"
+
#include "tosthread_sensirionSht11.h"
#include "tosthread_hamamatsuS10871.h"
#include "tosthread_hamamatsuS1087.h"
#ifndef _TOSTHREAD_SLCS_TYPES_H
#define _TOSTHREAD_SLCS_TYPES_H
-#include "tosthread.h"
-#include "tosthread_leds.h"
-#include "tosthread_amradio.h"
-#include "tosthread_blockstorage.h"
-#include "tosthread_logstorage.h"
-#include "tosthread_configstorage.h"
-#include "tosthread_threadsync.h"
-#include "tosthread_amserial.h"
-#include "tosthread_queue.h"
-#include "tosthread_sensirionSht11.h"
-#include "tosthread_hamamatsuS10871.h"
-#include "tosthread_hamamatsuS1087.h"
-
-
-/*******************************/
#include "slcs_types.h"
-
struct addr fun[] = {
{tosthread_sleep}, {tosthread_create},
{queue_init}, {queue_clear}, {queue_enqueue},
{queue_dequeue}, {queue_remove}, {queue_size},
{queue_is_empty},
-
+
{sensirionSht11_humidity_read}, {sensirionSht11_humidity_getNumBits}, {sensirionSht11_temperature_read},
{sensirionSht11_temperature_getNumBits},
configuration CHamamatsuS10871TsrC {}
implementation {
components CHamamatsuS10871TsrP;
+#ifdef PLATFORM_TELOSB
components new BlockingHamamatsuS10871TsrC();
CHamamatsuS10871TsrP.DeviceMetadata -> BlockingHamamatsuS10871TsrC.DeviceMetadata;
CHamamatsuS10871TsrP.Read -> BlockingHamamatsuS10871TsrC.Read;
CHamamatsuS10871TsrP.ReadStream -> BlockingHamamatsuS10871TsrC.ReadStream;
+#endif
}
uint8_t hamamatsuS10871_tsr_getNumBits() @C() AT_SPONTANEOUS {
return call DeviceMetadata.getSignificantBits();
}
+
+ default command error_t Read.read(uint16_t* val) {
+ return FAIL;
+ }
+
+ default command error_t ReadStream.read(uint32_t* usPeriod, uint16_t* buf, uint16_t count) {
+ return FAIL;
+ }
+
+ default command uint8_t DeviceMetadata.getSignificantBits() {
+ return 0;
+ }
}
configuration CHamamatsuS1087ParC {}
implementation {
components CHamamatsuS1087ParP;
+#ifdef PLATFORM_TELOSB
components new BlockingHamamatsuS1087ParC();
CHamamatsuS1087ParP.DeviceMetadata -> BlockingHamamatsuS1087ParC.DeviceMetadata;
CHamamatsuS1087ParP.Read -> BlockingHamamatsuS1087ParC.Read;
CHamamatsuS1087ParP.ReadStream -> BlockingHamamatsuS1087ParC.ReadStream;
+#endif
}
uint8_t hamamatsuS1087_par_getNumBits() @C() AT_SPONTANEOUS {
return call DeviceMetadata.getSignificantBits();
}
+
+ default command error_t Read.read(uint16_t* val) {
+ return FAIL;
+ }
+
+ default command error_t ReadStream.read(uint32_t* usPeriod, uint16_t* buf, uint16_t count) {
+ return FAIL;
+ }
+
+ default command uint8_t DeviceMetadata.getSignificantBits() {
+ return 0;
+ }
}
configuration CSensirionSht11C {}
implementation {
components CSensirionSht11P;
+#ifdef PLATFORM_TELOSB
components new BlockingSensirionSht11C();
CSensirionSht11P.Temperature -> BlockingSensirionSht11C.Temperature;
CSensirionSht11P.TemperatureMetadata -> BlockingSensirionSht11C.TemperatureMetadata;
CSensirionSht11P.Humidity -> BlockingSensirionSht11C.Humidity;
CSensirionSht11P.HumidityMetadata -> BlockingSensirionSht11C.HumidityMetadata;
+#endif
}
uint8_t sensirionSht11_temperature_getNumBits() @C() AT_SPONTANEOUS {
return call TemperatureMetadata.getSignificantBits();
}
+
+ default command error_t Humidity.read(uint16_t* val) {
+ return FAIL;
+ }
+
+ default command uint8_t HumidityMetadata.getSignificantBits() {
+ return 0;
+ }
+
+ default command error_t Temperature.read(uint16_t* val) {
+ return FAIL;
+ }
+
+ default command uint8_t TemperatureMetadata.getSignificantBits() {
+ return 0;
+ }
}