X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Fchips%2Fcc2420_tkn154%2FCaptureTime.nc;h=14980fda9be603d725cc3e478194744b5887d064;hp=45e7300e7083e98c5f707d4274f3eff845bbba47;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hpb=adf1de6c009d13b7b52e68535c63b28f59c97400 diff --git a/tos/chips/cc2420_tkn154/CaptureTime.nc b/tos/chips/cc2420_tkn154/CaptureTime.nc index 45e7300e..14980fda 100644 --- a/tos/chips/cc2420_tkn154/CaptureTime.nc +++ b/tos/chips/cc2420_tkn154/CaptureTime.nc @@ -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); }