3 #define MAVLINK_MSG_ID_SYSTEM_TIME 2
11 #define MAVLINK_MSG_ID_SYSTEM_TIME_LEN 12
12 #define MAVLINK_MSG_ID_2_LEN 12
14 #define MAVLINK_MSG_ID_SYSTEM_TIME_CRC 137
15 #define MAVLINK_MSG_ID_2_CRC 137
19 #define MAVLINK_MESSAGE_INFO_SYSTEM_TIME { \
22 { { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_system_time_t, time_unix_usec) }, \
23 { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_system_time_t, time_boot_ms) }, \
38 static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
39 uint64_t time_unix_usec, uint32_t time_boot_ms)
41 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
42 char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN];
43 _mav_put_uint64_t(buf, 0, time_unix_usec);
44 _mav_put_uint32_t(buf, 8, time_boot_ms);
46 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
52 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
55 msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME;
57 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
59 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
73 static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
74 mavlink_message_t* msg,
75 uint64_t time_unix_usec,uint32_t time_boot_ms)
77 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
78 char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN];
79 _mav_put_uint64_t(buf, 0, time_unix_usec);
80 _mav_put_uint32_t(buf, 8, time_boot_ms);
82 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
88 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
91 msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME;
93 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
95 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
107 static inline uint16_t mavlink_msg_system_time_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_system_time_t* system_time)
121 static inline uint16_t mavlink_msg_system_time_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_system_time_t* system_time)
123 return mavlink_msg_system_time_pack_chan(system_id, component_id, chan, msg, system_time->
time_unix_usec, system_time->
time_boot_ms);
133 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
135 static inline void mavlink_msg_system_time_send(mavlink_channel_t chan, uint64_t time_unix_usec, uint32_t time_boot_ms)
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
138 char buf[MAVLINK_MSG_ID_SYSTEM_TIME_LEN];
139 _mav_put_uint64_t(buf, 0, time_unix_usec);
140 _mav_put_uint32_t(buf, 8, time_boot_ms);
142 #if MAVLINK_CRC_EXTRA
143 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
145 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
152 #if MAVLINK_CRC_EXTRA
153 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (
const char *)&packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
155 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (
const char *)&packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
160 #if MAVLINK_MSG_ID_SYSTEM_TIME_LEN <= MAVLINK_MAX_PAYLOAD_LEN
168 static inline void mavlink_msg_system_time_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_unix_usec, uint32_t time_boot_ms)
170 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171 char *buf = (
char *)msgbuf;
172 _mav_put_uint64_t(buf, 0, time_unix_usec);
173 _mav_put_uint32_t(buf, 8, time_boot_ms);
175 #if MAVLINK_CRC_EXTRA
176 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
178 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
185 #if MAVLINK_CRC_EXTRA
186 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (
const char *)packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN, MAVLINK_MSG_ID_SYSTEM_TIME_CRC);
188 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (
const char *)packet, MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
204 static inline uint64_t mavlink_msg_system_time_get_time_unix_usec(
const mavlink_message_t* msg)
206 return _MAV_RETURN_uint64_t(msg, 0);
214 static inline uint32_t mavlink_msg_system_time_get_time_boot_ms(
const mavlink_message_t* msg)
216 return _MAV_RETURN_uint32_t(msg, 8);
225 static inline void mavlink_msg_system_time_decode(
const mavlink_message_t* msg,
mavlink_system_time_t* system_time)
227 #if MAVLINK_NEED_BYTE_SWAP
228 system_time->
time_unix_usec = mavlink_msg_system_time_get_time_unix_usec(msg);
229 system_time->
time_boot_ms = mavlink_msg_system_time_get_time_boot_ms(msg);
231 memcpy(system_time, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SYSTEM_TIME_LEN);
Definition: mavlink_msg_system_time.h:5
uint32_t time_boot_ms
Timestamp of the component clock since boot time in milliseconds.
Definition: mavlink_msg_system_time.h:8
uint64_t time_unix_usec
Timestamp of the master clock in microseconds since UNIX epoch.
Definition: mavlink_msg_system_time.h:7