]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc2420_tkn154/CaptureTime.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / chips / cc2420_tkn154 / CaptureTime.nc
index 45e7300e7083e98c5f707d4274f3eff845bbba47..14980fda9be603d725cc3e478194744b5887d064 100644 (file)
@@ -38,6 +38,20 @@ interface CaptureTime
    * @param   time  capture time
    * @param   localTime capture time converted to local time + offset symbols
    * @param   offset time in symbols (16 us) to add to capture time
+   * @return  SUCCESS if conversion was made successfully, FAIL otherwise
    */
-  async command void convert(uint16_t time, ieee154_reftime_t *localTime, int16_t offset);
+  async command error_t convert(uint16_t time, ieee154_timestamp_t *localTime, int16_t offset);
+
+  /**
+   * Tells whether the timestamp is valid. On the CC2420 an SFD transition
+   * does not necessarily mean that the packet is put in the RXFIFO.
+   * This command should return FALSE iff the time between the rising SFD
+   * and the falling SFD is too short for the smallest possible frame, i.e.
+   * ACK frame (see CC2420 datasheet for details on SFD timing).
+   *
+   * @param  risingSFDTime capture time of rising SFD
+   * @param  fallingSFDTime capture time of falling SFD
+   * @return FALSE if time offset is too small for a valid packet
+   */
+  async command bool isValidTimestamp(uint16_t risingSFDTime, uint16_t fallingSFDTime);
 }