X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Fplatforms%2Ftmirws%2Fsensors%2FAverage.nc;h=d9ed12c339a7970f6ae3c7df93b9b81d8178859b;hp=cccb75a801b8977a11bc4e40d413e508477560b4;hb=31c5577e7d049bcb6dfc5e3d0a2c8bfd324ef25c;hpb=f54520e9a604b832eb3498102975f50f1494d1c3 diff --git a/tos/platforms/tmirws/sensors/Average.nc b/tos/platforms/tmirws/sensors/Average.nc index cccb75a8..d9ed12c3 100644 --- a/tos/platforms/tmirws/sensors/Average.nc +++ b/tos/platforms/tmirws/sensors/Average.nc @@ -41,16 +41,16 @@ interface Average { 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 + * reset() or average(). */ - 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 + * reset() or average(). average() + * also performs a reset(). */ - event void average(val_t); + command val_t average(); }