4#define MAVLINK_MSG_ID_RADIO 166
7typedef struct __mavlink_radio_t {
17#define MAVLINK_MSG_ID_RADIO_LEN 9
18#define MAVLINK_MSG_ID_RADIO_MIN_LEN 9
19#define MAVLINK_MSG_ID_166_LEN 9
20#define MAVLINK_MSG_ID_166_MIN_LEN 9
22#define MAVLINK_MSG_ID_RADIO_CRC 21
23#define MAVLINK_MSG_ID_166_CRC 21
27#if MAVLINK_COMMAND_24BIT
28#define MAVLINK_MESSAGE_INFO_RADIO { \
32 { { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_t, rssi) }, \
33 { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_t, remrssi) }, \
34 { "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_t, txbuf) }, \
35 { "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_t, noise) }, \
36 { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_t, remnoise) }, \
37 { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_t, rxerrors) }, \
38 { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_t, fixed) }, \
42#define MAVLINK_MESSAGE_INFO_RADIO { \
45 { { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_t, rssi) }, \
46 { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_t, remrssi) }, \
47 { "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_t, txbuf) }, \
48 { "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_t, noise) }, \
49 { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_t, remnoise) }, \
50 { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_t, rxerrors) }, \
51 { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_t, fixed) }, \
71static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
72 uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
74#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
75 char buf[MAVLINK_MSG_ID_RADIO_LEN];
76 _mav_put_uint16_t(buf, 0, rxerrors);
77 _mav_put_uint16_t(buf, 2, fixed);
78 _mav_put_uint8_t(buf, 4, rssi);
79 _mav_put_uint8_t(buf, 5, remrssi);
80 _mav_put_uint8_t(buf, 6, txbuf);
81 _mav_put_uint8_t(buf, 7, noise);
82 _mav_put_uint8_t(buf, 8, remnoise);
84 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_LEN);
86 mavlink_radio_t packet;
87 packet.rxerrors = rxerrors;
90 packet.remrssi = remrssi;
93 packet.remnoise = remnoise;
95 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_LEN);
98 msg->msgid = MAVLINK_MSG_ID_RADIO;
99 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
117static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
118 mavlink_message_t* msg,
119 uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed)
121#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
122 char buf[MAVLINK_MSG_ID_RADIO_LEN];
123 _mav_put_uint16_t(buf, 0, rxerrors);
124 _mav_put_uint16_t(buf, 2, fixed);
125 _mav_put_uint8_t(buf, 4, rssi);
126 _mav_put_uint8_t(buf, 5, remrssi);
127 _mav_put_uint8_t(buf, 6, txbuf);
128 _mav_put_uint8_t(buf, 7, noise);
129 _mav_put_uint8_t(buf, 8, remnoise);
131 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_LEN);
133 mavlink_radio_t packet;
134 packet.rxerrors = rxerrors;
135 packet.fixed = fixed;
137 packet.remrssi = remrssi;
138 packet.txbuf = txbuf;
139 packet.noise = noise;
140 packet.remnoise = remnoise;
142 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_LEN);
145 msg->msgid = MAVLINK_MSG_ID_RADIO;
146 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
157static inline uint16_t mavlink_msg_radio_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_radio_t* radio)
159 return mavlink_msg_radio_pack(system_id, component_id, msg, radio->rssi, radio->remrssi, radio->txbuf, radio->noise, radio->remnoise, radio->rxerrors, radio->fixed);
171static inline uint16_t mavlink_msg_radio_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_radio_t* radio)
173 return mavlink_msg_radio_pack_chan(system_id, component_id, chan, msg, radio->rssi, radio->remrssi, radio->txbuf, radio->noise, radio->remnoise, radio->rxerrors, radio->fixed);
188#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
190static inline void mavlink_msg_radio_send(mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
192#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193 char buf[MAVLINK_MSG_ID_RADIO_LEN];
194 _mav_put_uint16_t(buf, 0, rxerrors);
195 _mav_put_uint16_t(buf, 2, fixed);
196 _mav_put_uint8_t(buf, 4, rssi);
197 _mav_put_uint8_t(buf, 5, remrssi);
198 _mav_put_uint8_t(buf, 6, txbuf);
199 _mav_put_uint8_t(buf, 7, noise);
200 _mav_put_uint8_t(buf, 8, remnoise);
202 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
204 mavlink_radio_t packet;
205 packet.rxerrors = rxerrors;
206 packet.fixed = fixed;
208 packet.remrssi = remrssi;
209 packet.txbuf = txbuf;
210 packet.noise = noise;
211 packet.remnoise = remnoise;
213 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (
const char *)&packet, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
222static inline void mavlink_msg_radio_send_struct(mavlink_channel_t chan,
const mavlink_radio_t* radio)
224#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
225 mavlink_msg_radio_send(chan, radio->rssi, radio->remrssi, radio->txbuf, radio->noise, radio->remnoise, radio->rxerrors, radio->fixed);
227 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (
const char *)radio, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
231#if MAVLINK_MSG_ID_RADIO_LEN <= MAVLINK_MAX_PAYLOAD_LEN
239static inline void mavlink_msg_radio_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
241#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
242 char *buf = (
char *)msgbuf;
243 _mav_put_uint16_t(buf, 0, rxerrors);
244 _mav_put_uint16_t(buf, 2, fixed);
245 _mav_put_uint8_t(buf, 4, rssi);
246 _mav_put_uint8_t(buf, 5, remrssi);
247 _mav_put_uint8_t(buf, 6, txbuf);
248 _mav_put_uint8_t(buf, 7, noise);
249 _mav_put_uint8_t(buf, 8, remnoise);
251 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
253 mavlink_radio_t *packet = (mavlink_radio_t *)msgbuf;
254 packet->rxerrors = rxerrors;
255 packet->fixed = fixed;
257 packet->remrssi = remrssi;
258 packet->txbuf = txbuf;
259 packet->noise = noise;
260 packet->remnoise = remnoise;
262 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (
const char *)packet, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
277static inline uint8_t mavlink_msg_radio_get_rssi(
const mavlink_message_t* msg)
279 return _MAV_RETURN_uint8_t(msg, 4);
287static inline uint8_t mavlink_msg_radio_get_remrssi(
const mavlink_message_t* msg)
289 return _MAV_RETURN_uint8_t(msg, 5);
297static inline uint8_t mavlink_msg_radio_get_txbuf(
const mavlink_message_t* msg)
299 return _MAV_RETURN_uint8_t(msg, 6);
307static inline uint8_t mavlink_msg_radio_get_noise(
const mavlink_message_t* msg)
309 return _MAV_RETURN_uint8_t(msg, 7);
317static inline uint8_t mavlink_msg_radio_get_remnoise(
const mavlink_message_t* msg)
319 return _MAV_RETURN_uint8_t(msg, 8);
327static inline uint16_t mavlink_msg_radio_get_rxerrors(
const mavlink_message_t* msg)
329 return _MAV_RETURN_uint16_t(msg, 0);
337static inline uint16_t mavlink_msg_radio_get_fixed(
const mavlink_message_t* msg)
339 return _MAV_RETURN_uint16_t(msg, 2);
348static inline void mavlink_msg_radio_decode(
const mavlink_message_t* msg, mavlink_radio_t* radio)
350#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
351 radio->rxerrors = mavlink_msg_radio_get_rxerrors(msg);
352 radio->fixed = mavlink_msg_radio_get_fixed(msg);
353 radio->rssi = mavlink_msg_radio_get_rssi(msg);
354 radio->remrssi = mavlink_msg_radio_get_remrssi(msg);
355 radio->txbuf = mavlink_msg_radio_get_txbuf(msg);
356 radio->noise = mavlink_msg_radio_get_noise(msg);
357 radio->remnoise = mavlink_msg_radio_get_remnoise(msg);
359 uint8_t len = msg->len < MAVLINK_MSG_ID_RADIO_LEN? msg->len : MAVLINK_MSG_ID_RADIO_LEN;
360 memset(radio, 0, MAVLINK_MSG_ID_RADIO_LEN);
361 memcpy(radio, _MAV_PAYLOAD(msg), len);