1 /***********************
2 * Message Definitions *
3 ***********************/
7 #define MSG_HEADER 0x1234
9 #define MSG_VALID_DEVICE 0x0001
10 #define MSG_VALID_START 0x0002
11 #define MSG_VALID_PERIOD 0x0004
12 #define MSG_VALID_WORLD 0x0008
17 MSG_ID_INIT, // Device initialization
18 MSG_ID_SYNC, // Time synchronization
19 MSG_ID_EVENT, // Event occurred
20 MSG_MAX_ID, // Maximum message ID
24 uint32_t seconds; // Seconds since 1970 (without leap seconds)
25 uint32_t nanosec; // Nanoseconds since 'seconds'
29 uint16_t header; // Message Header
30 uint16_t msgid; // Message ID
31 uint16_t length; // Body length
32 uint16_t cksum; // Body checksum
36 uint16_t valid; // Message valid bits
37 uint16_t device; // Device ID to use
38 ntime_t start; // Transmit start time
39 ntime_t period; // Transmit period
40 ntime_t world; // World time (since 1970)
44 uint32_t seq; // Current sequence counter
45 ntime_t time; // Time of previous message
49 uint16_t device; // Device ID
50 uint16_t event; // Event ID
51 ntime_t time; // Timestamp