4#define MAVLINK_MSG_ID_PLAY_TUNE 258
14#define MAVLINK_MSG_ID_PLAY_TUNE_LEN 232
15#define MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN 32
16#define MAVLINK_MSG_ID_258_LEN 232
17#define MAVLINK_MSG_ID_258_MIN_LEN 32
19#define MAVLINK_MSG_ID_PLAY_TUNE_CRC 187
20#define MAVLINK_MSG_ID_258_CRC 187
22#define MAVLINK_MSG_PLAY_TUNE_FIELD_TUNE_LEN 30
23#define MAVLINK_MSG_PLAY_TUNE_FIELD_TUNE2_LEN 200
25#if MAVLINK_COMMAND_24BIT
26#define MAVLINK_MESSAGE_INFO_PLAY_TUNE {
30 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0
, 0
, offsetof(mavlink_play_tune_t, target_system) },
31 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0
, 1
, offsetof(mavlink_play_tune_t, target_component) },
32 { "tune", NULL, MAVLINK_TYPE_CHAR, 30
, 2
, offsetof(mavlink_play_tune_t, tune) },
33 { "tune2", NULL, MAVLINK_TYPE_CHAR, 200
, 32
, offsetof(mavlink_play_tune_t, tune2) },
35}
37#define MAVLINK_MESSAGE_INFO_PLAY_TUNE {
40 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0
, 0
, offsetof(mavlink_play_tune_t, target_system) },
41 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0
, 1
, offsetof(mavlink_play_tune_t, target_component) },
42 { "tune", NULL, MAVLINK_TYPE_CHAR, 30
, 2
, offsetof(mavlink_play_tune_t, tune) },
43 { "tune2", NULL, MAVLINK_TYPE_CHAR, 200
, 32
, offsetof(mavlink_play_tune_t, tune2) },
45}
49
50
51
52
53
54
55
56
57
58
59
60static inline uint16_t mavlink_msg_play_tune_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
61 uint8_t target_system, uint8_t target_component,
const char *tune,
const char *tune2)
63#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
65 _mav_put_uint8_t(buf, 0, target_system);
66 _mav_put_uint8_t(buf, 1, target_component);
67 _mav_put_char_array(buf, 2, tune, 30);
68 _mav_put_char_array(buf, 32, tune2, 200);
71 mavlink_play_tune_t packet;
72 packet.target_system = target_system;
73 packet.target_component = target_component;
74 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*30);
75 mav_array_memcpy(packet.tune2, tune2,
sizeof(
char)*200);
76 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
84
85
86
87
88
89
90
91
92
93
94
95
96static inline uint16_t mavlink_msg_play_tune_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
97 uint8_t target_system, uint8_t target_component,
const char *tune,
const char *tune2)
99#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
101 _mav_put_uint8_t(buf, 0, target_system);
102 _mav_put_uint8_t(buf, 1, target_component);
103 _mav_put_char_array(buf, 2, tune, 30);
104 _mav_put_char_array(buf, 32, tune2, 200);
107 mavlink_play_tune_t packet;
108 packet.target_system = target_system;
109 packet.target_component = target_component;
110 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*30);
111 mav_array_memcpy(packet.tune2, tune2,
sizeof(
char)*200);
112 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
117 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_LEN, MAVLINK_MSG_ID_PLAY_TUNE_CRC);
124
125
126
127
128
129
130
131
132
133
134
135static inline uint16_t mavlink_msg_play_tune_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
136 mavlink_message_t* msg,
137 uint8_t target_system,uint8_t target_component,
const char *tune,
const char *tune2)
139#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
141 _mav_put_uint8_t(buf, 0, target_system);
142 _mav_put_uint8_t(buf, 1, target_component);
143 _mav_put_char_array(buf, 2, tune, 30);
144 _mav_put_char_array(buf, 32, tune2, 200);
147 mavlink_play_tune_t packet;
148 packet.target_system = target_system;
149 packet.target_component = target_component;
150 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*30);
151 mav_array_memcpy(packet.tune2, tune2,
sizeof(
char)*200);
152 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
160
161
162
163
164
165
166
167static inline uint16_t mavlink_msg_play_tune_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_play_tune_t* play_tune)
169 return mavlink_msg_play_tune_pack(system_id, component_id, msg, play_tune->target_system, play_tune->target_component, play_tune->tune, play_tune->tune2);
173
174
175
176
177
178
179
180
181static inline uint16_t mavlink_msg_play_tune_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_play_tune_t* play_tune)
183 return mavlink_msg_play_tune_pack_chan(system_id, component_id, chan, msg, play_tune->target_system, play_tune->target_component, play_tune->tune, play_tune->tune2);
187
188
189
190
191
192
193
194
195static inline uint16_t mavlink_msg_play_tune_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_play_tune_t* play_tune)
197 return mavlink_msg_play_tune_pack_status(system_id, component_id, _status, msg, play_tune->target_system, play_tune->target_component, play_tune->tune, play_tune->tune2);
201
202
203
204
205
206
207
208
209#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
211static inline void mavlink_msg_play_tune_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component,
const char *tune,
const char *tune2)
213#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
214 char buf[MAVLINK_MSG_ID_PLAY_TUNE_LEN];
215 _mav_put_uint8_t(buf, 0, target_system);
216 _mav_put_uint8_t(buf, 1, target_component);
217 _mav_put_char_array(buf, 2, tune, 30);
218 _mav_put_char_array(buf, 32, tune2, 200);
219 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE, buf, MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_LEN, MAVLINK_MSG_ID_PLAY_TUNE_CRC);
221 mavlink_play_tune_t packet;
222 packet.target_system = target_system;
223 packet.target_component = target_component;
224 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*30);
225 mav_array_memcpy(packet.tune2, tune2,
sizeof(
char)*200);
226 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE, (
const char *)&packet, MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_LEN, MAVLINK_MSG_ID_PLAY_TUNE_CRC);
231
232
233
234
235static inline void mavlink_msg_play_tune_send_struct(mavlink_channel_t chan,
const mavlink_play_tune_t* play_tune)
237#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
238 mavlink_msg_play_tune_send(chan, play_tune->target_system, play_tune->target_component, play_tune->tune, play_tune->tune2);
240 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE, (
const char *)play_tune, MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_LEN, MAVLINK_MSG_ID_PLAY_TUNE_CRC);
244#if MAVLINK_MSG_ID_PLAY_TUNE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
246
247
248
249
250
251
252static inline void mavlink_msg_play_tune_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component,
const char *tune,
const char *tune2)
254#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
255 char *buf = (
char *)msgbuf;
256 _mav_put_uint8_t(buf, 0, target_system);
257 _mav_put_uint8_t(buf, 1, target_component);
258 _mav_put_char_array(buf, 2, tune, 30);
259 _mav_put_char_array(buf, 32, tune2, 200);
260 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE, buf, MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_LEN, MAVLINK_MSG_ID_PLAY_TUNE_CRC);
262 mavlink_play_tune_t *packet = (mavlink_play_tune_t *)msgbuf;
263 packet->target_system = target_system;
264 packet->target_component = target_component;
265 mav_array_memcpy(packet->tune, tune,
sizeof(
char)*30);
266 mav_array_memcpy(packet->tune2, tune2,
sizeof(
char)*200);
267 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PLAY_TUNE, (
const char *)packet, MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_LEN, MAVLINK_MSG_ID_PLAY_TUNE_CRC);
278
279
280
281
282static inline uint8_t mavlink_msg_play_tune_get_target_system(
const mavlink_message_t* msg)
284 return _MAV_RETURN_uint8_t(msg, 0);
288
289
290
291
292static inline uint8_t mavlink_msg_play_tune_get_target_component(
const mavlink_message_t* msg)
294 return _MAV_RETURN_uint8_t(msg, 1);
298
299
300
301
302static inline uint16_t mavlink_msg_play_tune_get_tune(
const mavlink_message_t* msg,
char *tune)
304 return _MAV_RETURN_char_array(msg, tune, 30, 2);
308
309
310
311
312static inline uint16_t mavlink_msg_play_tune_get_tune2(
const mavlink_message_t* msg,
char *tune2)
314 return _MAV_RETURN_char_array(msg, tune2, 200, 32);
318
319
320
321
322
323static inline void mavlink_msg_play_tune_decode(
const mavlink_message_t* msg, mavlink_play_tune_t* play_tune)
325#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
326 play_tune->target_system = mavlink_msg_play_tune_get_target_system(msg);
327 play_tune->target_component = mavlink_msg_play_tune_get_target_component(msg);
328 mavlink_msg_play_tune_get_tune(msg, play_tune->tune);
329 mavlink_msg_play_tune_get_tune2(msg, play_tune->tune2);
331 uint8_t len = msg->len < MAVLINK_MSG_ID_PLAY_TUNE_LEN? msg->len : MAVLINK_MSG_ID_PLAY_TUNE_LEN;
332 memset(play_tune, 0, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
333 memcpy(play_tune, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_PLAY_TUNE_CRC
Definition: mavlink_msg_play_tune.h:19
#define MAVLINK_MSG_ID_PLAY_TUNE
Definition: mavlink_msg_play_tune.h:4
#define MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN
Definition: mavlink_msg_play_tune.h:15
#define MAVLINK_MSG_ID_PLAY_TUNE_LEN
Definition: mavlink_msg_play_tune.h:14
Definition: mavlink_msg_play_tune.h:7
uint8_t target_component
Definition: mavlink_msg_play_tune.h:9
char tune[30]
Definition: mavlink_msg_play_tune.h:10
char tune2[200]
Definition: mavlink_msg_play_tune.h:11
uint8_t target_system
Definition: mavlink_msg_play_tune.h:8