Files
c_library_v2/XYK/mavlink_msg_xyk_surface_neutral_set.h
T
2019-03-09 06:12:13 +08:00

314 lines
14 KiB
C

#pragma once
// MESSAGE XYK_SURFACE_NEUTRAL_SET PACKING
#define MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET 30007
MAVPACKED(
typedef struct __mavlink_xyk_surface_neutral_set_t {
uint16_t AILERONL; /*< AILERON left [1000,2000]*/
uint16_t AILERONR; /*< aileron right[1000,2000]*/
uint16_t RUDERL; /*< rudder left[1000,2000]*/
uint16_t RUDERR; /*< rudder right[1000,2000]*/
uint8_t PLANE_ID; /*< PLANE ID*/
}) mavlink_xyk_surface_neutral_set_t;
#define MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN 9
#define MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_MIN_LEN 9
#define MAVLINK_MSG_ID_30007_LEN 9
#define MAVLINK_MSG_ID_30007_MIN_LEN 9
#define MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_CRC 180
#define MAVLINK_MSG_ID_30007_CRC 180
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_XYK_SURFACE_NEUTRAL_SET { \
30007, \
"XYK_SURFACE_NEUTRAL_SET", \
5, \
{ { "PLANE_ID", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_xyk_surface_neutral_set_t, PLANE_ID) }, \
{ "AILERONL", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_xyk_surface_neutral_set_t, AILERONL) }, \
{ "AILERONR", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_xyk_surface_neutral_set_t, AILERONR) }, \
{ "RUDERL", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_xyk_surface_neutral_set_t, RUDERL) }, \
{ "RUDERR", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_xyk_surface_neutral_set_t, RUDERR) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_XYK_SURFACE_NEUTRAL_SET { \
"XYK_SURFACE_NEUTRAL_SET", \
5, \
{ { "PLANE_ID", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_xyk_surface_neutral_set_t, PLANE_ID) }, \
{ "AILERONL", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_xyk_surface_neutral_set_t, AILERONL) }, \
{ "AILERONR", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_xyk_surface_neutral_set_t, AILERONR) }, \
{ "RUDERL", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_xyk_surface_neutral_set_t, RUDERL) }, \
{ "RUDERR", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_xyk_surface_neutral_set_t, RUDERR) }, \
} \
}
#endif
/**
* @brief Pack a xyk_surface_neutral_set 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 PLANE_ID PLANE ID
* @param AILERONL AILERON left [1000,2000]
* @param AILERONR aileron right[1000,2000]
* @param RUDERL rudder left[1000,2000]
* @param RUDERR rudder right[1000,2000]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_xyk_surface_neutral_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t PLANE_ID, uint16_t AILERONL, uint16_t AILERONR, uint16_t RUDERL, uint16_t RUDERR)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN];
_mav_put_uint16_t(buf, 0, AILERONL);
_mav_put_uint16_t(buf, 2, AILERONR);
_mav_put_uint16_t(buf, 4, RUDERL);
_mav_put_uint16_t(buf, 6, RUDERR);
_mav_put_uint8_t(buf, 8, PLANE_ID);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN);
#else
mavlink_xyk_surface_neutral_set_t packet;
packet.AILERONL = AILERONL;
packet.AILERONR = AILERONR;
packet.RUDERL = RUDERL;
packet.RUDERR = RUDERR;
packet.PLANE_ID = PLANE_ID;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_MIN_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_CRC);
}
/**
* @brief Pack a xyk_surface_neutral_set message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param PLANE_ID PLANE ID
* @param AILERONL AILERON left [1000,2000]
* @param AILERONR aileron right[1000,2000]
* @param RUDERL rudder left[1000,2000]
* @param RUDERR rudder right[1000,2000]
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_xyk_surface_neutral_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t PLANE_ID,uint16_t AILERONL,uint16_t AILERONR,uint16_t RUDERL,uint16_t RUDERR)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN];
_mav_put_uint16_t(buf, 0, AILERONL);
_mav_put_uint16_t(buf, 2, AILERONR);
_mav_put_uint16_t(buf, 4, RUDERL);
_mav_put_uint16_t(buf, 6, RUDERR);
_mav_put_uint8_t(buf, 8, PLANE_ID);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN);
#else
mavlink_xyk_surface_neutral_set_t packet;
packet.AILERONL = AILERONL;
packet.AILERONR = AILERONR;
packet.RUDERL = RUDERL;
packet.RUDERR = RUDERR;
packet.PLANE_ID = PLANE_ID;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_MIN_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_CRC);
}
/**
* @brief Encode a xyk_surface_neutral_set struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param xyk_surface_neutral_set C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_xyk_surface_neutral_set_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_xyk_surface_neutral_set_t* xyk_surface_neutral_set)
{
return mavlink_msg_xyk_surface_neutral_set_pack(system_id, component_id, msg, xyk_surface_neutral_set->PLANE_ID, xyk_surface_neutral_set->AILERONL, xyk_surface_neutral_set->AILERONR, xyk_surface_neutral_set->RUDERL, xyk_surface_neutral_set->RUDERR);
}
/**
* @brief Encode a xyk_surface_neutral_set struct on a channel
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param xyk_surface_neutral_set C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_xyk_surface_neutral_set_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_xyk_surface_neutral_set_t* xyk_surface_neutral_set)
{
return mavlink_msg_xyk_surface_neutral_set_pack_chan(system_id, component_id, chan, msg, xyk_surface_neutral_set->PLANE_ID, xyk_surface_neutral_set->AILERONL, xyk_surface_neutral_set->AILERONR, xyk_surface_neutral_set->RUDERL, xyk_surface_neutral_set->RUDERR);
}
/**
* @brief Send a xyk_surface_neutral_set message
* @param chan MAVLink channel to send the message
*
* @param PLANE_ID PLANE ID
* @param AILERONL AILERON left [1000,2000]
* @param AILERONR aileron right[1000,2000]
* @param RUDERL rudder left[1000,2000]
* @param RUDERR rudder right[1000,2000]
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_xyk_surface_neutral_set_send(mavlink_channel_t chan, uint8_t PLANE_ID, uint16_t AILERONL, uint16_t AILERONR, uint16_t RUDERL, uint16_t RUDERR)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN];
_mav_put_uint16_t(buf, 0, AILERONL);
_mav_put_uint16_t(buf, 2, AILERONR);
_mav_put_uint16_t(buf, 4, RUDERL);
_mav_put_uint16_t(buf, 6, RUDERR);
_mav_put_uint8_t(buf, 8, PLANE_ID);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET, buf, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_MIN_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_CRC);
#else
mavlink_xyk_surface_neutral_set_t packet;
packet.AILERONL = AILERONL;
packet.AILERONR = AILERONR;
packet.RUDERL = RUDERL;
packet.RUDERR = RUDERR;
packet.PLANE_ID = PLANE_ID;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET, (const char *)&packet, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_MIN_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_CRC);
#endif
}
/**
* @brief Send a xyk_surface_neutral_set message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_xyk_surface_neutral_set_send_struct(mavlink_channel_t chan, const mavlink_xyk_surface_neutral_set_t* xyk_surface_neutral_set)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_xyk_surface_neutral_set_send(chan, xyk_surface_neutral_set->PLANE_ID, xyk_surface_neutral_set->AILERONL, xyk_surface_neutral_set->AILERONR, xyk_surface_neutral_set->RUDERL, xyk_surface_neutral_set->RUDERR);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET, (const char *)xyk_surface_neutral_set, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_MIN_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_CRC);
#endif
}
#if MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
mavlink_message_t which is the size of a full mavlink message. This
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_xyk_surface_neutral_set_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t PLANE_ID, uint16_t AILERONL, uint16_t AILERONR, uint16_t RUDERL, uint16_t RUDERR)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint16_t(buf, 0, AILERONL);
_mav_put_uint16_t(buf, 2, AILERONR);
_mav_put_uint16_t(buf, 4, RUDERL);
_mav_put_uint16_t(buf, 6, RUDERR);
_mav_put_uint8_t(buf, 8, PLANE_ID);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET, buf, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_MIN_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_CRC);
#else
mavlink_xyk_surface_neutral_set_t *packet = (mavlink_xyk_surface_neutral_set_t *)msgbuf;
packet->AILERONL = AILERONL;
packet->AILERONR = AILERONR;
packet->RUDERL = RUDERL;
packet->RUDERR = RUDERR;
packet->PLANE_ID = PLANE_ID;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET, (const char *)packet, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_MIN_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_CRC);
#endif
}
#endif
#endif
// MESSAGE XYK_SURFACE_NEUTRAL_SET UNPACKING
/**
* @brief Get field PLANE_ID from xyk_surface_neutral_set message
*
* @return PLANE ID
*/
static inline uint8_t mavlink_msg_xyk_surface_neutral_set_get_PLANE_ID(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
* @brief Get field AILERONL from xyk_surface_neutral_set message
*
* @return AILERON left [1000,2000]
*/
static inline uint16_t mavlink_msg_xyk_surface_neutral_set_get_AILERONL(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field AILERONR from xyk_surface_neutral_set message
*
* @return aileron right[1000,2000]
*/
static inline uint16_t mavlink_msg_xyk_surface_neutral_set_get_AILERONR(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Get field RUDERL from xyk_surface_neutral_set message
*
* @return rudder left[1000,2000]
*/
static inline uint16_t mavlink_msg_xyk_surface_neutral_set_get_RUDERL(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field RUDERR from xyk_surface_neutral_set message
*
* @return rudder right[1000,2000]
*/
static inline uint16_t mavlink_msg_xyk_surface_neutral_set_get_RUDERR(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Decode a xyk_surface_neutral_set message into a struct
*
* @param msg The message to decode
* @param xyk_surface_neutral_set C-struct to decode the message contents into
*/
static inline void mavlink_msg_xyk_surface_neutral_set_decode(const mavlink_message_t* msg, mavlink_xyk_surface_neutral_set_t* xyk_surface_neutral_set)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
xyk_surface_neutral_set->AILERONL = mavlink_msg_xyk_surface_neutral_set_get_AILERONL(msg);
xyk_surface_neutral_set->AILERONR = mavlink_msg_xyk_surface_neutral_set_get_AILERONR(msg);
xyk_surface_neutral_set->RUDERL = mavlink_msg_xyk_surface_neutral_set_get_RUDERL(msg);
xyk_surface_neutral_set->RUDERR = mavlink_msg_xyk_surface_neutral_set_get_RUDERR(msg);
xyk_surface_neutral_set->PLANE_ID = mavlink_msg_xyk_surface_neutral_set_get_PLANE_ID(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN? msg->len : MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN;
memset(xyk_surface_neutral_set, 0, MAVLINK_MSG_ID_XYK_SURFACE_NEUTRAL_SET_LEN);
memcpy(xyk_surface_neutral_set, _MAV_PAYLOAD(msg), len);
#endif
}