4#define MAVLINK_MSG_ID_PLAY_TUNE_V2 400
12} mavlink_play_tune_v2_t;
14#define MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN 254
15#define MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN 254
16#define MAVLINK_MSG_ID_400_LEN 254
17#define MAVLINK_MSG_ID_400_MIN_LEN 254
19#define MAVLINK_MSG_ID_PLAY_TUNE_V2_CRC 110
20#define MAVLINK_MSG_ID_400_CRC 110
22#define MAVLINK_MSG_PLAY_TUNE_V2_FIELD_TUNE_LEN 248
24#if MAVLINK_COMMAND_24BIT
25#define MAVLINK_MESSAGE_INFO_PLAY_TUNE_V2 {
29 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0
, 4
, offsetof(mavlink_play_tune_v2_t, target_system) },
30 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0
, 5
, offsetof(mavlink_play_tune_v2_t, target_component) },
31 { "format", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_play_tune_v2_t, format) },
32 { "tune", NULL, MAVLINK_TYPE_CHAR, 248
, 6
, offsetof(mavlink_play_tune_v2_t, tune) },
34}
36#define MAVLINK_MESSAGE_INFO_PLAY_TUNE_V2 {
39 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0
, 4
, offsetof(mavlink_play_tune_v2_t, target_system) },
40 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0
, 5
, offsetof(mavlink_play_tune_v2_t, target_component) },
41 { "format", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_play_tune_v2_t, format) },
42 { "tune", NULL, MAVLINK_TYPE_CHAR, 248
, 6
, offsetof(mavlink_play_tune_v2_t, tune) },
44}
48
49
50
51
52
53
54
55
56
57
58
59static inline uint16_t mavlink_msg_play_tune_v2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
60 uint8_t target_system, uint8_t target_component, uint32_t format,
const char *tune)
62#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
64 _mav_put_uint32_t(buf, 0, format);
65 _mav_put_uint8_t(buf, 4, target_system);
66 _mav_put_uint8_t(buf, 5, target_component);
67 _mav_put_char_array(buf, 6, tune, 248);
70 mavlink_play_tune_v2_t packet;
71 packet.format = format;
72 packet.target_system = target_system;
73 packet.target_component = target_component;
74 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*248);
75 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN);
83
84
85
86
87
88
89
90
91
92
93
94
95static inline uint16_t mavlink_msg_play_tune_v2_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
96 uint8_t target_system, uint8_t target_component, uint32_t format,
const char *tune)
98#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
100 _mav_put_uint32_t(buf, 0, format);
101 _mav_put_uint8_t(buf, 4, target_system);
102 _mav_put_uint8_t(buf, 5, target_component);
103 _mav_put_char_array(buf, 6, tune, 248);
106 mavlink_play_tune_v2_t packet;
107 packet.format = format;
108 packet.target_system = target_system;
109 packet.target_component = target_component;
110 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*248);
111 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN);
116 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_CRC);
123
124
125
126
127
128
129
130
131
132
133
134static inline uint16_t mavlink_msg_play_tune_v2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
135 mavlink_message_t* msg,
136 uint8_t target_system,uint8_t target_component,uint32_t format,
const char *tune)
138#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
140 _mav_put_uint32_t(buf, 0, format);
141 _mav_put_uint8_t(buf, 4, target_system);
142 _mav_put_uint8_t(buf, 5, target_component);
143 _mav_put_char_array(buf, 6, tune, 248);
146 mavlink_play_tune_v2_t packet;
147 packet.format = format;
148 packet.target_system = target_system;
149 packet.target_component = target_component;
150 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*248);
151 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN);
159
160
161
162
163
164
165
166static inline uint16_t mavlink_msg_play_tune_v2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_play_tune_v2_t* play_tune_v2)
168 return mavlink_msg_play_tune_v2_pack(system_id, component_id, msg, play_tune_v2->target_system, play_tune_v2->target_component, play_tune_v2->format, play_tune_v2->tune);
172
173
174
175
176
177
178
179
180static inline uint16_t mavlink_msg_play_tune_v2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_play_tune_v2_t* play_tune_v2)
182 return mavlink_msg_play_tune_v2_pack_chan(system_id, component_id, chan, msg, play_tune_v2->target_system, play_tune_v2->target_component, play_tune_v2->format, play_tune_v2->tune);
186
187
188
189
190
191
192
193
194static inline uint16_t mavlink_msg_play_tune_v2_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_play_tune_v2_t* play_tune_v2)
196 return mavlink_msg_play_tune_v2_pack_status(system_id, component_id, _status, msg, play_tune_v2->target_system, play_tune_v2->target_component, play_tune_v2->format, play_tune_v2->tune);
200
201
202
203
204
205
206
207
208#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
210static inline void mavlink_msg_play_tune_v2_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t format,
const char *tune)
212#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
213 char buf[MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN];
214 _mav_put_uint32_t(buf, 0, format);
215 _mav_put_uint8_t(buf, 4, target_system);
216 _mav_put_uint8_t(buf, 5, target_component);
217 _mav_put_char_array(buf, 6, tune, 248);
218 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE_V2, buf, MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_CRC);
220 mavlink_play_tune_v2_t packet;
221 packet.format = format;
222 packet.target_system = target_system;
223 packet.target_component = target_component;
224 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*248);
225 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE_V2, (
const char *)&packet, MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_CRC);
230
231
232
233
234static inline void mavlink_msg_play_tune_v2_send_struct(mavlink_channel_t chan,
const mavlink_play_tune_v2_t* play_tune_v2)
236#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
237 mavlink_msg_play_tune_v2_send(chan, play_tune_v2->target_system, play_tune_v2->target_component, play_tune_v2->format, play_tune_v2->tune);
239 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE_V2, (
const char *)play_tune_v2, MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_CRC);
243#if MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN <= MAVLINK_MAX_PAYLOAD_LEN
245
246
247
248
249
250
251static inline void mavlink_msg_play_tune_v2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t format,
const char *tune)
253#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
254 char *buf = (
char *)msgbuf;
255 _mav_put_uint32_t(buf, 0, format);
256 _mav_put_uint8_t(buf, 4, target_system);
257 _mav_put_uint8_t(buf, 5, target_component);
258 _mav_put_char_array(buf, 6, tune, 248);
259 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE_V2, buf, MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_CRC);
261 mavlink_play_tune_v2_t *packet = (mavlink_play_tune_v2_t *)msgbuf;
262 packet->format = format;
263 packet->target_system = target_system;
264 packet->target_component = target_component;
265 mav_array_memcpy(packet->tune, tune,
sizeof(
char)*248);
266 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE_V2, (
const char *)packet, MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN, MAVLINK_MSG_ID_PLAY_TUNE_V2_CRC);
277
278
279
280
281static inline uint8_t mavlink_msg_play_tune_v2_get_target_system(
const mavlink_message_t* msg)
283 return _MAV_RETURN_uint8_t(msg, 4);
287
288
289
290
291static inline uint8_t mavlink_msg_play_tune_v2_get_target_component(
const mavlink_message_t* msg)
293 return _MAV_RETURN_uint8_t(msg, 5);
297
298
299
300
301static inline uint32_t mavlink_msg_play_tune_v2_get_format(
const mavlink_message_t* msg)
303 return _MAV_RETURN_uint32_t(msg, 0);
307
308
309
310
311static inline uint16_t mavlink_msg_play_tune_v2_get_tune(
const mavlink_message_t* msg,
char *tune)
313 return _MAV_RETURN_char_array(msg, tune, 248, 6);
317
318
319
320
321
322static inline void mavlink_msg_play_tune_v2_decode(
const mavlink_message_t* msg, mavlink_play_tune_v2_t* play_tune_v2)
324#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
325 play_tune_v2->format = mavlink_msg_play_tune_v2_get_format(msg);
326 play_tune_v2->target_system = mavlink_msg_play_tune_v2_get_target_system(msg);
327 play_tune_v2->target_component = mavlink_msg_play_tune_v2_get_target_component(msg);
328 mavlink_msg_play_tune_v2_get_tune(msg, play_tune_v2->tune);
330 uint8_t len = msg->len < MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN? msg->len : MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN;
331 memset(play_tune_v2, 0, MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN);
332 memcpy(play_tune_v2, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_PLAY_TUNE_V2
Definition: mavlink_msg_play_tune_v2.h:4
#define MAVLINK_MSG_ID_PLAY_TUNE_V2_CRC
Definition: mavlink_msg_play_tune_v2.h:19
#define MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN
Definition: mavlink_msg_play_tune_v2.h:15
#define MAVLINK_MSG_ID_PLAY_TUNE_V2_LEN
Definition: mavlink_msg_play_tune_v2.h:14
Definition: mavlink_msg_play_tune_v2.h:7
char tune[248]
Definition: mavlink_msg_play_tune_v2.h:11
uint8_t target_component
Definition: mavlink_msg_play_tune_v2.h:10
uint32_t format
Definition: mavlink_msg_play_tune_v2.h:8
uint8_t target_system
Definition: mavlink_msg_play_tune_v2.h:9