添加MAVLINK协议库

This commit is contained in:
OPTOC
2025-09-02 10:34:06 +08:00
parent 7960bb80ec
commit 040ce2c62c
360 changed files with 143976 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
/** @file
* @brief MAVLink comm protocol built from uAvionix.xml
* @see http://mavlink.org
*/
#pragma once
#ifndef MAVLINK_H
#define MAVLINK_H
#define MAVLINK_PRIMARY_XML_IDX 2
#ifndef MAVLINK_STX
#define MAVLINK_STX 253
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 1
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 1
#endif
#ifndef MAVLINK_COMMAND_24BIT
#define MAVLINK_COMMAND_24BIT 1
#endif
#include "version.h"
#include "uAvionix.h"
#endif // MAVLINK_H

View File

@@ -0,0 +1,380 @@
#pragma once
// MESSAGE UAVIONIX_ADSB_OUT_CFG PACKING
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG 10001
MAVPACKED(
typedef struct __mavlink_uavionix_adsb_out_cfg_t {
uint32_t ICAO; /*< Vehicle address (24 bit)*/
uint16_t stallSpeed; /*< [cm/s] Aircraft stall speed in cm/s*/
char callsign[9]; /*< Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, " " only)*/
uint8_t emitterType; /*< Transmitting vehicle type. See ADSB_EMITTER_TYPE enum*/
uint8_t aircraftSize; /*< Aircraft length and width encoding (table 2-35 of DO-282B)*/
uint8_t gpsOffsetLat; /*< GPS antenna lateral offset (table 2-36 of DO-282B)*/
uint8_t gpsOffsetLon; /*< GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B)*/
uint8_t rfSelect; /*< ADS-B transponder reciever and transmit enable flags*/
}) mavlink_uavionix_adsb_out_cfg_t;
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN 20
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN 20
#define MAVLINK_MSG_ID_10001_LEN 20
#define MAVLINK_MSG_ID_10001_MIN_LEN 20
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_CRC 209
#define MAVLINK_MSG_ID_10001_CRC 209
#define MAVLINK_MSG_UAVIONIX_ADSB_OUT_CFG_FIELD_CALLSIGN_LEN 9
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_OUT_CFG { \
10001, \
"UAVIONIX_ADSB_OUT_CFG", \
8, \
{ { "ICAO", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_uavionix_adsb_out_cfg_t, ICAO) }, \
{ "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 6, offsetof(mavlink_uavionix_adsb_out_cfg_t, callsign) }, \
{ "emitterType", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_uavionix_adsb_out_cfg_t, emitterType) }, \
{ "aircraftSize", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_uavionix_adsb_out_cfg_t, aircraftSize) }, \
{ "gpsOffsetLat", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_uavionix_adsb_out_cfg_t, gpsOffsetLat) }, \
{ "gpsOffsetLon", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_uavionix_adsb_out_cfg_t, gpsOffsetLon) }, \
{ "stallSpeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_uavionix_adsb_out_cfg_t, stallSpeed) }, \
{ "rfSelect", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_uavionix_adsb_out_cfg_t, rfSelect) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_OUT_CFG { \
"UAVIONIX_ADSB_OUT_CFG", \
8, \
{ { "ICAO", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_uavionix_adsb_out_cfg_t, ICAO) }, \
{ "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 6, offsetof(mavlink_uavionix_adsb_out_cfg_t, callsign) }, \
{ "emitterType", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_uavionix_adsb_out_cfg_t, emitterType) }, \
{ "aircraftSize", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_uavionix_adsb_out_cfg_t, aircraftSize) }, \
{ "gpsOffsetLat", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_uavionix_adsb_out_cfg_t, gpsOffsetLat) }, \
{ "gpsOffsetLon", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_uavionix_adsb_out_cfg_t, gpsOffsetLon) }, \
{ "stallSpeed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_uavionix_adsb_out_cfg_t, stallSpeed) }, \
{ "rfSelect", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_uavionix_adsb_out_cfg_t, rfSelect) }, \
} \
}
#endif
/**
* @brief Pack a uavionix_adsb_out_cfg message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param ICAO Vehicle address (24 bit)
* @param callsign Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, " " only)
* @param emitterType Transmitting vehicle type. See ADSB_EMITTER_TYPE enum
* @param aircraftSize Aircraft length and width encoding (table 2-35 of DO-282B)
* @param gpsOffsetLat GPS antenna lateral offset (table 2-36 of DO-282B)
* @param gpsOffsetLon GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B)
* @param stallSpeed [cm/s] Aircraft stall speed in cm/s
* @param rfSelect ADS-B transponder reciever and transmit enable flags
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_cfg_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t ICAO, const char *callsign, uint8_t emitterType, uint8_t aircraftSize, uint8_t gpsOffsetLat, uint8_t gpsOffsetLon, uint16_t stallSpeed, uint8_t rfSelect)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN];
_mav_put_uint32_t(buf, 0, ICAO);
_mav_put_uint16_t(buf, 4, stallSpeed);
_mav_put_uint8_t(buf, 15, emitterType);
_mav_put_uint8_t(buf, 16, aircraftSize);
_mav_put_uint8_t(buf, 17, gpsOffsetLat);
_mav_put_uint8_t(buf, 18, gpsOffsetLon);
_mav_put_uint8_t(buf, 19, rfSelect);
_mav_put_char_array(buf, 6, callsign, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN);
#else
mavlink_uavionix_adsb_out_cfg_t packet;
packet.ICAO = ICAO;
packet.stallSpeed = stallSpeed;
packet.emitterType = emitterType;
packet.aircraftSize = aircraftSize;
packet.gpsOffsetLat = gpsOffsetLat;
packet.gpsOffsetLon = gpsOffsetLon;
packet.rfSelect = rfSelect;
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_CRC);
}
/**
* @brief Pack a uavionix_adsb_out_cfg message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param ICAO Vehicle address (24 bit)
* @param callsign Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, " " only)
* @param emitterType Transmitting vehicle type. See ADSB_EMITTER_TYPE enum
* @param aircraftSize Aircraft length and width encoding (table 2-35 of DO-282B)
* @param gpsOffsetLat GPS antenna lateral offset (table 2-36 of DO-282B)
* @param gpsOffsetLon GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B)
* @param stallSpeed [cm/s] Aircraft stall speed in cm/s
* @param rfSelect ADS-B transponder reciever and transmit enable flags
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_cfg_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t ICAO,const char *callsign,uint8_t emitterType,uint8_t aircraftSize,uint8_t gpsOffsetLat,uint8_t gpsOffsetLon,uint16_t stallSpeed,uint8_t rfSelect)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN];
_mav_put_uint32_t(buf, 0, ICAO);
_mav_put_uint16_t(buf, 4, stallSpeed);
_mav_put_uint8_t(buf, 15, emitterType);
_mav_put_uint8_t(buf, 16, aircraftSize);
_mav_put_uint8_t(buf, 17, gpsOffsetLat);
_mav_put_uint8_t(buf, 18, gpsOffsetLon);
_mav_put_uint8_t(buf, 19, rfSelect);
_mav_put_char_array(buf, 6, callsign, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN);
#else
mavlink_uavionix_adsb_out_cfg_t packet;
packet.ICAO = ICAO;
packet.stallSpeed = stallSpeed;
packet.emitterType = emitterType;
packet.aircraftSize = aircraftSize;
packet.gpsOffsetLat = gpsOffsetLat;
packet.gpsOffsetLon = gpsOffsetLon;
packet.rfSelect = rfSelect;
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_CRC);
}
/**
* @brief Encode a uavionix_adsb_out_cfg struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param uavionix_adsb_out_cfg C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_cfg_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uavionix_adsb_out_cfg_t* uavionix_adsb_out_cfg)
{
return mavlink_msg_uavionix_adsb_out_cfg_pack(system_id, component_id, msg, uavionix_adsb_out_cfg->ICAO, uavionix_adsb_out_cfg->callsign, uavionix_adsb_out_cfg->emitterType, uavionix_adsb_out_cfg->aircraftSize, uavionix_adsb_out_cfg->gpsOffsetLat, uavionix_adsb_out_cfg->gpsOffsetLon, uavionix_adsb_out_cfg->stallSpeed, uavionix_adsb_out_cfg->rfSelect);
}
/**
* @brief Encode a uavionix_adsb_out_cfg struct on a channel
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param uavionix_adsb_out_cfg C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_cfg_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uavionix_adsb_out_cfg_t* uavionix_adsb_out_cfg)
{
return mavlink_msg_uavionix_adsb_out_cfg_pack_chan(system_id, component_id, chan, msg, uavionix_adsb_out_cfg->ICAO, uavionix_adsb_out_cfg->callsign, uavionix_adsb_out_cfg->emitterType, uavionix_adsb_out_cfg->aircraftSize, uavionix_adsb_out_cfg->gpsOffsetLat, uavionix_adsb_out_cfg->gpsOffsetLon, uavionix_adsb_out_cfg->stallSpeed, uavionix_adsb_out_cfg->rfSelect);
}
/**
* @brief Send a uavionix_adsb_out_cfg message
* @param chan MAVLink channel to send the message
*
* @param ICAO Vehicle address (24 bit)
* @param callsign Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, " " only)
* @param emitterType Transmitting vehicle type. See ADSB_EMITTER_TYPE enum
* @param aircraftSize Aircraft length and width encoding (table 2-35 of DO-282B)
* @param gpsOffsetLat GPS antenna lateral offset (table 2-36 of DO-282B)
* @param gpsOffsetLon GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B)
* @param stallSpeed [cm/s] Aircraft stall speed in cm/s
* @param rfSelect ADS-B transponder reciever and transmit enable flags
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_uavionix_adsb_out_cfg_send(mavlink_channel_t chan, uint32_t ICAO, const char *callsign, uint8_t emitterType, uint8_t aircraftSize, uint8_t gpsOffsetLat, uint8_t gpsOffsetLon, uint16_t stallSpeed, uint8_t rfSelect)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN];
_mav_put_uint32_t(buf, 0, ICAO);
_mav_put_uint16_t(buf, 4, stallSpeed);
_mav_put_uint8_t(buf, 15, emitterType);
_mav_put_uint8_t(buf, 16, aircraftSize);
_mav_put_uint8_t(buf, 17, gpsOffsetLat);
_mav_put_uint8_t(buf, 18, gpsOffsetLon);
_mav_put_uint8_t(buf, 19, rfSelect);
_mav_put_char_array(buf, 6, callsign, 9);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG, buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_CRC);
#else
mavlink_uavionix_adsb_out_cfg_t packet;
packet.ICAO = ICAO;
packet.stallSpeed = stallSpeed;
packet.emitterType = emitterType;
packet.aircraftSize = aircraftSize;
packet.gpsOffsetLat = gpsOffsetLat;
packet.gpsOffsetLon = gpsOffsetLon;
packet.rfSelect = rfSelect;
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG, (const char *)&packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_CRC);
#endif
}
/**
* @brief Send a uavionix_adsb_out_cfg message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_uavionix_adsb_out_cfg_send_struct(mavlink_channel_t chan, const mavlink_uavionix_adsb_out_cfg_t* uavionix_adsb_out_cfg)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_uavionix_adsb_out_cfg_send(chan, uavionix_adsb_out_cfg->ICAO, uavionix_adsb_out_cfg->callsign, uavionix_adsb_out_cfg->emitterType, uavionix_adsb_out_cfg->aircraftSize, uavionix_adsb_out_cfg->gpsOffsetLat, uavionix_adsb_out_cfg->gpsOffsetLon, uavionix_adsb_out_cfg->stallSpeed, uavionix_adsb_out_cfg->rfSelect);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG, (const char *)uavionix_adsb_out_cfg, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_CRC);
#endif
}
#if MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
mavlink_message_t which is the size of a full mavlink message. This
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_uavionix_adsb_out_cfg_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t ICAO, const char *callsign, uint8_t emitterType, uint8_t aircraftSize, uint8_t gpsOffsetLat, uint8_t gpsOffsetLon, uint16_t stallSpeed, uint8_t rfSelect)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, ICAO);
_mav_put_uint16_t(buf, 4, stallSpeed);
_mav_put_uint8_t(buf, 15, emitterType);
_mav_put_uint8_t(buf, 16, aircraftSize);
_mav_put_uint8_t(buf, 17, gpsOffsetLat);
_mav_put_uint8_t(buf, 18, gpsOffsetLon);
_mav_put_uint8_t(buf, 19, rfSelect);
_mav_put_char_array(buf, 6, callsign, 9);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG, buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_CRC);
#else
mavlink_uavionix_adsb_out_cfg_t *packet = (mavlink_uavionix_adsb_out_cfg_t *)msgbuf;
packet->ICAO = ICAO;
packet->stallSpeed = stallSpeed;
packet->emitterType = emitterType;
packet->aircraftSize = aircraftSize;
packet->gpsOffsetLat = gpsOffsetLat;
packet->gpsOffsetLon = gpsOffsetLon;
packet->rfSelect = rfSelect;
mav_array_memcpy(packet->callsign, callsign, sizeof(char)*9);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG, (const char *)packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_CRC);
#endif
}
#endif
#endif
// MESSAGE UAVIONIX_ADSB_OUT_CFG UNPACKING
/**
* @brief Get field ICAO from uavionix_adsb_out_cfg message
*
* @return Vehicle address (24 bit)
*/
static inline uint32_t mavlink_msg_uavionix_adsb_out_cfg_get_ICAO(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field callsign from uavionix_adsb_out_cfg message
*
* @return Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, " " only)
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_cfg_get_callsign(const mavlink_message_t* msg, char *callsign)
{
return _MAV_RETURN_char_array(msg, callsign, 9, 6);
}
/**
* @brief Get field emitterType from uavionix_adsb_out_cfg message
*
* @return Transmitting vehicle type. See ADSB_EMITTER_TYPE enum
*/
static inline uint8_t mavlink_msg_uavionix_adsb_out_cfg_get_emitterType(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 15);
}
/**
* @brief Get field aircraftSize from uavionix_adsb_out_cfg message
*
* @return Aircraft length and width encoding (table 2-35 of DO-282B)
*/
static inline uint8_t mavlink_msg_uavionix_adsb_out_cfg_get_aircraftSize(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
* @brief Get field gpsOffsetLat from uavionix_adsb_out_cfg message
*
* @return GPS antenna lateral offset (table 2-36 of DO-282B)
*/
static inline uint8_t mavlink_msg_uavionix_adsb_out_cfg_get_gpsOffsetLat(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 17);
}
/**
* @brief Get field gpsOffsetLon from uavionix_adsb_out_cfg message
*
* @return GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B)
*/
static inline uint8_t mavlink_msg_uavionix_adsb_out_cfg_get_gpsOffsetLon(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 18);
}
/**
* @brief Get field stallSpeed from uavionix_adsb_out_cfg message
*
* @return [cm/s] Aircraft stall speed in cm/s
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_cfg_get_stallSpeed(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field rfSelect from uavionix_adsb_out_cfg message
*
* @return ADS-B transponder reciever and transmit enable flags
*/
static inline uint8_t mavlink_msg_uavionix_adsb_out_cfg_get_rfSelect(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 19);
}
/**
* @brief Decode a uavionix_adsb_out_cfg message into a struct
*
* @param msg The message to decode
* @param uavionix_adsb_out_cfg C-struct to decode the message contents into
*/
static inline void mavlink_msg_uavionix_adsb_out_cfg_decode(const mavlink_message_t* msg, mavlink_uavionix_adsb_out_cfg_t* uavionix_adsb_out_cfg)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
uavionix_adsb_out_cfg->ICAO = mavlink_msg_uavionix_adsb_out_cfg_get_ICAO(msg);
uavionix_adsb_out_cfg->stallSpeed = mavlink_msg_uavionix_adsb_out_cfg_get_stallSpeed(msg);
mavlink_msg_uavionix_adsb_out_cfg_get_callsign(msg, uavionix_adsb_out_cfg->callsign);
uavionix_adsb_out_cfg->emitterType = mavlink_msg_uavionix_adsb_out_cfg_get_emitterType(msg);
uavionix_adsb_out_cfg->aircraftSize = mavlink_msg_uavionix_adsb_out_cfg_get_aircraftSize(msg);
uavionix_adsb_out_cfg->gpsOffsetLat = mavlink_msg_uavionix_adsb_out_cfg_get_gpsOffsetLat(msg);
uavionix_adsb_out_cfg->gpsOffsetLon = mavlink_msg_uavionix_adsb_out_cfg_get_gpsOffsetLon(msg);
uavionix_adsb_out_cfg->rfSelect = mavlink_msg_uavionix_adsb_out_cfg_get_rfSelect(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN? msg->len : MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN;
memset(uavionix_adsb_out_cfg, 0, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_LEN);
memcpy(uavionix_adsb_out_cfg, _MAV_PAYLOAD(msg), len);
#endif
}

