[Tinyos-2-commits] CVS: tinyos-2.x/doc/txt tep109.txt, 1.1.2.6,
1.1.2.7
Gilman Tolle
gtolle at users.sourceforge.net
Wed Dec 6 10:35:31 PST 2006
Update of /cvsroot/tinyos/tinyos-2.x/doc/txt
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16092/txt
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
tep109.txt
Log Message:
Removed the getMostSignificantBit call. Removed the MAY left shift text. Propagated the interface into all examples.
Index: tep109.txt
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/doc/txt/tep109.txt,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** tep109.txt 6 Dec 2006 17:47:46 -0000 1.1.2.6
--- tep109.txt 6 Dec 2006 18:35:28 -0000 1.1.2.7
***************
*** 113,118 ****
--- 113,121 ----
provides interface Read<uint16_t> as Temperature;
provides interface ReadStream<uint16_t> as TemperatureStream;
+ provides interface DeviceMetadata as TemperatureDeviceMetadata;
+
provides interface Read<uint16_t> as Humidity;
provides interface ReadStream<uint16_t> as HumidityStream;
+ provides interface DeviceMetadata as HumidityDeviceMetadata;
}
implementation {
***************
*** 134,156 ****
Generally, simple types are made up of octets. However, sensor values
! often have levels of precision besides a multiple of 8. A value
! contained returned from the device through a SID interface MAY be left
! shifted so that it covers as much of the type's range as possible. For
! example, if a 12-bit ADC reading is presented as a 16-bit Read
! interface::
!
! component DemoSensorC {
! provides interface Read<uint16_t>;
! }
!
! then the driver MAY shift the 12-bit value left so that its range is
! 0x0000 - 0xfff0, rather than 0x0000 - 0x0fff.
!
! Such a device MUST specify the precision of one of its interfaces by
! providing the DeviceMetadata interface::
interface DeviceMetadata {
command uint8_t getSignificantBits();
- command uint8_t getMostSignificantBit();
}
--- 137,146 ----
Generally, simple types are made up of octets. However, sensor values
! often have levels of precision besides a multiple of 8. To account for
! such cases, each device MUST specify the precision of each one of its
! interfaces by providing the DeviceMetadata interface::
interface DeviceMetadata {
command uint8_t getSignificantBits();
}
***************
*** 160,169 ****
The getSignificantBits() call MUST return the number of significant
bits in the reading. For example, a sensor reading taken from a 12-bit
! ADC MUST return the value "12". The getMostSignificantBit() call MUST
! return the index of the most significant bit in the reading, 0-indexed
! from the least significant bit. For example, if the 12-bit ADC
! reading is right-shifted, the call MUST return the value "11", and if
! the 12-bit ADC reading is left-shifted, the call MUST return the value
! "15".
Sensor driver components SHOULD be named according to the make and
--- 150,154 ----
The getSignificantBits() call MUST return the number of significant
bits in the reading. For example, a sensor reading taken from a 12-bit
! ADC MUST return the value "12".
Sensor driver components SHOULD be named according to the make and
***************
*** 181,184 ****
--- 166,170 ----
provides interface Read<uint16_t>;
provides interface ReadStream<uint16_t>;
+ provides interface DeviceMetadata;
}
implementation {
***************
*** 186,189 ****
--- 172,176 ----
Read = SensirionSht11C.Temperature;
ReadStream = SensirionSht11C.TemperatureStream;
+ DeviceMetadata = SensirionSht11C.TemperatureDeviceMetadata;
}
***************
*** 191,194 ****
--- 178,182 ----
provides interface Read<uint16_t>;
provides interface ReadStream<uint16_t>;
+ provides interface DeviceMetadata;
}
implementation {
***************
*** 196,199 ****
--- 184,188 ----
Read = SensirionSht11C.Humidity;
ReadStream = SensirionSht11C.HumidityStream;
+ DeviceMetadata = SensirionSht11C.HumidityDeviceMetadata;
}
***************
*** 430,434 ****
command uint8_t DeviceMetadata.getSignificantBits() { return 12; }
- command uint8_t DeviceMetadata.getMostSignificantBit() { return 11; }
}
--- 419,422 ----
***************
*** 456,470 ****
provides interface Get<bool>;
provides interface Notify<bool>;
}
implementation {
components UserButtonLogicP;
components HplUserButtonC;
UserButtonLogicP.GpioInterrupt -> HplUserButtonC.GpioInterrupt;
UserButtonLogicP.GeneralIO -> HplUserButtonC.GeneralIO;
-
- Get = UserButtonLogicP;
- Notify = UserButtonLogicP;
}
--- 444,459 ----
provides interface Get<bool>;
provides interface Notify<bool>;
+ provides interface DeviceMetadata;
}
implementation {
components UserButtonLogicP;
+ Get = UserButtonLogicP;
+ Notify = UserButtonLogicP;
+ DeviceMetadata = UserButtonLogicP;
components HplUserButtonC;
UserButtonLogicP.GpioInterrupt -> HplUserButtonC.GpioInterrupt;
UserButtonLogicP.GeneralIO -> HplUserButtonC.GeneralIO;
}
***************
*** 476,479 ****
--- 465,469 ----
provides interface Get<bool>;
provides interface Notify<bool>;
+ provides interface DeviceMetadata;
uses interface GeneralIO;
***************
*** 523,526 ****
--- 513,518 ----
}
}
+
+ command uint8_t DeviceMetadata.getSignificantBits() { return 1; }
}
***************
*** 640,645 ****
command uint8_t TemperatureDeviceMetadata.getSignificantBits() { return 14; }
! command uint8_t TemperatureDeviceMetadata.getMostSignificantBit() { return 13; }
!
command error_t Humidity.read() {
call HumResource.request();
--- 632,636 ----
command uint8_t TemperatureDeviceMetadata.getSignificantBits() { return 14; }
!
command error_t Humidity.read() {
call HumResource.request();
***************
*** 661,665 ****
command uint8_t HumidityDeviceMetadata.getSignificantBits() { return 12; }
- command uint8_t HumidityDeviceMetadata.getMostSignificantBit() { return 11; }
event void Sht11Temp.resetDone( error_t result ) { }
--- 652,655 ----
More information about the Tinyos-2-commits
mailing list