X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fcc1000%2FCC1000Msg.h;h=c106b7a090a1df93c2bfc87ee94420e2b30f8410;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=8932aa6a3d4b5b422d59f8b0bad4f03c865d15a6;hpb=1a329382c4f4556fd52d85f4e3f4a67e54911682;p=tinyos-2.x.git diff --git a/tos/chips/cc1000/CC1000Msg.h b/tos/chips/cc1000/CC1000Msg.h index 8932aa6a..c106b7a0 100644 --- a/tos/chips/cc1000/CC1000Msg.h +++ b/tos/chips/cc1000/CC1000Msg.h @@ -15,12 +15,29 @@ typedef nx_struct CC1KFooter { nxle_uint16_t crc; } cc1000_footer_t; +typedef enum { + CC1000_ACK_BIT = 0x1, + CC1000_WHITE_BIT = 0x2, + /* 60 comes from the mica2 data sheet (MPR/MIB guide) and Dongjin Son's work in SenSys 2006. + Son's work showed that a SINR of 6dB is sufficient for > 90% PRR. Figure 7-2 of the data + sheet shows that a 6dB difference is approximately equal to a VRSSI voltage difference of + 0.15V. Since the battery voltage is 2.8V (approximately), 60/1024 * 2.8 is roughly equal + to 0.15. This deserves some experimental testing. -pal */ + CC1000_WHITE_BIT_THRESH = 60 +} CC1KMetadataBits; + typedef nx_struct CC1KMetadata { nx_int16_t strength_or_preamble; /* negative when used for preamble length */ - nx_uint8_t ack; - nx_uint16_t time; + nx_uint8_t metadataBits; + nx_bool timesync; + nx_uint32_t timestamp; nx_uint8_t sendSecurityMode; nx_uint8_t receiveSecurityMode; } cc1000_metadata_t; +enum +{ + CC1000_INVALID_TIMESTAMP = 0x80000000L, +}; + #endif