[Tinyos-2-commits] CVS: tinyos-2.x/doc/html tep109.html, 1.1.2.10, 1.1.2.11

Gilman Tolle gtolle at users.sourceforge.net
Wed Dec 6 10:35:31 PST 2006


Update of /cvsroot/tinyos/tinyos-2.x/doc/html
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16092/html

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	tep109.html 
Log Message:
Removed the getMostSignificantBit call. Removed the MAY left shift text. Propagated the interface into all examples.

Index: tep109.html
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/doc/html/tep109.html,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** tep109.html	6 Dec 2006 17:47:46 -0000	1.1.2.10
--- tep109.html	6 Dec 2006 18:35:28 -0000	1.1.2.11
***************
*** 403,408 ****
--- 403,411 ----
    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 {
***************
*** 422,443 ****
  components described in <a class="citation-reference" href="#tep115" id="id4" name="id4">[TEP115]</a> can make this implementation easier.</p>
  <p>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:</p>
! <pre class="literal-block">
! component DemoSensorC {
!   provides interface Read&lt;uint16_t&gt;;
! }
! </pre>
! <p>then the driver MAY shift the 12-bit value left so that its range is
! 0x0000 - 0xfff0, rather than 0x0000 - 0x0fff.</p>
! <p>Such a device MUST specify the precision of one of its interfaces by
! providing the DeviceMetadata interface:</p>
  <pre class="literal-block">
  interface DeviceMetadata {
    command uint8_t getSignificantBits();
-   command uint8_t getMostSignificantBit();
  }
  </pre>
--- 425,434 ----
  components described in <a class="citation-reference" href="#tep115" id="id4" name="id4">[TEP115]</a> can make this implementation easier.</p>
  <p>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:</p>
  <pre class="literal-block">
  interface DeviceMetadata {
    command uint8_t getSignificantBits();
  }
  </pre>
***************
*** 446,455 ****
  <p>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 &quot;12&quot;. 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 &quot;11&quot;, and if
! the 12-bit ADC reading is left-shifted, the call MUST return the value
! &quot;15&quot;.</p>
  <p>Sensor driver components SHOULD be named according to the make and
  model of the sensing device being presented. Using specific names
--- 437,441 ----
  <p>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 &quot;12&quot;.</p>
  <p>Sensor driver components SHOULD be named according to the make and
  model of the sensing device being presented. Using specific names
***************
*** 465,468 ****
--- 451,455 ----
    provides interface Read&lt;uint16_t&gt;;
    provides interface ReadStream&lt;uint16_t&gt;;
+   provides interface DeviceMetadata;
  }
  implementation {
***************
*** 470,473 ****
--- 457,461 ----
    Read = SensirionSht11C.Temperature;
    ReadStream = SensirionSht11C.TemperatureStream;
+   DeviceMetadata = SensirionSht11C.TemperatureDeviceMetadata;
  }
  
***************
*** 475,478 ****
--- 463,467 ----
    provides interface Read&lt;uint16_t&gt;;
    provides interface ReadStream&lt;uint16_t&gt;;
+   provides interface DeviceMetadata;
  }
  implementation {
***************
*** 480,483 ****
--- 469,473 ----
    Read = SensirionSht11C.Humidity;
    ReadStream = SensirionSht11C.HumidityStream;
+   DeviceMetadata = SensirionSht11C.HumidityDeviceMetadata;
  }
  </pre>
***************
*** 709,713 ****
  
    command uint8_t DeviceMetadata.getSignificantBits() { return 12; }
-   command uint8_t DeviceMetadata.getMostSignificantBit() { return 11; }
  }
  </pre>
--- 699,702 ----
***************
*** 731,745 ****
    provides interface Get&lt;bool&gt;;
    provides interface Notify&lt;bool&gt;;
  }
  implementation {
  
    components UserButtonLogicP;
  
    components HplUserButtonC;
    UserButtonLogicP.GpioInterrupt -&gt; HplUserButtonC.GpioInterrupt;
    UserButtonLogicP.GeneralIO -&gt; HplUserButtonC.GeneralIO;
- 
-   Get = UserButtonLogicP;
-   Notify = UserButtonLogicP;
  }
  </pre>
--- 720,735 ----
    provides interface Get&lt;bool&gt;;
    provides interface Notify&lt;bool&gt;;
+   provides interface DeviceMetadata;
  }
  implementation {
  
    components UserButtonLogicP;
+   Get = UserButtonLogicP;
+   Notify = UserButtonLogicP;
+   DeviceMetadata = UserButtonLogicP;
  
    components HplUserButtonC;
    UserButtonLogicP.GpioInterrupt -&gt; HplUserButtonC.GpioInterrupt;
    UserButtonLogicP.GeneralIO -&gt; HplUserButtonC.GeneralIO;
  }
  </pre>
***************
*** 750,753 ****
--- 740,744 ----
    provides interface Get&lt;bool&gt;;
    provides interface Notify&lt;bool&gt;;
+   provides interface DeviceMetadata;
  
    uses interface GeneralIO;
***************
*** 797,800 ****
--- 788,793 ----
      }
    }
+ 
+   command uint8_t DeviceMetadata.getSignificantBits() { return 1; }
  }
  </pre>
***************
*** 905,910 ****
  
    command uint8_t TemperatureDeviceMetadata.getSignificantBits() { return 14; }
!   command uint8_t TemperatureDeviceMetadata.getMostSignificantBit() { return 13; }
!     
    command error_t Humidity.read() {
      call HumResource.request();
--- 898,902 ----
  
    command uint8_t TemperatureDeviceMetadata.getSignificantBits() { return 14; }
! 
    command error_t Humidity.read() {
      call HumResource.request();
***************
*** 926,930 ****
  
    command uint8_t HumidityDeviceMetadata.getSignificantBits() { return 12; }
-   command uint8_t HumidityDeviceMetadata.getMostSignificantBit() { return 11; }
  
    event void Sht11Temp.resetDone( error_t result ) { }
--- 918,921 ----



More information about the Tinyos-2-commits mailing list