X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fftsp%2FTimeSyncMsg.h;h=74a90197ae601cb5e77a9f15c91c38406ab74902;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=bf5830a77334d57a05ab60ec223ef723ae6ee7db;hpb=1487f209aa37c20dc0a7a91593ebbf44410dd030;p=tinyos-2.x.git diff --git a/tos/lib/ftsp/TimeSyncMsg.h b/tos/lib/ftsp/TimeSyncMsg.h index bf5830a7..74a90197 100644 --- a/tos/lib/ftsp/TimeSyncMsg.h +++ b/tos/lib/ftsp/TimeSyncMsg.h @@ -32,10 +32,16 @@ typedef nx_struct TimeSyncMsg nx_uint16_t nodeID; // the node if of the sender nx_uint8_t seqNum; // sequence number for the root - /* This field is initially set to the offset between global time and local - * time. The TimeStamping component will add the current local time when the - * message is actually transmitted. Thus the receiver will receive the - * global time of the sender when the message is actually sent. */ + /* + * After TEP 133, the message timestamp contains the difference between + * event time and the time the message was actually sent out. TimeSyncP + * sends the local time associated with this globalTime to the + * TimeStamping mechanism, which then calculates the difference. + * + * On the receiving side, the difference is applied to the local + * timestamp. The receiving timestamp thus represents the time on the + * receiving clock when the remote globalTime was taken. + */ nx_uint32_t globalTime; //just for convenience @@ -43,7 +49,7 @@ typedef nx_struct TimeSyncMsg } TimeSyncMsg; enum { - AM_TIMESYNCMSG = 0xAA, + TIMESYNC_AM_FTSP = 0x3E, TIMESYNCMSG_LEN = sizeof(TimeSyncMsg) - sizeof(nx_uint32_t), TS_TIMER_MODE = 0, // see TimeSyncMode interface TS_USER_MODE = 1, // see TimeSyncMode interface