4#define MAVLINK_MSG_ID_PLAY_TUNE 258
7typedef struct __mavlink_play_tune_t {
9 uint8_t target_component;
11}) mavlink_play_tune_t;
13#define MAVLINK_MSG_ID_PLAY_TUNE_LEN 32
14#define MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN 32
15#define MAVLINK_MSG_ID_258_LEN 32
16#define MAVLINK_MSG_ID_258_MIN_LEN 32
18#define MAVLINK_MSG_ID_PLAY_TUNE_CRC 187
19#define MAVLINK_MSG_ID_258_CRC 187
21#define MAVLINK_MSG_PLAY_TUNE_FIELD_TUNE_LEN 30
23#if MAVLINK_COMMAND_24BIT
24#define MAVLINK_MESSAGE_INFO_PLAY_TUNE { \
28 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_play_tune_t, target_system) }, \
29 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_play_tune_t, target_component) }, \
30 { "tune", NULL, MAVLINK_TYPE_CHAR, 30, 2, offsetof(mavlink_play_tune_t, tune) }, \
34#define MAVLINK_MESSAGE_INFO_PLAY_TUNE { \
37 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_play_tune_t, target_system) }, \
38 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_play_tune_t, target_component) }, \
39 { "tune", NULL, MAVLINK_TYPE_CHAR, 30, 2, offsetof(mavlink_play_tune_t, tune) }, \
55static inline uint16_t mavlink_msg_play_tune_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
56 uint8_t target_system, uint8_t target_component,
const char *tune)
58#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
59 char buf[MAVLINK_MSG_ID_PLAY_TUNE_LEN];
60 _mav_put_uint8_t(buf, 0, target_system);
61 _mav_put_uint8_t(buf, 1, target_component);
62 _mav_put_char_array(buf, 2, tune, 30);
63 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
65 mavlink_play_tune_t packet;
66 packet.target_system = target_system;
67 packet.target_component = target_component;
68 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*30);
69 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
72 msg->msgid = MAVLINK_MSG_ID_PLAY_TUNE;
73 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_LEN, MAVLINK_MSG_ID_PLAY_TUNE_CRC);
87static inline uint16_t mavlink_msg_play_tune_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
88 mavlink_message_t* msg,
89 uint8_t target_system,uint8_t target_component,
const char *tune)
91#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
92 char buf[MAVLINK_MSG_ID_PLAY_TUNE_LEN];
93 _mav_put_uint8_t(buf, 0, target_system);
94 _mav_put_uint8_t(buf, 1, target_component);
95 _mav_put_char_array(buf, 2, tune, 30);
96 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
98 mavlink_play_tune_t packet;
99 packet.target_system = target_system;
100 packet.target_component = target_component;
101 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*30);
102 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
105 msg->msgid = MAVLINK_MSG_ID_PLAY_TUNE;
106 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN, MAVLINK_MSG_ID_PLAY_TUNE_LEN, MAVLINK_MSG_ID_PLAY_TUNE_CRC);
117static 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)
119 return mavlink_msg_play_tune_pack(system_id, component_id, msg, play_tune->target_system, play_tune->target_component, play_tune->tune);
131static 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)
133 return mavlink_msg_play_tune_pack_chan(system_id, component_id, chan, msg, play_tune->target_system, play_tune->target_component, play_tune->tune);
144#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
146static inline void mavlink_msg_play_tune_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component,
const char *tune)
148#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
149 char buf[MAVLINK_MSG_ID_PLAY_TUNE_LEN];
150 _mav_put_uint8_t(buf, 0, target_system);
151 _mav_put_uint8_t(buf, 1, target_component);
152 _mav_put_char_array(buf, 2, tune, 30);
153 _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);
155 mavlink_play_tune_t packet;
156 packet.target_system = target_system;
157 packet.target_component = target_component;
158 mav_array_memcpy(packet.tune, tune,
sizeof(
char)*30);
159 _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);
168static inline void mavlink_msg_play_tune_send_struct(mavlink_channel_t chan,
const mavlink_play_tune_t* play_tune)
170#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171 mavlink_msg_play_tune_send(chan, play_tune->target_system, play_tune->target_component, play_tune->tune);
173 _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);
177#if MAVLINK_MSG_ID_PLAY_TUNE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
185static 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)
187#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
188 char *buf = (
char *)msgbuf;
189 _mav_put_uint8_t(buf, 0, target_system);
190 _mav_put_uint8_t(buf, 1, target_component);
191 _mav_put_char_array(buf, 2, tune, 30);
192 _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);
194 mavlink_play_tune_t *packet = (mavlink_play_tune_t *)msgbuf;
195 packet->target_system = target_system;
196 packet->target_component = target_component;
197 mav_array_memcpy(packet->tune, tune,
sizeof(
char)*30);
198 _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);
213static inline uint8_t mavlink_msg_play_tune_get_target_system(
const mavlink_message_t* msg)
215 return _MAV_RETURN_uint8_t(msg, 0);
223static inline uint8_t mavlink_msg_play_tune_get_target_component(
const mavlink_message_t* msg)
225 return _MAV_RETURN_uint8_t(msg, 1);
233static inline uint16_t mavlink_msg_play_tune_get_tune(
const mavlink_message_t* msg,
char *tune)
235 return _MAV_RETURN_char_array(msg, tune, 30, 2);
244static inline void mavlink_msg_play_tune_decode(
const mavlink_message_t* msg, mavlink_play_tune_t* play_tune)
246#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
247 play_tune->target_system = mavlink_msg_play_tune_get_target_system(msg);
248 play_tune->target_component = mavlink_msg_play_tune_get_target_component(msg);
249 mavlink_msg_play_tune_get_tune(msg, play_tune->tune);
251 uint8_t len = msg->len < MAVLINK_MSG_ID_PLAY_TUNE_LEN? msg->len : MAVLINK_MSG_ID_PLAY_TUNE_LEN;
252 memset(play_tune, 0, MAVLINK_MSG_ID_PLAY_TUNE_LEN);
253 memcpy(play_tune, _MAV_PAYLOAD(msg), len);