]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/sht11/SensirionSht11ReaderP.nc
Added DeviceMetadata interface to telosb sensors.
[tinyos-2.x.git] / tos / chips / sht11 / SensirionSht11ReaderP.nc
index 66acc3fd3e48ccfd9912d97183b0ea4a69d9c836..44c59b9183cc207c1ffcff5ca01856e2f9fb6ee7 100644 (file)
  * @version $Revision$ $Date$
  */
 
+#include <SensirionSht11.h>
+
 generic module SensirionSht11ReaderP() {
+  provides interface DeviceMetadata as TemperatureMetadata;
   provides interface Read<uint16_t> as Temperature;
+  provides interface DeviceMetadata as HumidityMetadata;
   provides interface Read<uint16_t> as Humidity;
   
   uses interface Resource as TempResource;
@@ -50,6 +54,9 @@ generic module SensirionSht11ReaderP() {
   uses interface SensirionSht11 as Sht11Hum;
 }
 implementation {
+
+  command uint8_t TemperatureMetadata.getSignificantBits() { return SHT11_TEMPERATURE_BITS; }
+
   command error_t Temperature.read() {
     call TempResource.request();
     return SUCCESS;
@@ -68,6 +75,8 @@ implementation {
     signal Temperature.readDone( result, val );
   }
 
+  command uint8_t HumidityMetadata.getSignificantBits() { return SHT11_HUMIDITY_BITS; }
+
   command error_t Humidity.read() {
     call HumResource.request();
     return SUCCESS;