4#define MAVLINK_MSG_ID_TIMESYNC 111
14#define MAVLINK_MSG_ID_TIMESYNC_LEN 18
15#define MAVLINK_MSG_ID_TIMESYNC_MIN_LEN 16
16#define MAVLINK_MSG_ID_111_LEN 18
17#define MAVLINK_MSG_ID_111_MIN_LEN 16
19#define MAVLINK_MSG_ID_TIMESYNC_CRC 34
20#define MAVLINK_MSG_ID_111_CRC 34
24#if MAVLINK_COMMAND_24BIT
25#define MAVLINK_MESSAGE_INFO_TIMESYNC {
29 { { "tc1", NULL, MAVLINK_TYPE_INT64_T, 0
, 0
, offsetof(mavlink_timesync_t, tc1) },
30 { "ts1", NULL, MAVLINK_TYPE_INT64_T, 0
, 8
, offsetof(mavlink_timesync_t, ts1) },
31 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0
, 16
, offsetof(mavlink_timesync_t, target_system) },
32 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0
, 17
, offsetof(mavlink_timesync_t, target_component) },
34}
36#define MAVLINK_MESSAGE_INFO_TIMESYNC {
39 { { "tc1", NULL, MAVLINK_TYPE_INT64_T, 0
, 0
, offsetof(mavlink_timesync_t, tc1) },
40 { "ts1", NULL, MAVLINK_TYPE_INT64_T, 0
, 8
, offsetof(mavlink_timesync_t, ts1) },
41 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0
, 16
, offsetof(mavlink_timesync_t, target_system) },
42 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0
, 17
, offsetof(mavlink_timesync_t, target_component) },
44}
48
49
50
51
52
53
54
55
56
57
58
59static inline uint16_t mavlink_msg_timesync_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
60 int64_t tc1, int64_t ts1, uint8_t target_system, uint8_t target_component)
62#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
64 _mav_put_int64_t(buf, 0, tc1);
65 _mav_put_int64_t(buf, 8, ts1);
66 _mav_put_uint8_t(buf, 16, target_system);
67 _mav_put_uint8_t(buf, 17, target_component);
71 mavlink_timesync_t packet;
74 packet.target_system = target_system;
75 packet.target_component = target_component;
77 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIMESYNC_LEN);
85
86
87
88
89
90
91
92
93
94
95
96
97static inline uint16_t mavlink_msg_timesync_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
98 int64_t tc1, int64_t ts1, uint8_t target_system, uint8_t target_component)
100#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
102 _mav_put_int64_t(buf, 0, tc1);
103 _mav_put_int64_t(buf, 8, ts1);
104 _mav_put_uint8_t(buf, 16, target_system);
105 _mav_put_uint8_t(buf, 17, target_component);
109 mavlink_timesync_t packet;
112 packet.target_system = target_system;
113 packet.target_component = target_component;
115 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIMESYNC_LEN);
120 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
127
128
129
130
131
132
133
134
135
136
137
138static inline uint16_t mavlink_msg_timesync_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
139 mavlink_message_t* msg,
140 int64_t tc1,int64_t ts1,uint8_t target_system,uint8_t target_component)
142#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
144 _mav_put_int64_t(buf, 0, tc1);
145 _mav_put_int64_t(buf, 8, ts1);
146 _mav_put_uint8_t(buf, 16, target_system);
147 _mav_put_uint8_t(buf, 17, target_component);
151 mavlink_timesync_t packet;
154 packet.target_system = target_system;
155 packet.target_component = target_component;
157 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIMESYNC_LEN);
165
166
167
168
169
170
171
172static inline uint16_t mavlink_msg_timesync_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_timesync_t* timesync)
174 return mavlink_msg_timesync_pack(system_id, component_id, msg, timesync->tc1, timesync->ts1, timesync->target_system, timesync->target_component);
178
179
180
181
182
183
184
185
186static inline uint16_t mavlink_msg_timesync_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_timesync_t* timesync)
188 return mavlink_msg_timesync_pack_chan(system_id, component_id, chan, msg, timesync->tc1, timesync->ts1, timesync->target_system, timesync->target_component);
192
193
194
195
196
197
198
199
200static inline uint16_t mavlink_msg_timesync_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_timesync_t* timesync)
202 return mavlink_msg_timesync_pack_status(system_id, component_id, _status, msg, timesync->tc1, timesync->ts1, timesync->target_system, timesync->target_component);
206
207
208
209
210
211
212
213
214#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
216static inline void mavlink_msg_timesync_send(mavlink_channel_t chan, int64_t tc1, int64_t ts1, uint8_t target_system, uint8_t target_component)
218#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
219 char buf[MAVLINK_MSG_ID_TIMESYNC_LEN];
220 _mav_put_int64_t(buf, 0, tc1);
221 _mav_put_int64_t(buf, 8, ts1);
222 _mav_put_uint8_t(buf, 16, target_system);
223 _mav_put_uint8_t(buf, 17, target_component);
225 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
227 mavlink_timesync_t packet;
230 packet.target_system = target_system;
231 packet.target_component = target_component;
233 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (
const char *)&packet, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
238
239
240
241
242static inline void mavlink_msg_timesync_send_struct(mavlink_channel_t chan,
const mavlink_timesync_t* timesync)
244#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
245 mavlink_msg_timesync_send(chan, timesync->tc1, timesync->ts1, timesync->target_system, timesync->target_component);
247 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (
const char *)timesync, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
251#if MAVLINK_MSG_ID_TIMESYNC_LEN <= MAVLINK_MAX_PAYLOAD_LEN
253
254
255
256
257
258
259static inline void mavlink_msg_timesync_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int64_t tc1, int64_t ts1, uint8_t target_system, uint8_t target_component)
261#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
262 char *buf = (
char *)msgbuf;
263 _mav_put_int64_t(buf, 0, tc1);
264 _mav_put_int64_t(buf, 8, ts1);
265 _mav_put_uint8_t(buf, 16, target_system);
266 _mav_put_uint8_t(buf, 17, target_component);
268 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, buf, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
270 mavlink_timesync_t *packet = (mavlink_timesync_t *)msgbuf;
273 packet->target_system = target_system;
274 packet->target_component = target_component;
276 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIMESYNC, (
const char *)packet, MAVLINK_MSG_ID_TIMESYNC_MIN_LEN, MAVLINK_MSG_ID_TIMESYNC_LEN, MAVLINK_MSG_ID_TIMESYNC_CRC);
287
288
289
290
291static inline int64_t mavlink_msg_timesync_get_tc1(
const mavlink_message_t* msg)
293 return _MAV_RETURN_int64_t(msg, 0);
297
298
299
300
301static inline int64_t mavlink_msg_timesync_get_ts1(
const mavlink_message_t* msg)
303 return _MAV_RETURN_int64_t(msg, 8);
307
308
309
310
311static inline uint8_t mavlink_msg_timesync_get_target_system(
const mavlink_message_t* msg)
313 return _MAV_RETURN_uint8_t(msg, 16);
317
318
319
320
321static inline uint8_t mavlink_msg_timesync_get_target_component(
const mavlink_message_t* msg)
323 return _MAV_RETURN_uint8_t(msg, 17);
327
328
329
330
331
332static inline void mavlink_msg_timesync_decode(
const mavlink_message_t* msg, mavlink_timesync_t* timesync)
334#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
335 timesync->tc1 = mavlink_msg_timesync_get_tc1(msg);
336 timesync->ts1 = mavlink_msg_timesync_get_ts1(msg);
337 timesync->target_system = mavlink_msg_timesync_get_target_system(msg);
338 timesync->target_component = mavlink_msg_timesync_get_target_component(msg);
340 uint8_t len = msg->len < MAVLINK_MSG_ID_TIMESYNC_LEN? msg->len : MAVLINK_MSG_ID_TIMESYNC_LEN;
341 memset(timesync, 0, MAVLINK_MSG_ID_TIMESYNC_LEN);
342 memcpy(timesync, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_TIMESYNC
Definition: mavlink_msg_timesync.h:4
#define MAVLINK_MSG_ID_TIMESYNC_CRC
Definition: mavlink_msg_timesync.h:19
#define MAVLINK_MSG_ID_TIMESYNC_LEN
Definition: mavlink_msg_timesync.h:14
#define MAVLINK_MSG_ID_TIMESYNC_MIN_LEN
Definition: mavlink_msg_timesync.h:15
Definition: mavlink_msg_timesync.h:7
int64_t tc1
Definition: mavlink_msg_timesync.h:8
uint8_t target_component
Definition: mavlink_msg_timesync.h:11
int64_t ts1
Definition: mavlink_msg_timesync.h:9
uint8_t target_system
Definition: mavlink_msg_timesync.h:10