]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Moving most recent TEP versions to trunk. Recompile HTML.
authorscipio <scipio>
Fri, 8 Sep 2006 23:15:07 +0000 (23:15 +0000)
committerscipio <scipio>
Fri, 8 Sep 2006 23:15:07 +0000 (23:15 +0000)
24 files changed:
doc/html/overview.html
doc/html/tep1.html
doc/html/tep101.html
doc/html/tep102.html
doc/html/tep103.html
doc/html/tep106.html
doc/html/tep107.html
doc/html/tep108.html
doc/html/tep109.html
doc/html/tep110.html
doc/html/tep111.html
doc/html/tep112.html
doc/html/tep113.html
doc/html/tep114.html
doc/html/tep115.html
doc/html/tep116.html
doc/html/tep117.html
doc/html/tep118.html
doc/html/tep119.html
doc/html/tep120.html
doc/html/tep123.html
doc/html/tep3.html
doc/txt/tep118.txt
doc/txt/tep119.txt

index 166e94aa259d98c59c1884a9662c2a613083cc21..a929d36e29a92ccc3ffaf46ed9253c8fc8a86f07 100644 (file)
@@ -361,7 +361,7 @@ use and safely compile on multiple platforms. For example, the HIL
 component of the CC1000 on the mica2 is <tt class="docutils literal"><span class="pre">ActiveMessageC</span></tt>, representing
 a full active message communication layer.</p>
 <p>The HAA is described in TEP 2: Hardware Abstraction Architecture[<a class="reference" href="#tep2">TEP2</a>].</p>
-<p>Currently (as of the 2.0 beta release at TTX3), TinyOS 2.0 supports
+<p>Currently (as of the 2.0 beta2 release in July 2006), TinyOS 2.0 supports
 the following platforms:</p>
 <blockquote>
 <ul class="simple">
@@ -375,6 +375,7 @@ the following platforms:</p>
 <li>btnode3</li>
 </ul>
 </blockquote>
+<p>The btnode3 platform is not included in the beta2 RPM.</p>
 </div>
 <div class="section">
 <h1><a id="scheduler" name="scheduler">3. Scheduler</a></h1>
index 46bdd8cf968dcbe59674f358c228c0f7b40b9755..b517558810c74fbcc935b818fe42c92fda9646c1 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Philip Levis</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">18-Oct-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.3</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-13</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index 2ec1e50cd51fd320635e5fa0b1ca0a2a2137efe3..69a56fb450e22365983bdf42217e061d5f8d2a05 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Jan-Hinrich Hauer, Philip Levis, Vlado Handziski, David Gay</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">20-Dec-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.6</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.3</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-14</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-09-08</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
@@ -329,7 +329,7 @@ ADC is platform-dependent.</p>
 <div class="section">
 <h1><a id="introduction" name="introduction">1. Introduction</a></h1>
 <p>Analog-to-digital converters (ADCs) are devices that convert analog input
-signals to discrete digital output signals, typically voltage to a digital
+signals to discrete digital output signals, typically voltage to a binary
 number.  The interested reader can refer to Appendix A for a brief overview of
 the ADC hardware on some current TinyOS platforms.  In earlier versions of
 TinyOS, the distinction between a sensor and an ADC were blurred: this led
@@ -378,10 +378,11 @@ interfaces for data collection and chip-specific configuration interfaces.</p>
 <ul class="simple">
 <li>the set of platform-independent interfaces for the collection of ADC
 conversion results (<a class="reference" href="#interfaces">2. Interfaces</a>)</li>
-<li>guidelines on how an ADC's HAL SHOULD should be split into HAL1 and HAL2 and
-how the HAL1 SHOULD expose chip-specific interfaces (<a class="reference" href="#hal1-guidelines">3. HAL1 guidelines</a>)</li>
+<li>guidelines on how an ADC's HAL should be split into HAL1 and HAL2 and
+how the HAL1 should expose chip-specific interfaces (<a class="reference" href="#hal1-guidelines">3. HAL1 guidelines</a>)</li>
 <li>what components an ADC's HAL2 MUST implement (<a class="reference" href="#hal2-requirements">4. HAL2 requirements</a>)</li>
 <li>guidelines on how the HAL2 may be structured (<a class="reference" href="#hal2-implementation-guidelines">5. HAL2 implementation guidelines</a>)</li>
+<li>a section pointing to the current implementation (<a class="reference" href="#implementation">6. Implementation</a>)</li>
 </ul>
 <p>This TEP ends with appendices documenting, as an example, the ADC
 implementation for the TI MSP430 MCU.</p>
@@ -417,9 +418,8 @@ occurs (the request may be buffered).</p>
 sampling: If a call to ReadNow.read() succeeds, the ADC starts to sample the
 channel immediately (the request is not buffered). Due to its timing
 constraints the ReadNow interface is always provided in conjunction with an
-instance of the Resource interface. A client MUST request access to the ADC
-via the Resource interface before it can call ReadNow.read() and it MUST
-release access via the Resource interface when it is finished (see <a class="citation-reference" href="#tep108" id="id8" name="id8">[TEP108]</a>).</p>
+instance of the Resource interface. Refer to <a class="citation-reference" href="#tep108" id="id8" name="id8">[TEP108]</a> on how the 'Resource'
+interface should be used by a client component.</p>
 </div>
 <div class="section">
 <h2><a id="readstream" name="readstream">ReadStream</a></h2>
@@ -437,39 +437,35 @@ below HAL2 and above the HPL. It exposes the full capabilities of the ADC in a
 chip-specific way and has the same function as the 'traditional' HAL in the
 HAA <a class="citation-reference" href="#tep2" id="id9" name="id9">[TEP2]</a>. Therefore only chip- and platform-dependent clients MAY wire to
 the HAL1. Although the HAL1 is chip-specific, both, in terms of implementation
-and representation, its design SHOULD follow the guidelines described below to
+and representation, its design should follow the guidelines described below to
 facilitate the mapping to platform-independent interfaces on the level of
 HAL2. Appendix B shows the HAL1 specification for the TI MSP430 MCU.</p>
 <div class="section">
 <h2><a id="resource-reservation" name="resource-reservation">Resource reservation</a></h2>
 <p>As the ADC hardware is a shared resource that is multiplexed between several
 clients, it requires access arbitration. Therefore the HAL1 configuration
-component SHOULD provide a parameterized 'Resource' interface, instantiate a
+component should provide a parameterized 'Resource' interface, instantiate a
 generic arbiter component and connect the 'Resource' interface to the arbiter
-as described in <a class="citation-reference" href="#tep108" id="id10" name="id10">[TEP108]</a>. To provide a uniform arbitration service for all
-platforms on the level of HAL2 (see <a class="reference" href="#hal2-requirements">4. HAL2 requirements</a>), all ADCs should
-be arbitrated in round robin fashion, i.e. the HAL1 SHOULD instantiate the
-standard round robin arbiter. On the level of HAL1 a client MUST have
-successfully requested access to the ADC via the 'Resource' interface before
-it can configure / sample a channel. After use it MUST release the ADC via the
-'Resource' interface (see <a class="citation-reference" href="#tep108" id="id11" name="id11">[TEP108]</a>).</p>
+as described in <a class="citation-reference" href="#tep108" id="id10" name="id10">[TEP108]</a>. To ensure fair and uniform arbitration on all
+platforms the standard round robin arbiter is recommended. Refer to <a class="citation-reference" href="#tep108" id="id11" name="id11">[TEP108]</a>
+on how the 'Resource' interface is to be used by a client wiring to HAL1.</p>
 </div>
 <div class="section">
 <h2><a id="configuration-and-sampling" name="configuration-and-sampling">Configuration and sampling</a></h2>
-<p>As the ADC hardware is a shared resource the HAL1 SHOULD support hardware
+<p>As the ADC hardware is a shared resource the HAL1 should support hardware
 configuration and sampling on a per-client basis (although per-port
 configuration is possible, it is not recommended, because it forces all
-clients to use the same settings for a given port). Therefore an HAL1 SHOULD
-provide &quot;sampling interfaces&quot; parameterized by a client identifier. An HAL1
+clients to use the same settings for a given port). Therefore an HAL1 should
+provide sampling interfaces parameterized by a client identifier. An HAL1
 client can use its instance of the sampling interface to configure the ADC
 hardware, start the sampling process and get conversion results. It wires to a
 sampling interface using a unique client identifier. All commands and events
-in the sampling interface SHOULD be 'async' to reflect the potential timing
-requirements of clients. An HAL1 MAY provide multiple different parameterized
+in the sampling interface should be 'async' to reflect the potential timing
+requirements of clients. An HAL1 may provide multiple different parameterized
 sampling interfaces, depending on the hardware capabilities.  This allows to
 differentiate/group ADC functionality, for example single vs.  repeated
 sampling, single channel vs. multiple channels or low-frequency vs.
-high-frequency sampling.  Every sampling interface SHOULD allow the client to
+high-frequency sampling.  Every sampling interface should allow the client to
 individually configure the ADC hardware, for example by including the
 configuration data as parameters in the sampling commands.  However, if
 configuration data is passed as a pointer, the HAL1 component MUST NOT
@@ -479,7 +475,7 @@ HAL1 interfaces for the TI MSP430 MCU.</p>
 <div class="section">
 <h2><a id="hal1-virtualization" name="hal1-virtualization">HAL1 virtualization</a></h2>
 <p>In order to hide wiring complexities and/or export only a subset of all ADC
-functions generic ADC wrapper components MAY be provided on the level of HAL1
+functions generic ADC wrapper components may be provided on the level of HAL1
 to be instantiated by chip- and platform-dependent clients.</p>
 </div>
 </div>
index 85a7e62409030bb14359e9c1638d4148995fec74..c716ce01c3f0814df101daac9156efbb92a3aa05 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Cory Sharp, Martin Turon, David Gay</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">22-Sep-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.4</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.3</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-16</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-09-06</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
@@ -795,6 +795,34 @@ generic component VirtualizeTimerC( typedef precision_tag, int max_timers )
 </div>
 </div>
 <div class="section">
+<h1><a id="author-s-address" name="author-s-address">6. Author's Address</a></h1>
+<div class="line-block">
+<div class="line">Cory Sharp</div>
+<div class="line">Moteiv Corporation</div>
+<div class="line">55 Hawthorne St, Suite 550</div>
+<div class="line">San Francisco, CA 94105</div>
+<div class="line"><br /></div>
+<div class="line">email - <a class="reference" href="mailto:cory&#64;moteiv.com">cory&#64;moteiv.com</a></div>
+<div class="line"><br /></div>
+<div class="line"><br /></div>
+<div class="line">Martin Turon</div>
+<div class="line">P.O. Box 8525</div>
+<div class="line">Berkeley, CA 94707</div>
+<div class="line"><br /></div>
+<div class="line">phone - +1 408 965 3355</div>
+<div class="line">email - <a class="reference" href="mailto:mturon&#64;xbow.com">mturon&#64;xbow.com</a></div>
+<div class="line"><br /></div>
+<div class="line"><br /></div>
+<div class="line">David Gay</div>
+<div class="line">2150 Shattuck Ave, Suite 1300</div>
+<div class="line">Intel Research</div>
+<div class="line">Berkeley, CA 94704</div>
+<div class="line"><br /></div>
+<div class="line">phone - +1 510 495 3055</div>
+<div class="line">email - <a class="reference" href="mailto:david.e.gay&#64;intel.com">david.e.gay&#64;intel.com</a></div>
+</div>
+</div>
+<div class="section">
 <h1><a id="appendix-a-timer-hardware-on-various-microcontrollers" name="appendix-a-timer-hardware-on-various-microcontrollers">Appendix A: Timer hardware on various microcontrollers</a></h1>
 <blockquote>
 <ol class="loweralpha simple">
index 6ed078f4bb4b4d484f4f22a4e1a2e6cf41c065b4..d43a308bfd7ab68d2bee121a49e19fc9c94c5016 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>David Gay, Jonathan Hui</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">27-Sep-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.12</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-21</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index c8939f500e3959ea2f6f5d69dcce0036b82a2e1c..4becd9dfbd93d01e189ad8991737291fc27e3543 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Philip Levis and Cory Sharp</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">10-Dec-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.9</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.3</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-13</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-09-08</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
@@ -524,7 +524,8 @@ module SchedulerBasicP {
 </pre>
 <p>A scheduler MUST provide a parameterized TaskBasic interface.
 If a call to TaskBasic.postTask() returns SUCCESS, the scheduler MUST run it
-eventually. The scheduler MUST return SUCCESS to a TaskBasic.postTask()
+eventually, so that starvation is not a concern. The scheduler MUST
+return SUCCESS to a TaskBasic.postTask()
 operation unless it is not the first call to TaskBasic.postTask() since
 that task's TaskBasic.runTask() event has been signaled. The
 McuSleep interface is used for microcontroller power management;
@@ -558,7 +559,7 @@ interface TaskBasic {
   void event runTask();
 }
 </pre>
-<p>When a component declares a task with the   task   keyword in nesC, it
+<p>When a component declares a task with the <tt class="docutils literal"><span class="pre">task</span></tt> keyword in nesC, it
 is implicitly declaring that it uses an instance of the TaskBasic
 interface: the task body is the runTask event. When a component uses the
 <tt class="docutils literal"><span class="pre">post</span></tt> keyword, it calls the postTask command. Each TaskBasic MUST be
@@ -582,11 +583,11 @@ that provides wire-through of SchedulerBasicP.</p>
 SHOULD put a configuration named TinySchedulerC in the application
 directory: this will replace the default. The scheduler component
 provides a wire-through of the desired scheduler implementation. All
-scheduler implementations SHOULD provide a parameterize TaskBasic
+scheduler implementations MUST provide a parameterize TaskBasic
 interface, as SchedulerBasicP does; this supports nesC post statements
-and task declarations. If a scheduler does not provide the TaskBasic
-interface, compiling applications requires modifying the standard
-ncc scheduler parameters (as described in Appendix A). All scheduler
+and task declarations and enables TinyOS core systems to operate
+properly. Generally, TinyOS core code needs to be able to run unchanged
+with new scheduler implementations.  All scheduler
 implementations MUST provide the Scheduler interface.</p>
 <p>For example, imagine a hypothetical scheduler that provides earliest
 deadline first tasks, which are provided through the TaskEdf
@@ -663,11 +664,15 @@ implementation {
   }
 }
 </pre>