View File

@@ -0,0 +1,588 @@
#pragma once
// MESSAGE UAVIONIX_ADSB_OUT_DYNAMIC PACKING
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC 10002
MAVPACKED(
typedef struct __mavlink_uavionix_adsb_out_dynamic_t {
uint32_t utcTime; /*< [s] UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX*/
int32_t gpsLat; /*< [degE7] Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX*/
int32_t gpsLon; /*< [degE7] Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX*/
int32_t gpsAlt; /*< [mm] Altitude in mm (m * 1E-3) UP +ve. WGS84 altitude. If unknown set to INT32_MAX*/
int32_t baroAltMSL; /*< [mbar] Barometric pressure altitude relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX*/
uint32_t accuracyHor; /*< [mm] Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX*/
uint16_t accuracyVert; /*< [cm] Vertical accuracy in cm. If unknown set to UINT16_MAX*/
uint16_t accuracyVel; /*< [mm/s] Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX*/
int16_t velVert; /*< [cm/s] GPS vertical speed in cm/s. If unknown set to INT16_MAX*/
int16_t velNS; /*< [cm/s] North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX*/
int16_t VelEW; /*< [cm/s] East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX*/
uint16_t state; /*< ADS-B transponder dynamic input state flags*/
uint16_t squawk; /*< Mode A code (typically 1200 [0x04B0] for VFR)*/
uint8_t gpsFix; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK*/
uint8_t numSats; /*< Number of satellites visible. If unknown set to UINT8_MAX*/
uint8_t emergencyStatus; /*< Emergency status*/
}) mavlink_uavionix_adsb_out_dynamic_t;
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN 41
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN 41
#define MAVLINK_MSG_ID_10002_LEN 41
#define MAVLINK_MSG_ID_10002_MIN_LEN 41
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_CRC 186
#define MAVLINK_MSG_ID_10002_CRC 186
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_OUT_DYNAMIC { \
10002, \
"UAVIONIX_ADSB_OUT_DYNAMIC", \
16, \
{ { "utcTime", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_uavionix_adsb_out_dynamic_t, utcTime) }, \
{ "gpsLat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_uavionix_adsb_out_dynamic_t, gpsLat) }, \
{ "gpsLon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_uavionix_adsb_out_dynamic_t, gpsLon) }, \
{ "gpsAlt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_uavionix_adsb_out_dynamic_t, gpsAlt) }, \
{ "gpsFix", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_uavionix_adsb_out_dynamic_t, gpsFix) }, \
{ "numSats", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_uavionix_adsb_out_dynamic_t, numSats) }, \
{ "baroAltMSL", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_uavionix_adsb_out_dynamic_t, baroAltMSL) }, \
{ "accuracyHor", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_uavionix_adsb_out_dynamic_t, accuracyHor) }, \
{ "accuracyVert", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_uavionix_adsb_out_dynamic_t, accuracyVert) }, \
{ "accuracyVel", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_uavionix_adsb_out_dynamic_t, accuracyVel) }, \
{ "velVert", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_uavionix_adsb_out_dynamic_t, velVert) }, \
{ "velNS", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_uavionix_adsb_out_dynamic_t, velNS) }, \
{ "VelEW", NULL, MAVLINK_TYPE_INT16_T, 0, 32, offsetof(mavlink_uavionix_adsb_out_dynamic_t, VelEW) }, \
{ "emergencyStatus", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_uavionix_adsb_out_dynamic_t, emergencyStatus) }, \
{ "state", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_uavionix_adsb_out_dynamic_t, state) }, \
{ "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_uavionix_adsb_out_dynamic_t, squawk) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_OUT_DYNAMIC { \
"UAVIONIX_ADSB_OUT_DYNAMIC", \
16, \
{ { "utcTime", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_uavionix_adsb_out_dynamic_t, utcTime) }, \
{ "gpsLat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_uavionix_adsb_out_dynamic_t, gpsLat) }, \
{ "gpsLon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_uavionix_adsb_out_dynamic_t, gpsLon) }, \
{ "gpsAlt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_uavionix_adsb_out_dynamic_t, gpsAlt) }, \
{ "gpsFix", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_uavionix_adsb_out_dynamic_t, gpsFix) }, \
{ "numSats", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_uavionix_adsb_out_dynamic_t, numSats) }, \
{ "baroAltMSL", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_uavionix_adsb_out_dynamic_t, baroAltMSL) }, \
{ "accuracyHor", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_uavionix_adsb_out_dynamic_t, accuracyHor) }, \
{ "accuracyVert", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_uavionix_adsb_out_dynamic_t, accuracyVert) }, \
{ "accuracyVel", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_uavionix_adsb_out_dynamic_t, accuracyVel) }, \
{ "velVert", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_uavionix_adsb_out_dynamic_t, velVert) }, \
{ "velNS", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_uavionix_adsb_out_dynamic_t, velNS) }, \
{ "VelEW", NULL, MAVLINK_TYPE_INT16_T, 0, 32, offsetof(mavlink_uavionix_adsb_out_dynamic_t, VelEW) }, \
{ "emergencyStatus", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_uavionix_adsb_out_dynamic_t, emergencyStatus) }, \
{ "state", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_uavionix_adsb_out_dynamic_t, state) }, \
{ "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_uavionix_adsb_out_dynamic_t, squawk) }, \
} \
}
#endif
/**
* @brief Pack a uavionix_adsb_out_dynamic message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param utcTime [s] UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX
* @param gpsLat [degE7] Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX
* @param gpsLon [degE7] Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX
* @param gpsAlt [mm] Altitude in mm (m * 1E-3) UP +ve. WGS84 altitude. If unknown set to INT32_MAX
* @param gpsFix 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK
* @param numSats Number of satellites visible. If unknown set to UINT8_MAX
* @param baroAltMSL [mbar] Barometric pressure altitude relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX
* @param accuracyHor [mm] Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX
* @param accuracyVert [cm] Vertical accuracy in cm. If unknown set to UINT16_MAX
* @param accuracyVel [mm/s] Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX
* @param velVert [cm/s] GPS vertical speed in cm/s. If unknown set to INT16_MAX
* @param velNS [cm/s] North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX
* @param VelEW [cm/s] East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX
* @param emergencyStatus Emergency status
* @param state ADS-B transponder dynamic input state flags
* @param squawk Mode A code (typically 1200 [0x04B0] for VFR)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_dynamic_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t utcTime, int32_t gpsLat, int32_t gpsLon, int32_t gpsAlt, uint8_t gpsFix, uint8_t numSats, int32_t baroAltMSL, uint32_t accuracyHor, uint16_t accuracyVert, uint16_t accuracyVel, int16_t velVert, int16_t velNS, int16_t VelEW, uint8_t emergencyStatus, uint16_t state, uint16_t squawk)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN];
_mav_put_uint32_t(buf, 0, utcTime);
_mav_put_int32_t(buf, 4, gpsLat);
_mav_put_int32_t(buf, 8, gpsLon);
_mav_put_int32_t(buf, 12, gpsAlt);
_mav_put_int32_t(buf, 16, baroAltMSL);
_mav_put_uint32_t(buf, 20, accuracyHor);
_mav_put_uint16_t(buf, 24, accuracyVert);
_mav_put_uint16_t(buf, 26, accuracyVel);
_mav_put_int16_t(buf, 28, velVert);
_mav_put_int16_t(buf, 30, velNS);
_mav_put_int16_t(buf, 32, VelEW);
_mav_put_uint16_t(buf, 34, state);
_mav_put_uint16_t(buf, 36, squawk);
_mav_put_uint8_t(buf, 38, gpsFix);
_mav_put_uint8_t(buf, 39, numSats);
_mav_put_uint8_t(buf, 40, emergencyStatus);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN);
#else
mavlink_uavionix_adsb_out_dynamic_t packet;
packet.utcTime = utcTime;
packet.gpsLat = gpsLat;
packet.gpsLon = gpsLon;
packet.gpsAlt = gpsAlt;
packet.baroAltMSL = baroAltMSL;
packet.accuracyHor = accuracyHor;
packet.accuracyVert = accuracyVert;
packet.accuracyVel = accuracyVel;
packet.velVert = velVert;
packet.velNS = velNS;
packet.VelEW = VelEW;
packet.state = state;
packet.squawk = squawk;
packet.gpsFix = gpsFix;
packet.numSats = numSats;
packet.emergencyStatus = emergencyStatus;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_CRC);
}
/**
* @brief Pack a uavionix_adsb_out_dynamic message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param utcTime [s] UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX
* @param gpsLat [degE7] Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX
* @param gpsLon [degE7] Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX
* @param gpsAlt [mm] Altitude in mm (m * 1E-3) UP +ve. WGS84 altitude. If unknown set to INT32_MAX
* @param gpsFix 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK
* @param numSats Number of satellites visible. If unknown set to UINT8_MAX
* @param baroAltMSL [mbar] Barometric pressure altitude relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX
* @param accuracyHor [mm] Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX
* @param accuracyVert [cm] Vertical accuracy in cm. If unknown set to UINT16_MAX
* @param accuracyVel [mm/s] Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX
* @param velVert [cm/s] GPS vertical speed in cm/s. If unknown set to INT16_MAX
* @param velNS [cm/s] North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX
* @param VelEW [cm/s] East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX
* @param emergencyStatus Emergency status
* @param state ADS-B transponder dynamic input state flags
* @param squawk Mode A code (typically 1200 [0x04B0] for VFR)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_dynamic_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t utcTime,int32_t gpsLat,int32_t gpsLon,int32_t gpsAlt,uint8_t gpsFix,uint8_t numSats,int32_t baroAltMSL,uint32_t accuracyHor,uint16_t accuracyVert,uint16_t accuracyVel,int16_t velVert,int16_t velNS,int16_t VelEW,uint8_t emergencyStatus,uint16_t state,uint16_t squawk)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN];
_mav_put_uint32_t(buf, 0, utcTime);
_mav_put_int32_t(buf, 4, gpsLat);
_mav_put_int32_t(buf, 8, gpsLon);
_mav_put_int32_t(buf, 12, gpsAlt);
_mav_put_int32_t(buf, 16, baroAltMSL);
_mav_put_uint32_t(buf, 20, accuracyHor);
_mav_put_uint16_t(buf, 24, accuracyVert);
_mav_put_uint16_t(buf, 26, accuracyVel);
_mav_put_int16_t(buf, 28, velVert);
_mav_put_int16_t(buf, 30, velNS);
_mav_put_int16_t(buf, 32, VelEW);
_mav_put_uint16_t(buf, 34, state);
_mav_put_uint16_t(buf, 36, squawk);
_mav_put_uint8_t(buf, 38, gpsFix);
_mav_put_uint8_t(buf, 39, numSats);
_mav_put_uint8_t(buf, 40, emergencyStatus);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN);
#else
mavlink_uavionix_adsb_out_dynamic_t packet;
packet.utcTime = utcTime;
packet.gpsLat = gpsLat;
packet.gpsLon = gpsLon;
packet.gpsAlt = gpsAlt;
packet.baroAltMSL = baroAltMSL;
packet.accuracyHor = accuracyHor;
packet.accuracyVert = accuracyVert;
packet.accuracyVel = accuracyVel;
packet.velVert = velVert;
packet.velNS = velNS;
packet.VelEW = VelEW;
packet.state = state;
packet.squawk = squawk;
packet.gpsFix = gpsFix;
packet.numSats = numSats;
packet.emergencyStatus = emergencyStatus;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_CRC);
}
/**
* @brief Encode a uavionix_adsb_out_dynamic struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param uavionix_adsb_out_dynamic C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_dynamic_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uavionix_adsb_out_dynamic_t* uavionix_adsb_out_dynamic)
{
return mavlink_msg_uavionix_adsb_out_dynamic_pack(system_id, component_id, msg, uavionix_adsb_out_dynamic->utcTime, uavionix_adsb_out_dynamic->gpsLat, uavionix_adsb_out_dynamic->gpsLon, uavionix_adsb_out_dynamic->gpsAlt, uavionix_adsb_out_dynamic->gpsFix, uavionix_adsb_out_dynamic->numSats, uavionix_adsb_out_dynamic->baroAltMSL, uavionix_adsb_out_dynamic->accuracyHor, uavionix_adsb_out_dynamic->accuracyVert, uavionix_adsb_out_dynamic->accuracyVel, uavionix_adsb_out_dynamic->velVert, uavionix_adsb_out_dynamic->velNS, uavionix_adsb_out_dynamic->VelEW, uavionix_adsb_out_dynamic->emergencyStatus, uavionix_adsb_out_dynamic->state, uavionix_adsb_out_dynamic->squawk);
}
/**
* @brief Encode a uavionix_adsb_out_dynamic struct on a channel
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param uavionix_adsb_out_dynamic C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_dynamic_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uavionix_adsb_out_dynamic_t* uavionix_adsb_out_dynamic)
{
return mavlink_msg_uavionix_adsb_out_dynamic_pack_chan(system_id, component_id, chan, msg, uavionix_adsb_out_dynamic->utcTime, uavionix_adsb_out_dynamic->gpsLat, uavionix_adsb_out_dynamic->gpsLon, uavionix_adsb_out_dynamic->gpsAlt, uavionix_adsb_out_dynamic->gpsFix, uavionix_adsb_out_dynamic->numSats, uavionix_adsb_out_dynamic->baroAltMSL, uavionix_adsb_out_dynamic->accuracyHor, uavionix_adsb_out_dynamic->accuracyVert, uavionix_adsb_out_dynamic->accuracyVel, uavionix_adsb_out_dynamic->velVert, uavionix_adsb_out_dynamic->velNS, uavionix_adsb_out_dynamic->VelEW, uavionix_adsb_out_dynamic->emergencyStatus, uavionix_adsb_out_dynamic->state, uavionix_adsb_out_dynamic->squawk);
}
/**
* @brief Send a uavionix_adsb_out_dynamic message
* @param chan MAVLink channel to send the message
*
* @param utcTime [s] UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX
* @param gpsLat [degE7] Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX
* @param gpsLon [degE7] Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX
* @param gpsAlt [mm] Altitude in mm (m * 1E-3) UP +ve. WGS84 altitude. If unknown set to INT32_MAX
* @param gpsFix 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK
* @param numSats Number of satellites visible. If unknown set to UINT8_MAX
* @param baroAltMSL [mbar] Barometric pressure altitude relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX
* @param accuracyHor [mm] Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX
* @param accuracyVert [cm] Vertical accuracy in cm. If unknown set to UINT16_MAX
* @param accuracyVel [mm/s] Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX
* @param velVert [cm/s] GPS vertical speed in cm/s. If unknown set to INT16_MAX
* @param velNS [cm/s] North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX
* @param VelEW [cm/s] East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX
* @param emergencyStatus Emergency status
* @param state ADS-B transponder dynamic input state flags
* @param squawk Mode A code (typically 1200 [0x04B0] for VFR)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_uavionix_adsb_out_dynamic_send(mavlink_channel_t chan, uint32_t utcTime, int32_t gpsLat, int32_t gpsLon, int32_t gpsAlt, uint8_t gpsFix, uint8_t numSats, int32_t baroAltMSL, uint32_t accuracyHor, uint16_t accuracyVert, uint16_t accuracyVel, int16_t velVert, int16_t velNS, int16_t VelEW, uint8_t emergencyStatus, uint16_t state, uint16_t squawk)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN];
_mav_put_uint32_t(buf, 0, utcTime);
_mav_put_int32_t(buf, 4, gpsLat);
_mav_put_int32_t(buf, 8, gpsLon);
_mav_put_int32_t(buf, 12, gpsAlt);
_mav_put_int32_t(buf, 16, baroAltMSL);
_mav_put_uint32_t(buf, 20, accuracyHor);
_mav_put_uint16_t(buf, 24, accuracyVert);
_mav_put_uint16_t(buf, 26, accuracyVel);
_mav_put_int16_t(buf, 28, velVert);
_mav_put_int16_t(buf, 30, velNS);
_mav_put_int16_t(buf, 32, VelEW);
_mav_put_uint16_t(buf, 34, state);
_mav_put_uint16_t(buf, 36, squawk);
_mav_put_uint8_t(buf, 38, gpsFix);
_mav_put_uint8_t(buf, 39, numSats);
_mav_put_uint8_t(buf, 40, emergencyStatus);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC, buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_CRC);
#else
mavlink_uavionix_adsb_out_dynamic_t packet;
packet.utcTime = utcTime;
packet.gpsLat = gpsLat;
packet.gpsLon = gpsLon;
packet.gpsAlt = gpsAlt;
packet.baroAltMSL = baroAltMSL;
packet.accuracyHor = accuracyHor;
packet.accuracyVert = accuracyVert;
packet.accuracyVel = accuracyVel;
packet.velVert = velVert;
packet.velNS = velNS;
packet.VelEW = VelEW;
packet.state = state;
packet.squawk = squawk;
packet.gpsFix = gpsFix;
packet.numSats = numSats;
packet.emergencyStatus = emergencyStatus;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC, (const char *)&packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_CRC);
#endif
}
/**
* @brief Send a uavionix_adsb_out_dynamic message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_uavionix_adsb_out_dynamic_send_struct(mavlink_channel_t chan, const mavlink_uavionix_adsb_out_dynamic_t* uavionix_adsb_out_dynamic)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_uavionix_adsb_out_dynamic_send(chan, uavionix_adsb_out_dynamic->utcTime, uavionix_adsb_out_dynamic->gpsLat, uavionix_adsb_out_dynamic->gpsLon, uavionix_adsb_out_dynamic->gpsAlt, uavionix_adsb_out_dynamic->gpsFix, uavionix_adsb_out_dynamic->numSats, uavionix_adsb_out_dynamic->baroAltMSL, uavionix_adsb_out_dynamic->accuracyHor, uavionix_adsb_out_dynamic->accuracyVert, uavionix_adsb_out_dynamic->accuracyVel, uavionix_adsb_out_dynamic->velVert, uavionix_adsb_out_dynamic->velNS, uavionix_adsb_out_dynamic->VelEW, uavionix_adsb_out_dynamic->emergencyStatus, uavionix_adsb_out_dynamic->state, uavionix_adsb_out_dynamic->squawk);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC, (const char *)uavionix_adsb_out_dynamic, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_CRC);
#endif
}
#if MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
mavlink_message_t which is the size of a full mavlink message. This
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_uavionix_adsb_out_dynamic_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t utcTime, int32_t gpsLat, int32_t gpsLon, int32_t gpsAlt, uint8_t gpsFix, uint8_t numSats, int32_t baroAltMSL, uint32_t accuracyHor, uint16_t accuracyVert, uint16_t accuracyVel, int16_t velVert, int16_t velNS, int16_t VelEW, uint8_t emergencyStatus, uint16_t state, uint16_t squawk)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, utcTime);
_mav_put_int32_t(buf, 4, gpsLat);
_mav_put_int32_t(buf, 8, gpsLon);
_mav_put_int32_t(buf, 12, gpsAlt);
_mav_put_int32_t(buf, 16, baroAltMSL);
_mav_put_uint32_t(buf, 20, accuracyHor);
_mav_put_uint16_t(buf, 24, accuracyVert);
_mav_put_uint16_t(buf, 26, accuracyVel);
_mav_put_int16_t(buf, 28, velVert);
_mav_put_int16_t(buf, 30, velNS);
_mav_put_int16_t(buf, 32, VelEW);
_mav_put_uint16_t(buf, 34, state);
_mav_put_uint16_t(buf, 36, squawk);
_mav_put_uint8_t(buf, 38, gpsFix);
_mav_put_uint8_t(buf, 39, numSats);
_mav_put_uint8_t(buf, 40, emergencyStatus);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC, buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_CRC);
#else
mavlink_uavionix_adsb_out_dynamic_t *packet = (mavlink_uavionix_adsb_out_dynamic_t *)msgbuf;
packet->utcTime = utcTime;
packet->gpsLat = gpsLat;
packet->gpsLon = gpsLon;
packet->gpsAlt = gpsAlt;
packet->baroAltMSL = baroAltMSL;
packet->accuracyHor = accuracyHor;
packet->accuracyVert = accuracyVert;
packet->accuracyVel = accuracyVel;
packet->velVert = velVert;
packet->velNS = velNS;
packet->VelEW = VelEW;
packet->state = state;
packet->squawk = squawk;
packet->gpsFix = gpsFix;
packet->numSats = numSats;
packet->emergencyStatus = emergencyStatus;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC, (const char *)packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_CRC);
#endif
}
#endif
#endif
// MESSAGE UAVIONIX_ADSB_OUT_DYNAMIC UNPACKING
/**
* @brief Get field utcTime from uavionix_adsb_out_dynamic message
*
* @return [s] UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX
*/
static inline uint32_t mavlink_msg_uavionix_adsb_out_dynamic_get_utcTime(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field gpsLat from uavionix_adsb_out_dynamic message
*
* @return [degE7] Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX
*/
static inline int32_t mavlink_msg_uavionix_adsb_out_dynamic_get_gpsLat(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 4);
}
/**
* @brief Get field gpsLon from uavionix_adsb_out_dynamic message
*
* @return [degE7] Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX
*/
static inline int32_t mavlink_msg_uavionix_adsb_out_dynamic_get_gpsLon(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 8);
}
/**
* @brief Get field gpsAlt from uavionix_adsb_out_dynamic message
*
* @return [mm] Altitude in mm (m * 1E-3) UP +ve. WGS84 altitude. If unknown set to INT32_MAX
*/
static inline int32_t mavlink_msg_uavionix_adsb_out_dynamic_get_gpsAlt(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 12);
}
/**
* @brief Get field gpsFix from uavionix_adsb_out_dynamic message
*
* @return 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK
*/
static inline uint8_t mavlink_msg_uavionix_adsb_out_dynamic_get_gpsFix(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 38);
}
/**
* @brief Get field numSats from uavionix_adsb_out_dynamic message
*
* @return Number of satellites visible. If unknown set to UINT8_MAX
*/
static inline uint8_t mavlink_msg_uavionix_adsb_out_dynamic_get_numSats(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 39);
}
/**
* @brief Get field baroAltMSL from uavionix_adsb_out_dynamic message
*
* @return [mbar] Barometric pressure altitude relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX
*/
static inline int32_t mavlink_msg_uavionix_adsb_out_dynamic_get_baroAltMSL(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 16);
}
/**
* @brief Get field accuracyHor from uavionix_adsb_out_dynamic message
*
* @return [mm] Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX
*/
static inline uint32_t mavlink_msg_uavionix_adsb_out_dynamic_get_accuracyHor(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 20);
}
/**
* @brief Get field accuracyVert from uavionix_adsb_out_dynamic message
*
* @return [cm] Vertical accuracy in cm. If unknown set to UINT16_MAX
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_dynamic_get_accuracyVert(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 24);
}
/**
* @brief Get field accuracyVel from uavionix_adsb_out_dynamic message
*
* @return [mm/s] Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_dynamic_get_accuracyVel(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 26);
}
/**
* @brief Get field velVert from uavionix_adsb_out_dynamic message
*
* @return [cm/s] GPS vertical speed in cm/s. If unknown set to INT16_MAX
*/
static inline int16_t mavlink_msg_uavionix_adsb_out_dynamic_get_velVert(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 28);
}
/**
* @brief Get field velNS from uavionix_adsb_out_dynamic message
*
* @return [cm/s] North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX
*/
static inline int16_t mavlink_msg_uavionix_adsb_out_dynamic_get_velNS(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 30);
}
/**
* @brief Get field VelEW from uavionix_adsb_out_dynamic message
*
* @return [cm/s] East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX
*/
static inline int16_t mavlink_msg_uavionix_adsb_out_dynamic_get_VelEW(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 32);
}
/**
* @brief Get field emergencyStatus from uavionix_adsb_out_dynamic message
*
* @return Emergency status
*/
static inline uint8_t mavlink_msg_uavionix_adsb_out_dynamic_get_emergencyStatus(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 40);
}
/**
* @brief Get field state from uavionix_adsb_out_dynamic message
*
* @return ADS-B transponder dynamic input state flags
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_dynamic_get_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 34);
}
/**
* @brief Get field squawk from uavionix_adsb_out_dynamic message
*
* @return Mode A code (typically 1200 [0x04B0] for VFR)
*/
static inline uint16_t mavlink_msg_uavionix_adsb_out_dynamic_get_squawk(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 36);
}
/**
* @brief Decode a uavionix_adsb_out_dynamic message into a struct
*
* @param msg The message to decode
* @param uavionix_adsb_out_dynamic C-struct to decode the message contents into
*/
static inline void mavlink_msg_uavionix_adsb_out_dynamic_decode(const mavlink_message_t* msg, mavlink_uavionix_adsb_out_dynamic_t* uavionix_adsb_out_dynamic)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
uavionix_adsb_out_dynamic->utcTime = mavlink_msg_uavionix_adsb_out_dynamic_get_utcTime(msg);
uavionix_adsb_out_dynamic->gpsLat = mavlink_msg_uavionix_adsb_out_dynamic_get_gpsLat(msg);
uavionix_adsb_out_dynamic->gpsLon = mavlink_msg_uavionix_adsb_out_dynamic_get_gpsLon(msg);
uavionix_adsb_out_dynamic->gpsAlt = mavlink_msg_uavionix_adsb_out_dynamic_get_gpsAlt(msg);
uavionix_adsb_out_dynamic->baroAltMSL = mavlink_msg_uavionix_adsb_out_dynamic_get_baroAltMSL(msg);
uavionix_adsb_out_dynamic->accuracyHor = mavlink_msg_uavionix_adsb_out_dynamic_get_accuracyHor(msg);
uavionix_adsb_out_dynamic->accuracyVert = mavlink_msg_uavionix_adsb_out_dynamic_get_accuracyVert(msg);
uavionix_adsb_out_dynamic->accuracyVel = mavlink_msg_uavionix_adsb_out_dynamic_get_accuracyVel(msg);
uavionix_adsb_out_dynamic->velVert = mavlink_msg_uavionix_adsb_out_dynamic_get_velVert(msg);
uavionix_adsb_out_dynamic->velNS = mavlink_msg_uavionix_adsb_out_dynamic_get_velNS(msg);
uavionix_adsb_out_dynamic->VelEW = mavlink_msg_uavionix_adsb_out_dynamic_get_VelEW(msg);
uavionix_adsb_out_dynamic->state = mavlink_msg_uavionix_adsb_out_dynamic_get_state(msg);
uavionix_adsb_out_dynamic->squawk = mavlink_msg_uavionix_adsb_out_dynamic_get_squawk(msg);
uavionix_adsb_out_dynamic->gpsFix = mavlink_msg_uavionix_adsb_out_dynamic_get_gpsFix(msg);
uavionix_adsb_out_dynamic->numSats = mavlink_msg_uavionix_adsb_out_dynamic_get_numSats(msg);
uavionix_adsb_out_dynamic->emergencyStatus = mavlink_msg_uavionix_adsb_out_dynamic_get_emergencyStatus(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN? msg->len : MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN;
memset(uavionix_adsb_out_dynamic, 0, MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_LEN);
memcpy(uavionix_adsb_out_dynamic, _MAV_PAYLOAD(msg), len);
#endif
}

