00001
00002
00003 #define MAVLINK_MSG_ID_RADIO_STATUS 109
00004
00005 typedef struct __mavlink_radio_status_t
00006 {
00007 uint16_t rxerrors;
00008 uint16_t fixed;
00009 uint8_t rssi;
00010 uint8_t remrssi;
00011 uint8_t txbuf;
00012 uint8_t noise;
00013 uint8_t remnoise;
00014 } mavlink_radio_status_t;
00015
00016 #define MAVLINK_MSG_ID_RADIO_STATUS_LEN 9
00017 #define MAVLINK_MSG_ID_109_LEN 9
00018
00019 #define MAVLINK_MSG_ID_RADIO_STATUS_CRC 185
00020 #define MAVLINK_MSG_ID_109_CRC 185
00021
00022
00023
00024 #define MAVLINK_MESSAGE_INFO_RADIO_STATUS { \
00025 "RADIO_STATUS", \
00026 7, \
00027 { { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_status_t, rxerrors) }, \
00028 { "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_status_t, fixed) }, \
00029 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_status_t, rssi) }, \
00030 { "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_status_t, remrssi) }, \
00031 { "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_status_t, txbuf) }, \
00032 { "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_status_t, noise) }, \
00033 { "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_status_t, remnoise) }, \
00034 } \
00035 }
00036
00037
00053 static inline uint16_t mavlink_msg_radio_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
00054 uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
00055 {
00056 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00057 char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN];
00058 _mav_put_uint16_t(buf, 0, rxerrors);
00059 _mav_put_uint16_t(buf, 2, fixed);
00060 _mav_put_uint8_t(buf, 4, rssi);
00061 _mav_put_uint8_t(buf, 5, remrssi);
00062 _mav_put_uint8_t(buf, 6, txbuf);
00063 _mav_put_uint8_t(buf, 7, noise);
00064 _mav_put_uint8_t(buf, 8, remnoise);
00065
00066 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00067 #else
00068 mavlink_radio_status_t packet;
00069 packet.rxerrors = rxerrors;
00070 packet.fixed = fixed;
00071 packet.rssi = rssi;
00072 packet.remrssi = remrssi;
00073 packet.txbuf = txbuf;
00074 packet.noise = noise;
00075 packet.remnoise = remnoise;
00076
00077 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00078 #endif
00079
00080 msg->msgid = MAVLINK_MSG_ID_RADIO_STATUS;
00081 #if MAVLINK_CRC_EXTRA
00082 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
00083 #else
00084 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00085 #endif
00086 }
00087
00103 static inline uint16_t mavlink_msg_radio_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
00104 mavlink_message_t* msg,
00105 uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed)
00106 {
00107 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00108 char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN];
00109 _mav_put_uint16_t(buf, 0, rxerrors);
00110 _mav_put_uint16_t(buf, 2, fixed);
00111 _mav_put_uint8_t(buf, 4, rssi);
00112 _mav_put_uint8_t(buf, 5, remrssi);
00113 _mav_put_uint8_t(buf, 6, txbuf);
00114 _mav_put_uint8_t(buf, 7, noise);
00115 _mav_put_uint8_t(buf, 8, remnoise);
00116
00117 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00118 #else
00119 mavlink_radio_status_t packet;
00120 packet.rxerrors = rxerrors;
00121 packet.fixed = fixed;
00122 packet.rssi = rssi;
00123 packet.remrssi = remrssi;
00124 packet.txbuf = txbuf;
00125 packet.noise = noise;
00126 packet.remnoise = remnoise;
00127
00128 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00129 #endif
00130
00131 msg->msgid = MAVLINK_MSG_ID_RADIO_STATUS;
00132 #if MAVLINK_CRC_EXTRA
00133 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
00134 #else
00135 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00136 #endif
00137 }
00138
00147 static inline uint16_t mavlink_msg_radio_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_radio_status_t* radio_status)
00148 {
00149 return mavlink_msg_radio_status_pack(system_id, component_id, msg, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed);
00150 }
00151
00161 static inline uint16_t mavlink_msg_radio_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_radio_status_t* radio_status)
00162 {
00163 return mavlink_msg_radio_status_pack_chan(system_id, component_id, chan, msg, radio_status->rssi, radio_status->remrssi, radio_status->txbuf, radio_status->noise, radio_status->remnoise, radio_status->rxerrors, radio_status->fixed);
00164 }
00165
00178 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
00179
00180 static inline void mavlink_msg_radio_status_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)
00181 {
00182 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00183 char buf[MAVLINK_MSG_ID_RADIO_STATUS_LEN];
00184 _mav_put_uint16_t(buf, 0, rxerrors);
00185 _mav_put_uint16_t(buf, 2, fixed);
00186 _mav_put_uint8_t(buf, 4, rssi);
00187 _mav_put_uint8_t(buf, 5, remrssi);
00188 _mav_put_uint8_t(buf, 6, txbuf);
00189 _mav_put_uint8_t(buf, 7, noise);
00190 _mav_put_uint8_t(buf, 8, remnoise);
00191
00192 #if MAVLINK_CRC_EXTRA
00193 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
00194 #else
00195 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00196 #endif
00197 #else
00198 mavlink_radio_status_t packet;
00199 packet.rxerrors = rxerrors;
00200 packet.fixed = fixed;
00201 packet.rssi = rssi;
00202 packet.remrssi = remrssi;
00203 packet.txbuf = txbuf;
00204 packet.noise = noise;
00205 packet.remnoise = remnoise;
00206
00207 #if MAVLINK_CRC_EXTRA
00208 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)&packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
00209 #else
00210 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)&packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00211 #endif
00212 #endif
00213 }
00214
00215 #if MAVLINK_MSG_ID_RADIO_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
00216
00217
00218
00219
00220
00221
00222
00223 static inline void mavlink_msg_radio_status_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)
00224 {
00225 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00226 char *buf = (char *)msgbuf;
00227 _mav_put_uint16_t(buf, 0, rxerrors);
00228 _mav_put_uint16_t(buf, 2, fixed);
00229 _mav_put_uint8_t(buf, 4, rssi);
00230 _mav_put_uint8_t(buf, 5, remrssi);
00231 _mav_put_uint8_t(buf, 6, txbuf);
00232 _mav_put_uint8_t(buf, 7, noise);
00233 _mav_put_uint8_t(buf, 8, remnoise);
00234
00235 #if MAVLINK_CRC_EXTRA
00236 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
00237 #else
00238 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, buf, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00239 #endif
00240 #else
00241 mavlink_radio_status_t *packet = (mavlink_radio_status_t *)msgbuf;
00242 packet->rxerrors = rxerrors;
00243 packet->fixed = fixed;
00244 packet->rssi = rssi;
00245 packet->remrssi = remrssi;
00246 packet->txbuf = txbuf;
00247 packet->noise = noise;
00248 packet->remnoise = remnoise;
00249
00250 #if MAVLINK_CRC_EXTRA
00251 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN, MAVLINK_MSG_ID_RADIO_STATUS_CRC);
00252 #else
00253 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO_STATUS, (const char *)packet, MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00254 #endif
00255 #endif
00256 }
00257 #endif
00258
00259 #endif
00260
00261
00262
00263
00269 static inline uint8_t mavlink_msg_radio_status_get_rssi(const mavlink_message_t* msg)
00270 {
00271 return _MAV_RETURN_uint8_t(msg, 4);
00272 }
00273
00279 static inline uint8_t mavlink_msg_radio_status_get_remrssi(const mavlink_message_t* msg)
00280 {
00281 return _MAV_RETURN_uint8_t(msg, 5);
00282 }
00283
00289 static inline uint8_t mavlink_msg_radio_status_get_txbuf(const mavlink_message_t* msg)
00290 {
00291 return _MAV_RETURN_uint8_t(msg, 6);
00292 }
00293
00299 static inline uint8_t mavlink_msg_radio_status_get_noise(const mavlink_message_t* msg)
00300 {
00301 return _MAV_RETURN_uint8_t(msg, 7);
00302 }
00303
00309 static inline uint8_t mavlink_msg_radio_status_get_remnoise(const mavlink_message_t* msg)
00310 {
00311 return _MAV_RETURN_uint8_t(msg, 8);
00312 }
00313
00319 static inline uint16_t mavlink_msg_radio_status_get_rxerrors(const mavlink_message_t* msg)
00320 {
00321 return _MAV_RETURN_uint16_t(msg, 0);
00322 }
00323
00329 static inline uint16_t mavlink_msg_radio_status_get_fixed(const mavlink_message_t* msg)
00330 {
00331 return _MAV_RETURN_uint16_t(msg, 2);
00332 }
00333
00340 static inline void mavlink_msg_radio_status_decode(const mavlink_message_t* msg, mavlink_radio_status_t* radio_status)
00341 {
00342 #if MAVLINK_NEED_BYTE_SWAP
00343 radio_status->rxerrors = mavlink_msg_radio_status_get_rxerrors(msg);
00344 radio_status->fixed = mavlink_msg_radio_status_get_fixed(msg);
00345 radio_status->rssi = mavlink_msg_radio_status_get_rssi(msg);
00346 radio_status->remrssi = mavlink_msg_radio_status_get_remrssi(msg);
00347 radio_status->txbuf = mavlink_msg_radio_status_get_txbuf(msg);
00348 radio_status->noise = mavlink_msg_radio_status_get_noise(msg);
00349 radio_status->remnoise = mavlink_msg_radio_status_get_remnoise(msg);
00350 #else
00351 memcpy(radio_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RADIO_STATUS_LEN);
00352 #endif
00353 }