+<p>The requirement that basic tasks not be subject to starvation
+requires that a scheduler supporting EDF tasks must ensure that
+basic tasks run eventually even if there is an unending stream of
+short deadline tasks to run.</p>
 <p>If the scheduler provides two instances of the same task interface,
 their unique keys are based on the name of the interface as the
 scheduler presents it (the &quot;as&quot; keyword). For example, imagine
 a scheduler which provides two instances of TaskBasic: standard
-tasks and high-priority tasks. The scheduler always selects a task
+tasks and high-priority tasks. The scheduler usually selects a task
 for the high priority queue before the standard queue:</p>
 <pre class="literal-block">
 configuration TinySchedulerC {
@@ -676,8 +681,9 @@ configuration TinySchedulerC {
   provides interface TaskBasic[uint8_t taskID] as TaskHighPriority;
 }
 </pre>
-<p>A component that uses a high priority task would then wire to
-TaskHighPriority with the key &quot;TinySchedulerC.TaskHighPriority&quot;:</p>
+<p>It cannot always select a high priority task because that could
+starve basic tasks.  A component that uses a high priority task would
+wire to TaskHighPriority with the key &quot;TinySchedulerC.TaskHighPriority&quot;:</p>
 <pre class="literal-block">
 configuration SomethingElseC {}
 implementation {
index 5c9f4e3673cb3adff10e9d1a45d4dcecc63d8ad5..4814463fe9b57853936f124179c6a3bf21c0b36e 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Philip Levis</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">10-Dec-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.11</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-13</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index 795f1ca082a5429e1f3c9edcde0e88528f1560ca..f1d33c115e50e9047fb8deca9bf590b3c4fe4b0a 100644 (file)
@@ -307,9 +307,9 @@ ul.auto-toc {
 <br />Vlado Handziski</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">28-Mar-2005</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.9</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.3</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-21</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-09-08</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
@@ -333,7 +333,7 @@ arbitrate access to shared abstractions.</p>
 <p>TinyOS 1.x has two mechanisms for managing shared resources:
 virtualization and completion events. A virtualized resource appears
 as an independent instance of an abstraction, such as the Timer
-interface is TimerC. A client of a Timer instance can use it
+interface in TimerC. A client of a Timer instance can use it
 independently of the others: TimerC virtualizes the underlying
 hardware clock into N separate timers.</p>
 <p>Some abstractions, however, are not well suited to virtualization:
@@ -341,14 +341,12 @@ programs need the control provided by a physical abstraction. For
 example, components in 1.x share a single communication stack,
 GenericComm.  GenericComm can only handle one outgoing packet at a
 time. If a component tries to send a packet when GenericComm is
-already busy, then the call returns FAIL. Therefore, shared use of
-GenericComm follows a first-come, first-served arbitration policy. If
-a component sends a packet but GenericComm is busy, the component
-needs a way to tell when GenericComm is free so it can retry. TinyOS
+already busy, then the call returns FAIL. The component needs a way to
+tell when GenericComm is free so it can retry. TinyOS
 1.x provides the mechanism of a global completion event which is
-signalled whenever a packet send completes. Interested components can
+signaled whenever a packet send completes. Interested components can
 handle this event and retry.</p>
-<p>The approach to physical (rather than virtualized) abstractions
+<p>This approach to physical (rather than virtualized) abstractions
 has several drawbacks:</p>
 <ul class="simple">
 <li>If you need to make several requests, you have to handle the
@@ -362,100 +360,68 @@ via this software interface. For instance, I2C buses have a
 concept of &quot;repeated start&quot; when doing multiple bus transactions,
 but it is not clear how to use this in TinyOS 1.x's I2C abstraction.</li>
 <li>Most TinyOS 1.x services do not provide a very convenient way of
-monitoring an abstractions's availability for the purpose of retries,
+monitoring an abstraction's availability for the purpose of retries,
 nor very clear documentation of which requests could happen simultaneously.</li>
 </ul>
-<p>A single approach to resource sharing is not appropriate for all
-circumstances. For instance, requiring resource reservation allows
-programs to have better timing guarantees for access to an A/D converter.
-But if a program does not need precise timing guarantees (e.g., when measuring
-temperature in a biological monitoring application), this extra resource
-reservation step unnecessarily complicates code.</p>
+<p>It should be clear that a single approach to resource sharing is not appropriate
+for all circumstances. For instance, requiring explicit reservation of a
+resource allows programs to have better timing guarantees for access to an A/D
+converter. If a program does not need precise timing guarantees, however (e.g.,
+when measuring temperature in a biological monitoring application), this extra
+resource reservation step unnecessarily complicates code and can be handled
+nicely using virtualization. The following section introduces the concept of
+resource classes in order to address this issue.  The sharing policy used by a
+particular resource abstraction is dictated by the resource class it belongs to.</p>
 </div>
 <div class="section">
 <h1><a id="resource-classes" name="resource-classes">2. Resource Classes</a></h1>
 <p>TinyOS 2.x distinguishes between three kinds of abstractions:
-<em>dedicated</em>, <em>shared</em>, and <em>virtualized</em>.
-Components offer resource sharing mechanisms appropriate to their
-goals and level of abstraction. As discussed in Section 2.1, access
-control to dedicated abstractions is generally handled
-through nesC interfaces. As discussed in Section 2.2, access control
-to virtualized abstractions is handled through software design
-patterns such as the Service Instance <a class="footnote-reference" href="#id9" id="id1" name="id1">[3]</a> and/or
-queueing. Section 2.3 addresses with the most complex class of
-abstraction, shared, while Section 3 describes the
-components and interfaces used to arbitrate access to this class.</p>
-<p>Hardware Presentation Layer (HPL) components of the HAA <a class="footnote-reference" href="#id7" id="id2" name="id2">[1]</a> are not
-virtual, as virtualization inevitably requires state. Depending on their
-expected use, HPL abstractions are either dedicated or
+<em>dedicated</em>, <em>virtualized</em>, and <em>shared</em>.  Components offer resource
+sharing mechanisms appropriate to their goals and level of abstraction.</p>
+<div class="note">
+<p class="first admonition-title">Note</p>
+<p class="last">It is important to point out that Hardware Presentation Layer (HPL)
+components of the HAA <a class="footnote-reference" href="#id4" id="id1" name="id1">[1]</a> can never be virtualized, as virtualization
+inevitably requires state. Depending on their
+expected use, HPL abstractions can either be dedicated or
 shared. For example, while hardware timers are rarely
 multiplexed between multiple components, buses almost always are.
-For example, on the MSP430 microcontroller, compare and counter registers are
-dedicated, while the USARTs are shared.</p>
+This can be seen on the MSP430 microcontroller, where the compare and
+counter registers are implemented as dedicated resources, and the USARTs
+are shared ones.</p>
+</div>
 <div class="section">
 <h2><a id="dedicated" name="dedicated">2.1 Dedicated</a></h2>
 <p>An abstraction is <em>dedicated</em> if it is a resource
-which a subsystem needs exclusive access to at all times. Examples of
-dedicated abstractions include interrupts and counters.
-Generally, a physical and dedicated abstraction is just an interface
-which its user wires to. For example, on the Atmega128, Timer 2 is
-presented by the component HplAtm128Timer2C:</p>
-<pre class="literal-block">
-module HplAtm128Timer2C {
-  provides {
-    interface HplTimer&lt;uint8_t&gt;   as Timer2;
-    interface HplTimerCtrl8       as Timer2Ctrl;
-    interface HplCompare&lt;uint8_t&gt; as Compare2;
-  }
-}
-</pre>
+which a subsystem needs exclusive access to at all times.
+In this class of resources, no sharing policy is needed since only
+a single component ever requires use of the resource.  Examples of
+dedicated abstractions include interrupts and counters.</p>
 <p>Dedicated abstractions MAY be annotated with the nesC attribute
-&#64;atmostonce or &#64;exactlyonce is to provide compile-time checks that
+&#64;atmostonce or &#64;exactlyonce to provide compile-time checks that
 their usage assumptions are not violated.</p>
+<p>Please refer to Appendix A for an example of how a dedicated
+resource might be represented, including the use of
+the nesC &#64;exactlyonce attribute.</p>
 </div>
 <div class="section">
-<h2><a id="virtual" name="virtual">2.2 Virtual</a></h2>
+<h2><a id="virtualized" name="virtualized">2.2 Virtualized</a></h2>
 <p><em>Virtual</em> abstractions hide multiple clients from each other
-through software virtualization. Every client of the resource thinks it
-has its own independent instance of the resource, but these virtualized
-instances are multiplexed on top of a single underlying resource. Because
-the virtualization is in software, there is no upper bound on the number
-of clients of the abstraction, barring memory or efficiency constraints.
-For example, the TimerMilliC component provides a virtual and shared
-abstraction of millisecond precision timers to application
-components <a class="footnote-reference" href="#id8" id="id3" name="id3">[2]</a>. As virtualization usually requires keeping state
-that scales with the number of virtualized instances,
-virtualized resources often use the Service Instance pattern <a class="footnote-reference" href="#id9" id="id4" name="id4">[3]</a>,
-which is based on a parameterized interface. For example, HilTimerMilliC
-provides multiple virtualized timer clients and auto-wires the
-chip timer implementation (HilTimerMilliC <a class="footnote-reference" href="#id8" id="id5" name="id5">[2]</a>) to the boot initialization
-sequence:</p>
-<pre class="literal-block">
-configuration TimerMilliP {
-  provides interface Timer&lt;TMilli&gt; as TimerMilli[uint8_t num];
-}
-implementation {
-  components HilTimerMilliC, MainC;
-  MainC.SoftwareInit -&gt; HilTimerMilliC;
-  TimerMilli = HilTimerMilliC;
-}
-</pre>
-<p>while TimerMilliC encapsulates this in a generic configuration:</p>
-<pre class="literal-block">
-generic configuration TimerMilliC {
-  provides interface Timer&lt;TMilli&gt;;
-}
-implementation {
-  components HilTimerMilliC;
-  Timer = HilTimerMilliC.Timer[unique(UQ_TIMER_MILLI)];
-}
-</pre>
-<p>Virtualization generally allows a client to use a very simple interface.
-This simplicity comes at a cost of reduced efficiency and an inability to
-precisely control the underlying resource. For example, TimerMilli32C
-introduces CPU overhead from dispatching and maintaining all of the
-virtual timers as well as jitter from when two timers want to fire at
-the same time.</p>
+through software virtualization. Every client of a virtualized resource
+interacts with it as if it were a dedicated resource, with all virtualized
+instances being multiplexed on top of a single underlying resource. Because
+the virtualization is done in software, there is no upper bound on the number
+of clients using the abstraction, barring memory or efficiency constraints.
+As virtualization usually requires keeping state that scales with the number
+of virtualized instances, virtualized resources often use the Service Instance
+pattern <a class="footnote-reference" href="#id6" id="id2" name="id2">[3]</a>, which is based on a parameterized interface.</p>
+<p>Virtualization generally provides a very simple interface to its clients.
+This simplicity comes at the cost of reduced efficiency and an inability to
+precisely control the underlying resource. For example, a virtualized
+timer resource introduces CPU overhead from dispatching and maintaining
+each individual virtual timer, as well as introducing jitter whenever two
+timers happen to fire at the same time. Please refer to Appendix A for an
+example of how such a virtualized timer resource might be implemented.</p>
 </div>
 <div class="section">
 <h2><a id="shared" name="shared">2.3 Shared</a></h2>
@@ -466,13 +432,6 @@ control in order to share a resource in a simple way. There are
 situations, however, when many clients need precise control of a
 resource. Clearly, they can't all have such control at the same time:
 some degree of multiplexing is needed.</p>
-<p>In TinyOS 2.x, a resource <em>arbiter</em> is responsible for this
-multiplexing. The arbiter determines which client has access to the
-resource. While a client holds a resource, it has complete and
-unfettered control. Arbiters assume that clients are cooperative, only
-acquiring the resource when needed and holding on to it no longer than
-necessary. Clients explicitly release resources: there is no way for
-an arbiter to forcibly reclaim it.</p>
 <p>A motivating example of a shared resource is a bus.
 The bus may have multiple peripherals on it, corresponding to
 different subsystems. For example, on the Telos platform the flash
@@ -482,136 +441,92 @@ but they also need to share it with the other subsystem. In this
 case, virtualization is problematic, as the radio stack needs to be
 able to perform a series of operations in quick succession without
 having to reacquire the bus in each case. Having the bus be a
-physical but shared resource allows the radio stack to
-send a series of operations atomically across to the radio without
-having to buffer them all up in memory beforehand (which would
-introduce memory pressure).</p>
+shared resource allows the radio stack to send a series of operations
+to the radio atomically, without having to buffer them all up
+in memory beforehand (introducing memory pressure in the process).</p>
+<p>In TinyOS 2.x, a resource <em>arbiter</em> is responsible for multiplexing
+between the different clients of a shared resource. It determines
+which client has access to the resource at which time. While a client
+holds a resource, it has complete and unfettered control. Arbiters assume
+that clients are cooperative, only acquiring the resource when needed
+and holding on to it no longer than necessary. Clients explicitly
+release resources: there is no way for an arbiter to forcibly reclaim it.
+The following section is dedicated to describing the arbiter and its
+interfaces.</p>
 </div>
 </div>
 <div class="section">
 <h1><a id="resource-arbiters" name="resource-arbiters">3. Resource Arbiters</a></h1>
 <p>Every shared resource has an arbiter to manage which client
 can use the resource at any given time. Because an arbiter is a
-centralized place that knows whether the resource is in use, it also
-provides information useful for a variety of other services, such as
+centralized place that knows whether the resource is in use, it can also
+provide information useful for a variety of other services, such as
 power management. An arbiter MUST provide a parameterized Resource
 interface as well as an instance of the ArbiterInfo interface. An
-arbiter SHOULD also provide an instance of ResourceController and
-ResourceConfigure interfaces. An arbiter MAY provide additional
-interfaces or instance of interfaces in order to provide a particular
-arbitration policy.</p>
+arbiter SHOULD also provide a parameterized ResourceRequested interface
+and use a parameterized ResourceConfigure interface.  It MAY also provide
+an instance of the ResourceController interface or any additional
+interfaces specific to the particular arbitration policy being
+implemented.</p>
 <div class="section">
 <h2><a id="resource" name="resource">3.1 Resource</a></h2>
 <p>Clients of a shared resource arbiter request access
-with the Resource interface:</p>
+using the Resource interface:</p>
 <pre class="literal-block">
 interface Resource {
   async command error_t request();
   async command error_t immediateRequest();
   event void granted();
-  async command void release();
+  async command error_t release();
+  async command bool isOwner();
 }
 </pre>
-<p>A client lets an arbiter know it needs access to the resource with
-a call to request(). The arbiter signals the granted() event to a
-client when it gains exclusive access to the resource. A client
-can also acquire the resource with immediateRequest(). The
-return value of this call determines whether the client was able
-to acquire the resource. If immmediateRequest() does not successfully
-acquire the resource (does not return SUCCESS), then it can try to do
-so in the standard,
-split-phase way with request(). If the call to immediateRequest()
-returns SUCCESS, then the arbiter MUST NOT issue a granted() event.</p>
-<p>An arbiter MUST provide a parameterized Resource interface,
+<p>A client lets an arbiter know it needs access to a resource by
+making a call to request(). If the resource is free,
+SUCCESS is returned, and a granted event is signaled
+back to the client.  If the resource is busy, SUCCESS will
+still be returned, but the request will be queued
+according to the queuing policy of the arbiter. Whenever a client is
+done with the resource, it calls the release() command, and the next
+client in the request queue is given access to the resource and
+is signaled its granted() event. If a client ever makes multiple
+requests before receiving a granted event, an EBUSY value is returned,
+and the request is not queued.  Using this policy, clients are not able to
+hog the resource queue by making multiple requests, but they may still be
+able to hog the resource if they do not release it in a timely manner.</p>
+<p>Clients can also request the use of a resource through the
+immediateRequest() command.  A call to immediateRequest() can either
+return SUCCESS or FAIL, with requests made through this command never being
+queued.  If a call to immediateRequest() returns SUCCESS, the client is granted
+access to the resource immediately after the call has returned, and no granted
+event is ever signaled.  If it returns FAIL, the client is not granted access to
+the resource and the request does not get queued.  The client will have to try
+and gain access to the resource again later.</p>
+<p>A client can use the isOwner command of the Resource interface to
+check if it is the current owner of the resource.  This command is mostly
+used to perform runtime checks to make sure that clients not owning a resource
+are not able to use it.  If a call to isOwner fails, then no call
+should be made to commands provided by that resource.</p>
+<p>An arbiter MUST provide exactly one parameterized Resource interface,
 where the parameter is a client ID, following the Service
-Instance pattern <a class="footnote-reference" href="#id9" id="id6" name="id6">[3]</a>. An arbitrated component SomeNameC MUST
+Instance pattern[3]_.  An arbitrated component SomeNameP MUST
 #define SOME_NAME_RESOURCE to a string which can be passed to unique()
-to obtain a client id. For instance, an I2C bus might look like this:</p>
-<pre class="literal-block">
-includes I2CPacketC;
-configuration I2CPacketC {
-  provides {
-    interface Resource[uint8_t id];
-    interface I2CPacket[uint8_t busId];
-  }
-} ...
-</pre>
-<p>where I2CPacketC.h contains the #define for the resource:</p>
-<pre class="literal-block">
-#ifndef I2CPACKETC_H
-#define I2CPACKETC_H
-#define I2CPACKET_RESOURCE &quot;I2CPacket.Resource&quot;
-#endif
-</pre>
-<p>The #define for the unique string must be placed in a separate file
-because of the way nesC files are preprocessed: referring to I2CPacketC
-isn't enough to ensure that macros #define'd in I2CPacketC are visible
-in the referring component.</p>
-<p>For example, clients of the I2C service might use it as follows:</p>
-<pre class="literal-block">
-module I2CUserM {
-  uses interface Resource as I2CResource;
-  uses interface I2CPacket;
-} ...
-
-#include &lt;I2CPacketC.h&gt;
-configuration I2CUserC { }
-implementation {
-  components I2CUserM, I2CPacketC;
-
-  I2CUserM.I2CResource -&gt; I2CPacketC.Resource[unique(I2C_RESOURCE)];
-  I2CUserM.I2CPacket -&gt; I2CPacket.I2CPacket[0x73]; // using I2C device 0x73
-}
-</pre>
+to obtain a client id.  This #define must be placed in a separate file
+because of the way nesC files are preprocessed: including the
+SomeNameP component isn't enough to ensure that macros #define'd in
+SomeNameP are visible in the referring component.</p>
+<p>Please refer to Appendix B for an example of how to wrap this component
+inside a generic configuration. Wrapping the component in this way ensures that
+each Resource client is given a unique client ID, with the added
+benefit of properly coupling multiple components that all need to
+refer to the same client ID.</p>
+<p>For a complete example of how the I2C resource might be abstracted
+according to this pattern, please refer to Appendix B.  For further
+examples please refer to the various chip implementations in the
+tinyos-2.x source tree under tinyos-2.x/chips/</p>
 </div>
 <div class="section">
-<h2><a id="resourcecontroller" name="resourcecontroller">3.2 ResourceController</a></h2>
-<p>An arbiter SHOULD provide one instance of the ResourceController
-interface and MAY provide more than one. The Resource interface is for
-simple and basic use cases, where clients are peers that share the
-resource in some equal fashion. ResourceController is for clients that
-require additional information due to the policies of the arbiter and
-how they use the resource.  The ResourceController interface is based
-on Resource, but introduces two additional events, idle() and
-requested():</p>
-<pre class="literal-block">
-interface ResourceController {
-  async command error_t request();
-  async command error_t immediateRequest();
-  event void granted();
-  async command void release();
-  async event void requested();
-  async event void idle();
-}
-</pre>
-<p>An arbiter signals the requested event if the client currently has the resource
-and some other client has requested it. It signals the idle() event when
-no client holds the resource.</p>
-<p>ResourceController allows an arbiter to provide a much richer set of
-policies than simple sharing. For example, arbiters that want to
-incorporate a power management policy can provide ResourceController
-for a power management component. The power management component can
-detect when nobody is using the resource with idle(), acquire it
-atomically with immediateRequest(), and power it down. When another
-client requests the resource, the power manager will handle the
-requested() event. It can then power up the resource and release it
-when the power up completes. Note that if power up is a split-phase
-operation (takes a while), then calls by clients to immediateRequest()
-when in powered down state will not return SUCCESS. See TEP 115 for
-details. The default arbiters in TinyOS 2.x (see Section 4) all provide a
-single instance of ResourceController, in order to enable power
-management as described above.</p>
-<p>ResourceController can also be used for special case clients: the
-algorithm used to determine when its requests are handled in
-comparison to instances of Resource is arbiter specific. Therefore,
-arbiters MAY provide one or more instances of ResourceController.  For
-example, the FcfsPriorityArbiter has a single high-priority client who
-is always granted access to the resource before any other client.
-Other clients only obtain the resource if the high-priority client has
-not requested it or when the high-priority client releases it.</p>
-</div>
-<div class="section">
-<h2><a id="arbiterinfo" name="arbiterinfo">3.3 ArbiterInfo</a></h2>
+<h2><a id="arbiterinfo" name="arbiterinfo">3.2 ArbiterInfo</a></h2>
 <p>Arbiters MUST provide an instance of the ArbiterInfo interface.
 The ArbiterInfo interface allows a component to query the current
 status of an arbiter:</p>
@@ -623,133 +538,297 @@ interface ArbiterInfo {
 </pre>
 <p>The ArbiterInfo interface has a variety of uses. For example, the resource
 implementation can use it to refuse requests from clients that do not
-currently have access. In this case, the abstraction would need to provide
-a parameterized interface for its operations so it could distinguish separate
-clients, and the client ID for its operations would need to be the same
-as the client ID for the arbiter.</p>
+currently have access.  For an example of how this interface is used
+in this fashion please refer to Appendix B.</p>
+</div>
+<div class="section">
+<h2><a id="resourcerequested" name="resourcerequested">3.3 ResourceRequested</a></h2>
+<p>Sometimes it is useful for a client to be able to hold onto a resource until
+someone else needs it and only at that time decide to release it.  Using the
+ResourceRequested interface, this information is made available to the current
+owner of a resource:</p>
+<pre class="literal-block">
+interface ResourceRequested {
+  async event void requested();
+  async event void immediateRequested();
+}
+</pre>
+<p>A requested event is signaled to the current owner of the resource if another
+client makes a request for the resource through the request() command of
+its Resource interface.  If a request is made through the immediateRequest()
+command, then the immediateRequested() event is signaled.</p>
+<p>An arbiter SHOULD provide a parameterized ResourceRequested interface to its
+clients, but is not required to.  The client id of the parameterized
+ResourceRequested interface should be coupled with the client id of the Resource
+interface to ensure that all events are signaled to the proper clients.  Please
+refer to Appendix B for an example of how this interface might be used.</p>
 </div>
 <div class="section">
 <h2><a id="resourceconfigure" name="resourceconfigure">3.4 ResourceConfigure</a></h2>
-<p>The ResourceConfigure interface provides a mechanism for clients that need
-to use a resource with different configurations. Rather than forcing a
-client to reconfigure the resource itself, the component representing a
-client can wire to an arbiter's ResourceConfigure interface, which is called
-before the client is granted the resource.</p>
-<p>For example, the MSP430 USART0 bus can operate in three modes: SPI, I2C, and
-UART. Using all three concurrently is problematic: only one should be enabled
-at a time. However, different clients of the bus might need different bus
-protocols. For example, Telos sensors use an I2C, while the radio and flash
-chip use SPI.</p>
-<p>Arbiters MAY use a parameterized ResourceConfigure interface:</p>
+<p>The ResourceConfigure interface provides a mechanism for clients
+that need to use a resource with different configurations to do so.
+Rather than forcing a client to reconfigure the resource itself, the
+component representing a client can wire to an arbiter's
+ResourceConfigure interface, which is called just before granting the
+client the resource:</p>
 <pre class="literal-block">
 interface ResourceConfigure {
   async command void configure();
   async command void unconfigure();
 }
 </pre>
-<p>The parameter is the client ID, and corresponds directly to an instance of
-the Resource interface. For example:</p>
-<pre class="literal-block">
-generic component RoundRobinArbiterC {
-  provides {
-    interface Resource[uint8_t id];
-    interface ResourceController;
-    interface ArbiterInfo;
-  }
-  uses {
-    interface ResourceConfigure[uint8_t id];
-  }
-}
-</pre>
-<p>If an arbiter uses the ResourceConfigure interface, before it signals the
-Resource.granted() event and before it returns SUCCESS from a call to
-Resource.immediateRequest(), it MUST call ResourceConfigure.configure() on
-the granted client ID. Similarly, after a valid call to Resource.release(),
-it MUST call ResourceConfigure.unconfigure() on the releasing client ID.</p>
-<p>Using a parameterized interface that calls out rather than a decorator
-on the Resource interface simplifies code reuse. Using a decorator
-could lead to a large number of clients all including redundant
-configuration code, while the call out will only have one instance
-of the code. For example, an SPI client might look like this:</p>
+<p>The arbiter SHOULD use a parameterized ResourceConfigure interface, with
+its client ID parameter coupled with the client id of its parameterized
+Resource interface.  If an arbiter uses the ResourceConfigure interface,
+it MUST call ResourceConfigure.configure() on the granted client ID
+before it signals the Resource.granted() event. Similarly, after a valid
+call to Resource.release(), it MUST call ResourceConfigure.unconfigure()
+on the releasing client ID.  By calling ResourceConfigure.configure() just
+before granting a client access to a resource and calling
+ResourceConfigure.unconfigure() just before fully releasing it, it is guaranteed
+that a resource is always unconfigured before an attempt to configure it can be
+made again.</p>
+<p>Using the parameterized ResourceConfigure interface that calls out rather than
+additional commands being put into the Resource interface
+simplifies code reuse. Introducing these new commands into the
+Resource interface could lead to a large number of clients all
+including redundant configuration code, while using the call out
+approach provided by the parameterized interface will only have one
+instance of the code.</p>
+<p>For an example of how the three different modes of the Msp430 Usart
+component can take advantage of this ResourceConfigure interface
+please refer to Appendix B as well as section 4 on the use of
+cross-component reservation.</p>
+</div>
+<div class="section">
+<h2><a id="resourcecontroller" name="resourcecontroller">3.5 ResourceController</a></h2>
+<p>The normal Resource interface is for use by clients that all share the resource
+in an equal fashion. The ResourceController interface is for use by a single
+client that needs to be given control of the resource whenever no one else is
+using it. An arbiter MAY provide a single instance of the ResourceController
+interface.:</p>
 <pre class="literal-block">
-generic component Msp430Spi0ClientC {
-  provides {
-    interface Resource;
-    interface SPIByte;
-    interface SPIPacket;
-  }
-}
-implementation {
-  enum {MSP430_SPI0_CLIENT = unique(MSP430_USART_RESOURCE);
-  components Msp430Usart0C, Msp430Spi0Configure as Configure;
-
-  Resource = Msp430Usart0C.Resource[MSP430_SPI0_CLIENT];
-  Msp430Usart0C.ResourceConfigure[MSP430_SPI0_CLIENT] -&gt; Configure;
+interface ResourceController {
+  async event void granted();
+  async command error_t release();
+  async command bool isOwner();
+  async event void requested();
+  async event void immediateRequested();
 }
 </pre>
-<p>Arbiters SHOULD provide a parameterized ResourceConfigure interface.</p>
+<p>The Arbiter MUST guarantee that the user of the ResourceController interface is
+made the owner of the resource before the boot initialization sequence is
+completed.  When a normal resource client makes a request for the resource, the
+ResourceController will receive either a requested() or an immediateRequested()
+event depending on how the request was made.  It must then decide if and when to
+release it.  Once released, all clients that have pending requests will be
+granted access to the resource in the order determined by the queuing policy of
+the arbiter in use.  Once all pending requests have been granted (including
+those that came in while other clients had access to the resource), the
+ResourceController is automatically given control of the resource, receiving its
+granted() event in the process.  The ResourceController interface also contains
+the same isOwner() command as the normal Resource interface, and the semantics
+of its use are exactly the same.</p>
+<p>Although the ResourceController interface looks similar to a combination of the
+normal Resource interface and the ResourceRequested interface, its intended use
+is quite different.  The ResourceController interface should only be used by
+clients that wish to have access to a resource only when no other clients are
+using it.  They do not actively seek out access to the resource, but rather use
+it to perform operations when it would otherwise simply be idle.</p>
+<p>Combining the use of the Resource and ResourceRequested interfaces could be made
+to operate in a similar manner as the ResourceController interface, except that
+there is no way to tell a client with these interfaces that a resource has gone
+completely idle.  Each client must actively request the use of the resource and
+be granted that resource in the order determined by the queuing policy of its
+arbiter.  With the ResourceController interface, there is no active request of
+the resource.  The arbiter simply signals the granted event to the
+ResourceController whenever there are no more pending requests and the last
+client that owned the resource releases it.</p>
+<p>The primary motivation behind the definition of the ResourceController
+interface was to allow for an easy integration of the power management
+policy used by the resource with the arbitration of the resource
+itself.  Arbiters that want to allow a resource to be controlled by a particular power management policy can provide the ResourceController interface
+for use by a component that implements that policy. The power management component will receive the granted() event whenever the resource has gone idle,
+and will then proceed in powering it down.  When another
+client requests the resource, the power manager will be notified through
+either the requested() or immediateRequested() events as appropriate.  It
+can then power up the resource and release it once the power up has completed.
+Note that if power up is a split-phase operation (takes a while), then calls
+by clients to immediateRequest() when in the powered down state will not return
+SUCCESS. Please see the TEP on the Power Management of Non-Virtualized devices
+(<a class="footnote-reference" href="#id7" id="id3" name="id3">[4]</a>) for more details.</p>
+</div>
 </div>
 <div class="section">
-<h2><a id="cross-component-reservation" name="cross-component-reservation">3.5 Cross-component reservation</a></h2>
-<p>In some cases, it is desirable to share reservation of resources
-across components. For example, on the TI MSP430, the same pins can
-be used as an I2C bus, a UART, or an SPI connection. Clearly, on this
-chip, a reservation of the I2C bus implicitly reserves the
-corresponding UART and SPI.  This can be accomplished in the framework
-described above by:</p>
+<h1><a id="cross-component-reservation" name="cross-component-reservation">4. Cross-Component Reservation</a></h1>
+<p>In some cases, it is desirable to share the reservation of a
+single resource across multiple components. For example, on the TI
+MSP430, a single USART component can be used as an I2C bus, a UART,
+or an SPI connection. Clearly, on this chip, a reservation of the I2C
+bus implicitly restricts the corresponding UART and SPI
+services from gaining access to the resource. Enforcing such a policy
+can be accomplished in the framework described above by:</p>
+<blockquote>
 <ol class="arabic simple">
-<li>using the same unique string for all three resources</li>
+<li>Creating a set of unique ids for each service using the shared
+resource.</li>
+<li>Mapping these ids onto the ids of the underlying resource</li>
 </ol>
-<p>2) wiring the three parameterised Resource interfaces to the same
-arbiter</p>
-<p>The common way to do this is as follows (the UART and SPI components
-are omitted, they are similar to I2CC,  low-level I2C component):</p>
+</blockquote>
+<p>Clients connecting to these services do not know that that this
+mapping is taking place.  As far as they are concerned, the only
+arbitration taking place is between other clients using the same
+service.  In the MSP430 example, a single client of the I2C bus could
+be contending with a single client of the SPI connection, but they
+would probably have the same service level client ID.  These two
+service level client ids would be mapped onto 2 unique resource ids
+for use by the shared USART component. The proper way to achieve this
+mapping is through the use of generic components.  The example given
+below shows how to perform this mapping for the SPI component on the
+MSP430.  It is done similarly for the UART and I2C bus:</p>
 <pre class="literal-block">
-#define I2C_RESOURCE MSP_BUS_RESOURCE
-configuration I2CC {
-  provides interface Resource[uint8_t clientId];
-  provides interface I2C;
+#include &quot;Msp430Usart.h&quot;
+generic configuration Msp430Spi0C() {
+  provides interface Resource;
+  provides interface SpiByte;
+  provides interface SpiPacket;
 }
 implementation {
-  components MspBusC, I2CM;
+  enum { CLIENT_ID = unique(MSP430_SPIO_BUS) };
+
+  components Msp430Spi0P as SpiP;
+  Resource = SpiP.Resource[ CLIENT_ID ];
+  SpiByte = SpiP.SpiByte;
+  SpiPacket = SpiP.SpiPacket[ CLIENT_ID ];
 
-  Resource = MspBusC.Resource;
-  I2C = I2CM.I2C;
+  components new Msp430Usart0C() as UsartC;
+  SpiP.UsartResource[ CLIENT_ID ] -&gt; UsartC.Resource;
+  SpiP.UsartInterrupts -&gt; UsartC.HplMsp430UsartInterrupts;
 }
 </pre>
-<p>MspBusC (the arbiter for the MSP bus):</p>
-<pre class="literal-block">
-#define MSP_BUS_RESOURCE &quot;MspBus.Resource&quot;
-configuration {
-  provides interface Resource[uint8_t clientId];
-} ...
-</pre>
-</div>
+<p>The definition of the MSP430_SPIO_BUS string is defined in
+Msp430Usart.h. A unique id is created from this string every time a
+new Msp430Spi0C component is instantiated.  This id is used as a
+parameter to the parameterized Resource interface provided by the
+Msp430Spi0P component.  This is where the mapping of the two
+different ids begins.  As well as <em>providing</em> a parameterized
+Resource interface, the Msp430Spi0P component also <em>uses</em> a
+parameterized Resource interface. Whenever a client makes a call
+through the provided Resource interface with id CLIENT_ID, an
+underlying call to the used Resource interface with the same id is
+implicitly made.  By wiring the used Resource interface with id
+CLIENT_ID to the instance of the Resource interface provided by the
+instantiation of the Msp430Usart0C component, the mapping is complete.
+Any calls to the Resource interface provided by a new instantiation of
+the Msp430Spi0C component will now be made through a unique Resource
+interface on the underlying  Msp430Usart0C component.</p>
+<p>This level of indirection is necessary because it may not always be
+desirable to directly wire the service level Resource interface to
+the underlying shared Resource interface.  Sometimes we may want to
+perform some operations between a service level command being
+called, and calling the underlying command on the shared resource.
+With such a mapping, inserting these operations is made possible.</p>
+<p>Having such a mapping is also important for services that need to
+explicitly keep track of the number of clients they have,
+independent from how many total clients the underlying shared
+resource has.  For example, a sensor implementation that uses an
+underlying ADC resource may wish to power down its sensor whenever it
+has no clients.  It doesn't want to have to wait until the entire ADC
+is free to do so.  Providing this mapping allows the implicit power
+manager components described in TEP 115 to be wired in at both levels
+of the abstraction without interfering with one another.  In this
+way, implementations of these components become much simpler, and code
+reuse is encouraged.</p>
+<p>Implementations of components similar to this one can be found in the
+tinyos-2.x source tree in the tos/chips/msp430/uart directory</p>
 </div>
 <div class="section">
-<h1><a id="implementation" name="implementation">4. Implementation</a></h1>
+<h1><a id="implementation" name="implementation">5. Implementation</a></h1>
 <p>Because most components use one of a small number of arbitration
-policies, TinyOS includes a number of default resource arbiters. These
+policies, tinyos-2.x includes a number of default resource arbiters. These
 arbiters can be found in <tt class="docutils literal"><span class="pre">tinyos-2.x/tos/system</span></tt> and are all
-generic components that include this signature:</p>
+generic components that include one of the two signatures seen below:</p>
 <pre class="literal-block">
-generic module ArbiterC {
+generic module SimpleArbiter {
+  provides interface Resource[uint8_t id];
+  provides interface ResourceRequested[uint8_t id];
+  provides interface ArbiterInfo;
+  uses interface ResourceConfigure[uint8_t id];
+}
+
+generic module Arbiter {
   provides interface Resource[uint8_t id];
+  provides interface ResourceRequested[uint8_t id];
   provides interface ResourceController;
   provides interface ArbiterInfo;
   uses interface ResourceConfigure[uint8_t id];
 }
 </pre>
-<p>For example, <tt class="docutils literal"><span class="pre">RoundRobinArbiterC</span></tt> provides round-robin arbitration. This
-arbiter assigns a fixed order to all clients and grants outstanding
-requests in that order, which is based on client ID. <tt class="docutils literal"><span class="pre">FcfsArbiterC</span></tt>
-provides a FIFO order, where requests are serviced in the order they
-are received. <tt class="docutils literal"><span class="pre">FcfsPriorityArbiterC</span></tt> is similar to FcfsArbiterC, but
-provides an additional ResourceController interface for the
-high-priority client.</p>
+<p>The &quot;Simple&quot; arbiters are intended for use by resources that
+do not require the additional overhead incurred by providing the
+ResourceController interface.</p>
+<p>For many situations, changing an arbitration policy requires nothing
+more than changing the queuing policy it uses to decide the order in
+which incoming requests should be granted. In this way, separating
+queuing policy implementations from actual arbitration implementations
+encourages code reuse.  The introduction of the SimpleArbiterP and
+ArbiterP components found under tinyos-2.x/tos/system help in this
+separation.  They can be wired to components providing
+a particular queuing policy through the use of the ResourceQueue
+interface.:</p>
+<pre class="literal-block">
+interface ResourceQueue {
+  async command bool isEmpty();
+  async command bool isEnqueued(resource_client_id_t id);
+  async command resource_client_id_t dequeue();
+  async command error_t enqueue(resource_client_id_t id);
+}
+</pre>
+<p>An example of wiring a First-Come-First-Serve (FCFS) queuing policy to
+the SimpleArbiterP component using the ResourceQueue interface
+defined above can be seen below:</p>
+<pre class="literal-block">
+generic configuration SimpleFcfsArbiterC(char resourceName[]) {
+  provides {
+    interface Resource[uint8_t id];
+    interface ResourceRequested[uint8_t id];
+    interface ArbiterInfo;
+  }
+  uses interface ResourceConfigure[uint8_t id];
+}
+implementation {
+  components MainC;
+  components new FcfsResourceQueueC(uniqueCount(resourceName)) as Queue;
+  components new SimpleArbiterP() as Arbiter;
+
+  MainC.SoftwareInit -&gt; Queue;
+
+  Resource = Arbiter;
+  ResourceRequested = Arbiter;
+  ArbiterInfo = Arbiter;
+  ResourceConfigure = Arbiter;
+
+  Arbiter.Queue -&gt; Queue;
+}
+</pre>
+<p>This generic configuration can instantiated by a resource in order
+to grant requests made by its clients in an FCFS fashion.</p>
+<p>All of the default queuing policies provided in tinyos-2.x along with the
+respective arbitration components that have been built using them are
+given below:</p>
+<blockquote>
+<p>Queuing Policies:
+- FcfsResourceQueueC
+- RoundRobinResourceQueueC</p>
+<p>Arbiters:
+- SimpleFcfsArbiterC
+- FcfsArbiterC
+- SimpleRoundRobinArbiterC
+- RoundRobinArbiterC</p>
+</blockquote>
 </div>
 <div class="section">
-<h1><a id="author-s-address" name="author-s-address">5. Author's Address</a></h1>
+<h1><a id="author-s-address" name="author-s-address">6. Author's Address</a></h1>
 <div class="line-block">
 <div class="line">Kevin Klues</div>
 <div class="line">503 Bryan Hall</div>
@@ -783,7 +862,6 @@ high-priority client.</p>
 <div class="line">phone - +1 510 643 7572</div>
 <div class="line">email - <a class="reference" href="mailto:culler&#64;cs.berkeley.edu">culler&#64;cs.berkeley.edu</a></div>
 <div class="line"><br /></div>
-<div class="line"><br /></div>
 <div class="line">Vlado Handziski</div>
 <div class="line">Sekr FT5</div>
 <div class="line">Einsteinufer 25</div>
@@ -794,26 +872,394 @@ high-priority client.</p>
 </div>
 </div>
 <div class="section">
-<h1><a id="citations" name="citations">6. Citations</a></h1>
-<table class="docutils footnote" frame="void" id="id7" rules="none">
+<h1><a id="citations" name="citations">7. Citations</a></h1>
+<table class="docutils footnote" frame="void" id="id4" rules="none">
 <colgroup><col class="label" /><col /></colgroup>
 <tbody valign="top">
-<tr><td class="label"><a class="fn-backref" href="#id2" name="id7">[1]</a></td><td>TEP 2: Hardware Abstraction Architecture.</td></tr>
+<tr><td class="label"><a class="fn-backref" href="#id1" name="id4">[1]</a></td><td>TEP 2: Hardware Abstraction Architecture.</td></tr>
 </tbody>
 </table>
-<table class="docutils footnote" frame="void" id="id8" rules="none">
+<table class="docutils footnote" frame="void" id="id5" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id10" name="id5">[2]</a></td><td>TEP 102: Timers.</td></tr>
+</tbody>
+</table>
+<table class="docutils footnote" frame="void" id="id6" rules="none">
 <colgroup><col class="label" /><col /></colgroup>
 <tbody valign="top">
-<tr><td class="label"><a name="id8">[2]</a></td><td><em>(<a class="fn-backref" href="#id3">1</a>, <a class="fn-backref" href="#id5">2</a>)</em> TEP 102: Timers.</td></tr>
+<tr><td class="label"><a class="fn-backref" href="#id2" name="id6">[3]</a></td><td>Service Instance Pattern. In <em>Software Design Patterns for TinyOS.</em> David Gay, Philip Levis, and David Culler. Published in Proceedings of the ACM SIGPLAN/SIGBED 2005 Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES'05).</td></tr>
 </tbody>
 </table>
-<table class="docutils footnote" frame="void" id="id9" rules="none">
+<table class="docutils footnote" frame="void" id="id7" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id3" name="id7">[4]</a></td><td>TEP 115: Power Management of Non-Virtualized Devices.</td></tr>
+</tbody>
+</table>
+<table class="docutils footnote" frame="void" id="id8" rules="none">
 <colgroup><col class="label" /><col /></colgroup>
 <tbody valign="top">
-<tr><td class="label"><a name="id9">[3]</a></td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id4">2</a>, <a class="fn-backref" href="#id6">3</a>)</em> Service Instance Pattern. In <em>Software Design Patterns for TinyOS.</em> David Gay, Philip Levis, and David Culler. Published in Proceedings of the ACM SIGPLAN/SIGBED 2005 Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES'05).</td></tr>
+<tr><td class="label"><a class="fn-backref" href="#id9" name="id8">[5]</a></td><td>TinyOS Programming. <a class="reference" href="http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf">http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf</a></td></tr>
 </tbody>
 </table>
 </div>
+<div class="section">
+<h1><a id="appendix-a-resource-class-examples" name="appendix-a-resource-class-examples">Appendix A: Resource Class Examples</a></h1>
+<div class="section">
+<h2><a id="dedicated-resource" name="dedicated-resource">Dedicated Resource</a></h2>
+<p>Timer 2 on the Atmega128 microprocessor is a dedicated resource
+represented by the HplAtm128Timer2C component:</p>
+<pre class="literal-block">
+module HplAtm128Timer2C {
+  provides {
+    interface HplTimer&lt;uint8_t&gt;   as Timer2     &#64;exactlyonce();
+    interface HplTimerCtrl8       as Timer2Ctrl &#64;exactlyonce();
+    interface HplCompare&lt;uint8_t&gt; as Compare2   &#64;exactlyonce();
+  }
+}
+</pre>
+<p>Only a single client can wire to any of these interfaces as enforced through
+the nesC &#64;exactlyonce attribute.  Keep in mind that although the interfaces of
+this component are only allowed to be wired to once, nothing prevents the
+component wiring to them from virtualizing the services they provide at some
+higher level.  If you are unfamiliar with how &#64;exactlyonce and other nesC
+attributes are used to by the nesC compiler, please refer to section 9.1 of the
+TinyOS Programming Manual <a class="footnote-reference" href="#id8" id="id9" name="id9">[5]</a>.</p>
+</div>
+<div class="section">
+<h2><a id="virtualized-resource" name="virtualized-resource">Virtualized Resource</a></h2>
+<p>The TimerMilliC component provides a virtual abstraction of millisecond
+precision timers to application components <a class="footnote-reference" href="#id5" id="id10" name="id10">[2]</a>. It encapsulates the required
+parameterized Timer interface through the use of a generic configuration.
+Clients wishing to use a millisecond timer need only instantiate a single
+instance of the TimerMilliC generic, leaving the fact that it is virtualized
+underneath transparent.:</p>
+<pre class="literal-block">
+generic configuration TimerMilliC {
+  provides interface Timer&lt;TMilli&gt;;
+}
+implementation {
+  components TimerMilliP;
+  Timer = TimerMilliP.TimerMilli[unique(UQ_TIMER_MILLI)];
+}
+</pre>
+<p>The actual parameterized Timer interface is provided by the chip specific
+HilTimerMilliC component.  This interface is exposed through
+the TimerMilliP component which wires HilTimerMilliC to the boot
+initialization sequence:</p>
+<pre class="literal-block">
+configuration TimerMilliP {
+  provides interface Timer&lt;TMilli&gt; as TimerMilli[uint8_t num];
+}
+implementation {
+  components HilTimerMilliC, MainC;
+  MainC.SoftwareInit -&gt; HilTimerMilliC;
+  TimerMilli = HilTimerMilliC;
+}
+</pre>
+</div>
+</div>
+<div class="section">
+<h1><a id="appendix-b-arbiter-interface-examples" name="appendix-b-arbiter-interface-examples">Appendix B: Arbiter Interface Examples</a></h1>
+<!-- Note:
+Most of the examples provided in this section use complex nesC syntax that may
+be unfamiliar to the novice nesC programmer.  Please refer to the TinyOS
+programming Manual [5]_ for clarification as necessary. -->
+<div class="section">
+<h2><a id="id11" name="id11">Resource</a></h2>
+<p>Examples of how to use the Resource interface for arbitrating
+between multiple clients can be found in the tinyos-2.x
+source tree under tinyos-2.x/apps/tests/TestArbiter.</p>
+<p>A specific example of where the Resource.isOwner() is used
+can be seen in the HplTda5250DataP component of the Infineon
+Tda5250 radio implementation:</p>
+<pre class="literal-block">
+async command error_t HplTda5250Data.tx(uint8_t data) {
+  if(call UartResource.isOwner() == FALSE)
+    return FAIL;
+  call Usart.tx(data);
+  return SUCCESS;
+}
+</pre>
+<p>A call to the HplTda5250Data.tx command will fail if the radio does
+not currently have control of the underlying Usart resource.  If it
+does, then the Usart.tx(data) command is called as requested.</p>
+<p>A component using the Resource interface to implement an I2C
+service might look like this:</p>
+<pre class="literal-block">
+#include I2CPacket.h
+configuration I2CPacketP {
+  provides interface Resource[uint8_t client];
+  provides interface I2CPacket&lt;I2CAddrSize&gt;[uint8_t client];
+}
+implementation {
+  components new FcfsArbiterC(I2CPACKET_RESOURCE) as Arbiter;
+  components I2CPacketImplP() as I2C;
+  ...
+
+  Resource  = Arbiter;
+  I2CPacket = I2C;
+  ...
+}
+</pre>
+<p>where I2CPacketImplP contains the actual implementation of the
+I2C service, and I2CPacket.h contains the #define for the
+name of the resource required by the arbiter:</p>
+<pre class="literal-block">
+#ifndef I2CPACKETC_H
+#define I2CPACKETC_H
+#define I2CPACKET_RESOURCE &quot;I2CPacket.Resource&quot;
+#endif
+</pre>
+<p>This service would then be made available to a user through
+the generic configuration seen below:</p>
+<pre class="literal-block">
+#include I2CPacket.h
+generic configuration I2CPacketC {
+  provides interface Resource;
+  provides interface I2CPacket&lt;I2CAddrSize&gt;;
+}
+implementation {
+  enum { CLIENT_ID = unique(I2CPACKET_RESOURCE) };
+
+  components I2CPacketP as I2C;
+  Resource = I2C.Resource[CLIENT_ID];
+  I2CPacket = I2C.I2CPacket[CLIENT_ID];
+}
+</pre>
+<p>In this example, an instance of the I2CPacket interface is coupled with
+an instance of the Resource interface on every new instantiation of
+the I2CPacketC component.  In this way, a single Resource and a
+single I2CPacket interface can be exported by this component together
+for use by a client.</p>
+<p>Clients of the I2C service would use it as follows:</p>
+<pre class="literal-block">
+module I2CClientP {
+  uses interface Resource as I2CResource;
+  uses interface I2CPacket&lt;I2CAddrSize&gt;;
+} ...
+
+configuration I2CClientC { }
+implementation {
+  components I2CClientP, new I2CPacketC();
+
+  I2CClientP.I2CResource -&gt; I2CPacketC.Resource;
+  I2CUserM.I2CPacket -&gt; I2CPacket.I2CPacket;
+}
+</pre>
+</div>
+<div class="section">
+<h2><a id="id12" name="id12">ArbiterInfo</a></h2>
+<p>In the implementation of the ADC component on the Msp430 microcontroller,
+a simple arbiter is used to provide a round robin sharing policy
+between clients of the ADC:</p>
+<pre class="literal-block">
+configuration Msp430Adc12C {
+  provides interface Resource[uint8_t id];
+  provides interface Msp430Adc12SingleChannel[uint8_t id];
+  provides interface Msp430Adc12FastSingleChannel[uint8_t id];
+}
+implementation {
+  components Msp430Adc12P,MainC,
+             new SimpleRoundRobinArbiterC(MSP430ADC12_RESOURCE) as Arbiter,
+             ...
+
+  Resource = Arbiter;
+  SingleChannel = Msp430Adc12P.SingleChannel;
+  FastSingleChannel = Msp430Adc12P.FastSingleChannel;
+
+  Msp430Adc12P.Init &lt;- MainC;
+  Msp430Adc12P.ADCArbiterInfo -&gt; Arbiter;
+  ...
+}
+</pre>
+<p>In this configuration we see that the Resource interface provided by
+Msp430Adc12C is wired directly to the instance of the SimpleRoundRobinArbiterC
+component that is created.  The ArbiterInfo interface provided by
+SimpleRoundRobinArbiterC is then wired to Msp430Adc12P.  The Msp430Adc12P
+component then uses this interface to perform run time checks to ensure that
+only the client that currently has access to the ADC resource is able to
+use it:</p>
+<pre class="literal-block">
+async command error_t Msp430Adc12SingleChannel.getSingleData[uint8_t id]() {
+  if (call ADCArbiterInfo.userId() == id){
+    configureChannel()
+    // Start getting data
+  }
+  else return ERESERVE;
+}
+
+async command error_t Msp430Adc12FastSingleChannel.configure[uint8_t id]() {
+  if (call ADCArbiterInfo.userId() == id){
+    clientID = id
+    configureChannel()
+  }
+  else return ERESERVE;
+}
+
+async command error_t Msp430Adc12FastSingleChannel.getSingleData[uint8_t id]()
+{
+  if (clientID = id)
+    // Start getting data
+  else return ERESERVE;
+}
+</pre>
+<p>In order for these runtime checks to succeed, users of the
+Msp430Adc12SingleChannel and Msp430Adc12FastSingleChannel interfaces will have
+to match their client id's with the client id of a corresponding Resource
+interface.  This can be done in the following way:</p>
+<pre class="literal-block">
+generic configuration Msp430Adc12ClientC() {
+  provides interface Resource;
+  provides interface Msp430Adc12SingleChannel;
+}
+implementation {
+  components Msp430Adc12C;
+  enum { ID = unique(MSP430ADC12_RESOURCE) };
+
+  Resource = Msp430Adc12C.Resource[ID];
+  Msp430Adc12SingleChannel = Msp430Adc12C.SingleChannel[ID];
+}
+</pre>
+<pre class="literal-block">
+generic configuration Msp430Adc12FastClientC() {
+  provides interface Resource;
+  provides interface Msp430Adc12FastSingleChannel;
+}
+implementation {
+  components Msp430Adc12C;
+  enum { ID = unique(MSP430ADC12_RESOURCE) };
+
+  Resource = Msp430Adc12C.Resource[ID];
+  Msp430Adc12FastSingleChannel = Msp430Adc12C.SingleChannel[ID];
+}
+</pre>
+<p>Since these are generic components, users simply need to instantiate them
+in order to get access to a single Resource interface that is already
+properly coupled with a Msp430Adc12SingleChannel or Msp430Adc12FastSingleChannel
+interface.</p>
+<p>Take a look in the tinyos-2.x source tree under tinyos-2.x/tos/chips/adc12
+to see the full implementation of these components in their original context.</p>
+</div>
+<div class="section">
+<h2><a id="id13" name="id13">ResourceRequested</a></h2>
+<p>On the eyesIFXv2 platform, both the radio and the flash need access to the bus
+provided by the Usart0 component on the Msp430 microcontroller.  Using
+a simple cooperative arbitration policy, these two components should able to
+share the Usart resource by only holding on to it as long as they need it and
+then releasing it for use by the other component.  In the case of the MAC
+implementation of the Tda5250 radio component, however, the Msp430 Usart
+resource needs be held onto indefinitely.  It only ever considers releasing the
+resource if a request from the flash component comes in through its
+ResourceRequested interface.  If it cannot release it right away (i.e. it is in
+the middle of receiving a packet), it defers the release until some later point
+in time.  Once it is ready to release the resource, it releases it, but then
+immediately requests it again.  The flash is then able to do what it wants with
+the Usart, with the radio regaining control soon thereafter.</p>
+<p>In the CsmaMacP implementation of the Tda5250 radio we see the ResourceRequested
+event being implemented:</p>
+<pre class="literal-block">
+async event void ResourceRequested.requested() {
+  atomic {
+    /* This gives other devices the chance to get the Resource
+       because RxMode implies a new arbitration round.  */
+    if (macState == RX) call Tda5250Control.RxMode()();
+  }
+}
+</pre>
+<p>Through several levels of wiring, the Tda5250 interface is provided to this
+component by the Tda5250RadioP component:</p>
+<pre class="literal-block">
+module Tda5250RadioP {
+  provides interface Tda5250Control;
+  uses interface Resource as UsartResource;
+  ...
+}
+implementation {
+  async command error_t Tda5250Control.RxMode() {
+    if(radioBusy() == FALSE)
+      call UsartResource.release();
+      call UsartResource.request();
+  }
+  event void UsartResource.granted() {
+    // Finish setting to RX Mode
+  }
+  ...
+}
+</pre>
+<p>Although the full implementation of these components is not provided, the
+functionality they exhibit should be clear.  The CsmaMacP component receives the
+ResourceRequested.requested() event when the flash requests the use of the
+Msp430 Usart0 resource.  If it is already in the receive state, it tries to
+reset the receive state through a call to a lower level component.  This
+component checks to see if the radio is in the middle of doing anything (i.e.
+the radioBusy() == FALSE check), and if not, releases the resource and then
+requests it again.</p>
+<p>To see the full implementations of these components and their wirings to one
+another, please refer to the tinyos-2.x source tree under
+tinyos-2.x/tos/chips/tda5250, tinyos-2.x/tos/chips/tda5250/mac,
+tinyos-2.x/tos/platforms/eyesIFX/chips/tda5250, and
+tinyos-2.x/tos/platforms/eyesIFX/chips/msp430.</p>
+</div>
+<div class="section">
+<h2><a id="resource-configure" name="resource-configure">Resource Configure</a></h2>
+<p>The Msp430 Usart0 bus can operate in three modes: SPI, I2C,
+and UART. Using all three concurrently is problematic: only one should
+be enabled at any given time. However, different clients of the bus might
+require the bus to be configured for different protocols. On Telos, for example
+many of the available sensors use an I2C bus, while the radio and flash chip use
+SPI.</p>
+<p>A component providing the SPI service on top of the shared Usart component looks
+like this:</p>
+<pre class="literal-block">
+generic configuration Msp430Spi0C() {
+  provides interface Resource;
+  provides interface SpiByte;
+  provides interface SpiPacket;
+  ...
+}
+implementation {
+  enum { CLIENT_ID = unique( MSP430_SPIO_BUS ) };
+
+  components Msp430SpiNoDma0P as SpiP;
+  components new Msp430Usart0C() as UsartC;
+  SpiP.ResourceConfigure[ CLIENT_ID ] &lt;- UsartC.ResourceConfigure;
+  SpiP.UsartResource[ CLIENT_ID ] -&gt; UsartC.Resource;
+  SpiP.UsartInterrupts -&gt; UsartC.HplMsp430UsartInterrupts;
+  ...
+}
+</pre>
+<p>And one providing the I2C service looks like this:</p>
+<pre class="literal-block">
+generic configuration Msp430I2CC() {
+  provides interface Resource;
+  provides interface I2CPacket&lt;TI2CBasicAddr&gt; as I2CBasicAddr;
+   ...
+}
+implementation {
+  enum { CLIENT_ID = unique( MSP430_I2CO_BUS ) };
+
+   components Msp430I2C0P as I2CP;
+   components new Msp430Usart0C() as UsartC;
+   I2CP.ResourceConfigure[ CLIENT_ID ] &lt;- UsartC.ResourceConfigure;
+   I2CP.UsartResource[ CLIENT_ID ] -&gt; UsartC.Resource;
+   I2CP.I2CInterrupts -&gt; UsartC.HplMsp430UsartInterrupts;
+   ...
+}
+</pre>
+<p>The implementation of the ResourceConfigure interface is
+provided by both the Msp430SpiNoDma0P and the Msp430I2C0P.  In the
+two different components, the same Msp430Usart0C component is used,
+but wired to the proper implementation of the ResourceConfigure
+interface. In this way, different instances of the Msp430Usart0C
+can each have different configurations associated with them, but
+still provide the same functionality.</p>
+<p>Take a look in the tinyos-2.x source tree under
+tinyos-2.x/tos/chips/msp430/usart to see the full implementation of
+these components along with the corresponding Uart implementation.</p>
+</div>
+</div>
 </div>
 </body>
 </html>
index dad85f80919885ffe913a1c68f4ae742b08371c9..ac263e9b3015ea2fb9ca8e668fb566dac5878109 100644 (file)
@@ -4,8 +4,8 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
-<title>Sensor Boards</title>
-<meta name="author" content="David Gay, Phil Levis, Wei Hong, and Joe Polastre" />
+<title>Sensors and Sensor Boards</title>
+<meta name="author" content="David Gay, Phil Levis, Wei Hong, Joe Polastre, and Gilman Tolle" />
 <style type="text/css">
 
 /*
@@ -283,8 +283,8 @@ ul.auto-toc {
 </style>
 </head>
 <body>
-<div class="document" id="sensor-boards">
-<h1 class="title">Sensor Boards</h1>
+<div class="document" id="sensors-and-sensor-boards">
+<h1 class="title">Sensors and Sensor Boards</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -300,12 +300,8 @@ ul.auto-toc {
 <tr class="field"><th class="docinfo-name">TinyOS-Version:</th><td class="field-body">2.x</td>
 </tr>
 <tr><th class="docinfo-name">Author:</th>
-<td>David Gay, Phil Levis, Wei Hong, and Joe Polastre</td></tr>
-<tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">19-Apr-2005</td>
-</tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.1</td>
-</tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2005-10-31</td>
+<td>David Gay, Phil Levis, Wei Hong, Joe Polastre, and Gilman Tolle</td></tr>
+<tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">10-Jun-2006</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
@@ -320,262 +316,281 @@ TEP 1.</p>
 </div>
 <div class="section">
 <h1><a id="abstract" name="abstract">Abstract</a></h1>
-<p>This memo documents how sensor boards are organized in TinyOS, and the
-general principles followed by the components that provide access to
-its sensors.</p>
+<p>This memo documents how sensor drivers are organized in TinyOS and how
+sets of sensor drivers are combined into sensor boards and sensor
+platforms, along with general principles followed by the components
+that provide access to sensors.</p>
 </div>
 <div class="section">
-<h1><a id="introduction" name="introduction">1. Introduction</a></h1>
-<p>This document defines the default organization of a sensor board in
-TinyOS. There likely will be sensor boards that cannot conform
-to this specification, but following as closely to its spirit as possible
-will simplify generic applications that use a range of sensor boards.</p>
-<p>This document assumes that sensors return uninterpreted 16-bit values, and,
-optionally uninterpreted, arbitrary-size calibration data. Conversion of
-sensor values to something with actual physical meaning is beyond the
-scope of this document.</p>
-</div>
-<div class="section">
-<h1><a id="directory-organization" name="directory-organization">2. Directory Organization</a></h1>
+<h1><a id="principles" name="principles">1. Principles</a></h1>
+<p>This section describes the basic organization principles for sensor
+drivers in TinyOS.</p>
+<p>For background, a sensor may be attached to the microcontroller on a
+TinyOS platform through a few different types of connections:</p>
+<blockquote>
 <ul class="simple">
-<li>A sensor board MUST have a unique name, composed of letters, numbers
-and underscores. Case is significant, but two sensor boards MUST
-differ in more than case. This is necessary to support platforms where
-filename case differences are not significant. We will use SBOARD to
-denote the sensor board name in the rest of this document.</li>
-<li>Each sensor board MUST have its own directory named SBOARD; default TinyOS
-sensor boards are placed in tinyos-2.x/tos/sensorboards, but
-sensor board directories can be placed anywhere as long as the nesC compiler
-receives a <cite>-I</cite> directive pointing to the sensor board's directory.</li>
-<li>Each sensor board directory MUST contain a <cite>.sensor</cite> file. This file
-is a perl script which contains any additional compiler settings needed for
-this sensor board (this file will be empty in many cases).</li>
-<li>If the sensor board wishes to define any C types or constants, it SHOULD
-place these in a file named SBOARD.h in the sensor board's directory.</li>
-<li>The sensor board directory SHOULD contain sensor board components
-for accessing each sensor on the sensor board. The conventions for these
-components are detailed in Section 3.</li>
-<li>A sensor board MAY include additional components providing alternative or
-higher-level interfaces to the sensors (e.g., for TinyDB). These components
-are beyond the scope of this document.</li>
-<li>Finally, the sensor board MAY contain any number of components,
-interfaces, C files, etc for internal use. To avoid name collisions, all
-externally visible names (interface types, components, C constants and
-types) used for internal purposes SHOULD be prefixed with SBOARD. All such
-components should end in P.</li>
+<li>Included within the microcontroller itself</li>
+<li>Connected to general-purpose IO pins for level/edge detection</li>
+<li>Connected to an ADC in the microcontroller for voltage sampling</li>
+<li>Connected to general-purpose IO pins for digital communication</li>
+<li>Connected through a standard digital bus protocol (1-Wire, I2C, SPI)</li>
 </ul>
-<p>A simple example: the basic sensor board is named <cite>basicsb</cite>, it's directory
-is <cite>tinyos-2.x/tos/sensorboards/basicsb</cite>. It has no <cite>basicsb.h</cite> file and
-its <cite>.sensor</cite> file is empty. It has two components, <cite>PhotoC</cite> and <cite>TempC</cite>
-representing its light and temperature sensors.</p>
+</blockquote>
+<p>Physically, these connections may also be decoupled by attaching the
+sensors to a <cite>sensor board</cite>, which can be removed from the TinyOS
+platform, and may fit multiple different TinyOS platforms.</p>
+<p>The capabilities of a physical sensor are made available to a TinyOS
+application through a <cite>sensor driver</cite>.</p>
+<p>According to the HAA <a class="citation-reference" href="#tep2" id="id1" name="id1">[TEP2]</a>, TinyOS devices should provide both
+simple hardware-independent interfaces for common-case use (HIL) and
+rich hardware-dependent interfaces for special-case use (HAL). Sensor
+drivers should follow this spirit as well.</p>
+<p>TinyOS 2.x represents each sensor as an individual component. This
+allows the compilation process to minimize the amount of code
+included. A sensor board containing multiple sensors should be
+represented as a collection of components, one for each sensor,
+contained within a sensor board directory.</p>
+<p>Sensors, being physical devices that may be shared, can benefit from
+virtualization and arbitration. This document describes a design
+pattern for sensor virtualization that may be followed by sensor
+drivers.</p>
+<p>The same physical sensor may be attached to multiple different TinyOS
+platforms, through platform-dependent interconnections. The common
+logic of sensor driver should be factored into chip-dependent,
+platform-independent components, and those components should be bound
+to the hardware resources on a platform by platform-dependent
+components, and to the hardware resources on a sensor board by
+sensorboard-dependent components.</p>
+<p>A physical sensor has a general class and a specific set of
+performance characteristics, captured by the make and model of the
+sensor itself. The naming of the sensor driver components should
+reflect the specifc name of the sensor, and optionally provide a
+component with a generic name for application authors who only care
+about the general class of the sensor.</p>
+<p>This document assumes that sensors return uninterpreted values of
+arbitrary size or datatype. Conversion of sensor values to something
+with actual physical meaning is beyond the scope of this document.</p>
 </div>
 <div class="section">
-<h1><a id="sensor-board-components" name="sensor-board-components">3. Sensor Board Components</a></h1>
-<p>We have not yet selected any naming conventions for sensor board
-components. Please select reasonable namesldots</p>
-<p>A sensor board component MUST provide:</p>
+<h1><a id="sensor-hil-components" name="sensor-hil-components">2. Sensor HIL Components</a></h1>
+<p>A sensor HIL component MUST provide:</p>
 <ul class="simple">
-<li>An <cite>Init</cite> interface.</li>
-<li>A <cite>StdControl</cite> or <cite>SplitControl</cite> interface for power management.</li>
-<li>A non-empty set of <cite>AcquireData</cite> interfaces for sampling.</li>
+<li>One or more SID interfaces <a class="citation-reference" href="#tep114" id="id2" name="id2">[TEP114]</a>, for reading data.</li>
 </ul>
-<p>A sensor board component MAY provide:</p>
+<p>A sensor HIL component MAY provide:</p>
 <ul class="simple">
-<li>Some <cite>CalibrationData</cite> interfaces for obtaining calibration data.
-A calibration interface for a sensor accessed via interface X should
-be called XCalibration.</li>
-<li>Some <cite>AcquireDataNow</cite> and <cite>AcquireDataBuffered</cite> interfaces, for high-speed
-or low-latency data acquisition.</li>
-<li>Any other appropriate interface.</li>
+<li>One or more SID interfaces <a class="citation-reference" href="#tep114" id="id3" name="id3">[TEP114]</a>, for reading or
+writing calibration coefficients or control registers.</li>
 </ul>
-<p>The <cite>CalibrationData</cite> interface is shown below, while <cite>AcquireData</cite>,
-<cite>AcquireDataNow</cite> and <cite>AcquireDataBuffered</cite> are in TEP 101. The
-<cite>AcquireData</cite> interface returns uinterpreted 16-bit data. This might
-represent an A/D conversion result, a counter, etc. The optional
-calibration interface returns uninterpreted, arbitrary-size data.</p>
-<p>A sensor board component SHOULD be as lightweight as possible - it should
-just provide basic access to the physical sensors and SHOULD NOT attempt to do
-calibration, signal processing, etc. If such functionality is desired, it
-SHOULD be provided in separate components.</p>
-<div class="line-block">
-<div class="line-block">
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">CalibrationData</span> <span class="pre">{</span></tt></div>
-<div class="line-block">
-<div class="line-block">
-<div class="line"><tt class="docutils literal"><span class="pre">/*</span> <span class="pre">Collect</span> <span class="pre">uninterpreted</span> <span class="pre">calibration</span> <span class="pre">data</span> <span class="pre">from</span> <span class="pre">a</span> <span class="pre">sensor</span> <span class="pre">*/</span></tt></div>
-<div class="line"><br /></div>
-<div class="line"><tt class="docutils literal"><span class="pre">/**</span> <span class="pre">Request</span> <span class="pre">calibration</span> <span class="pre">data</span></tt></div>
-<div class="line-block">
-<div class="line"><tt class="docutils literal"><span class="pre">*</span>&nbsp; <span class="pre">&#64;return</span> <span class="pre">SUCCESS</span> <span class="pre">if</span> <span class="pre">request</span> <span class="pre">accepted,</span> <span class="pre">FAIL</span> <span class="pre">if</span> <span class="pre">it</span> <span class="pre">is</span> <span class="pre">refused</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">*</span>&nbsp;&nbsp;&nbsp; <span class="pre">data</span> <span class="pre">error</span> <span class="pre">will</span> <span class="pre">be</span> <span class="pre">signaled</span> <span class="pre">if</span> <span class="pre">SUCCESS</span> <span class="pre">is</span> <span class="pre">returned</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">*/</span></tt></div>
-</div>
-<div class="line"><tt class="docutils literal"><span class="pre">command</span> <span class="pre">result_t</span> <span class="pre">get();</span></tt></div>
-<div class="line"><br /></div>
-</div>
-<div class="line"><tt class="docutils literal"><span class="pre">/**</span> <span class="pre">Returns</span> <span class="pre">calibration</span> <span class="pre">data</span></tt></div>
-<div class="line-block">
-<div class="line"><tt class="docutils literal"><span class="pre">*</span> <span class="pre">&#64;param</span> <span class="pre">x</span> <span class="pre">Pointer</span> <span class="pre">to</span> <span class="pre">(uinterpreted)</span> <span class="pre">calibration</span> <span class="pre">data.</span> <span class="pre">This</span> <span class="pre">data</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">*</span>&nbsp;&nbsp; <span class="pre">must</span> <span class="pre">not</span> <span class="pre">be</span> <span class="pre">modified.</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">*</span> <span class="pre">&#64;param</span> <span class="pre">len</span> <span class="pre">Length</span> <span class="pre">of</span> <span class="pre">calibration</span> <span class="pre">data</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">*</span> <span class="pre">&#64;return</span> <span class="pre">Ignored.</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">*/</span></tt></div>
-</div>
-<div class="line"><tt class="docutils literal"><span class="pre">event</span> <span class="pre">result_t</span> <span class="pre">data(const</span> <span class="pre">void</span> <span class="pre">*x,</span> <span class="pre">uint8_t</span> <span class="pre">len);</span></tt></div>
-</div>
-</div>
-<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
+<p>A sensor device driver SHOULD be a generic component that virtualizes
+access to the sensor. A sensor device driver can provide such
+virtualization for itself by defining a nesC generic client
+component. When a client component is being used, a call to a
+top-level SID interface should be delayed when the device is busy,
+rather than failing. This virtualization may be easier to accomplish
+by using one of the arbiters provided by the system.</p>
+<p>For example:</p>
+<pre class="literal-block">
+generic configuration SensirionSht11C() {
+  provides interface Read&lt;uint16_t&gt; as Temperature;
+  provides interface ReadStream&lt;uint16_t&gt; as TemperatureStream;
+  provides interface Read&lt;uint16_t&gt; as Humidity;
+  provides interface ReadStream&lt;uint16_t&gt; as HumidityStream;
+}
+implementation {
+  // connect to the ADC HIL, GPIO HAL, or sensor's HAL
+}
+</pre>
+<p>When a HIL component is being used, the sensor MUST initialize itself,
+either by including the <cite>MainC</cite> component and wiring to the
+<cite>SoftwareInit</cite> interface, or by allowing a lower-level component (like
+an ADC) to initialize itself.</p>
+<p>In addition, the HIL sensor driver MUST start the physical sensor
+automatically. For sensors without a constant power draw, the sensor
+MAY be started once at boot time by wiring to the <cite>MainC.Boot</cite>
+interface. Sensors that draw appreciable power MUST be started in
+response to a call to one of the top-level SID interfaces, and stopped
+some time after that call completes. One of the power-management
+components described in <a class="citation-reference" href="#tep115" id="id4" name="id4">[TEP115]</a> may be useful for this purpose.</p>
+<p>Generally, simple types are made up of octets. However, sensor values
+often have levels of precision besides a multiple of 8. A device MAY
+specify the precision of one of its interfaces with the DeviceMetadata
+interface:</p>
+<pre class="literal-block">
+interface DeviceMetadata {
+  command uint8_t getSignificantBits();
+}
+</pre>
+<p>The name of the instance of DeviceMetadata SHOULD clearly indicate
+which interface it corresponds to.</p>
+<p>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>Sensor driver components SHOULD be named according to the make and
+model of the sensing device being presented. Using specific names
+gives the developer the option to bind to a particular sensor, which
+provides compile-time detection of missing sensors. However, wrapper
+components using &quot;common&quot; names MAY also be provided by the driver
+author, to support application developers who are only concerned with
+the particular type of the sensor and not its make, model, or detailed
+performance characteristics.</p>
+<p>A &quot;common&quot; naming layer atop a HIL may look like this:</p>
+<pre class="literal-block">
+generic configuration TemperatureC() {
+  provides interface Read&lt;uint16_t&gt;;
+  provides interface ReadStream&lt;uint16_t&gt;;
+}
+implementation {
+  components new SensirionSht11C();
+  Read = SensirionSht11C.Temperature;
+  ReadStream = SensirionSht11C.TemperatureStream;
+}
+
+generic configuration HumidityC() {
+  provides interface Read&lt;uint16_t&gt;;
+  provides interface ReadStream&lt;uint16_t&gt;;
+}
+implementation {
+  components new SensirionSht11C();
+  Read = SensirionSht11C.Humidity;
+  ReadStream = SensirionSht11C.HumidityStream;
+}
+</pre>
 </div>
-<p>Some common setups for sensor board components are:</p>
+<div class="section">
+<h1><a id="sensor-hal-components" name="sensor-hal-components">3. Sensor HAL Components</a></h1>
+<p>Sensors with a richer interface than would be supported by the SID
+interfaces MAY provide a HAL component in addition to a HIL
+component.</p>
+<p>A sensor HAL component MUST provide:</p>
 <ul class="simple">
-<li>A single <cite>AcquireData</cite> interface. This is probably the most common case,
-where a single component corresponds to a single physical sensor, e.g., for
-light, temperature, pressure and there is no expectation of high sample
-rates.</li>
-<li>Multiple <cite>AcquireData</cite> interfaces. Some sensors might be strongly
-related, e.g., the axes of an accelerometer.  A single component could then
-provide a sensor interface for each axis. For instance, a 2-axis
-accelerometer which can be sampled at high speed, and which has some
-calibration data might be declared with:</li>
+<li>A SID-based interface or a specific hardware-dependent interface
+with commands for sampling and controlling the sensor device.</li>
 </ul>
-<div class="line-block">
-<div class="line"><tt class="docutils literal"><span class="pre">configuration</span> <span class="pre">Accelerometer2D</span> <span class="pre">{</span></tt></div>
-<div class="line-block">
-<div class="line"><tt class="docutils literal"><span class="pre">provides</span> <span class="pre">{</span></tt></div>
-<div class="line-block">
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">StdControl</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">AcquireData</span> <span class="pre">as</span> <span class="pre">AccelX;</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">AcquireDataNow</span> <span class="pre">as</span> <span class="pre">AccelXSingle;</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">AcquireDataBuffered</span> <span class="pre">as</span> <span class="pre">AccelXMultiple;</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">CalibrationData</span> <span class="pre">as</span> <span class="pre">AccelXCalibration;</span></tt></div>
-<div class="line"><br /></div>
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">AcquireData</span> <span class="pre">as</span> <span class="pre">AccelY;</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">AcquireDataNow</span> <span class="pre">as</span> <span class="pre">AccelYSingle;</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">AcquireDataBuffered</span> <span class="pre">as</span> <span class="pre">AccelYMultiple;</span></tt></div>
-<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">CalibrationData</span> <span class="pre">as</span> <span class="pre">AccelYCalibration;</span></tt></div>
-</div>
-<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
-</div>
-<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
-</div>
+<p>A sensor HAL component MAY need to provide:</p>
 <ul class="simple">
-<li>A parameterised <cite>AcquireData</cite> interface. If a sensor board has multiple
-similar sensors, it may make sense to provide a single component to access
-all of these, using a parameterised <cite>AcquireData</cite> interface. For instance,
-a general purpose sensor board with multiple A/D channels might provide an
-<cite>AcquireData</cite> interface parameterised by the A/D channel id.</li>
-<li>In all of these examples, if high-speed sampling makes sensor for the
-sensor (e.g., a microphone), and the sensor is connected in a way that
-supports high-frequency and/or low-latency access (e.g., via an
-on-microcontroller A/D converter), the component should offer
-<cite>AcquireDataNow</cite> and <cite>AcquireDataBuffered</cite> interfaces.</li>
+<li>A <cite>StdControl</cite> or <cite>SplitControl</cite> interface for manual power
+management by the user, following the conventions described in
+<a class="citation-reference" href="#tep115" id="id5" name="id5">[TEP115]</a>.</li>
+<li>A Resource[] interface for requesting access to the device and
+possibly performing automated power management.</li>
+<li>Any other interfaces needed to control the device.</li>
 </ul>
-<p>Sensor board components MUST respect the following conventions
-on the use of the <cite>Init</cite>, <cite>StdControl</cite>,  and <cite>SplitControl</cite>
-interfaces.  These are given assuming <cite>StdControl</cite> is used, but the
-behaviour with <cite>SplitControl</cite> is identical except that <cite>start</cite> and <cite>stop</cite>
-are not considered complete until the <cite>startDone</cite> and <cite>stopDone</cite> events are
-signaled. The conventions are:</p>
-<ol class="arabic">
-<li><p class="first"><cite>Init.init</cite>: must be called at mote boot time.</p>
-</li>
-<li><dl class="first docutils">
-<dt><cite>StdControl.start</cite>: ensure the sensor corresponding to this component is</dt>
-<dd><p class="first">ready for use. For instance, this should power-up the sensor if
-necessary. The application can call <cite>getData</cite> once <cite>StdControl.start</cite>
-completes.</p>
-<p class="last">If a sensor takes a while to power-up, the sensor board implementer can
-either use a <cite>SplitControl</cite> interface and signal <cite>startDone</cite>
-when the sensor is ready for use, or delay <cite>dataReady</cite> events
-until the sensor is ready. The former choice is preferable.</p>
-</dd>
-</dl>
-</li>
-<li><p class="first"><cite>StdControl.stop</cite>: put the sensor in a low-power mode.
-<cite>StdControl.start</cite> must be called before any further readings
-are taken. The behaviour of calls to <cite>StdControl.stop</cite> during
-sampling (i.e., when an <cite>dataReady</cite> event is going to be
-signaled) is undefined.</p>
-</li>
-</ol>
+<p>For example:</p>
+<pre class="literal-block">
+configuration SensirionSht11DeviceC {
+  provides interface Resource[ uint8_t client ];
+  provides interface SensirionSht11[ uint8_t client ];
+}
+implementation {
+  // connect to the sensor's platform-dependent HPL here
+}
+</pre>
+</div>
+<div class="section">
+<h1><a id="sensor-hpl-components" name="sensor-hpl-components">4. Sensor HPL Components</a></h1>
+<p>A sensor HPL is necessarily platform-dependent or
+sensorboard-dependent. These components should provide access to the
+physical resources needed by the sensor, in a platform-independent
+manner that can be used by the shared logic of the sensor HAL
+components. In the case of bus-based sensors, this HPL may be nothing
+more than wiring to the appropriate bus interface for use by the HAL
+component.</p>
+<p>For example:</p>
+<pre class="literal-block">
+configuration HplSensirionSht11C {
+  provides interface Init;
+  provides interface Resource[ uint8_t id ];
+  provides interface GeneralIO as DATA;
+  provides interface GeneralIO as SCK;
+  provides interface GpioInterrupt as InterruptDATA;
+}
+implementation {
+  // connect to platform or sensorboard-dependent resources
+  // power-manage the sensor through platform-specific means
+}
+</pre>
 </div>
 <div class="section">
-<h1><a id="sensor-file" name="sensor-file"><cite>.sensor</cite> File</a></h1>
-<p>This file is a perl script which gets executed as part of the <cite>ncc</cite>
-nesC compiler frontend. It can add or modify any compile-time options
-necessary for a particular sensor board. It MAY modify the following perl
-variables, and MUST NOT modify any others:</p>
+<h1><a id="directory-organization-guidelines" name="directory-organization-guidelines">5. Directory Organization Guidelines</a></h1>
+<p>Because the same physical sensor may be attached to TinyOS platforms
+in many different ways, the organization of sensor drivers should
+reflect the distinction between sensor and sensor interconnect.</p>
+<p>Sensor components commonly exist at three levels:
+platform-independent, sensorboard-dependent, and
+platform-dependent. Factoring a sensor driver into these three pieces
+allows for greater code reuse when the same sensor is attached to
+different sensorboards or platforms.</p>
+<p>Platform-independent sensor driver components for a particular sensor,
+like protocol logic, when in the core TinyOS 2.x source tree, SHOULD
+be placed into &quot;tos/chips/&lt;sensor&gt;&quot;, where &lt;sensor&gt; reflects the make
+and model of the sensor device being supported. When not a part of the
+core source tree, this directory can be placed anywhere as long as the
+nesC compiler recieves a <cite>-I</cite> directive pointing to the sensor's
+directory. However, not all sensors have a sufficiently large amount
+of platform-independent logic to justify a separate &quot;chips&quot;
+directory. Sensor chips are more likely to be digital sensors than
+analog sensors, for example.</p>
+<p>A sensor board is a collection of sensor components with a fixed name,
+intended for attachment to multiple platforms. Each sensor board MUST
+have its own directory named &lt;sensorboard&gt;. Default TinyOS 2.x sensor
+boards are placed in &quot;tos/sensorboards/&lt;sensorboard&gt;&quot;, but sensor
+board directories can be placed anywhere as long as the nesC compiler
+receives a <cite>-I</cite> directive pointing to the sensor board's directory.</p>
+<p>Both sensors and sensor boards MUST have unique names. Case is
+significant, but two sensor boards MUST differ in more than case. This
+is necessary to support platforms where filename case differences are
+not significant.</p>
+<p>Each sensor board directory MUST contain a <cite>.sensor</cite> file.  This file
+is a perl script which gets executed as part of the <cite>ncc</cite> nesC
+compiler frontend. It can add or modify any compile-time options
+necessary for a particular sensor board. It MAY modify the following
+perl variables, and MUST NOT modify any others:</p>
 <ul class="simple">
-<li>&#64;new_args: This is the array of arguments which will be
-passed to nescc. For instance, you might add an include directive
-to &#64;new_args with push &#64;new_args, <cite>-Isomedir</cite></li>
+<li>&#64;new_args: This is the array of arguments which will be passed to
+nescc. For instance, you might add an include directive to &#64;new_args
+with push &#64;new_args, <cite>-Isomedir</cite>. This could be used to include
+subdirectories.</li>
 <li>&#64;commonboards: This can be set to a list of sensor board names which
 should be added to the include path list. These sensor boards must be
 in tinyos-2.x/tos/sensorboards.</li>
 </ul>
+<p>If the sensor board wishes to define any C types or constants, it
+SHOULD place these in a file named &lt;sensorboard&gt;.h in the sensor
+board's directory.</p>
+<p>A sensor board directory MAY contain a &quot;chips&quot; directory, with
+subdirectories for each of the sensors connected to the sensor board.
+If a &quot;chips&quot; subdirectory is used, sensorboard-dependent driver
+components needed to connect platform-independent logic to a
+particular attachment for that sensor should be placed in
+&quot;&lt;sensorboard&gt;/chips/&lt;sensor&gt;&quot;.</p>
+<p>Components needed to connect the platform-independent sensor driver
+components or sensorboard-dependent components to the hardware
+resources available on a particular platform SHOULD be placed in
+&quot;tos/&lt;platform&gt;/chips/&lt;sensor&gt;&quot;. In addition, components for a sensor
+that only exists on a particular platform should be placed in a such a
+directory.</p>
+<p>Sensors that exist as part of a larger chip, like a MCU internal
+voltage sensor, SHOULD be placed in a subdirectory of the chip's
+directory. &quot;tos/&lt;chip&gt;/sensors/&lt;sensor&gt;&quot;.</p>
+<p>The <cite>.platform</cite> and <cite>.sensor</cite> files need to include enough <cite>-I</cite>
+directives to locate all of the necessary components needed to support
+the sensors on a platform and/or sensorboard.</p>
+<p>All of these directory organization guidelines are only intended for
+code that will enter the core source tree. In general, sensor
+components may be placed anywhere as long as the nesC compiler
+receives enough <cite>-I</cite> directives to locate all of the necessary pieces.</p>
 </div>
 <div class="section">
-<h1><a id="example-mts3x0" name="example-mts3x0">Example: mts3x0</a></h1>
-<p>The mica sensor board (mts300/mts310) has five sensors (and one actuator,
-the sounder) -- the accelerometer and magnetometer are only present on
-the mts310:</p>
-<table border="1" class="docutils">
-<colgroup>
-</colgroup>
-<tbody valign="top">
-</tbody>
-</table>
-<div class="line-block">
-<div class="line">Name          | Component | Sensor Interfaces | Other Interfaces |</div>
-</div>
-<p>+===============+===========+===================+==================+</p>
-<div class="line-block">
-<div class="line">Accelerometer | AccelC    | AccelX            |                  |</div>
-</div>
-<div class="line-block">
-<div class="line">|           | AccelY            |                  |</div>
-</div>
-<div class="line-block">
-<div class="line">Magnetometer  | MagC      | MagX              | MagSetting       |</div>
-</div>
-<div class="line-block">
-<div class="line">|           | MagY              |                  |</div>
-</div>
-<div class="line-block">
-<div class="line">Microphone    | MicC      | MicADC            | Mic              |</div>
-</div>
-<div class="line-block">
-<div class="line">|           |                   | MicInterrupt     |</div>
-</div>
-<div class="line-block">
-<div class="line">Light         | PhotoC    | PhotoADC          |                  |</div>
-</div>
-<div class="line-block">
-<div class="line">Temperature   | TempC     | TempADC           |                  |</div>
-</div>
-<table border="1" class="docutils">
-<colgroup>
-</colgroup>
-<tbody valign="top">
-</tbody>
-</table>
-<p>Each physical sensor is represented by a separate component. Specific
-sensors that have more than one axis of measurement (AccelC and MagC)
-provide more than one <cite>AcquireData</cite> interface on a single component. Some
-sensors, such as the magnetometer and microphone, have additional
-functionality provided through sensor-specific interfaces.</p>
-<p>Although light and temperature are represented by separate components, in
-reality they share a single microcontroller pin. The two components PhotoC
-and TempC sit on top of the PhotoTempP component, which controls access to
-the shared pin, and orchestrates which sensor is currently connected to
-it. From a programmer's perspective, they appear as individual sensors,
-even though their underlying implementation is a bit more complex.</p>
-<p>The board's mts3x0.h file contains private configuration data
-(pin usage, ADC ports, etc).</p>
-<p>The mica sensor board has an empty .sensor file.</p>
-</div>
-<div class="section">
-<h1><a id="author-s-address" name="author-s-address">6. Author's Address</a></h1>
+<h1><a id="authors-addresses" name="authors-addresses">6. Authors' Addresses</a></h1>
 <div class="line-block">
 <div class="line">David Gay</div>
 <div class="line">2150 Shattuck Ave, Suite 1300</div>
@@ -587,8 +602,9 @@ even though their underlying implementation is a bit more complex.</p>
 <div class="line">email - <a class="reference" href="mailto:david.e.gay&#64;intel.com">david.e.gay&#64;intel.com</a></div>
 <div class="line"><br /></div>
 <div class="line">Wei Hong</div>
-<div class="line">Arched Rock</div>
-<div class="line">Berkeley, CA 94704</div>
+<div class="line">Arch Rock</div>
+<div class="line">657 Mission St. Suite 600</div>
+<div class="line">San Francisco, CA 94105</div>
 <div class="line"><br /></div>
 <div class="line">email - <a class="reference" href="mailto:wei.hong&#64;gmail.com">wei.hong&#64;gmail.com</a></div>
 <div class="line"><br /></div>
@@ -608,7 +624,35 @@ even though their underlying implementation is a bit more complex.</p>
 <div class="line">Berkeley, CA 94720</div>
 <div class="line"><br /></div>
 <div class="line">email - <a class="reference" href="mailto:polastre&#64;cs.berkeley.edu">polastre&#64;cs.berkeley.edu</a></div>
+<div class="line"><br /></div>
+<div class="line">Gilman Tolle</div>
+<div class="line">Arch Rock</div>
+<div class="line">657 Mission St. Suite 600</div>
+<div class="line">San Francisco, CA 94105</div>
+<div class="line"><br /></div>
+<div class="line">email - <a class="reference" href="mailto:gtolle&#64;archrock.com">gtolle&#64;archrock.com</a></div>
+</div>
 </div>
+<div class="section">
+<h1><a id="citations" name="citations">7. Citations</a></h1>
+<table class="docutils citation" frame="void" id="tep2" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id1" name="tep2">[TEP2]</a></td><td>TEP 2: Hardware Abstraction Architecture</td></tr>
+</tbody>
+</table>
+<table class="docutils citation" frame="void" id="tep114" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a name="tep114">[TEP114]</a></td><td><em>(<a class="fn-backref" href="#id2">1</a>, <a class="fn-backref" href="#id3">2</a>)</em> TEP 114: SIDs: Source and Sink Indepedent Drivers</td></tr>
+</tbody>
+</table>
+<table class="docutils citation" frame="void" id="tep115" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a name="tep115">[TEP115]</a></td><td><em>(<a class="fn-backref" href="#id4">1</a>, <a class="fn-backref" href="#id5">2</a>)</em> TEP 115: Power Management of Non-Virtualized Devices</td></tr>
+</tbody>
+</table>
 </div>
 </div>
 </body>
index e1f4648c2cb4a7bf3f509f89ac1e40a20efb5bad..2f46f3e77bec7304e3e51acf5544745acf85a9c0 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Philip Levis</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">20-Jun-2005</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.2</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-02-08</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index 64bf124987f8eb826f0e3cfd107a5fb19fa65444..db1226c139e761a5aa909adef7d1dbff76b2c82a 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Philip Levis</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">11-Jul-2005</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.12</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-13</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index 2dcba25ef56fcd2c22903d7e9a1359fd589339dd..82f534fdcc462d66f1fe2522efd66829118ce2c9 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Robert Szewczyk, Philip Levis, Martin Turon, Lama Nachman, Philip Buonadonna, Vlado Handziski</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">19-Sep-2005</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.2</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2005-10-31</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index 7e3f307e20c870164023f546589daaf10128d3e9..6bb77b955b68d2860bb23a398dfd0d083bdfcebd 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Ben Greenstein and Philip Levis</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">11-Jul-2005</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.4</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-14</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index f40baace0cb9296252fd7609daec57d07fa54329..2a63b51640f4aafade0a1c0ac5b3d50dc076a6cf 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Gilman Tolle, Philip Levis, and David Gay</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">30-Oct-2005</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.3</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.3</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-09</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-09-08</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
@@ -472,29 +472,6 @@ passing by value is inefficient, such as a two-axis digital
 accelerometer.</p>
 </div>
 <div class="section">
-<h2><a id="metadata-and-shifting" name="metadata-and-shifting">3.3 Metadata and Shifting</a></h2>
-<p>Generally, simple types are made up of octets. However, sensor values
-often have levels of precision besides a multiple of 8. Any value
-contained in a simple type MUST 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 12-bit value MUST be shifted left so that its range is 0x0000
-- 0xfff0, rather than 0x0000 - 0x0fff. A device MAY specify the
-precision of one of its interfaces with the DeviceMetadata interface:</p>
-<pre class="literal-block">
-interface DeviceMetadata {
-  command uint8_t getSignificantBits();
-}
-</pre>
-<p>The name of the instance of DeviceMetadata SHOULD clearly indicate
-which interface it corresponds to.</p>
-</div>
-<div class="section">
 <h2><a id="single-phase-scalar-i-o" name="single-phase-scalar-i-o">3.4 Single-Phase Scalar I/O</a></h2>
 <p>Some devices may have their state cached or readily available. In
 these cases, the device can provide a single-phase instead of
index 98ca5a71e3b826a08bca2c47e7d2fc30c714d438..633dd17ae6792d077755891374c2a0f200f8bef6 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Vlado Handziski, Kevin Klues, Jan-Hinrich Hauer, Phil Levis</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">11-Jan-2006</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.3</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-05-16</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List
 &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
index f017163136a698b94914a987ed02371cdd82c8e3..50b9aa6383ea42c7bacbeb292cc32270cbf69605 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Philip Levis</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">10-Dec-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.10</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-22</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index a67018273d4e68cc66b06ff4caf8a7cdfa169075..7d1b01d94e0a1eb443d9ffa0169a91deb786363f 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Phil Buonadonna</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">23-Jan-2006</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.4</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-01-25</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index b5895d4a960f68cb649acaaa5ed842038c9b62a0..47d1b974aab9e8cf3b1bb4568de64e29eda8a01f 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Philip Levis and Gilman Tolle</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">10-Dec-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.3</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-20</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index 4ec768b815bd6c404b51d8f496b5112fb56fd873..3719f95ec2cf6198818bc906cc7e31a55b646e3f 100644 (file)
@@ -466,26 +466,14 @@ then node B's metric value MUST be greater than node A's.</p>
 <h2><a id="collectionsenderc" name="collectionsenderc">3.1 CollectionSenderC</a></h2>
 <p>Collection has a virtualized sending abstraction, the generic
 component CollectionSenderC:</p>
-<div class="system-message">
-<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">txt/tep119.txt</tt>, line 198)</p>
-Literal block expected; none found.</div>
-<dl class="docutils">
-<dt>generic configuration CollectionSenderC(collection_id_t collectid) {</dt>
-<dd><dl class="first docutils">
-<dt>provides {</dt>
-<dd>interface Send;
-interface Packet;</dd>
-</dl>
-<div class="system-message">
-<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">txt/tep119.txt</tt>, line 202)</p>
-Definition list ends without a blank line; unexpected unindent.</div>
-<p class="last">}</p>
-</dd>
-</dl>
-<div class="system-message">
-<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">txt/tep119.txt</tt>, line 203)</p>
-Definition list ends without a blank line; unexpected unindent.</div>
-<p>}</p>
+<pre class="literal-block">
+generic configuration CollectionSenderC(collection_id_t collectid) {
+  provides {
+    interface Send;
+    interface Packet;
+  }
+}
+</pre>
 <p>This abstraction follows a similar virtualization approach to
 AMSenderC [<a class="reference" href="#id1">1</a>], except that it is parameterized by a collection_id_t
 rather than an am_id_t. As with am_id_t, every collection_id_t SHOULD
index 9c375968af4ad8df5d2df4c7edbf160a3e8912cb..02affb5a5f1c8bc8d77086f9c40b4241f6b84308 100644 (file)
@@ -314,9 +314,9 @@ ul.auto-toc {
 <br />Adam Wolisz</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">17-April-2006</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.3</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-06-09</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Alliance &lt;tinyos-alliance at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index aa4a224dc2626d7cd55faf46f196d522fafa8233..4ff751b42f9d5e5fe53de77fb91cc55a7ba9052d 100644 (file)
@@ -305,7 +305,7 @@ ul.auto-toc {
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-09-08</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
@@ -447,9 +447,9 @@ acknowledgments enabled.</p>
                      1
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-|C|P| reserved  |     address     |
+|C|P| reserved  |      parent     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-|    address    |       ETX       |
+|     parent    |       ETX       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |      ETX      |
 +-+-+-+-+-+-+-+-+
@@ -459,14 +459,19 @@ acknowledgments enabled.</p>
 <ul class="simple">
 <li>C: Same as data frame.</li>
 <li>P: Same as data frame.</li>
-<li>address: The node's active message address.</li>
+<li>parent: The node's current parent.</li>
 <li>metric: The node's current routing metric value.</li>
 </ul>
 </blockquote>
 <p>When a node hears a routing frame, it MUST update its routing table to
 reflect the address' new metric. If a node's ETX value changes
 significantly, then CTP SHOULD transmit a broadcast frame soon thereafter
-to notify other nodes, which might change their routes.</p>
+to notify other nodes, which might change their routes. The parent
+field acts as a surrogate for the single-hop destination field of
+a data packet: a parent can detect when a child's ETX is significantly
+below its own. When a parent hears a child advertise an ETX below its
+own, it MUST schedule a routing frame for transmission in the near
+future.</p>
 </div>
 </div>
 </body>
index a5f6123a24906ee94d0feceeac578b3662022bba..7153aad81a42a99a3424e2db5c56101ad49ab925 100644 (file)
@@ -303,9 +303,9 @@ ul.auto-toc {
 <td>Ion Yannopoulos, David Gay</td></tr>
 <tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">31-Dec-2004</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1.2.3</td>
+<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.2</td>
 </tr>
-<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-01-16</td>
+<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2006-07-12</td>
 </tr>
 <tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS Developer List &lt;tinyos-devel at mail.millennium.berkeley.edu&gt;</td>
 </tr>
index 5ffb7ba3bc99eca54125d1def1ad5d5929b4ea0d..5b5ca8a5ba1e52b21923a9448b5aeaa630d1c461 100644 (file)
@@ -113,7 +113,7 @@ which has the following signature::
     provides interface DisseminationUpdate <t>;
   }
 
-The t argument MUST be able to fit in a single message_t[tep111_]  after
+The t argument MUST be able to fit in a single message_t[1_]  after
 considering the headers that the dissemination protocol introduces.
 A dissemination implementation SHOULD have a compile error if a larger
 type than this is used.
index 6c14d0ed51b4a58eabfbdde1a10bda52407e85df..94580b31e4869ec2db68a4c321bd6360bf52d60a 100644 (file)
@@ -195,12 +195,12 @@ then node B's metric value MUST be greater than node A's.
 Collection has a virtualized sending abstraction, the generic
 component CollectionSenderC::
 
-generic configuration CollectionSenderC(collection_id_t collectid) {
-  provides {
-    interface Send;
-    interface Packet;
+  generic configuration CollectionSenderC(collection_id_t collectid) {
+    provides {
+      interface Send;
+      interface Packet;
+    }
   }
-}
 
 This abstraction follows a similar virtualization approach to
 AMSenderC [1_], except that it is parameterized by a collection_id_t