View File

@@ -0,0 +1,213 @@
#pragma once
// MESSAGE UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT PACKING
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT 10003
MAVPACKED(
typedef struct __mavlink_uavionix_adsb_transceiver_health_report_t {
uint8_t rfHealth; /*< ADS-B transponder messages*/
}) mavlink_uavionix_adsb_transceiver_health_report_t;
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN 1
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN 1
#define MAVLINK_MSG_ID_10003_LEN 1
#define MAVLINK_MSG_ID_10003_MIN_LEN 1
#define MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_CRC 4
#define MAVLINK_MSG_ID_10003_CRC 4
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT { \
10003, \
"UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT", \
1, \
{ { "rfHealth", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_uavionix_adsb_transceiver_health_report_t, rfHealth) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT { \
"UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT", \
1, \
{ { "rfHealth", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_uavionix_adsb_transceiver_health_report_t, rfHealth) }, \
} \
}
#endif
/**
* @brief Pack a uavionix_adsb_transceiver_health_report message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param rfHealth ADS-B transponder messages
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_uavionix_adsb_transceiver_health_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t rfHealth)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN];
_mav_put_uint8_t(buf, 0, rfHealth);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN);
#else
mavlink_uavionix_adsb_transceiver_health_report_t packet;
packet.rfHealth = rfHealth;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_CRC);
}
/**
* @brief Pack a uavionix_adsb_transceiver_health_report message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param rfHealth ADS-B transponder messages
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_uavionix_adsb_transceiver_health_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t rfHealth)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN];
_mav_put_uint8_t(buf, 0, rfHealth);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN);
#else
mavlink_uavionix_adsb_transceiver_health_report_t packet;
packet.rfHealth = rfHealth;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_CRC);
}
/**
* @brief Encode a uavionix_adsb_transceiver_health_report struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param uavionix_adsb_transceiver_health_report C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_uavionix_adsb_transceiver_health_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uavionix_adsb_transceiver_health_report_t* uavionix_adsb_transceiver_health_report)
{
return mavlink_msg_uavionix_adsb_transceiver_health_report_pack(system_id, component_id, msg, uavionix_adsb_transceiver_health_report->rfHealth);
}
/**
* @brief Encode a uavionix_adsb_transceiver_health_report struct on a channel
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param uavionix_adsb_transceiver_health_report C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_uavionix_adsb_transceiver_health_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uavionix_adsb_transceiver_health_report_t* uavionix_adsb_transceiver_health_report)
{
return mavlink_msg_uavionix_adsb_transceiver_health_report_pack_chan(system_id, component_id, chan, msg, uavionix_adsb_transceiver_health_report->rfHealth);
}
/**
* @brief Send a uavionix_adsb_transceiver_health_report message
* @param chan MAVLink channel to send the message
*
* @param rfHealth ADS-B transponder messages
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_uavionix_adsb_transceiver_health_report_send(mavlink_channel_t chan, uint8_t rfHealth)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN];
_mav_put_uint8_t(buf, 0, rfHealth);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT, buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_CRC);
#else
mavlink_uavionix_adsb_transceiver_health_report_t packet;
packet.rfHealth = rfHealth;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT, (const char *)&packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_CRC);
#endif
}
/**
* @brief Send a uavionix_adsb_transceiver_health_report message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_uavionix_adsb_transceiver_health_report_send_struct(mavlink_channel_t chan, const mavlink_uavionix_adsb_transceiver_health_report_t* uavionix_adsb_transceiver_health_report)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_uavionix_adsb_transceiver_health_report_send(chan, uavionix_adsb_transceiver_health_report->rfHealth);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT, (const char *)uavionix_adsb_transceiver_health_report, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_CRC);
#endif
}
#if MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
mavlink_message_t which is the size of a full mavlink message. This
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_uavionix_adsb_transceiver_health_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t rfHealth)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint8_t(buf, 0, rfHealth);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT, buf, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_CRC);
#else
mavlink_uavionix_adsb_transceiver_health_report_t *packet = (mavlink_uavionix_adsb_transceiver_health_report_t *)msgbuf;
packet->rfHealth = rfHealth;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT, (const char *)packet, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_CRC);
#endif
}
#endif
#endif
// MESSAGE UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT UNPACKING
/**
* @brief Get field rfHealth from uavionix_adsb_transceiver_health_report message
*
* @return ADS-B transponder messages
*/
static inline uint8_t mavlink_msg_uavionix_adsb_transceiver_health_report_get_rfHealth(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Decode a uavionix_adsb_transceiver_health_report message into a struct
*
* @param msg The message to decode
* @param uavionix_adsb_transceiver_health_report C-struct to decode the message contents into
*/
static inline void mavlink_msg_uavionix_adsb_transceiver_health_report_decode(const mavlink_message_t* msg, mavlink_uavionix_adsb_transceiver_health_report_t* uavionix_adsb_transceiver_health_report)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
uavionix_adsb_transceiver_health_report->rfHealth = mavlink_msg_uavionix_adsb_transceiver_health_report_get_rfHealth(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN? msg->len : MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN;
memset(uavionix_adsb_transceiver_health_report, 0, MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_LEN);
memcpy(uavionix_adsb_transceiver_health_report, _MAV_PAYLOAD(msg), len);
#endif
}

View File

@@ -0,0 +1,222 @@
/** @file
* @brief MAVLink comm protocol testsuite generated from uAvionix.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#pragma once
#ifndef UAVIONIX_TESTSUITE_H
#define UAVIONIX_TESTSUITE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MAVLINK_TEST_ALL
#define MAVLINK_TEST_ALL
static void mavlink_test_uAvionix(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_uAvionix(system_id, component_id, last_msg);
}
#endif
static void mavlink_test_uavionix_adsb_out_cfg(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG >= 256) {
return;
}
#endif
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_uavionix_adsb_out_cfg_t packet_in = {
963497464,17443,"GHIJKLMN",242,53,120,187,254
};
mavlink_uavionix_adsb_out_cfg_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.ICAO = packet_in.ICAO;
packet1.stallSpeed = packet_in.stallSpeed;
packet1.emitterType = packet_in.emitterType;
packet1.aircraftSize = packet_in.aircraftSize;
packet1.gpsOffsetLat = packet_in.gpsOffsetLat;
packet1.gpsOffsetLon = packet_in.gpsOffsetLon;
packet1.rfSelect = packet_in.rfSelect;
mav_array_memcpy(packet1.callsign, packet_in.callsign, sizeof(char)*9);
#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
// cope with extensions
memset(MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG_MIN_LEN);
}
#endif
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_out_cfg_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_uavionix_adsb_out_cfg_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_out_cfg_pack(system_id, component_id, &msg , packet1.ICAO , packet1.callsign , packet1.emitterType , packet1.aircraftSize , packet1.gpsOffsetLat , packet1.gpsOffsetLon , packet1.stallSpeed , packet1.rfSelect );
mavlink_msg_uavionix_adsb_out_cfg_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_out_cfg_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ICAO , packet1.callsign , packet1.emitterType , packet1.aircraftSize , packet1.gpsOffsetLat , packet1.gpsOffsetLon , packet1.stallSpeed , packet1.rfSelect );
mavlink_msg_uavionix_adsb_out_cfg_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_uavionix_adsb_out_cfg_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_out_cfg_send(MAVLINK_COMM_1 , packet1.ICAO , packet1.callsign , packet1.emitterType , packet1.aircraftSize , packet1.gpsOffsetLat , packet1.gpsOffsetLon , packet1.stallSpeed , packet1.rfSelect );
mavlink_msg_uavionix_adsb_out_cfg_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_uavionix_adsb_out_dynamic(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC >= 256) {
return;
}
#endif
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_uavionix_adsb_out_dynamic_t packet_in = {
963497464,963497672,963497880,963498088,963498296,963498504,18483,18587,18691,18795,18899,19003,19107,247,58,125
};
mavlink_uavionix_adsb_out_dynamic_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.utcTime = packet_in.utcTime;
packet1.gpsLat = packet_in.gpsLat;
packet1.gpsLon = packet_in.gpsLon;
packet1.gpsAlt = packet_in.gpsAlt;
packet1.baroAltMSL = packet_in.baroAltMSL;
packet1.accuracyHor = packet_in.accuracyHor;
packet1.accuracyVert = packet_in.accuracyVert;
packet1.accuracyVel = packet_in.accuracyVel;
packet1.velVert = packet_in.velVert;
packet1.velNS = packet_in.velNS;
packet1.VelEW = packet_in.VelEW;
packet1.state = packet_in.state;
packet1.squawk = packet_in.squawk;
packet1.gpsFix = packet_in.gpsFix;
packet1.numSats = packet_in.numSats;
packet1.emergencyStatus = packet_in.emergencyStatus;
#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
// cope with extensions
memset(MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC_MIN_LEN);
}
#endif
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_out_dynamic_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_uavionix_adsb_out_dynamic_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_out_dynamic_pack(system_id, component_id, &msg , packet1.utcTime , packet1.gpsLat , packet1.gpsLon , packet1.gpsAlt , packet1.gpsFix , packet1.numSats , packet1.baroAltMSL , packet1.accuracyHor , packet1.accuracyVert , packet1.accuracyVel , packet1.velVert , packet1.velNS , packet1.VelEW , packet1.emergencyStatus , packet1.state , packet1.squawk );
mavlink_msg_uavionix_adsb_out_dynamic_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_out_dynamic_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.utcTime , packet1.gpsLat , packet1.gpsLon , packet1.gpsAlt , packet1.gpsFix , packet1.numSats , packet1.baroAltMSL , packet1.accuracyHor , packet1.accuracyVert , packet1.accuracyVel , packet1.velVert , packet1.velNS , packet1.VelEW , packet1.emergencyStatus , packet1.state , packet1.squawk );
mavlink_msg_uavionix_adsb_out_dynamic_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_uavionix_adsb_out_dynamic_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_out_dynamic_send(MAVLINK_COMM_1 , packet1.utcTime , packet1.gpsLat , packet1.gpsLon , packet1.gpsAlt , packet1.gpsFix , packet1.numSats , packet1.baroAltMSL , packet1.accuracyHor , packet1.accuracyVert , packet1.accuracyVel , packet1.velVert , packet1.velNS , packet1.VelEW , packet1.emergencyStatus , packet1.state , packet1.squawk );
mavlink_msg_uavionix_adsb_out_dynamic_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_uavionix_adsb_transceiver_health_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT >= 256) {
return;
}
#endif
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_uavionix_adsb_transceiver_health_report_t packet_in = {
5
};
mavlink_uavionix_adsb_transceiver_health_report_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.rfHealth = packet_in.rfHealth;
#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
// cope with extensions
memset(MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_MIN_LEN);
}
#endif
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_transceiver_health_report_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_uavionix_adsb_transceiver_health_report_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_transceiver_health_report_pack(system_id, component_id, &msg , packet1.rfHealth );
mavlink_msg_uavionix_adsb_transceiver_health_report_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_transceiver_health_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rfHealth );
mavlink_msg_uavionix_adsb_transceiver_health_report_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_uavionix_adsb_transceiver_health_report_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_uavionix_adsb_transceiver_health_report_send(MAVLINK_COMM_1 , packet1.rfHealth );
mavlink_msg_uavionix_adsb_transceiver_health_report_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_uAvionix(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_uavionix_adsb_out_cfg(system_id, component_id, last_msg);
mavlink_test_uavionix_adsb_out_dynamic(system_id, component_id, last_msg);
mavlink_test_uavionix_adsb_transceiver_health_report(system_id, component_id, last_msg);
}
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // UAVIONIX_TESTSUITE_H

View File

@@ -0,0 +1,194 @@
/** @file
* @brief MAVLink comm protocol generated from uAvionix.xml
* @see http://mavlink.org
*/
#pragma once
#ifndef MAVLINK_UAVIONIX_H
#define MAVLINK_UAVIONIX_H
#ifndef MAVLINK_H
#error Wrong include order: MAVLINK_UAVIONIX.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
#endif
#undef MAVLINK_THIS_XML_IDX
#define MAVLINK_THIS_XML_IDX 2
#ifdef __cplusplus
extern "C" {
#endif
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {{10001, 209, 20, 0, 0, 0}, {10002, 186, 41, 0, 0, 0}, {10003, 4, 1, 0, 0, 0}}
#endif
#include "../protocol.h"
#define MAVLINK_ENABLED_UAVIONIX
// ENUM DEFINITIONS
/** @brief State flags for ADS-B transponder dynamic report */
#ifndef HAVE_ENUM_UAVIONIX_ADSB_OUT_DYNAMIC_STATE
#define HAVE_ENUM_UAVIONIX_ADSB_OUT_DYNAMIC_STATE
typedef enum UAVIONIX_ADSB_OUT_DYNAMIC_STATE
{
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE=1, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_AUTOPILOT_ENABLED=2, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_NICBARO_CROSSCHECKED=4, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ON_GROUND=8, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_IDENT=16, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ENUM_END=17, /* | */
} UAVIONIX_ADSB_OUT_DYNAMIC_STATE;
#endif
/** @brief Transceiver RF control flags for ADS-B transponder dynamic reports */
#ifndef HAVE_ENUM_UAVIONIX_ADSB_OUT_RF_SELECT
#define HAVE_ENUM_UAVIONIX_ADSB_OUT_RF_SELECT
typedef enum UAVIONIX_ADSB_OUT_RF_SELECT
{
UAVIONIX_ADSB_OUT_RF_SELECT_STANDBY=0, /* | */
UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED=1, /* | */
UAVIONIX_ADSB_OUT_RF_SELECT_TX_ENABLED=2, /* | */
UAVIONIX_ADSB_OUT_RF_SELECT_ENUM_END=3, /* | */
} UAVIONIX_ADSB_OUT_RF_SELECT;
#endif
/** @brief Status for ADS-B transponder dynamic input */
#ifndef HAVE_ENUM_UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX
#define HAVE_ENUM_UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX
typedef enum UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX
{
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0=0, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_1=1, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_2D=2, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_3D=3, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_DGPS=4, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_RTK=5, /* | */
UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_ENUM_END=6, /* | */
} UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX;
#endif
/** @brief Status flags for ADS-B transponder dynamic output */
#ifndef HAVE_ENUM_UAVIONIX_ADSB_RF_HEALTH
#define HAVE_ENUM_UAVIONIX_ADSB_RF_HEALTH
typedef enum UAVIONIX_ADSB_RF_HEALTH
{
UAVIONIX_ADSB_RF_HEALTH_INITIALIZING=0, /* | */
UAVIONIX_ADSB_RF_HEALTH_OK=1, /* | */
UAVIONIX_ADSB_RF_HEALTH_FAIL_TX=2, /* | */
UAVIONIX_ADSB_RF_HEALTH_FAIL_RX=16, /* | */
UAVIONIX_ADSB_RF_HEALTH_ENUM_END=17, /* | */
} UAVIONIX_ADSB_RF_HEALTH;
#endif
/** @brief Definitions for aircraft size */
#ifndef HAVE_ENUM_UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE
#define HAVE_ENUM_UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE
typedef enum UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE
{
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA=0, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L15M_W23M=1, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25M_W28P5M=2, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25_34M=3, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_33M=4, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_38M=5, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_39P5M=6, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_45M=7, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_45M=8, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_52M=9, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_59P5M=10, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_67M=11, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W72P5M=12, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W80M=13, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W80M=14, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W90M=15, /* | */
UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_ENUM_END=16, /* | */
} UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE;
#endif
/** @brief GPS lataral offset encoding */
#ifndef HAVE_ENUM_UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT
#define HAVE_ENUM_UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT
typedef enum UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT
{
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA=0, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_2M=1, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_4M=2, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_6M=3, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_0M=4, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_2M=5, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_4M=6, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_6M=7, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_ENUM_END=8, /* | */
} UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT;
#endif
/** @brief GPS longitudinal offset encoding */
#ifndef HAVE_ENUM_UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON
#define HAVE_ENUM_UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON
typedef enum UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON
{
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA=0, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_APPLIED_BY_SENSOR=1, /* | */
UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_ENUM_END=2, /* | */
} UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON;
#endif
/** @brief Emergency status encoding */
#ifndef HAVE_ENUM_UAVIONIX_ADSB_EMERGENCY_STATUS
#define HAVE_ENUM_UAVIONIX_ADSB_EMERGENCY_STATUS
typedef enum UAVIONIX_ADSB_EMERGENCY_STATUS
{
UAVIONIX_ADSB_OUT_NO_EMERGENCY=0, /* | */
UAVIONIX_ADSB_OUT_GENERAL_EMERGENCY=1, /* | */
UAVIONIX_ADSB_OUT_LIFEGUARD_EMERGENCY=2, /* | */
UAVIONIX_ADSB_OUT_MINIMUM_FUEL_EMERGENCY=3, /* | */
UAVIONIX_ADSB_OUT_NO_COMM_EMERGENCY=4, /* | */
UAVIONIX_ADSB_OUT_UNLAWFUL_INTERFERANCE_EMERGENCY=5, /* | */
UAVIONIX_ADSB_OUT_DOWNED_AIRCRAFT_EMERGENCY=6, /* | */
UAVIONIX_ADSB_OUT_RESERVED=7, /* | */
UAVIONIX_ADSB_EMERGENCY_STATUS_ENUM_END=8, /* | */
} UAVIONIX_ADSB_EMERGENCY_STATUS;
#endif
// MAVLINK VERSION
#ifndef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
#if (MAVLINK_VERSION == 0)
#undef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
// MESSAGE DEFINITIONS
#include "./mavlink_msg_uavionix_adsb_out_cfg.h"
#include "./mavlink_msg_uavionix_adsb_out_dynamic.h"
#include "./mavlink_msg_uavionix_adsb_transceiver_health_report.h"
// base include
#undef MAVLINK_THIS_XML_IDX
#define MAVLINK_THIS_XML_IDX 2
#if MAVLINK_THIS_XML_IDX == MAVLINK_PRIMARY_XML_IDX
# define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_OUT_CFG, MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_OUT_DYNAMIC, MAVLINK_MESSAGE_INFO_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT}
# define MAVLINK_MESSAGE_NAMES {{ "UAVIONIX_ADSB_OUT_CFG", 10001 }, { "UAVIONIX_ADSB_OUT_DYNAMIC", 10002 }, { "UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT", 10003 }}
# if MAVLINK_COMMAND_24BIT
# include "../mavlink_get_info.h"
# endif
#endif
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // MAVLINK_UAVIONIX_H

View File

@@ -0,0 +1,14 @@
/** @file
* @brief MAVLink comm protocol built from uAvionix.xml
* @see http://mavlink.org
*/
#pragma once
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Thu Aug 30 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
#endif // MAVLINK_VERSION_H