Commit 3d751338 authored by James Goppert's avatar James Goppert

Updated to mavlink, need to update qgc project.

parent 0f3ad35d
#define MAVLINK_VERSION "1.0.5"
This diff is collapsed.
/** @file
* @brief MAVLink comm protocol built from ardupilotmega.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 85
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_BIG_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 0
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 0
#endif
#include "version.h"
#include "ardupilotmega.h"
#endif // MAVLINK_H
// MESSAGE AP_ADC PACKING
#define MAVLINK_MSG_ID_AP_ADC 153
typedef struct __mavlink_ap_adc_t
{
uint16_t adc1; ///< ADC output 1
uint16_t adc2; ///< ADC output 2
uint16_t adc3; ///< ADC output 3
uint16_t adc4; ///< ADC output 4
uint16_t adc5; ///< ADC output 5
uint16_t adc6; ///< ADC output 6
} mavlink_ap_adc_t;
#define MAVLINK_MSG_ID_AP_ADC_LEN 12
#define MAVLINK_MSG_ID_153_LEN 12
#define MAVLINK_MESSAGE_INFO_AP_ADC { \
"AP_ADC", \
6, \
{ { "adc1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ap_adc_t, adc1) }, \
{ "adc2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_ap_adc_t, adc2) }, \
{ "adc3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_ap_adc_t, adc3) }, \
{ "adc4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_ap_adc_t, adc4) }, \
{ "adc5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_ap_adc_t, adc5) }, \
{ "adc6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_ap_adc_t, adc6) }, \
} \
}
/**
* @brief Pack a ap_adc 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 adc1 ADC output 1
* @param adc2 ADC output 2
* @param adc3 ADC output 3
* @param adc4 ADC output 4
* @param adc5 ADC output 5
* @param adc6 ADC output 6
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_uint16_t(buf, 0, adc1);
_mav_put_uint16_t(buf, 2, adc2);
_mav_put_uint16_t(buf, 4, adc3);
_mav_put_uint16_t(buf, 6, adc4);
_mav_put_uint16_t(buf, 8, adc5);
_mav_put_uint16_t(buf, 10, adc6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_ap_adc_t packet;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.adc5 = adc5;
packet.adc6 = adc6;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_AP_ADC;
return mavlink_finalize_message(msg, system_id, component_id, 12);
}
/**
* @brief Pack a ap_adc 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param adc1 ADC output 1
* @param adc2 ADC output 2
* @param adc3 ADC output 3
* @param adc4 ADC output 4
* @param adc5 ADC output 5
* @param adc6 ADC output 6
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t adc1,uint16_t adc2,uint16_t adc3,uint16_t adc4,uint16_t adc5,uint16_t adc6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_uint16_t(buf, 0, adc1);
_mav_put_uint16_t(buf, 2, adc2);
_mav_put_uint16_t(buf, 4, adc3);
_mav_put_uint16_t(buf, 6, adc4);
_mav_put_uint16_t(buf, 8, adc5);
_mav_put_uint16_t(buf, 10, adc6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_ap_adc_t packet;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.adc5 = adc5;
packet.adc6 = adc6;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_AP_ADC;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12);
}
/**
* @brief Encode a ap_adc struct into a 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 ap_adc C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_ap_adc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ap_adc_t* ap_adc)
{
return mavlink_msg_ap_adc_pack(system_id, component_id, msg, ap_adc->adc1, ap_adc->adc2, ap_adc->adc3, ap_adc->adc4, ap_adc->adc5, ap_adc->adc6);
}
/**
* @brief Send a ap_adc message
* @param chan MAVLink channel to send the message
*
* @param adc1 ADC output 1
* @param adc2 ADC output 2
* @param adc3 ADC output 3
* @param adc4 ADC output 4
* @param adc5 ADC output 5
* @param adc6 ADC output 6
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_ap_adc_send(mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_uint16_t(buf, 0, adc1);
_mav_put_uint16_t(buf, 2, adc2);
_mav_put_uint16_t(buf, 4, adc3);
_mav_put_uint16_t(buf, 6, adc4);
_mav_put_uint16_t(buf, 8, adc5);
_mav_put_uint16_t(buf, 10, adc6);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, buf, 12);
#else
mavlink_ap_adc_t packet;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.adc5 = adc5;
packet.adc6 = adc6;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)&packet, 12);
#endif
}
#endif
// MESSAGE AP_ADC UNPACKING
/**
* @brief Get field adc1 from ap_adc message
*
* @return ADC output 1
*/
static inline uint16_t mavlink_msg_ap_adc_get_adc1(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field adc2 from ap_adc message
*
* @return ADC output 2
*/
static inline uint16_t mavlink_msg_ap_adc_get_adc2(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Get field adc3 from ap_adc message
*
* @return ADC output 3
*/
static inline uint16_t mavlink_msg_ap_adc_get_adc3(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field adc4 from ap_adc message
*
* @return ADC output 4
*/
static inline uint16_t mavlink_msg_ap_adc_get_adc4(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field adc5 from ap_adc message
*
* @return ADC output 5
*/
static inline uint16_t mavlink_msg_ap_adc_get_adc5(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Get field adc6 from ap_adc message
*
* @return ADC output 6
*/
static inline uint16_t mavlink_msg_ap_adc_get_adc6(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 10);
}
/**
* @brief Decode a ap_adc message into a struct
*
* @param msg The message to decode
* @param ap_adc C-struct to decode the message contents into
*/
static inline void mavlink_msg_ap_adc_decode(const mavlink_message_t* msg, mavlink_ap_adc_t* ap_adc)
{
#if MAVLINK_NEED_BYTE_SWAP
ap_adc->adc1 = mavlink_msg_ap_adc_get_adc1(msg);
ap_adc->adc2 = mavlink_msg_ap_adc_get_adc2(msg);
ap_adc->adc3 = mavlink_msg_ap_adc_get_adc3(msg);
ap_adc->adc4 = mavlink_msg_ap_adc_get_adc4(msg);
ap_adc->adc5 = mavlink_msg_ap_adc_get_adc5(msg);
ap_adc->adc6 = mavlink_msg_ap_adc_get_adc6(msg);
#else
memcpy(ap_adc, _MAV_PAYLOAD(msg), 12);
#endif
}
// MESSAGE FENCE_FETCH_POINT PACKING
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT 161
typedef struct __mavlink_fence_fetch_point_t
{
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
uint8_t idx; ///< point index (first point is 1, 0 is for return point)
} mavlink_fence_fetch_point_t;
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN 3
#define MAVLINK_MSG_ID_161_LEN 3
#define MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT { \
"FENCE_FETCH_POINT", \
3, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_fetch_point_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_fetch_point_t, target_component) }, \
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_fetch_point_t, idx) }, \
} \
}
/**
* @brief Pack a fence_fetch_point 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 target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t idx)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, idx);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_fence_fetch_point_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.idx = idx;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT;
return mavlink_finalize_message(msg, system_id, component_id, 3);
}
/**
* @brief Pack a fence_fetch_point 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,uint8_t idx)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, idx);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_fence_fetch_point_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.idx = idx;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3);
}
/**
* @brief Encode a fence_fetch_point struct into a 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 fence_fetch_point C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_fence_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_fetch_point_t* fence_fetch_point)
{
return mavlink_msg_fence_fetch_point_pack(system_id, component_id, msg, fence_fetch_point->target_system, fence_fetch_point->target_component, fence_fetch_point->idx);
}
/**
* @brief Send a fence_fetch_point message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_fence_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, idx);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, 3);
#else
mavlink_fence_fetch_point_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.idx = idx;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)&packet, 3);
#endif
}
#endif
// MESSAGE FENCE_FETCH_POINT UNPACKING
/**
* @brief Get field target_system from fence_fetch_point message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_fence_fetch_point_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from fence_fetch_point message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_fence_fetch_point_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field idx from fence_fetch_point message
*
* @return point index (first point is 1, 0 is for return point)
*/
static inline uint8_t mavlink_msg_fence_fetch_point_get_idx(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Decode a fence_fetch_point message into a struct
*
* @param msg The message to decode
* @param fence_fetch_point C-struct to decode the message contents into
*/
static inline void mavlink_msg_fence_fetch_point_decode(const mavlink_message_t* msg, mavlink_fence_fetch_point_t* fence_fetch_point)
{
#if MAVLINK_NEED_BYTE_SWAP
fence_fetch_point->target_system = mavlink_msg_fence_fetch_point_get_target_system(msg);
fence_fetch_point->target_component = mavlink_msg_fence_fetch_point_get_target_component(msg);
fence_fetch_point->idx = mavlink_msg_fence_fetch_point_get_idx(msg);
#else
memcpy(fence_fetch_point, _MAV_PAYLOAD(msg), 3);
#endif
}
// MESSAGE FENCE_POINT PACKING
#define MAVLINK_MSG_ID_FENCE_POINT 160
typedef struct __mavlink_fence_point_t
{
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
uint8_t idx; ///< point index (first point is 1, 0 is for return point)
uint8_t count; ///< total number of points (for sanity checking)
float lat; ///< Latitude of point
float lng; ///< Longitude of point
} mavlink_fence_point_t;
#define MAVLINK_MSG_ID_FENCE_POINT_LEN 12
#define MAVLINK_MSG_ID_160_LEN 12
#define MAVLINK_MESSAGE_INFO_FENCE_POINT { \
"FENCE_POINT", \
6, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_point_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_point_t, target_component) }, \
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_point_t, idx) }, \
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_fence_point_t, count) }, \
{ "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fence_point_t, lat) }, \
{ "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_fence_point_t, lng) }, \
} \
}
/**
* @brief Pack a fence_point 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 target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @param count total number of points (for sanity checking)
* @param lat Latitude of point
* @param lng Longitude of point
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, idx);
_mav_put_uint8_t(buf, 3, count);
_mav_put_float(buf, 4, lat);
_mav_put_float(buf, 8, lng);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_fence_point_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.idx = idx;
packet.count = count;
packet.lat = lat;
packet.lng = lng;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT;
return mavlink_finalize_message(msg, system_id, component_id, 12);
}
/**
* @brief Pack a fence_point 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @param count total number of points (for sanity checking)
* @param lat Latitude of point
* @param lng Longitude of point
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,uint8_t idx,uint8_t count,float lat,float lng)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, idx);
_mav_put_uint8_t(buf, 3, count);
_mav_put_float(buf, 4, lat);
_mav_put_float(buf, 8, lng);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_fence_point_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.idx = idx;
packet.count = count;
packet.lat = lat;
packet.lng = lng;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12);
}
/**
* @brief Encode a fence_point struct into a 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 fence_point C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_fence_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_point_t* fence_point)
{
return mavlink_msg_fence_point_pack(system_id, component_id, msg, fence_point->target_system, fence_point->target_component, fence_point->idx, fence_point->count, fence_point->lat, fence_point->lng);
}
/**
* @brief Send a fence_point message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @param count total number of points (for sanity checking)
* @param lat Latitude of point
* @param lng Longitude of point
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_fence_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[12];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, idx);
_mav_put_uint8_t(buf, 3, count);
_mav_put_float(buf, 4, lat);
_mav_put_float(buf, 8, lng);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, 12);
#else
mavlink_fence_point_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.idx = idx;
packet.count = count;
packet.lat = lat;
packet.lng = lng;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)&packet, 12);
#endif
}
#endif
// MESSAGE FENCE_POINT UNPACKING
/**
* @brief Get field target_system from fence_point message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_fence_point_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from fence_point message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_fence_point_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field idx from fence_point message
*
* @return point index (first point is 1, 0 is for return point)
*/
static inline uint8_t mavlink_msg_fence_point_get_idx(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Get field count from fence_point message
*
* @return total number of points (for sanity checking)
*/
static inline uint8_t mavlink_msg_fence_point_get_count(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field lat from fence_point message
*
* @return Latitude of point
*/
static inline float mavlink_msg_fence_point_get_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field lng from fence_point message
*
* @return Longitude of point
*/
static inline float mavlink_msg_fence_point_get_lng(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Decode a fence_point message into a struct
*
* @param msg The message to decode
* @param fence_point C-struct to decode the message contents into
*/
static inline void mavlink_msg_fence_point_decode(const mavlink_message_t* msg, mavlink_fence_point_t* fence_point)
{
#if MAVLINK_NEED_BYTE_SWAP
fence_point->target_system = mavlink_msg_fence_point_get_target_system(msg);
fence_point->target_component = mavlink_msg_fence_point_get_target_component(msg);
fence_point->idx = mavlink_msg_fence_point_get_idx(msg);
fence_point->count = mavlink_msg_fence_point_get_count(msg);
fence_point->lat = mavlink_msg_fence_point_get_lat(msg);
fence_point->lng = mavlink_msg_fence_point_get_lng(msg);
#else
memcpy(fence_point, _MAV_PAYLOAD(msg), 12);
#endif
}
// MESSAGE FENCE_STATUS PACKING
#define MAVLINK_MSG_ID_FENCE_STATUS 162
typedef struct __mavlink_fence_status_t
{
uint8_t breach_status; ///< 0 if currently inside fence, 1 if outside
uint16_t breach_count; ///< number of fence breaches
uint8_t breach_type; ///< last breach type (see FENCE_BREACH_* enum)
uint32_t breach_time; ///< time of last breach in milliseconds since boot
} mavlink_fence_status_t;
#define MAVLINK_MSG_ID_FENCE_STATUS_LEN 8
#define MAVLINK_MSG_ID_162_LEN 8
#define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \
"FENCE_STATUS", \
4, \
{ { "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_status_t, breach_status) }, \
{ "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 1, offsetof(mavlink_fence_status_t, breach_count) }, \
{ "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_fence_status_t, breach_type) }, \
{ "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_fence_status_t, breach_time) }, \
} \
}
/**
* @brief Pack a fence_status 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 breach_status 0 if currently inside fence, 1 if outside
* @param breach_count number of fence breaches
* @param breach_type last breach type (see FENCE_BREACH_* enum)
* @param breach_time time of last breach in milliseconds since boot
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint8_t(buf, 0, breach_status);
_mav_put_uint16_t(buf, 1, breach_count);
_mav_put_uint8_t(buf, 3, breach_type);
_mav_put_uint32_t(buf, 4, breach_time);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
#else
mavlink_fence_status_t packet;
packet.breach_status = breach_status;
packet.breach_count = breach_count;
packet.breach_type = breach_type;
packet.breach_time = breach_time;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS;
return mavlink_finalize_message(msg, system_id, component_id, 8);
}
/**
* @brief Pack a fence_status 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param breach_status 0 if currently inside fence, 1 if outside
* @param breach_count number of fence breaches
* @param breach_type last breach type (see FENCE_BREACH_* enum)
* @param breach_time time of last breach in milliseconds since boot
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t breach_status,uint16_t breach_count,uint8_t breach_type,uint32_t breach_time)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint8_t(buf, 0, breach_status);
_mav_put_uint16_t(buf, 1, breach_count);
_mav_put_uint8_t(buf, 3, breach_type);
_mav_put_uint32_t(buf, 4, breach_time);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
#else
mavlink_fence_status_t packet;
packet.breach_status = breach_status;
packet.breach_count = breach_count;
packet.breach_type = breach_type;
packet.breach_time = breach_time;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8);
}
/**
* @brief Encode a fence_status struct into a 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 fence_status C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_fence_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_status_t* fence_status)
{
return mavlink_msg_fence_status_pack(system_id, component_id, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time);
}
/**
* @brief Send a fence_status message
* @param chan MAVLink channel to send the message
*
* @param breach_status 0 if currently inside fence, 1 if outside
* @param breach_count number of fence breaches
* @param breach_type last breach type (see FENCE_BREACH_* enum)
* @param breach_time time of last breach in milliseconds since boot
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_fence_status_send(mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint8_t(buf, 0, breach_status);
_mav_put_uint16_t(buf, 1, breach_count);
_mav_put_uint8_t(buf, 3, breach_type);
_mav_put_uint32_t(buf, 4, breach_time);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, 8);
#else
mavlink_fence_status_t packet;
packet.breach_status = breach_status;
packet.breach_count = breach_count;
packet.breach_type = breach_type;
packet.breach_time = breach_time;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)&packet, 8);
#endif
}
#endif
// MESSAGE FENCE_STATUS UNPACKING
/**
* @brief Get field breach_status from fence_status message
*
* @return 0 if currently inside fence, 1 if outside
*/
static inline uint8_t mavlink_msg_fence_status_get_breach_status(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field breach_count from fence_status message
*
* @return number of fence breaches
*/
static inline uint16_t mavlink_msg_fence_status_get_breach_count(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 1);
}
/**
* @brief Get field breach_type from fence_status message
*
* @return last breach type (see FENCE_BREACH_* enum)
*/
static inline uint8_t mavlink_msg_fence_status_get_breach_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field breach_time from fence_status message
*
* @return time of last breach in milliseconds since boot
*/
static inline uint32_t mavlink_msg_fence_status_get_breach_time(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 4);
}
/**
* @brief Decode a fence_status message into a struct
*
* @param msg The message to decode
* @param fence_status C-struct to decode the message contents into
*/
static inline void mavlink_msg_fence_status_decode(const mavlink_message_t* msg, mavlink_fence_status_t* fence_status)
{
#if MAVLINK_NEED_BYTE_SWAP
fence_status->breach_status = mavlink_msg_fence_status_get_breach_status(msg);
fence_status->breach_count = mavlink_msg_fence_status_get_breach_count(msg);
fence_status->breach_type = mavlink_msg_fence_status_get_breach_type(msg);
fence_status->breach_time = mavlink_msg_fence_status_get_breach_time(msg);
#else
memcpy(fence_status, _MAV_PAYLOAD(msg), 8);
#endif
}
// MESSAGE HWSTATUS PACKING
#define MAVLINK_MSG_ID_HWSTATUS 165
typedef struct __mavlink_hwstatus_t
{
uint16_t Vcc; ///< board voltage (mV)
uint8_t I2Cerr; ///< I2C error count
} mavlink_hwstatus_t;
#define MAVLINK_MSG_ID_HWSTATUS_LEN 3
#define MAVLINK_MSG_ID_165_LEN 3
#define MAVLINK_MESSAGE_INFO_HWSTATUS { \
"HWSTATUS", \
2, \
{ { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_hwstatus_t, Vcc) }, \
{ "I2Cerr", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_hwstatus_t, I2Cerr) }, \
} \
}
/**
* @brief Pack a hwstatus 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 Vcc board voltage (mV)
* @param I2Cerr I2C error count
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_hwstatus_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t Vcc, uint8_t I2Cerr)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint16_t(buf, 0, Vcc);
_mav_put_uint8_t(buf, 2, I2Cerr);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_hwstatus_t packet;
packet.Vcc = Vcc;
packet.I2Cerr = I2Cerr;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_HWSTATUS;
return mavlink_finalize_message(msg, system_id, component_id, 3);
}
/**
* @brief Pack a hwstatus 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param Vcc board voltage (mV)
* @param I2Cerr I2C error count
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_hwstatus_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t Vcc,uint8_t I2Cerr)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint16_t(buf, 0, Vcc);
_mav_put_uint8_t(buf, 2, I2Cerr);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_hwstatus_t packet;
packet.Vcc = Vcc;
packet.I2Cerr = I2Cerr;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_HWSTATUS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3);
}
/**
* @brief Encode a hwstatus struct into a 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 hwstatus C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_hwstatus_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hwstatus_t* hwstatus)
{
return mavlink_msg_hwstatus_pack(system_id, component_id, msg, hwstatus->Vcc, hwstatus->I2Cerr);
}
/**
* @brief Send a hwstatus message
* @param chan MAVLink channel to send the message
*
* @param Vcc board voltage (mV)
* @param I2Cerr I2C error count
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_hwstatus_send(mavlink_channel_t chan, uint16_t Vcc, uint8_t I2Cerr)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint16_t(buf, 0, Vcc);
_mav_put_uint8_t(buf, 2, I2Cerr);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, buf, 3);
#else
mavlink_hwstatus_t packet;
packet.Vcc = Vcc;
packet.I2Cerr = I2Cerr;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, 3);
#endif
}
#endif
// MESSAGE HWSTATUS UNPACKING
/**
* @brief Get field Vcc from hwstatus message
*
* @return board voltage (mV)
*/
static inline uint16_t mavlink_msg_hwstatus_get_Vcc(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field I2Cerr from hwstatus message
*
* @return I2C error count
*/
static inline uint8_t mavlink_msg_hwstatus_get_I2Cerr(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Decode a hwstatus message into a struct
*
* @param msg The message to decode
* @param hwstatus C-struct to decode the message contents into
*/
static inline void mavlink_msg_hwstatus_decode(const mavlink_message_t* msg, mavlink_hwstatus_t* hwstatus)
{
#if MAVLINK_NEED_BYTE_SWAP
hwstatus->Vcc = mavlink_msg_hwstatus_get_Vcc(msg);
hwstatus->I2Cerr = mavlink_msg_hwstatus_get_I2Cerr(msg);
#else
memcpy(hwstatus, _MAV_PAYLOAD(msg), 3);
#endif
}
// MESSAGE MEMINFO PACKING
#define MAVLINK_MSG_ID_MEMINFO 152
typedef struct __mavlink_meminfo_t
{
uint16_t brkval; ///< heap top
uint16_t freemem; ///< free memory
} mavlink_meminfo_t;
#define MAVLINK_MSG_ID_MEMINFO_LEN 4
#define MAVLINK_MSG_ID_152_LEN 4
#define MAVLINK_MESSAGE_INFO_MEMINFO { \
"MEMINFO", \
2, \
{ { "brkval", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_meminfo_t, brkval) }, \
{ "freemem", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_meminfo_t, freemem) }, \
} \
}
/**
* @brief Pack a meminfo 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 brkval heap top
* @param freemem free memory
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t brkval, uint16_t freemem)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, brkval);
_mav_put_uint16_t(buf, 2, freemem);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_meminfo_t packet;
packet.brkval = brkval;
packet.freemem = freemem;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_MEMINFO;
return mavlink_finalize_message(msg, system_id, component_id, 4);
}
/**
* @brief Pack a meminfo 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param brkval heap top
* @param freemem free memory
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t brkval,uint16_t freemem)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, brkval);
_mav_put_uint16_t(buf, 2, freemem);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_meminfo_t packet;
packet.brkval = brkval;
packet.freemem = freemem;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_MEMINFO;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4);
}
/**
* @brief Encode a meminfo struct into a 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 meminfo C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_meminfo_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_meminfo_t* meminfo)
{
return mavlink_msg_meminfo_pack(system_id, component_id, msg, meminfo->brkval, meminfo->freemem);
}
/**
* @brief Send a meminfo message
* @param chan MAVLink channel to send the message
*
* @param brkval heap top
* @param freemem free memory
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_meminfo_send(mavlink_channel_t chan, uint16_t brkval, uint16_t freemem)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, brkval);
_mav_put_uint16_t(buf, 2, freemem);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, 4);
#else
mavlink_meminfo_t packet;
packet.brkval = brkval;
packet.freemem = freemem;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)&packet, 4);
#endif
}
#endif
// MESSAGE MEMINFO UNPACKING
/**
* @brief Get field brkval from meminfo message
*
* @return heap top
*/
static inline uint16_t mavlink_msg_meminfo_get_brkval(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field freemem from meminfo message
*
* @return free memory
*/
static inline uint16_t mavlink_msg_meminfo_get_freemem(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Decode a meminfo message into a struct
*
* @param msg The message to decode
* @param meminfo C-struct to decode the message contents into
*/
static inline void mavlink_msg_meminfo_decode(const mavlink_message_t* msg, mavlink_meminfo_t* meminfo)
{
#if MAVLINK_NEED_BYTE_SWAP
meminfo->brkval = mavlink_msg_meminfo_get_brkval(msg);
meminfo->freemem = mavlink_msg_meminfo_get_freemem(msg);
#else
memcpy(meminfo, _MAV_PAYLOAD(msg), 4);
#endif
}
// MESSAGE MOUNT_CONFIGURE PACKING
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE 156
typedef struct __mavlink_mount_configure_t
{
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
uint8_t mount_mode; ///< mount operating mode (see MAV_MOUNT_MODE enum)
uint8_t stab_roll; ///< (1 = yes, 0 = no)
uint8_t stab_pitch; ///< (1 = yes, 0 = no)
uint8_t stab_yaw; ///< (1 = yes, 0 = no)
} mavlink_mount_configure_t;
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN 6
#define MAVLINK_MSG_ID_156_LEN 6
#define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \
"MOUNT_CONFIGURE", \
6, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \
{ "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \
{ "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \
{ "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \
{ "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \
} \
}
/**
* @brief Pack a mount_configure 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 target_system System ID
* @param target_component Component ID
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
* @param stab_roll (1 = yes, 0 = no)
* @param stab_pitch (1 = yes, 0 = no)
* @param stab_yaw (1 = yes, 0 = no)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, mount_mode);
_mav_put_uint8_t(buf, 3, stab_roll);
_mav_put_uint8_t(buf, 4, stab_pitch);
_mav_put_uint8_t(buf, 5, stab_yaw);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_mount_configure_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.mount_mode = mount_mode;
packet.stab_roll = stab_roll;
packet.stab_pitch = stab_pitch;
packet.stab_yaw = stab_yaw;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
return mavlink_finalize_message(msg, system_id, component_id, 6);
}
/**
* @brief Pack a mount_configure 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
* @param stab_roll (1 = yes, 0 = no)
* @param stab_pitch (1 = yes, 0 = no)
* @param stab_yaw (1 = yes, 0 = no)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,uint8_t mount_mode,uint8_t stab_roll,uint8_t stab_pitch,uint8_t stab_yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, mount_mode);
_mav_put_uint8_t(buf, 3, stab_roll);
_mav_put_uint8_t(buf, 4, stab_pitch);
_mav_put_uint8_t(buf, 5, stab_yaw);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_mount_configure_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.mount_mode = mount_mode;
packet.stab_roll = stab_roll;
packet.stab_pitch = stab_pitch;
packet.stab_yaw = stab_yaw;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6);
}
/**
* @brief Encode a mount_configure struct into a 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 mount_configure C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_mount_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure)
{
return mavlink_msg_mount_configure_pack(system_id, component_id, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
}
/**
* @brief Send a mount_configure message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
* @param stab_roll (1 = yes, 0 = no)
* @param stab_pitch (1 = yes, 0 = no)
* @param stab_yaw (1 = yes, 0 = no)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, mount_mode);
_mav_put_uint8_t(buf, 3, stab_roll);
_mav_put_uint8_t(buf, 4, stab_pitch);
_mav_put_uint8_t(buf, 5, stab_yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, 6);
#else
mavlink_mount_configure_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.mount_mode = mount_mode;
packet.stab_roll = stab_roll;
packet.stab_pitch = stab_pitch;
packet.stab_yaw = stab_yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, 6);
#endif
}
#endif
// MESSAGE MOUNT_CONFIGURE UNPACKING
/**
* @brief Get field target_system from mount_configure message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_mount_configure_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from mount_configure message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_mount_configure_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field mount_mode from mount_configure message
*
* @return mount operating mode (see MAV_MOUNT_MODE enum)
*/
static inline uint8_t mavlink_msg_mount_configure_get_mount_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Get field stab_roll from mount_configure message
*
* @return (1 = yes, 0 = no)
*/
static inline uint8_t mavlink_msg_mount_configure_get_stab_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field stab_pitch from mount_configure message
*
* @return (1 = yes, 0 = no)
*/
static inline uint8_t mavlink_msg_mount_configure_get_stab_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field stab_yaw from mount_configure message
*
* @return (1 = yes, 0 = no)
*/
static inline uint8_t mavlink_msg_mount_configure_get_stab_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 5);
}
/**
* @brief Decode a mount_configure message into a struct
*
* @param msg The message to decode
* @param mount_configure C-struct to decode the message contents into
*/
static inline void mavlink_msg_mount_configure_decode(const mavlink_message_t* msg, mavlink_mount_configure_t* mount_configure)
{
#if MAVLINK_NEED_BYTE_SWAP
mount_configure->target_system = mavlink_msg_mount_configure_get_target_system(msg);
mount_configure->target_component = mavlink_msg_mount_configure_get_target_component(msg);
mount_configure->mount_mode = mavlink_msg_mount_configure_get_mount_mode(msg);
mount_configure->stab_roll = mavlink_msg_mount_configure_get_stab_roll(msg);
mount_configure->stab_pitch = mavlink_msg_mount_configure_get_stab_pitch(msg);
mount_configure->stab_yaw = mavlink_msg_mount_configure_get_stab_yaw(msg);
#else
memcpy(mount_configure, _MAV_PAYLOAD(msg), 6);
#endif
}
// MESSAGE MOUNT_CONTROL PACKING
#define MAVLINK_MSG_ID_MOUNT_CONTROL 157
typedef struct __mavlink_mount_control_t
{
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
int32_t input_a; ///< pitch(deg*100) or lat, depending on mount mode
int32_t input_b; ///< roll(deg*100) or lon depending on mount mode
int32_t input_c; ///< yaw(deg*100) or alt (in cm) depending on mount mode
uint8_t save_position; ///< if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
} mavlink_mount_control_t;
#define MAVLINK_MSG_ID_MOUNT_CONTROL_LEN 15
#define MAVLINK_MSG_ID_157_LEN 15
#define MAVLINK_MESSAGE_INFO_MOUNT_CONTROL { \
"MOUNT_CONTROL", \
6, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_control_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_control_t, target_component) }, \
{ "input_a", NULL, MAVLINK_TYPE_INT32_T, 0, 2, offsetof(mavlink_mount_control_t, input_a) }, \
{ "input_b", NULL, MAVLINK_TYPE_INT32_T, 0, 6, offsetof(mavlink_mount_control_t, input_b) }, \
{ "input_c", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_mount_control_t, input_c) }, \
{ "save_position", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mount_control_t, save_position) }, \
} \
}
/**
* @brief Pack a mount_control 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 target_system System ID
* @param target_component Component ID
* @param input_a pitch(deg*100) or lat, depending on mount mode
* @param input_b roll(deg*100) or lon depending on mount mode
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[15];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int32_t(buf, 2, input_a);
_mav_put_int32_t(buf, 6, input_b);
_mav_put_int32_t(buf, 10, input_c);
_mav_put_uint8_t(buf, 14, save_position);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
#else
mavlink_mount_control_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.input_a = input_a;
packet.input_b = input_b;
packet.input_c = input_c;
packet.save_position = save_position;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
#endif
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL;
return mavlink_finalize_message(msg, system_id, component_id, 15);
}
/**
* @brief Pack a mount_control 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param input_a pitch(deg*100) or lat, depending on mount mode
* @param input_b roll(deg*100) or lon depending on mount mode
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,int32_t input_a,int32_t input_b,int32_t input_c,uint8_t save_position)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[15];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int32_t(buf, 2, input_a);
_mav_put_int32_t(buf, 6, input_b);
_mav_put_int32_t(buf, 10, input_c);
_mav_put_uint8_t(buf, 14, save_position);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
#else
mavlink_mount_control_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.input_a = input_a;
packet.input_b = input_b;
packet.input_c = input_c;
packet.save_position = save_position;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
#endif
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15);
}
/**
* @brief Encode a mount_control struct into a 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 mount_control C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_mount_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_control_t* mount_control)
{
return mavlink_msg_mount_control_pack(system_id, component_id, msg, mount_control->target_system, mount_control->target_component, mount_control->input_a, mount_control->input_b, mount_control->input_c, mount_control->save_position);
}
/**
* @brief Send a mount_control message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param input_a pitch(deg*100) or lat, depending on mount mode
* @param input_b roll(deg*100) or lon depending on mount mode
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_mount_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[15];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int32_t(buf, 2, input_a);
_mav_put_int32_t(buf, 6, input_b);
_mav_put_int32_t(buf, 10, input_c);
_mav_put_uint8_t(buf, 14, save_position);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, buf, 15);
#else
mavlink_mount_control_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.input_a = input_a;
packet.input_b = input_b;
packet.input_c = input_c;
packet.save_position = save_position;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)&packet, 15);
#endif
}
#endif
// MESSAGE MOUNT_CONTROL UNPACKING
/**
* @brief Get field target_system from mount_control message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_mount_control_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from mount_control message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_mount_control_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field input_a from mount_control message
*
* @return pitch(deg*100) or lat, depending on mount mode
*/
static inline int32_t mavlink_msg_mount_control_get_input_a(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 2);
}
/**
* @brief Get field input_b from mount_control message
*
* @return roll(deg*100) or lon depending on mount mode
*/
static inline int32_t mavlink_msg_mount_control_get_input_b(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 6);
}
/**
* @brief Get field input_c from mount_control message
*
* @return yaw(deg*100) or alt (in cm) depending on mount mode
*/
static inline int32_t mavlink_msg_mount_control_get_input_c(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 10);
}
/**
* @brief Get field save_position from mount_control message
*
* @return if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
*/
static inline uint8_t mavlink_msg_mount_control_get_save_position(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 14);
}
/**
* @brief Decode a mount_control message into a struct
*
* @param msg The message to decode
* @param mount_control C-struct to decode the message contents into
*/
static inline void mavlink_msg_mount_control_decode(const mavlink_message_t* msg, mavlink_mount_control_t* mount_control)
{
#if MAVLINK_NEED_BYTE_SWAP
mount_control->target_system = mavlink_msg_mount_control_get_target_system(msg);
mount_control->target_component = mavlink_msg_mount_control_get_target_component(msg);
mount_control->input_a = mavlink_msg_mount_control_get_input_a(msg);
mount_control->input_b = mavlink_msg_mount_control_get_input_b(msg);
mount_control->input_c = mavlink_msg_mount_control_get_input_c(msg);
mount_control->save_position = mavlink_msg_mount_control_get_save_position(msg);
#else
memcpy(mount_control, _MAV_PAYLOAD(msg), 15);
#endif
}
// MESSAGE MOUNT_STATUS PACKING
#define MAVLINK_MSG_ID_MOUNT_STATUS 158
typedef struct __mavlink_mount_status_t
{
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
int32_t pointing_a; ///< pitch(deg*100) or lat, depending on mount mode
int32_t pointing_b; ///< roll(deg*100) or lon depending on mount mode
int32_t pointing_c; ///< yaw(deg*100) or alt (in cm) depending on mount mode
} mavlink_mount_status_t;
#define MAVLINK_MSG_ID_MOUNT_STATUS_LEN 14
#define MAVLINK_MSG_ID_158_LEN 14
#define MAVLINK_MESSAGE_INFO_MOUNT_STATUS { \
"MOUNT_STATUS", \
5, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_status_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_status_t, target_component) }, \
{ "pointing_a", NULL, MAVLINK_TYPE_INT32_T, 0, 2, offsetof(mavlink_mount_status_t, pointing_a) }, \
{ "pointing_b", NULL, MAVLINK_TYPE_INT32_T, 0, 6, offsetof(mavlink_mount_status_t, pointing_b) }, \
{ "pointing_c", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_mount_status_t, pointing_c) }, \
} \
}
/**
* @brief Pack a mount_status 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 target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[14];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int32_t(buf, 2, pointing_a);
_mav_put_int32_t(buf, 6, pointing_b);
_mav_put_int32_t(buf, 10, pointing_c);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
#else
mavlink_mount_status_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.pointing_a = pointing_a;
packet.pointing_b = pointing_b;
packet.pointing_c = pointing_c;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
#endif
msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS;
return mavlink_finalize_message(msg, system_id, component_id, 14);
}
/**
* @brief Pack a mount_status 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,int32_t pointing_a,int32_t pointing_b,int32_t pointing_c)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[14];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int32_t(buf, 2, pointing_a);
_mav_put_int32_t(buf, 6, pointing_b);
_mav_put_int32_t(buf, 10, pointing_c);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
#else
mavlink_mount_status_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.pointing_a = pointing_a;
packet.pointing_b = pointing_b;
packet.pointing_c = pointing_c;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
#endif
msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14);
}
/**
* @brief Encode a mount_status struct into a 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 mount_status C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_mount_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_status_t* mount_status)
{
return mavlink_msg_mount_status_pack(system_id, component_id, msg, mount_status->target_system, mount_status->target_component, mount_status->pointing_a, mount_status->pointing_b, mount_status->pointing_c);
}
/**
* @brief Send a mount_status message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_mount_status_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[14];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int32_t(buf, 2, pointing_a);
_mav_put_int32_t(buf, 6, pointing_b);
_mav_put_int32_t(buf, 10, pointing_c);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, buf, 14);
#else
mavlink_mount_status_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.pointing_a = pointing_a;
packet.pointing_b = pointing_b;
packet.pointing_c = pointing_c;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)&packet, 14);
#endif
}
#endif
// MESSAGE MOUNT_STATUS UNPACKING
/**
* @brief Get field target_system from mount_status message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_mount_status_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from mount_status message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_mount_status_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field pointing_a from mount_status message
*
* @return pitch(deg*100) or lat, depending on mount mode
*/
static inline int32_t mavlink_msg_mount_status_get_pointing_a(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 2);
}
/**
* @brief Get field pointing_b from mount_status message
*
* @return roll(deg*100) or lon depending on mount mode
*/
static inline int32_t mavlink_msg_mount_status_get_pointing_b(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 6);
}
/**
* @brief Get field pointing_c from mount_status message
*
* @return yaw(deg*100) or alt (in cm) depending on mount mode
*/
static inline int32_t mavlink_msg_mount_status_get_pointing_c(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 10);
}
/**
* @brief Decode a mount_status message into a struct
*
* @param msg The message to decode
* @param mount_status C-struct to decode the message contents into
*/
static inline void mavlink_msg_mount_status_decode(const mavlink_message_t* msg, mavlink_mount_status_t* mount_status)
{
#if MAVLINK_NEED_BYTE_SWAP
mount_status->target_system = mavlink_msg_mount_status_get_target_system(msg);
mount_status->target_component = mavlink_msg_mount_status_get_target_component(msg);
mount_status->pointing_a = mavlink_msg_mount_status_get_pointing_a(msg);
mount_status->pointing_b = mavlink_msg_mount_status_get_pointing_b(msg);
mount_status->pointing_c = mavlink_msg_mount_status_get_pointing_c(msg);
#else
memcpy(mount_status, _MAV_PAYLOAD(msg), 14);
#endif
}
// MESSAGE RADIO PACKING
#define MAVLINK_MSG_ID_RADIO 166
typedef struct __mavlink_radio_t
{
uint8_t rssi; ///< local signal strength
uint8_t remrssi; ///< remote signal strength
uint8_t txbuf; ///< how full the tx buffer is as a percentage
uint8_t noise; ///< background noise level
uint8_t remnoise; ///< remote background noise level
uint16_t rxerrors; ///< receive errors
uint16_t fixed; ///< count of error corrected packets
} mavlink_radio_t;
#define MAVLINK_MSG_ID_RADIO_LEN 9
#define MAVLINK_MSG_ID_166_LEN 9
#define MAVLINK_MESSAGE_INFO_RADIO { \
"RADIO", \
7, \
{ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_radio_t, rssi) }, \
{ "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_radio_t, remrssi) }, \
{ "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_radio_t, txbuf) }, \
{ "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_radio_t, noise) }, \
{ "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_t, remnoise) }, \
{ "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 5, offsetof(mavlink_radio_t, rxerrors) }, \
{ "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 7, offsetof(mavlink_radio_t, fixed) }, \
} \
}
/**
* @brief Pack a radio 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 rssi local signal strength
* @param remrssi remote signal strength
* @param txbuf how full the tx buffer is as a percentage
* @param noise background noise level
* @param remnoise remote background noise level
* @param rxerrors receive errors
* @param fixed count of error corrected packets
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint8_t(buf, 0, rssi);
_mav_put_uint8_t(buf, 1, remrssi);
_mav_put_uint8_t(buf, 2, txbuf);
_mav_put_uint8_t(buf, 3, noise);
_mav_put_uint8_t(buf, 4, remnoise);
_mav_put_uint16_t(buf, 5, rxerrors);
_mav_put_uint16_t(buf, 7, fixed);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_radio_t packet;
packet.rssi = rssi;
packet.remrssi = remrssi;
packet.txbuf = txbuf;
packet.noise = noise;
packet.remnoise = remnoise;
packet.rxerrors = rxerrors;
packet.fixed = fixed;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_RADIO;
return mavlink_finalize_message(msg, system_id, component_id, 9);
}
/**
* @brief Pack a radio 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param rssi local signal strength
* @param remrssi remote signal strength
* @param txbuf how full the tx buffer is as a percentage
* @param noise background noise level
* @param remnoise remote background noise level
* @param rxerrors receive errors
* @param fixed count of error corrected packets
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint8_t(buf, 0, rssi);
_mav_put_uint8_t(buf, 1, remrssi);
_mav_put_uint8_t(buf, 2, txbuf);
_mav_put_uint8_t(buf, 3, noise);
_mav_put_uint8_t(buf, 4, remnoise);
_mav_put_uint16_t(buf, 5, rxerrors);
_mav_put_uint16_t(buf, 7, fixed);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_radio_t packet;
packet.rssi = rssi;
packet.remrssi = remrssi;
packet.txbuf = txbuf;
packet.noise = noise;
packet.remnoise = remnoise;
packet.rxerrors = rxerrors;
packet.fixed = fixed;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_RADIO;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9);
}
/**
* @brief Encode a radio struct into a 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 radio C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_radio_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_radio_t* radio)
{
return mavlink_msg_radio_pack(system_id, component_id, msg, radio->rssi, radio->remrssi, radio->txbuf, radio->noise, radio->remnoise, radio->rxerrors, radio->fixed);
}
/**
* @brief Send a radio message
* @param chan MAVLink channel to send the message
*
* @param rssi local signal strength
* @param remrssi remote signal strength
* @param txbuf how full the tx buffer is as a percentage
* @param noise background noise level
* @param remnoise remote background noise level
* @param rxerrors receive errors
* @param fixed count of error corrected packets
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static 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)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint8_t(buf, 0, rssi);
_mav_put_uint8_t(buf, 1, remrssi);
_mav_put_uint8_t(buf, 2, txbuf);
_mav_put_uint8_t(buf, 3, noise);
_mav_put_uint8_t(buf, 4, remnoise);
_mav_put_uint16_t(buf, 5, rxerrors);
_mav_put_uint16_t(buf, 7, fixed);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, 9);
#else
mavlink_radio_t packet;
packet.rssi = rssi;
packet.remrssi = remrssi;
packet.txbuf = txbuf;
packet.noise = noise;
packet.remnoise = remnoise;
packet.rxerrors = rxerrors;
packet.fixed = fixed;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (const char *)&packet, 9);
#endif
}
#endif
// MESSAGE RADIO UNPACKING
/**
* @brief Get field rssi from radio message
*
* @return local signal strength
*/
static inline uint8_t mavlink_msg_radio_get_rssi(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field remrssi from radio message
*
* @return remote signal strength
*/
static inline uint8_t mavlink_msg_radio_get_remrssi(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field txbuf from radio message
*
* @return how full the tx buffer is as a percentage
*/
static inline uint8_t mavlink_msg_radio_get_txbuf(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Get field noise from radio message
*
* @return background noise level
*/
static inline uint8_t mavlink_msg_radio_get_noise(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field remnoise from radio message
*
* @return remote background noise level
*/
static inline uint8_t mavlink_msg_radio_get_remnoise(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field rxerrors from radio message
*
* @return receive errors
*/
static inline uint16_t mavlink_msg_radio_get_rxerrors(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 5);
}
/**
* @brief Get field fixed from radio message
*
* @return count of error corrected packets
*/
static inline uint16_t mavlink_msg_radio_get_fixed(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 7);
}
/**
* @brief Decode a radio message into a struct
*
* @param msg The message to decode
* @param radio C-struct to decode the message contents into
*/
static inline void mavlink_msg_radio_decode(const mavlink_message_t* msg, mavlink_radio_t* radio)
{
#if MAVLINK_NEED_BYTE_SWAP
radio->rssi = mavlink_msg_radio_get_rssi(msg);
radio->remrssi = mavlink_msg_radio_get_remrssi(msg);
radio->txbuf = mavlink_msg_radio_get_txbuf(msg);
radio->noise = mavlink_msg_radio_get_noise(msg);
radio->remnoise = mavlink_msg_radio_get_remnoise(msg);
radio->rxerrors = mavlink_msg_radio_get_rxerrors(msg);
radio->fixed = mavlink_msg_radio_get_fixed(msg);
#else
memcpy(radio, _MAV_PAYLOAD(msg), 9);
#endif
}
// MESSAGE SET_MAG_OFFSETS PACKING
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS 151
typedef struct __mavlink_set_mag_offsets_t
{
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
int16_t mag_ofs_x; ///< magnetometer X offset
int16_t mag_ofs_y; ///< magnetometer Y offset
int16_t mag_ofs_z; ///< magnetometer Z offset
} mavlink_set_mag_offsets_t;
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN 8
#define MAVLINK_MSG_ID_151_LEN 8
#define MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS { \
"SET_MAG_OFFSETS", \
5, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_mag_offsets_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_mag_offsets_t, target_component) }, \
{ "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_mag_offsets_t, mag_ofs_x) }, \
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_mag_offsets_t, mag_ofs_y) }, \
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_set_mag_offsets_t, mag_ofs_z) }, \
} \
}
/**
* @brief Pack a set_mag_offsets 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 target_system System ID
* @param target_component Component ID
* @param mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int16_t(buf, 2, mag_ofs_x);
_mav_put_int16_t(buf, 4, mag_ofs_y);
_mav_put_int16_t(buf, 6, mag_ofs_z);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
#else
mavlink_set_mag_offsets_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
return mavlink_finalize_message(msg, system_id, component_id, 8);
}
/**
* @brief Pack a set_mag_offsets 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int16_t(buf, 2, mag_ofs_x);
_mav_put_int16_t(buf, 4, mag_ofs_y);
_mav_put_int16_t(buf, 6, mag_ofs_z);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
#else
mavlink_set_mag_offsets_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8);
}
/**
* @brief Encode a set_mag_offsets struct into a 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 set_mag_offsets C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_mag_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_mag_offsets_t* set_mag_offsets)
{
return mavlink_msg_set_mag_offsets_pack(system_id, component_id, msg, set_mag_offsets->target_system, set_mag_offsets->target_component, set_mag_offsets->mag_ofs_x, set_mag_offsets->mag_ofs_y, set_mag_offsets->mag_ofs_z);
}
/**
* @brief Send a set_mag_offsets message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_mag_offsets_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_int16_t(buf, 2, mag_ofs_x);
_mav_put_int16_t(buf, 4, mag_ofs_y);
_mav_put_int16_t(buf, 6, mag_ofs_z);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, buf, 8);
#else
mavlink_set_mag_offsets_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)&packet, 8);
#endif
}
#endif
// MESSAGE SET_MAG_OFFSETS UNPACKING
/**
* @brief Get field target_system from set_mag_offsets message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_set_mag_offsets_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from set_mag_offsets message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_set_mag_offsets_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field mag_ofs_x from set_mag_offsets message
*
* @return magnetometer X offset
*/
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 2);
}
/**
* @brief Get field mag_ofs_y from set_mag_offsets message
*
* @return magnetometer Y offset
*/
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 4);
}
/**
* @brief Get field mag_ofs_z from set_mag_offsets message
*
* @return magnetometer Z offset
*/
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 6);
}
/**
* @brief Decode a set_mag_offsets message into a struct
*
* @param msg The message to decode
* @param set_mag_offsets C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_mag_offsets_decode(const mavlink_message_t* msg, mavlink_set_mag_offsets_t* set_mag_offsets)
{
#if MAVLINK_NEED_BYTE_SWAP
set_mag_offsets->target_system = mavlink_msg_set_mag_offsets_get_target_system(msg);
set_mag_offsets->target_component = mavlink_msg_set_mag_offsets_get_target_component(msg);
set_mag_offsets->mag_ofs_x = mavlink_msg_set_mag_offsets_get_mag_ofs_x(msg);
set_mag_offsets->mag_ofs_y = mavlink_msg_set_mag_offsets_get_mag_ofs_y(msg);
set_mag_offsets->mag_ofs_z = mavlink_msg_set_mag_offsets_get_mag_ofs_z(msg);
#else
memcpy(set_mag_offsets, _MAV_PAYLOAD(msg), 8);
#endif
}
This diff is collapsed.
/** @file
* @brief MAVLink comm protocol built from ardupilotmega.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Thu Apr 19 14:23:28 2012"
#define MAVLINK_WIRE_PROTOCOL_VERSION "0.9"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
#endif // MAVLINK_VERSION_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _CHECKSUM_H_
#define _CHECKSUM_H_
/**
*
* CALCULATE THE CHECKSUM
*
*/
#define X25_INIT_CRC 0xffff
#define X25_VALIDATE_CRC 0xf0b8
/**
* @brief Accumulate the X.25 CRC by adding one char at a time.
*
* The checksum function adds the hash of one char at a time to the
* 16 bit checksum (uint16_t).
*
* @param data new char to hash
* @param crcAccum the already accumulated checksum
**/
static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum)
{
/*Accumulate one byte of data into the CRC*/
uint8_t tmp;
tmp = data ^ (uint8_t)(*crcAccum &0xff);
tmp ^= (tmp<<4);
*crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4);
}
/**
* @brief Initiliaze the buffer for the X.25 CRC
*
* @param crcAccum the 16 bit X.25 CRC
*/
static inline void crc_init(uint16_t* crcAccum)
{
*crcAccum = X25_INIT_CRC;
}
/**
* @brief Calculates the X.25 checksum on a byte buffer
*
* @param pBuffer buffer containing the byte array to hash
* @param length length of the byte array
* @return the checksum over the buffer bytes
**/
static inline uint16_t crc_calculate(uint8_t* pBuffer, uint16_t length)
{
uint16_t crcTmp;
crc_init(&crcTmp);
while (length--) {
crc_accumulate(*pBuffer++, &crcTmp);
}
return crcTmp;
}
/**
* @brief Accumulate the X.25 CRC by adding an array of bytes
*
* The checksum function adds the hash of one char at a time to the
* 16 bit checksum (uint16_t).
*
* @param data new bytes to hash
* @param crcAccum the already accumulated checksum
**/
static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint8_t length)
{
const uint8_t *p = (const uint8_t *)pBuffer;
while (length--) {
crc_accumulate(*p++, crcAccum);
}
}
#endif /* _CHECKSUM_H_ */
#ifdef __cplusplus
}
#endif
This diff is collapsed.
/** @file
* @brief MAVLink comm protocol built from common.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 85
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_BIG_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 0
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 0
#endif
#include "version.h"
#include "common.h"
#endif // MAVLINK_H
// MESSAGE ACTION PACKING
#define MAVLINK_MSG_ID_ACTION 10
typedef struct __mavlink_action_t
{
uint8_t target; ///< The system executing the action
uint8_t target_component; ///< The component executing the action
uint8_t action; ///< The action id
} mavlink_action_t;
#define MAVLINK_MSG_ID_ACTION_LEN 3
#define MAVLINK_MSG_ID_10_LEN 3
#define MAVLINK_MESSAGE_INFO_ACTION { \
"ACTION", \
3, \
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_action_t, target) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_action_t, target_component) }, \
{ "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_action_t, action) }, \
} \
}
/**
* @brief Pack a action 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 target The system executing the action
* @param target_component The component executing the action
* @param action The action id
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_action_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, uint8_t target_component, uint8_t action)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, action);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_action_t packet;
packet.target = target;
packet.target_component = target_component;
packet.action = action;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_ACTION;
return mavlink_finalize_message(msg, system_id, component_id, 3);
}
/**
* @brief Pack a action 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target The system executing the action
* @param target_component The component executing the action
* @param action The action id
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_action_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,uint8_t target_component,uint8_t action)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, action);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_action_t packet;
packet.target = target;
packet.target_component = target_component;
packet.action = action;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_ACTION;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3);
}
/**
* @brief Encode a action struct into a 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 action C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_action_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_action_t* action)
{
return mavlink_msg_action_pack(system_id, component_id, msg, action->target, action->target_component, action->action);
}
/**
* @brief Send a action message
* @param chan MAVLink channel to send the message
*
* @param target The system executing the action
* @param target_component The component executing the action
* @param action The action id
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_action_send(mavlink_channel_t chan, uint8_t target, uint8_t target_component, uint8_t action)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, action);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION, buf, 3);
#else
mavlink_action_t packet;
packet.target = target;
packet.target_component = target_component;
packet.action = action;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTION, (const char *)&packet, 3);
#endif
}
#endif
// MESSAGE ACTION UNPACKING
/**
* @brief Get field target from action message
*
* @return The system executing the action
*/
static inline uint8_t mavlink_msg_action_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from action message
*
* @return The component executing the action
*/
static inline uint8_t mavlink_msg_action_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field action from action message
*
* @return The action id
*/
static inline uint8_t mavlink_msg_action_get_action(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Decode a action message into a struct
*
* @param msg The message to decode
* @param action C-struct to decode the message contents into
*/
static inline void mavlink_msg_action_decode(const mavlink_message_t* msg, mavlink_action_t* action)
{
#if MAVLINK_NEED_BYTE_SWAP
action->target = mavlink_msg_action_get_target(msg);
action->target_component = mavlink_msg_action_get_target_component(msg);
action->action = mavlink_msg_action_get_action(msg);
#else
memcpy(action, _MAV_PAYLOAD(msg), 3);
#endif
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/** @file
* @brief MAVLink comm protocol built from common.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Thu Apr 19 14:23:36 2012"
#define MAVLINK_WIRE_PROTOCOL_VERSION "0.9"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
#endif // MAVLINK_VERSION_H
This diff is collapsed.
This diff is collapsed.
/** @file
* @brief MAVLink comm protocol built from minimal.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 85
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_BIG_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 0
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 0
#endif
#include "version.h"
#include "minimal.h"
#endif // MAVLINK_H
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment