]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmirws/sensors/Average.nc
Redo Average interface.
[tinyos-2.x.git] / tos / platforms / tmirws / sensors / Average.nc
index cccb75a801b8977a11bc4e40d413e508477560b4..d9ed12c339a7970f6ae3c7df93b9b81d8178859b 100644 (file)
@@ -41,16 +41,16 @@ interface Average<val_t> {
   command void reset();
 
   /* Submit a value to the averager, to be averaged into the next average. */
-  command void submit(val_t);
+  command void submit(val_t value);
 
-  /* Submit a null value to the averager.  Each null submitted counts as one
-   * of the expected values for calculating the average.  Each null submitted
-   * reduces the divisor for the subsequent average by one.
+  /* Return the number of values submitted since the last
+   * <code>reset()</code> or <code>average()</code>.
    */
-  command void null();
+  command uint16_t count();
 
-  /* Signalled after the expected number of samples + nulls have been delivered
-   * and their set have been used to calculate a new average.
+  /* Ask for the average of the values submitted since the last
+   * <code>reset()</code> or <code>average()</code>.  <code>average()</code>
+   * also performs a <code>reset()</code>.
    */
-  event void average(val_t);
+  command val_t average();
 }