Commit 749a7494 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Merge branch 'master' of github.com:mavlink/qgroundcontrol

parents bcbc0379 aec67561
......@@ -49,13 +49,14 @@ To build on Linux:
sudo apt-get install phonon libqt4-dev \
libphonon-dev libphonon4 phonon-backend-gstreamer \
qtcreator libsdl1.2-dev libflite1 flite1-dev build-essential
qtcreator libsdl1.2-dev libflite1 flite1-dev build-essential \
libopenscenegraph-dev
cd directory
git clone https://github.com/mavlink/qgroundcontrol.git
go to thirdParty -> libxbee
go to libs/thirdParty -> libxbee
Create Library -> Readme file in folder
......
......@@ -4,7 +4,7 @@
typedef struct __mavlink_wind_t
{
float direction; ///< wind direction (degrees)
float direction; ///< wind direction that wind is coming from (degrees)
float speed; ///< wind speed in ground plane (m/s)
float speed_z; ///< vertical wind speed (m/s)
} mavlink_wind_t;
......@@ -30,7 +30,7 @@ typedef struct __mavlink_wind_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param direction wind direction (degrees)
* @param direction wind direction that wind is coming from (degrees)
* @param speed wind speed in ground plane (m/s)
* @param speed_z vertical wind speed (m/s)
* @return length of the message in bytes (excluding serial stream start sign)
......@@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t componen
* @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 direction wind direction (degrees)
* @param direction wind direction that wind is coming from (degrees)
* @param speed wind speed in ground plane (m/s)
* @param speed_z vertical wind speed (m/s)
* @return length of the message in bytes (excluding serial stream start sign)
......@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_wind_encode(uint8_t system_id, uint8_t compon
* @brief Send a wind message
* @param chan MAVLink channel to send the message
*
* @param direction wind direction (degrees)
* @param direction wind direction that wind is coming from (degrees)
* @param speed wind speed in ground plane (m/s)
* @param speed_z vertical wind speed (m/s)
*/
......@@ -143,7 +143,7 @@ static inline void mavlink_msg_wind_send(mavlink_channel_t chan, float direction
/**
* @brief Get field direction from wind message
*
* @return wind direction (degrees)
* @return wind direction that wind is coming from (degrees)
*/
static inline float mavlink_msg_wind_get_direction(const mavlink_message_t* msg)
{
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sat Dec 1 02:05:58 2012"
#define MAVLINK_BUILD_DATE "Wed Jan 9 16:17:57 2013"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254
......
......@@ -15,6 +15,7 @@ extern "C" {
#define X25_INIT_CRC 0xffff
#define X25_VALIDATE_CRC 0xf0b8
#ifndef HAVE_CRC_ACCUMULATE
/**
* @brief Accumulate the X.25 CRC by adding one char at a time.
*
......@@ -33,6 +34,7 @@ static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum)
tmp ^= (tmp<<4);
*crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4);
}
#endif
/**
* @brief Initiliaze the buffer for the X.25 CRC
......
// MESSAGE 6DOF_SETPOINT PACKING
#define MAVLINK_MSG_ID_6DOF_SETPOINT 149
typedef struct __mavlink_6dof_setpoint_t
{
float trans_x; ///< Translational Component in x
float trans_y; ///< Translational Component in y
float trans_z; ///< Translational Component in z
float rot_x; ///< Rotational Component in x
float rot_y; ///< Rotational Component in y
float rot_z; ///< Rotational Component in z
uint8_t target_system; ///< System ID
} mavlink_6dof_setpoint_t;
#define MAVLINK_MSG_ID_6DOF_SETPOINT_LEN 25
#define MAVLINK_MSG_ID_149_LEN 25
#define MAVLINK_MESSAGE_INFO_6DOF_SETPOINT { \
"6DOF_SETPOINT", \
7, \
{ { "trans_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_6dof_setpoint_t, trans_x) }, \
{ "trans_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_6dof_setpoint_t, trans_y) }, \
{ "trans_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_6dof_setpoint_t, trans_z) }, \
{ "rot_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_6dof_setpoint_t, rot_x) }, \
{ "rot_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_6dof_setpoint_t, rot_y) }, \
{ "rot_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_6dof_setpoint_t, rot_z) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_6dof_setpoint_t, target_system) }, \
} \
}
/**
* @brief Pack a 6dof_setpoint 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 trans_x Translational Component in x
* @param trans_y Translational Component in y
* @param trans_z Translational Component in z
* @param rot_x Rotational Component in x
* @param rot_y Rotational Component in y
* @param rot_z Rotational Component in z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_6dof_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, float trans_x, float trans_y, float trans_z, float rot_x, float rot_y, float rot_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[25];
_mav_put_float(buf, 0, trans_x);
_mav_put_float(buf, 4, trans_y);
_mav_put_float(buf, 8, trans_z);
_mav_put_float(buf, 12, rot_x);
_mav_put_float(buf, 16, rot_y);
_mav_put_float(buf, 20, rot_z);
_mav_put_uint8_t(buf, 24, target_system);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
#else
mavlink_6dof_setpoint_t packet;
packet.trans_x = trans_x;
packet.trans_y = trans_y;
packet.trans_z = trans_z;
packet.rot_x = rot_x;
packet.rot_y = rot_y;
packet.rot_z = rot_z;
packet.target_system = target_system;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
#endif
msg->msgid = MAVLINK_MSG_ID_6DOF_SETPOINT;
return mavlink_finalize_message(msg, system_id, component_id, 25, 144);
}
/**
* @brief Pack a 6dof_setpoint 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 trans_x Translational Component in x
* @param trans_y Translational Component in y
* @param trans_z Translational Component in z
* @param rot_x Rotational Component in x
* @param rot_y Rotational Component in y
* @param rot_z Rotational Component in z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_6dof_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,float trans_x,float trans_y,float trans_z,float rot_x,float rot_y,float rot_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[25];
_mav_put_float(buf, 0, trans_x);
_mav_put_float(buf, 4, trans_y);
_mav_put_float(buf, 8, trans_z);
_mav_put_float(buf, 12, rot_x);
_mav_put_float(buf, 16, rot_y);
_mav_put_float(buf, 20, rot_z);
_mav_put_uint8_t(buf, 24, target_system);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
#else
mavlink_6dof_setpoint_t packet;
packet.trans_x = trans_x;
packet.trans_y = trans_y;
packet.trans_z = trans_z;
packet.rot_x = rot_x;
packet.rot_y = rot_y;
packet.rot_z = rot_z;
packet.target_system = target_system;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
#endif
msg->msgid = MAVLINK_MSG_ID_6DOF_SETPOINT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 25, 144);
}
/**
* @brief Encode a 6dof_setpoint 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 6dof_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_6dof_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_6dof_setpoint_t* 6dof_setpoint)
{
return mavlink_msg_6dof_setpoint_pack(system_id, component_id, msg, 6dof_setpoint->target_system, 6dof_setpoint->trans_x, 6dof_setpoint->trans_y, 6dof_setpoint->trans_z, 6dof_setpoint->rot_x, 6dof_setpoint->rot_y, 6dof_setpoint->rot_z);
}
/**
* @brief Send a 6dof_setpoint message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param trans_x Translational Component in x
* @param trans_y Translational Component in y
* @param trans_z Translational Component in z
* @param rot_x Rotational Component in x
* @param rot_y Rotational Component in y
* @param rot_z Rotational Component in z
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_6dof_setpoint_send(mavlink_channel_t chan, uint8_t target_system, float trans_x, float trans_y, float trans_z, float rot_x, float rot_y, float rot_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[25];
_mav_put_float(buf, 0, trans_x);
_mav_put_float(buf, 4, trans_y);
_mav_put_float(buf, 8, trans_z);
_mav_put_float(buf, 12, rot_x);
_mav_put_float(buf, 16, rot_y);
_mav_put_float(buf, 20, rot_z);
_mav_put_uint8_t(buf, 24, target_system);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_6DOF_SETPOINT, buf, 25, 144);
#else
mavlink_6dof_setpoint_t packet;
packet.trans_x = trans_x;
packet.trans_y = trans_y;
packet.trans_z = trans_z;
packet.rot_x = rot_x;
packet.rot_y = rot_y;
packet.rot_z = rot_z;
packet.target_system = target_system;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_6DOF_SETPOINT, (const char *)&packet, 25, 144);
#endif
}
#endif
// MESSAGE 6DOF_SETPOINT UNPACKING
/**
* @brief Get field target_system from 6dof_setpoint message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_6dof_setpoint_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 24);
}
/**
* @brief Get field trans_x from 6dof_setpoint message
*
* @return Translational Component in x
*/
static inline float mavlink_msg_6dof_setpoint_get_trans_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field trans_y from 6dof_setpoint message
*
* @return Translational Component in y
*/
static inline float mavlink_msg_6dof_setpoint_get_trans_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field trans_z from 6dof_setpoint message
*
* @return Translational Component in z
*/
static inline float mavlink_msg_6dof_setpoint_get_trans_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field rot_x from 6dof_setpoint message
*
* @return Rotational Component in x
*/
static inline float mavlink_msg_6dof_setpoint_get_rot_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field rot_y from 6dof_setpoint message
*
* @return Rotational Component in y
*/
static inline float mavlink_msg_6dof_setpoint_get_rot_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field rot_z from 6dof_setpoint message
*
* @return Rotational Component in z
*/
static inline float mavlink_msg_6dof_setpoint_get_rot_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Decode a 6dof_setpoint message into a struct
*
* @param msg The message to decode
* @param 6dof_setpoint C-struct to decode the message contents into
*/
static inline void mavlink_msg_6dof_setpoint_decode(const mavlink_message_t* msg, mavlink_6dof_setpoint_t* 6dof_setpoint)
{
#if MAVLINK_NEED_BYTE_SWAP
6dof_setpoint->trans_x = mavlink_msg_6dof_setpoint_get_trans_x(msg);
6dof_setpoint->trans_y = mavlink_msg_6dof_setpoint_get_trans_y(msg);
6dof_setpoint->trans_z = mavlink_msg_6dof_setpoint_get_trans_z(msg);
6dof_setpoint->rot_x = mavlink_msg_6dof_setpoint_get_rot_x(msg);
6dof_setpoint->rot_y = mavlink_msg_6dof_setpoint_get_rot_y(msg);
6dof_setpoint->rot_z = mavlink_msg_6dof_setpoint_get_rot_z(msg);
6dof_setpoint->target_system = mavlink_msg_6dof_setpoint_get_target_system(msg);
#else
memcpy(6dof_setpoint, _MAV_PAYLOAD(msg), 25);
#endif
}
// MESSAGE 8DOF_SETPOINT PACKING
#define MAVLINK_MSG_ID_8DOF_SETPOINT 148
typedef struct __mavlink_8dof_setpoint_t
{
float val1; ///< Value 1
float val2; ///< Value 2
float val3; ///< Value 3
float val4; ///< Value 4
float val5; ///< Value 5
float val6; ///< Value 6
float val7; ///< Value 7
float val8; ///< Value 8
uint8_t target_system; ///< System ID
} mavlink_8dof_setpoint_t;
#define MAVLINK_MSG_ID_8DOF_SETPOINT_LEN 33
#define MAVLINK_MSG_ID_148_LEN 33
#define MAVLINK_MESSAGE_INFO_8DOF_SETPOINT { \
"8DOF_SETPOINT", \
9, \
{ { "val1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_8dof_setpoint_t, val1) }, \
{ "val2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_8dof_setpoint_t, val2) }, \
{ "val3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_8dof_setpoint_t, val3) }, \
{ "val4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_8dof_setpoint_t, val4) }, \
{ "val5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_8dof_setpoint_t, val5) }, \
{ "val6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_8dof_setpoint_t, val6) }, \
{ "val7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_8dof_setpoint_t, val7) }, \
{ "val8", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_8dof_setpoint_t, val8) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_8dof_setpoint_t, target_system) }, \
} \
}
/**
* @brief Pack a 8dof_setpoint 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 val1 Value 1
* @param val2 Value 2
* @param val3 Value 3
* @param val4 Value 4
* @param val5 Value 5
* @param val6 Value 6
* @param val7 Value 7
* @param val8 Value 8
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_8dof_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, float val1, float val2, float val3, float val4, float val5, float val6, float val7, float val8)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[33];
_mav_put_float(buf, 0, val1);
_mav_put_float(buf, 4, val2);
_mav_put_float(buf, 8, val3);
_mav_put_float(buf, 12, val4);
_mav_put_float(buf, 16, val5);
_mav_put_float(buf, 20, val6);
_mav_put_float(buf, 24, val7);
_mav_put_float(buf, 28, val8);
_mav_put_uint8_t(buf, 32, target_system);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
#else
mavlink_8dof_setpoint_t packet;
packet.val1 = val1;
packet.val2 = val2;
packet.val3 = val3;
packet.val4 = val4;
packet.val5 = val5;
packet.val6 = val6;
packet.val7 = val7;
packet.val8 = val8;
packet.target_system = target_system;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
#endif
msg->msgid = MAVLINK_MSG_ID_8DOF_SETPOINT;
return mavlink_finalize_message(msg, system_id, component_id, 33, 42);
}
/**
* @brief Pack a 8dof_setpoint 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 val1 Value 1
* @param val2 Value 2
* @param val3 Value 3
* @param val4 Value 4
* @param val5 Value 5
* @param val6 Value 6
* @param val7 Value 7
* @param val8 Value 8
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_8dof_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,float val1,float val2,float val3,float val4,float val5,float val6,float val7,float val8)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[33];
_mav_put_float(buf, 0, val1);
_mav_put_float(buf, 4, val2);
_mav_put_float(buf, 8, val3);
_mav_put_float(buf, 12, val4);
_mav_put_float(buf, 16, val5);
_mav_put_float(buf, 20, val6);
_mav_put_float(buf, 24, val7);
_mav_put_float(buf, 28, val8);
_mav_put_uint8_t(buf, 32, target_system);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
#else
mavlink_8dof_setpoint_t packet;
packet.val1 = val1;
packet.val2 = val2;
packet.val3 = val3;
packet.val4 = val4;
packet.val5 = val5;
packet.val6 = val6;
packet.val7 = val7;
packet.val8 = val8;
packet.target_system = target_system;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
#endif
msg->msgid = MAVLINK_MSG_ID_8DOF_SETPOINT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 33, 42);
}
/**
* @brief Encode a 8dof_setpoint 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 8dof_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_8dof_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_8dof_setpoint_t* 8dof_setpoint)
{
return mavlink_msg_8dof_setpoint_pack(system_id, component_id, msg, 8dof_setpoint->target_system, 8dof_setpoint->val1, 8dof_setpoint->val2, 8dof_setpoint->val3, 8dof_setpoint->val4, 8dof_setpoint->val5, 8dof_setpoint->val6, 8dof_setpoint->val7, 8dof_setpoint->val8);
}
/**
* @brief Send a 8dof_setpoint message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param val1 Value 1
* @param val2 Value 2
* @param val3 Value 3
* @param val4 Value 4
* @param val5 Value 5
* @param val6 Value 6
* @param val7 Value 7
* @param val8 Value 8
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_8dof_setpoint_send(mavlink_channel_t chan, uint8_t target_system, float val1, float val2, float val3, float val4, float val5, float val6, float val7, float val8)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[33];
_mav_put_float(buf, 0, val1);
_mav_put_float(buf, 4, val2);
_mav_put_float(buf, 8, val3);
_mav_put_float(buf, 12, val4);
_mav_put_float(buf, 16, val5);
_mav_put_float(buf, 20, val6);
_mav_put_float(buf, 24, val7);
_mav_put_float(buf, 28, val8);
_mav_put_uint8_t(buf, 32, target_system);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_8DOF_SETPOINT, buf, 33, 42);
#else
mavlink_8dof_setpoint_t packet;
packet.val1 = val1;
packet.val2 = val2;
packet.val3 = val3;
packet.val4 = val4;
packet.val5 = val5;
packet.val6 = val6;
packet.val7 = val7;
packet.val8 = val8;
packet.target_system = target_system;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_8DOF_SETPOINT, (const char *)&packet, 33, 42);
#endif
}
#endif
// MESSAGE 8DOF_SETPOINT UNPACKING
/**
* @brief Get field target_system from 8dof_setpoint message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_8dof_setpoint_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 32);
}
/**
* @brief Get field val1 from 8dof_setpoint message
*
* @return Value 1
*/
static inline float mavlink_msg_8dof_setpoint_get_val1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field val2 from 8dof_setpoint message
*
* @return Value 2
*/
static inline float mavlink_msg_8dof_setpoint_get_val2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field val3 from 8dof_setpoint message
*
* @return Value 3
*/
static inline float mavlink_msg_8dof_setpoint_get_val3(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field val4 from 8dof_setpoint message
*
* @return Value 4
*/
static inline float mavlink_msg_8dof_setpoint_get_val4(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field val5 from 8dof_setpoint message
*
* @return Value 5
*/
static inline float mavlink_msg_8dof_setpoint_get_val5(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field val6 from 8dof_setpoint message
*
* @return Value 6
*/
static inline float mavlink_msg_8dof_setpoint_get_val6(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field val7 from 8dof_setpoint message
*
* @return Value 7
*/
static inline float mavlink_msg_8dof_setpoint_get_val7(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field val8 from 8dof_setpoint message
*
* @return Value 8
*/
static inline float mavlink_msg_8dof_setpoint_get_val8(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a 8dof_setpoint message into a struct
*
* @param msg The message to decode
* @param 8dof_setpoint C-struct to decode the message contents into
*/
static inline void mavlink_msg_8dof_setpoint_decode(const mavlink_message_t* msg, mavlink_8dof_setpoint_t* 8dof_setpoint)
{
#if MAVLINK_NEED_BYTE_SWAP
8dof_setpoint->val1 = mavlink_msg_8dof_setpoint_get_val1(msg);
8dof_setpoint->val2 = mavlink_msg_8dof_setpoint_get_val2(msg);
8dof_setpoint->val3 = mavlink_msg_8dof_setpoint_get_val3(msg);
8dof_setpoint->val4 = mavlink_msg_8dof_setpoint_get_val4(msg);
8dof_setpoint->val5 = mavlink_msg_8dof_setpoint_get_val5(msg);
8dof_setpoint->val6 = mavlink_msg_8dof_setpoint_get_val6(msg);
8dof_setpoint->val7 = mavlink_msg_8dof_setpoint_get_val7(msg);
8dof_setpoint->val8 = mavlink_msg_8dof_setpoint_get_val8(msg);
8dof_setpoint->target_system = mavlink_msg_8dof_setpoint_get_target_system(msg);
#else
memcpy(8dof_setpoint, _MAV_PAYLOAD(msg), 33);
#endif
}
// MESSAGE OMNIDIRECTIONAL_FLOW PACKING
#define MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW 106
typedef struct __mavlink_omnidirectional_flow_t
{
uint64_t time_usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float front_distance_m; ///< Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
int16_t left[10]; ///< Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
int16_t right[10]; ///< Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
uint8_t sensor_id; ///< Sensor ID
uint8_t quality; ///< Optical flow quality / confidence. 0: bad, 255: maximum quality
} mavlink_omnidirectional_flow_t;
#define MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN 54
#define MAVLINK_MSG_ID_106_LEN 54
#define MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_LEFT_LEN 10
#define MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_RIGHT_LEN 10
#define MAVLINK_MESSAGE_INFO_OMNIDIRECTIONAL_FLOW { \
"OMNIDIRECTIONAL_FLOW", \
6, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_omnidirectional_flow_t, time_usec) }, \
{ "front_distance_m", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_omnidirectional_flow_t, front_distance_m) }, \
{ "left", NULL, MAVLINK_TYPE_INT16_T, 10, 12, offsetof(mavlink_omnidirectional_flow_t, left) }, \
{ "right", NULL, MAVLINK_TYPE_INT16_T, 10, 32, offsetof(mavlink_omnidirectional_flow_t, right) }, \
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_omnidirectional_flow_t, sensor_id) }, \
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_omnidirectional_flow_t, quality) }, \
} \
}
/**
* @brief Pack a omnidirectional_flow 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 time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param sensor_id Sensor ID
* @param left Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
* @param right Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
* @param front_distance_m Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_omnidirectional_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_usec, uint8_t sensor_id, const int16_t *left, const int16_t *right, uint8_t quality, float front_distance_m)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[54];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, front_distance_m);
_mav_put_uint8_t(buf, 52, sensor_id);
_mav_put_uint8_t(buf, 53, quality);
_mav_put_int16_t_array(buf, 12, left, 10);
_mav_put_int16_t_array(buf, 32, right, 10);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54);
#else
mavlink_omnidirectional_flow_t packet;
packet.time_usec = time_usec;
packet.front_distance_m = front_distance_m;
packet.sensor_id = sensor_id;
packet.quality = quality;
mav_array_memcpy(packet.left, left, sizeof(int16_t)*10);
mav_array_memcpy(packet.right, right, sizeof(int16_t)*10);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54);
#endif
msg->msgid = MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW;
return mavlink_finalize_message(msg, system_id, component_id, 54, 211);
}
/**
* @brief Pack a omnidirectional_flow 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 time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param sensor_id Sensor ID
* @param left Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
* @param right Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
* @param front_distance_m Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_omnidirectional_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t time_usec,uint8_t sensor_id,const int16_t *left,const int16_t *right,uint8_t quality,float front_distance_m)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[54];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, front_distance_m);
_mav_put_uint8_t(buf, 52, sensor_id);
_mav_put_uint8_t(buf, 53, quality);
_mav_put_int16_t_array(buf, 12, left, 10);
_mav_put_int16_t_array(buf, 32, right, 10);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54);
#else
mavlink_omnidirectional_flow_t packet;
packet.time_usec = time_usec;
packet.front_distance_m = front_distance_m;
packet.sensor_id = sensor_id;
packet.quality = quality;
mav_array_memcpy(packet.left, left, sizeof(int16_t)*10);
mav_array_memcpy(packet.right, right, sizeof(int16_t)*10);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54);
#endif
msg->msgid = MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 54, 211);
}
/**
* @brief Encode a omnidirectional_flow 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 omnidirectional_flow C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_omnidirectional_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_omnidirectional_flow_t* omnidirectional_flow)
{
return mavlink_msg_omnidirectional_flow_pack(system_id, component_id, msg, omnidirectional_flow->time_usec, omnidirectional_flow->sensor_id, omnidirectional_flow->left, omnidirectional_flow->right, omnidirectional_flow->quality, omnidirectional_flow->front_distance_m);
}
/**
* @brief Send a omnidirectional_flow message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param sensor_id Sensor ID
* @param left Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
* @param right Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
* @param front_distance_m Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_omnidirectional_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, const int16_t *left, const int16_t *right, uint8_t quality, float front_distance_m)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[54];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, front_distance_m);
_mav_put_uint8_t(buf, 52, sensor_id);
_mav_put_uint8_t(buf, 53, quality);
_mav_put_int16_t_array(buf, 12, left, 10);
_mav_put_int16_t_array(buf, 32, right, 10);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, buf, 54, 211);
#else
mavlink_omnidirectional_flow_t packet;
packet.time_usec = time_usec;
packet.front_distance_m = front_distance_m;
packet.sensor_id = sensor_id;
packet.quality = quality;
mav_array_memcpy(packet.left, left, sizeof(int16_t)*10);
mav_array_memcpy(packet.right, right, sizeof(int16_t)*10);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, (const char *)&packet, 54, 211);
#endif
}
#endif
// MESSAGE OMNIDIRECTIONAL_FLOW UNPACKING
/**
* @brief Get field time_usec from omnidirectional_flow message
*
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/
static inline uint64_t mavlink_msg_omnidirectional_flow_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field sensor_id from omnidirectional_flow message
*
* @return Sensor ID
*/
static inline uint8_t mavlink_msg_omnidirectional_flow_get_sensor_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 52);
}
/**
* @brief Get field left from omnidirectional_flow message
*
* @return Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
*/
static inline uint16_t mavlink_msg_omnidirectional_flow_get_left(const mavlink_message_t* msg, int16_t *left)
{
return _MAV_RETURN_int16_t_array(msg, left, 10, 12);
}
/**
* @brief Get field right from omnidirectional_flow message
*
* @return Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
*/
static inline uint16_t mavlink_msg_omnidirectional_flow_get_right(const mavlink_message_t* msg, int16_t *right)
{
return _MAV_RETURN_int16_t_array(msg, right, 10, 32);
}
/**
* @brief Get field quality from omnidirectional_flow message
*
* @return Optical flow quality / confidence. 0: bad, 255: maximum quality
*/
static inline uint8_t mavlink_msg_omnidirectional_flow_get_quality(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 53);
}
/**
* @brief Get field front_distance_m from omnidirectional_flow message
*
* @return Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
*/
static inline float mavlink_msg_omnidirectional_flow_get_front_distance_m(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Decode a omnidirectional_flow message into a struct
*
* @param msg The message to decode
* @param omnidirectional_flow C-struct to decode the message contents into
*/
static inline void mavlink_msg_omnidirectional_flow_decode(const mavlink_message_t* msg, mavlink_omnidirectional_flow_t* omnidirectional_flow)
{
#if MAVLINK_NEED_BYTE_SWAP
omnidirectional_flow->time_usec = mavlink_msg_omnidirectional_flow_get_time_usec(msg);
omnidirectional_flow->front_distance_m = mavlink_msg_omnidirectional_flow_get_front_distance_m(msg);
mavlink_msg_omnidirectional_flow_get_left(msg, omnidirectional_flow->left);
mavlink_msg_omnidirectional_flow_get_right(msg, omnidirectional_flow->right);
omnidirectional_flow->sensor_id = mavlink_msg_omnidirectional_flow_get_sensor_id(msg);
omnidirectional_flow->quality = mavlink_msg_omnidirectional_flow_get_quality(msg);
#else
memcpy(omnidirectional_flow, _MAV_PAYLOAD(msg), 54);
#endif
}
......@@ -4,7 +4,7 @@
typedef struct __mavlink_servo_output_raw_t
{
uint32_t time_boot_ms; ///< Timestamp (microseconds since system boot)
uint32_t time_usec; ///< Timestamp (microseconds since system boot)
uint16_t servo1_raw; ///< Servo output 1 value, in microseconds
uint16_t servo2_raw; ///< Servo output 2 value, in microseconds
uint16_t servo3_raw; ///< Servo output 3 value, in microseconds
......@@ -24,7 +24,7 @@ typedef struct __mavlink_servo_output_raw_t
#define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \
"SERVO_OUTPUT_RAW", \
10, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_boot_ms) }, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \
{ "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \
{ "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \
{ "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \
......@@ -44,7 +44,7 @@ typedef struct __mavlink_servo_output_raw_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param time_boot_ms Timestamp (microseconds since system boot)
* @param time_usec Timestamp (microseconds since system boot)
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
* @param servo1_raw Servo output 1 value, in microseconds
* @param servo2_raw Servo output 2 value, in microseconds
......@@ -57,11 +57,11 @@ typedef struct __mavlink_servo_output_raw_t
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_uint16_t(buf, 4, servo1_raw);
_mav_put_uint16_t(buf, 6, servo2_raw);
_mav_put_uint16_t(buf, 8, servo3_raw);
......@@ -75,7 +75,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21);
#else
mavlink_servo_output_raw_t packet;
packet.time_boot_ms = time_boot_ms;
packet.time_usec = time_usec;
packet.servo1_raw = servo1_raw;
packet.servo2_raw = servo2_raw;
packet.servo3_raw = servo3_raw;
......@@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
#endif
msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
return mavlink_finalize_message(msg, system_id, component_id, 21, 242);
return mavlink_finalize_message(msg, system_id, component_id, 21, 222);
}
/**
......@@ -99,7 +99,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
* @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 time_boot_ms Timestamp (microseconds since system boot)
* @param time_usec Timestamp (microseconds since system boot)
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
* @param servo1_raw Servo output 1 value, in microseconds
* @param servo2_raw Servo output 2 value, in microseconds
......@@ -113,11 +113,11 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
*/
static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,uint8_t port,uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw)
uint32_t time_usec,uint8_t port,uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_uint16_t(buf, 4, servo1_raw);
_mav_put_uint16_t(buf, 6, servo2_raw);
_mav_put_uint16_t(buf, 8, servo3_raw);
......@@ -131,7 +131,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id,
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21);
#else
mavlink_servo_output_raw_t packet;
packet.time_boot_ms = time_boot_ms;
packet.time_usec = time_usec;
packet.servo1_raw = servo1_raw;
packet.servo2_raw = servo2_raw;
packet.servo3_raw = servo3_raw;
......@@ -146,7 +146,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id,
#endif
msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 21, 242);
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 21, 222);
}
/**
......@@ -159,14 +159,14 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id,
*/
static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw)
{
return mavlink_msg_servo_output_raw_pack(system_id, component_id, msg, servo_output_raw->time_boot_ms, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw);
return mavlink_msg_servo_output_raw_pack(system_id, component_id, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw);
}
/**
* @brief Send a servo_output_raw message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (microseconds since system boot)
* @param time_usec Timestamp (microseconds since system boot)
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
* @param servo1_raw Servo output 1 value, in microseconds
* @param servo2_raw Servo output 2 value, in microseconds
......@@ -179,11 +179,11 @@ static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, ui
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_uint16_t(buf, 4, servo1_raw);
_mav_put_uint16_t(buf, 6, servo2_raw);
_mav_put_uint16_t(buf, 8, servo3_raw);
......@@ -194,10 +194,10 @@ static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uin
_mav_put_uint16_t(buf, 18, servo8_raw);
_mav_put_uint8_t(buf, 20, port);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, 21, 242);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, 21, 222);
#else
mavlink_servo_output_raw_t packet;
packet.time_boot_ms = time_boot_ms;
packet.time_usec = time_usec;
packet.servo1_raw = servo1_raw;
packet.servo2_raw = servo2_raw;
packet.servo3_raw = servo3_raw;
......@@ -208,7 +208,7 @@ static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uin
packet.servo8_raw = servo8_raw;
packet.port = port;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, 21, 242);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, 21, 222);
#endif
}
......@@ -218,11 +218,11 @@ static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uin
/**
* @brief Get field time_boot_ms from servo_output_raw message
* @brief Get field time_usec from servo_output_raw message
*
* @return Timestamp (microseconds since system boot)
*/
static inline uint32_t mavlink_msg_servo_output_raw_get_time_boot_ms(const mavlink_message_t* msg)
static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
......@@ -326,7 +326,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_get_servo8_raw(const mavlink
static inline void mavlink_msg_servo_output_raw_decode(const mavlink_message_t* msg, mavlink_servo_output_raw_t* servo_output_raw)
{
#if MAVLINK_NEED_BYTE_SWAP
servo_output_raw->time_boot_ms = mavlink_msg_servo_output_raw_get_time_boot_ms(msg);
servo_output_raw->time_usec = mavlink_msg_servo_output_raw_get_time_usec(msg);
servo_output_raw->servo1_raw = mavlink_msg_servo_output_raw_get_servo1_raw(msg);
servo_output_raw->servo2_raw = mavlink_msg_servo_output_raw_get_servo2_raw(msg);
servo_output_raw->servo3_raw = mavlink_msg_servo_output_raw_get_servo3_raw(msg);
......
......@@ -1327,7 +1327,7 @@ static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_i
};
mavlink_servo_output_raw_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_boot_ms = packet_in.time_boot_ms;
packet1.time_usec = packet_in.time_usec;
packet1.servo1_raw = packet_in.servo1_raw;
packet1.servo2_raw = packet_in.servo2_raw;
packet1.servo3_raw = packet_in.servo3_raw;
......@@ -1346,12 +1346,12 @@ static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_i
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_servo_output_raw_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
mavlink_msg_servo_output_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
mavlink_msg_servo_output_raw_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
mavlink_msg_servo_output_raw_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
......@@ -1364,7 +1364,7 @@ static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_i
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_servo_output_raw_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
mavlink_msg_servo_output_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw );
mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
......@@ -3886,6 +3886,59 @@ static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, ma
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_omnidirectional_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_omnidirectional_flow_t packet_in = {
93372036854775807ULL,
73.0,
{ 17859, 17860, 17861, 17862, 17863, 17864, 17865, 17866, 17867, 17868 },
{ 18899, 18900, 18901, 18902, 18903, 18904, 18905, 18906, 18907, 18908 },
161,
228,
};
mavlink_omnidirectional_flow_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_usec = packet_in.time_usec;
packet1.front_distance_m = packet_in.front_distance_m;
packet1.sensor_id = packet_in.sensor_id;
packet1.quality = packet_in.quality;
mav_array_memcpy(packet1.left, packet_in.left, sizeof(int16_t)*10);
mav_array_memcpy(packet1.right, packet_in.right, sizeof(int16_t)*10);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_omnidirectional_flow_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_omnidirectional_flow_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_omnidirectional_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.left , packet1.right , packet1.quality , packet1.front_distance_m );
mavlink_msg_omnidirectional_flow_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_omnidirectional_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.left , packet1.right , packet1.quality , packet1.front_distance_m );
mavlink_msg_omnidirectional_flow_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_omnidirectional_flow_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_omnidirectional_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.left , packet1.right , packet1.quality , packet1.front_distance_m );
mavlink_msg_omnidirectional_flow_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_file_transfer_start(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
......@@ -4562,6 +4615,7 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_vision_speed_estimate(system_id, component_id, last_msg);
mavlink_test_vicon_position_estimate(system_id, component_id, last_msg);
mavlink_test_highres_imu(system_id, component_id, last_msg);
mavlink_test_omnidirectional_flow(system_id, component_id, last_msg);
mavlink_test_file_transfer_start(system_id, component_id, last_msg);
mavlink_test_file_transfer_dir_list(system_id, component_id, last_msg);
mavlink_test_file_transfer_res(system_id, component_id, last_msg);
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sat Dec 1 02:07:06 2012"
#define MAVLINK_BUILD_DATE "Wed Jan 9 16:19:41 2013"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254
......
// MESSAGE AIRSPEEDS PACKING
#define MAVLINK_MSG_ID_AIRSPEEDS 182
typedef struct __mavlink_airspeeds_t
{
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
int16_t airspeed_imu; ///< Airspeed estimate from IMU, cm/s
int16_t airspeed_pitot; ///< Pitot measured forward airpseed, cm/s
int16_t airspeed_hot_wire; ///< Hot wire anenometer measured airspeed, cm/s
int16_t airspeed_ultrasonic; ///< Ultrasonic measured airspeed, cm/s
int16_t aoa; ///< Angle of attack sensor, degrees * 10
int16_t aoy; ///< Yaw angle sensor, degrees * 10
} mavlink_airspeeds_t;
#define MAVLINK_MSG_ID_AIRSPEEDS_LEN 16
#define MAVLINK_MSG_ID_182_LEN 16
#define MAVLINK_MESSAGE_INFO_AIRSPEEDS { \
"AIRSPEEDS", \
7, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_airspeeds_t, time_boot_ms) }, \
{ "airspeed_imu", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_airspeeds_t, airspeed_imu) }, \
{ "airspeed_pitot", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_airspeeds_t, airspeed_pitot) }, \
{ "airspeed_hot_wire", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_airspeeds_t, airspeed_hot_wire) }, \
{ "airspeed_ultrasonic", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_airspeeds_t, airspeed_ultrasonic) }, \
{ "aoa", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_airspeeds_t, aoa) }, \
{ "aoy", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_airspeeds_t, aoy) }, \
} \
}
/**
* @brief Pack a airspeeds 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 time_boot_ms Timestamp (milliseconds since system boot)
* @param airspeed_imu Airspeed estimate from IMU, cm/s
* @param airspeed_pitot Pitot measured forward airpseed, cm/s
* @param airspeed_hot_wire Hot wire anenometer measured airspeed, cm/s
* @param airspeed_ultrasonic Ultrasonic measured airspeed, cm/s
* @param aoa Angle of attack sensor, degrees * 10
* @param aoy Yaw angle sensor, degrees * 10
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_airspeeds_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, int16_t airspeed_imu, int16_t airspeed_pitot, int16_t airspeed_hot_wire, int16_t airspeed_ultrasonic, int16_t aoa, int16_t aoy)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int16_t(buf, 4, airspeed_imu);
_mav_put_int16_t(buf, 6, airspeed_pitot);
_mav_put_int16_t(buf, 8, airspeed_hot_wire);
_mav_put_int16_t(buf, 10, airspeed_ultrasonic);
_mav_put_int16_t(buf, 12, aoa);
_mav_put_int16_t(buf, 14, aoy);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
#else
mavlink_airspeeds_t packet;
packet.time_boot_ms = time_boot_ms;
packet.airspeed_imu = airspeed_imu;
packet.airspeed_pitot = airspeed_pitot;
packet.airspeed_hot_wire = airspeed_hot_wire;
packet.airspeed_ultrasonic = airspeed_ultrasonic;
packet.aoa = aoa;
packet.aoy = aoy;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
#endif
msg->msgid = MAVLINK_MSG_ID_AIRSPEEDS;
return mavlink_finalize_message(msg, system_id, component_id, 16, 154);
}
/**
* @brief Pack a airspeeds 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 time_boot_ms Timestamp (milliseconds since system boot)
* @param airspeed_imu Airspeed estimate from IMU, cm/s
* @param airspeed_pitot Pitot measured forward airpseed, cm/s
* @param airspeed_hot_wire Hot wire anenometer measured airspeed, cm/s
* @param airspeed_ultrasonic Ultrasonic measured airspeed, cm/s
* @param aoa Angle of attack sensor, degrees * 10
* @param aoy Yaw angle sensor, degrees * 10
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_airspeeds_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,int16_t airspeed_imu,int16_t airspeed_pitot,int16_t airspeed_hot_wire,int16_t airspeed_ultrasonic,int16_t aoa,int16_t aoy)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int16_t(buf, 4, airspeed_imu);
_mav_put_int16_t(buf, 6, airspeed_pitot);
_mav_put_int16_t(buf, 8, airspeed_hot_wire);
_mav_put_int16_t(buf, 10, airspeed_ultrasonic);
_mav_put_int16_t(buf, 12, aoa);
_mav_put_int16_t(buf, 14, aoy);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
#else
mavlink_airspeeds_t packet;
packet.time_boot_ms = time_boot_ms;
packet.airspeed_imu = airspeed_imu;
packet.airspeed_pitot = airspeed_pitot;
packet.airspeed_hot_wire = airspeed_hot_wire;
packet.airspeed_ultrasonic = airspeed_ultrasonic;
packet.aoa = aoa;
packet.aoy = aoy;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
#endif
msg->msgid = MAVLINK_MSG_ID_AIRSPEEDS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16, 154);
}
/**
* @brief Encode a airspeeds 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 airspeeds C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_airspeeds_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_airspeeds_t* airspeeds)
{
return mavlink_msg_airspeeds_pack(system_id, component_id, msg, airspeeds->time_boot_ms, airspeeds->airspeed_imu, airspeeds->airspeed_pitot, airspeeds->airspeed_hot_wire, airspeeds->airspeed_ultrasonic, airspeeds->aoa, airspeeds->aoy);
}
/**
* @brief Send a airspeeds message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param airspeed_imu Airspeed estimate from IMU, cm/s
* @param airspeed_pitot Pitot measured forward airpseed, cm/s
* @param airspeed_hot_wire Hot wire anenometer measured airspeed, cm/s
* @param airspeed_ultrasonic Ultrasonic measured airspeed, cm/s
* @param aoa Angle of attack sensor, degrees * 10
* @param aoy Yaw angle sensor, degrees * 10
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_airspeeds_send(mavlink_channel_t chan, uint32_t time_boot_ms, int16_t airspeed_imu, int16_t airspeed_pitot, int16_t airspeed_hot_wire, int16_t airspeed_ultrasonic, int16_t aoa, int16_t aoy)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int16_t(buf, 4, airspeed_imu);
_mav_put_int16_t(buf, 6, airspeed_pitot);
_mav_put_int16_t(buf, 8, airspeed_hot_wire);
_mav_put_int16_t(buf, 10, airspeed_ultrasonic);
_mav_put_int16_t(buf, 12, aoa);
_mav_put_int16_t(buf, 14, aoy);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEEDS, buf, 16, 154);
#else
mavlink_airspeeds_t packet;
packet.time_boot_ms = time_boot_ms;
packet.airspeed_imu = airspeed_imu;
packet.airspeed_pitot = airspeed_pitot;
packet.airspeed_hot_wire = airspeed_hot_wire;
packet.airspeed_ultrasonic = airspeed_ultrasonic;
packet.aoa = aoa;
packet.aoy = aoy;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEEDS, (const char *)&packet, 16, 154);
#endif
}
#endif
// MESSAGE AIRSPEEDS UNPACKING
/**
* @brief Get field time_boot_ms from airspeeds message
*
* @return Timestamp (milliseconds since system boot)
*/
static inline uint32_t mavlink_msg_airspeeds_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field airspeed_imu from airspeeds message
*
* @return Airspeed estimate from IMU, cm/s
*/
static inline int16_t mavlink_msg_airspeeds_get_airspeed_imu(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 4);
}
/**
* @brief Get field airspeed_pitot from airspeeds message
*
* @return Pitot measured forward airpseed, cm/s
*/
static inline int16_t mavlink_msg_airspeeds_get_airspeed_pitot(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 6);
}
/**
* @brief Get field airspeed_hot_wire from airspeeds message
*
* @return Hot wire anenometer measured airspeed, cm/s
*/
static inline int16_t mavlink_msg_airspeeds_get_airspeed_hot_wire(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 8);
}
/**
* @brief Get field airspeed_ultrasonic from airspeeds message
*
* @return Ultrasonic measured airspeed, cm/s
*/
static inline int16_t mavlink_msg_airspeeds_get_airspeed_ultrasonic(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 10);
}
/**
* @brief Get field aoa from airspeeds message
*
* @return Angle of attack sensor, degrees * 10
*/
static inline int16_t mavlink_msg_airspeeds_get_aoa(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 12);
}
/**
* @brief Get field aoy from airspeeds message
*
* @return Yaw angle sensor, degrees * 10
*/
static inline int16_t mavlink_msg_airspeeds_get_aoy(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 14);
}
/**
* @brief Decode a airspeeds message into a struct
*
* @param msg The message to decode
* @param airspeeds C-struct to decode the message contents into
*/
static inline void mavlink_msg_airspeeds_decode(const mavlink_message_t* msg, mavlink_airspeeds_t* airspeeds)
{
#if MAVLINK_NEED_BYTE_SWAP
airspeeds->time_boot_ms = mavlink_msg_airspeeds_get_time_boot_ms(msg);
airspeeds->airspeed_imu = mavlink_msg_airspeeds_get_airspeed_imu(msg);
airspeeds->airspeed_pitot = mavlink_msg_airspeeds_get_airspeed_pitot(msg);
airspeeds->airspeed_hot_wire = mavlink_msg_airspeeds_get_airspeed_hot_wire(msg);
airspeeds->airspeed_ultrasonic = mavlink_msg_airspeeds_get_airspeed_ultrasonic(msg);
airspeeds->aoa = mavlink_msg_airspeeds_get_aoa(msg);
airspeeds->aoy = mavlink_msg_airspeeds_get_aoy(msg);
#else
memcpy(airspeeds, _MAV_PAYLOAD(msg), 16);
#endif
}
// MESSAGE ALTITUDES PACKING
#define MAVLINK_MSG_ID_ALTITUDES 181
typedef struct __mavlink_altitudes_t
{
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
int32_t alt_gps; ///< GPS altitude in meters, expressed as * 1000 (millimeters), above MSL
int32_t alt_imu; ///< IMU altitude above ground in meters, expressed as * 1000 (millimeters)
int32_t alt_barometric; ///< barometeric altitude above ground in meters, expressed as * 1000 (millimeters)
int32_t alt_optical_flow; ///< Optical flow altitude above ground in meters, expressed as * 1000 (millimeters)
int32_t alt_range_finder; ///< Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters)
int32_t alt_extra; ///< Extra altitude above ground in meters, expressed as * 1000 (millimeters)
} mavlink_altitudes_t;
#define MAVLINK_MSG_ID_ALTITUDES_LEN 28
#define MAVLINK_MSG_ID_181_LEN 28
#define MAVLINK_MESSAGE_INFO_ALTITUDES { \
"ALTITUDES", \
7, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_altitudes_t, time_boot_ms) }, \
{ "alt_gps", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_altitudes_t, alt_gps) }, \
{ "alt_imu", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_altitudes_t, alt_imu) }, \
{ "alt_barometric", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_altitudes_t, alt_barometric) }, \
{ "alt_optical_flow", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_altitudes_t, alt_optical_flow) }, \
{ "alt_range_finder", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_altitudes_t, alt_range_finder) }, \
{ "alt_extra", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_altitudes_t, alt_extra) }, \
} \
}
/**
* @brief Pack a altitudes 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 time_boot_ms Timestamp (milliseconds since system boot)
* @param alt_gps GPS altitude in meters, expressed as * 1000 (millimeters), above MSL
* @param alt_imu IMU altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_barometric barometeric altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_optical_flow Optical flow altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_range_finder Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_extra Extra altitude above ground in meters, expressed as * 1000 (millimeters)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_altitudes_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, int32_t alt_gps, int32_t alt_imu, int32_t alt_barometric, int32_t alt_optical_flow, int32_t alt_range_finder, int32_t alt_extra)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, alt_gps);
_mav_put_int32_t(buf, 8, alt_imu);
_mav_put_int32_t(buf, 12, alt_barometric);
_mav_put_int32_t(buf, 16, alt_optical_flow);
_mav_put_int32_t(buf, 20, alt_range_finder);
_mav_put_int32_t(buf, 24, alt_extra);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_altitudes_t packet;
packet.time_boot_ms = time_boot_ms;
packet.alt_gps = alt_gps;
packet.alt_imu = alt_imu;
packet.alt_barometric = alt_barometric;
packet.alt_optical_flow = alt_optical_flow;
packet.alt_range_finder = alt_range_finder;
packet.alt_extra = alt_extra;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_ALTITUDES;
return mavlink_finalize_message(msg, system_id, component_id, 28, 55);
}
/**
* @brief Pack a altitudes 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 time_boot_ms Timestamp (milliseconds since system boot)
* @param alt_gps GPS altitude in meters, expressed as * 1000 (millimeters), above MSL
* @param alt_imu IMU altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_barometric barometeric altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_optical_flow Optical flow altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_range_finder Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_extra Extra altitude above ground in meters, expressed as * 1000 (millimeters)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_altitudes_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,int32_t alt_gps,int32_t alt_imu,int32_t alt_barometric,int32_t alt_optical_flow,int32_t alt_range_finder,int32_t alt_extra)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, alt_gps);
_mav_put_int32_t(buf, 8, alt_imu);
_mav_put_int32_t(buf, 12, alt_barometric);
_mav_put_int32_t(buf, 16, alt_optical_flow);
_mav_put_int32_t(buf, 20, alt_range_finder);
_mav_put_int32_t(buf, 24, alt_extra);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_altitudes_t packet;
packet.time_boot_ms = time_boot_ms;
packet.alt_gps = alt_gps;
packet.alt_imu = alt_imu;
packet.alt_barometric = alt_barometric;
packet.alt_optical_flow = alt_optical_flow;
packet.alt_range_finder = alt_range_finder;
packet.alt_extra = alt_extra;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_ALTITUDES;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 55);
}
/**
* @brief Encode a altitudes 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 altitudes C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_altitudes_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_altitudes_t* altitudes)
{
return mavlink_msg_altitudes_pack(system_id, component_id, msg, altitudes->time_boot_ms, altitudes->alt_gps, altitudes->alt_imu, altitudes->alt_barometric, altitudes->alt_optical_flow, altitudes->alt_range_finder, altitudes->alt_extra);
}
/**
* @brief Send a altitudes message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param alt_gps GPS altitude in meters, expressed as * 1000 (millimeters), above MSL
* @param alt_imu IMU altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_barometric barometeric altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_optical_flow Optical flow altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_range_finder Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters)
* @param alt_extra Extra altitude above ground in meters, expressed as * 1000 (millimeters)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_altitudes_send(mavlink_channel_t chan, uint32_t time_boot_ms, int32_t alt_gps, int32_t alt_imu, int32_t alt_barometric, int32_t alt_optical_flow, int32_t alt_range_finder, int32_t alt_extra)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, alt_gps);
_mav_put_int32_t(buf, 8, alt_imu);
_mav_put_int32_t(buf, 12, alt_barometric);
_mav_put_int32_t(buf, 16, alt_optical_flow);
_mav_put_int32_t(buf, 20, alt_range_finder);
_mav_put_int32_t(buf, 24, alt_extra);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDES, buf, 28, 55);
#else
mavlink_altitudes_t packet;
packet.time_boot_ms = time_boot_ms;
packet.alt_gps = alt_gps;
packet.alt_imu = alt_imu;
packet.alt_barometric = alt_barometric;
packet.alt_optical_flow = alt_optical_flow;
packet.alt_range_finder = alt_range_finder;
packet.alt_extra = alt_extra;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDES, (const char *)&packet, 28, 55);
#endif
}
#endif
// MESSAGE ALTITUDES UNPACKING
/**
* @brief Get field time_boot_ms from altitudes message
*
* @return Timestamp (milliseconds since system boot)
*/
static inline uint32_t mavlink_msg_altitudes_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field alt_gps from altitudes message
*
* @return GPS altitude in meters, expressed as * 1000 (millimeters), above MSL
*/
static inline int32_t mavlink_msg_altitudes_get_alt_gps(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 4);
}
/**
* @brief Get field alt_imu from altitudes message
*
* @return IMU altitude above ground in meters, expressed as * 1000 (millimeters)
*/
static inline int32_t mavlink_msg_altitudes_get_alt_imu(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 8);
}
/**
* @brief Get field alt_barometric from altitudes message
*
* @return barometeric altitude above ground in meters, expressed as * 1000 (millimeters)
*/
static inline int32_t mavlink_msg_altitudes_get_alt_barometric(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 12);
}
/**
* @brief Get field alt_optical_flow from altitudes message
*
* @return Optical flow altitude above ground in meters, expressed as * 1000 (millimeters)
*/
static inline int32_t mavlink_msg_altitudes_get_alt_optical_flow(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 16);
}
/**
* @brief Get field alt_range_finder from altitudes message
*
* @return Rangefinder Altitude above ground in meters, expressed as * 1000 (millimeters)
*/
static inline int32_t mavlink_msg_altitudes_get_alt_range_finder(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 20);
}
/**
* @brief Get field alt_extra from altitudes message
*
* @return Extra altitude above ground in meters, expressed as * 1000 (millimeters)
*/
static inline int32_t mavlink_msg_altitudes_get_alt_extra(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 24);
}
/**
* @brief Decode a altitudes message into a struct
*
* @param msg The message to decode
* @param altitudes C-struct to decode the message contents into
*/
static inline void mavlink_msg_altitudes_decode(const mavlink_message_t* msg, mavlink_altitudes_t* altitudes)
{
#if MAVLINK_NEED_BYTE_SWAP
altitudes->time_boot_ms = mavlink_msg_altitudes_get_time_boot_ms(msg);
altitudes->alt_gps = mavlink_msg_altitudes_get_alt_gps(msg);
altitudes->alt_imu = mavlink_msg_altitudes_get_alt_imu(msg);
altitudes->alt_barometric = mavlink_msg_altitudes_get_alt_barometric(msg);
altitudes->alt_optical_flow = mavlink_msg_altitudes_get_alt_optical_flow(msg);
altitudes->alt_range_finder = mavlink_msg_altitudes_get_alt_range_finder(msg);
altitudes->alt_extra = mavlink_msg_altitudes_get_alt_extra(msg);
#else
memcpy(altitudes, _MAV_PAYLOAD(msg), 28);
#endif
}
// MESSAGE FLEXIFUNCTION_BUFFER_FUNCTION PACKING
#define MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION 152
typedef struct __mavlink_flexifunction_buffer_function_t
{
uint16_t func_index; ///< Function index
uint16_t func_count; ///< Total count of functions
uint16_t data_address; ///< Address in the flexifunction data, Set to 0xFFFF to use address in target memory
uint16_t data_size; ///< Size of the
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
int8_t data[48]; ///< Settings data
} mavlink_flexifunction_buffer_function_t;
#define MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_LEN 58
#define MAVLINK_MSG_ID_152_LEN 58
#define MAVLINK_MSG_FLEXIFUNCTION_BUFFER_FUNCTION_FIELD_DATA_LEN 48
#define MAVLINK_MESSAGE_INFO_FLEXIFUNCTION_BUFFER_FUNCTION { \
"FLEXIFUNCTION_BUFFER_FUNCTION", \
7, \
{ { "func_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_flexifunction_buffer_function_t, func_index) }, \
{ "func_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_flexifunction_buffer_function_t, func_count) }, \
{ "data_address", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_flexifunction_buffer_function_t, data_address) }, \
{ "data_size", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_flexifunction_buffer_function_t, data_size) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_flexifunction_buffer_function_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_flexifunction_buffer_function_t, target_component) }, \
{ "data", NULL, MAVLINK_TYPE_INT8_T, 48, 10, offsetof(mavlink_flexifunction_buffer_function_t, data) }, \
} \
}
/**
* @brief Pack a flexifunction_buffer_function 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 func_index Function index
* @param func_count Total count of functions
* @param data_address Address in the flexifunction data, Set to 0xFFFF to use address in target memory
* @param data_size Size of the
* @param data Settings data
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint16_t func_index, uint16_t func_count, uint16_t data_address, uint16_t data_size, const int8_t *data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[58];
_mav_put_uint16_t(buf, 0, func_index);
_mav_put_uint16_t(buf, 2, func_count);
_mav_put_uint16_t(buf, 4, data_address);
_mav_put_uint16_t(buf, 6, data_size);
_mav_put_uint8_t(buf, 8, target_system);
_mav_put_uint8_t(buf, 9, target_component);
_mav_put_int8_t_array(buf, 10, data, 48);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 58);
#else
mavlink_flexifunction_buffer_function_t packet;
packet.func_index = func_index;
packet.func_count = func_count;
packet.data_address = data_address;
packet.data_size = data_size;
packet.target_system = target_system;
packet.target_component = target_component;
mav_array_memcpy(packet.data, data, sizeof(int8_t)*48);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 58);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION;
return mavlink_finalize_message(msg, system_id, component_id, 58, 101);
}
/**
* @brief Pack a flexifunction_buffer_function 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 func_index Function index
* @param func_count Total count of functions
* @param data_address Address in the flexifunction data, Set to 0xFFFF to use address in target memory
* @param data_size Size of the
* @param data Settings data
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_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,uint16_t func_index,uint16_t func_count,uint16_t data_address,uint16_t data_size,const int8_t *data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[58];
_mav_put_uint16_t(buf, 0, func_index);
_mav_put_uint16_t(buf, 2, func_count);
_mav_put_uint16_t(buf, 4, data_address);
_mav_put_uint16_t(buf, 6, data_size);
_mav_put_uint8_t(buf, 8, target_system);
_mav_put_uint8_t(buf, 9, target_component);
_mav_put_int8_t_array(buf, 10, data, 48);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 58);
#else
mavlink_flexifunction_buffer_function_t packet;
packet.func_index = func_index;
packet.func_count = func_count;
packet.data_address = data_address;
packet.data_size = data_size;
packet.target_system = target_system;
packet.target_component = target_component;
mav_array_memcpy(packet.data, data, sizeof(int8_t)*48);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 58);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 58, 101);
}
/**
* @brief Encode a flexifunction_buffer_function 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 flexifunction_buffer_function C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flexifunction_buffer_function_t* flexifunction_buffer_function)
{
return mavlink_msg_flexifunction_buffer_function_pack(system_id, component_id, msg, flexifunction_buffer_function->target_system, flexifunction_buffer_function->target_component, flexifunction_buffer_function->func_index, flexifunction_buffer_function->func_count, flexifunction_buffer_function->data_address, flexifunction_buffer_function->data_size, flexifunction_buffer_function->data);
}
/**
* @brief Send a flexifunction_buffer_function message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param func_index Function index
* @param func_count Total count of functions
* @param data_address Address in the flexifunction data, Set to 0xFFFF to use address in target memory
* @param data_size Size of the
* @param data Settings data
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_flexifunction_buffer_function_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t func_index, uint16_t func_count, uint16_t data_address, uint16_t data_size, const int8_t *data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[58];
_mav_put_uint16_t(buf, 0, func_index);
_mav_put_uint16_t(buf, 2, func_count);
_mav_put_uint16_t(buf, 4, data_address);
_mav_put_uint16_t(buf, 6, data_size);
_mav_put_uint8_t(buf, 8, target_system);
_mav_put_uint8_t(buf, 9, target_component);
_mav_put_int8_t_array(buf, 10, data, 48);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION, buf, 58, 101);
#else
mavlink_flexifunction_buffer_function_t packet;
packet.func_index = func_index;
packet.func_count = func_count;
packet.data_address = data_address;
packet.data_size = data_size;
packet.target_system = target_system;
packet.target_component = target_component;
mav_array_memcpy(packet.data, data, sizeof(int8_t)*48);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION, (const char *)&packet, 58, 101);
#endif
}
#endif
// MESSAGE FLEXIFUNCTION_BUFFER_FUNCTION UNPACKING
/**
* @brief Get field target_system from flexifunction_buffer_function message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_flexifunction_buffer_function_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
* @brief Get field target_component from flexifunction_buffer_function message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_flexifunction_buffer_function_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 9);
}
/**
* @brief Get field func_index from flexifunction_buffer_function message
*
* @return Function index
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_get_func_index(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field func_count from flexifunction_buffer_function message
*
* @return Total count of functions
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_get_func_count(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Get field data_address from flexifunction_buffer_function message
*
* @return Address in the flexifunction data, Set to 0xFFFF to use address in target memory
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_get_data_address(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field data_size from flexifunction_buffer_function message
*
* @return Size of the
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_get_data_size(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field data from flexifunction_buffer_function message
*
* @return Settings data
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_get_data(const mavlink_message_t* msg, int8_t *data)
{
return _MAV_RETURN_int8_t_array(msg, data, 48, 10);
}
/**
* @brief Decode a flexifunction_buffer_function message into a struct
*
* @param msg The message to decode
* @param flexifunction_buffer_function C-struct to decode the message contents into
*/
static inline void mavlink_msg_flexifunction_buffer_function_decode(const mavlink_message_t* msg, mavlink_flexifunction_buffer_function_t* flexifunction_buffer_function)
{
#if MAVLINK_NEED_BYTE_SWAP
flexifunction_buffer_function->func_index = mavlink_msg_flexifunction_buffer_function_get_func_index(msg);
flexifunction_buffer_function->func_count = mavlink_msg_flexifunction_buffer_function_get_func_count(msg);
flexifunction_buffer_function->data_address = mavlink_msg_flexifunction_buffer_function_get_data_address(msg);
flexifunction_buffer_function->data_size = mavlink_msg_flexifunction_buffer_function_get_data_size(msg);
flexifunction_buffer_function->target_system = mavlink_msg_flexifunction_buffer_function_get_target_system(msg);
flexifunction_buffer_function->target_component = mavlink_msg_flexifunction_buffer_function_get_target_component(msg);
mavlink_msg_flexifunction_buffer_function_get_data(msg, flexifunction_buffer_function->data);
#else
memcpy(flexifunction_buffer_function, _MAV_PAYLOAD(msg), 58);
#endif
}
// MESSAGE FLEXIFUNCTION_BUFFER_FUNCTION_ACK PACKING
#define MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK 153
typedef struct __mavlink_flexifunction_buffer_function_ack_t
{
uint16_t func_index; ///< Function index
uint16_t result; ///< result of acknowledge, 0=fail, 1=good
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
} mavlink_flexifunction_buffer_function_ack_t;
#define MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK_LEN 6
#define MAVLINK_MSG_ID_153_LEN 6
#define MAVLINK_MESSAGE_INFO_FLEXIFUNCTION_BUFFER_FUNCTION_ACK { \
"FLEXIFUNCTION_BUFFER_FUNCTION_ACK", \
4, \
{ { "func_index", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_flexifunction_buffer_function_ack_t, func_index) }, \
{ "result", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_flexifunction_buffer_function_ack_t, result) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_flexifunction_buffer_function_ack_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_flexifunction_buffer_function_ack_t, target_component) }, \
} \
}
/**
* @brief Pack a flexifunction_buffer_function_ack 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 func_index Function index
* @param result result of acknowledge, 0=fail, 1=good
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint16_t func_index, uint16_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint16_t(buf, 0, func_index);
_mav_put_uint16_t(buf, 2, result);
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, target_component);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_flexifunction_buffer_function_ack_t packet;
packet.func_index = func_index;
packet.result = result;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK;
return mavlink_finalize_message(msg, system_id, component_id, 6, 109);
}
/**
* @brief Pack a flexifunction_buffer_function_ack 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 func_index Function index
* @param result result of acknowledge, 0=fail, 1=good
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_ack_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,uint16_t func_index,uint16_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint16_t(buf, 0, func_index);
_mav_put_uint16_t(buf, 2, result);
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, target_component);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_flexifunction_buffer_function_ack_t packet;
packet.func_index = func_index;
packet.result = result;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 109);
}
/**
* @brief Encode a flexifunction_buffer_function_ack 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 flexifunction_buffer_function_ack C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flexifunction_buffer_function_ack_t* flexifunction_buffer_function_ack)
{
return mavlink_msg_flexifunction_buffer_function_ack_pack(system_id, component_id, msg, flexifunction_buffer_function_ack->target_system, flexifunction_buffer_function_ack->target_component, flexifunction_buffer_function_ack->func_index, flexifunction_buffer_function_ack->result);
}
/**
* @brief Send a flexifunction_buffer_function_ack message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param func_index Function index
* @param result result of acknowledge, 0=fail, 1=good
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_flexifunction_buffer_function_ack_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t func_index, uint16_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[6];
_mav_put_uint16_t(buf, 0, func_index);
_mav_put_uint16_t(buf, 2, result);
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, target_component);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK, buf, 6, 109);
#else
mavlink_flexifunction_buffer_function_ack_t packet;
packet.func_index = func_index;
packet.result = result;
packet.target_system = target_system;
packet.target_component = target_component;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK, (const char *)&packet, 6, 109);
#endif
}
#endif
// MESSAGE FLEXIFUNCTION_BUFFER_FUNCTION_ACK UNPACKING
/**
* @brief Get field target_system from flexifunction_buffer_function_ack message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_flexifunction_buffer_function_ack_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field target_component from flexifunction_buffer_function_ack message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_flexifunction_buffer_function_ack_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 5);
}
/**
* @brief Get field func_index from flexifunction_buffer_function_ack message
*
* @return Function index
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_ack_get_func_index(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field result from flexifunction_buffer_function_ack message
*
* @return result of acknowledge, 0=fail, 1=good
*/
static inline uint16_t mavlink_msg_flexifunction_buffer_function_ack_get_result(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Decode a flexifunction_buffer_function_ack message into a struct
*
* @param msg The message to decode
* @param flexifunction_buffer_function_ack C-struct to decode the message contents into
*/
static inline void mavlink_msg_flexifunction_buffer_function_ack_decode(const mavlink_message_t* msg, mavlink_flexifunction_buffer_function_ack_t* flexifunction_buffer_function_ack)
{
#if MAVLINK_NEED_BYTE_SWAP
flexifunction_buffer_function_ack->func_index = mavlink_msg_flexifunction_buffer_function_ack_get_func_index(msg);
flexifunction_buffer_function_ack->result = mavlink_msg_flexifunction_buffer_function_ack_get_result(msg);
flexifunction_buffer_function_ack->target_system = mavlink_msg_flexifunction_buffer_function_ack_get_target_system(msg);
flexifunction_buffer_function_ack->target_component = mavlink_msg_flexifunction_buffer_function_ack_get_target_component(msg);
#else
memcpy(flexifunction_buffer_function_ack, _MAV_PAYLOAD(msg), 6);
#endif
}
// MESSAGE FLEXIFUNCTION_COMMAND PACKING
#define MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND 157
typedef struct __mavlink_flexifunction_command_t
{
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
uint8_t command_type; ///< Flexifunction command type
} mavlink_flexifunction_command_t;
#define MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_LEN 3
#define MAVLINK_MSG_ID_157_LEN 3
#define MAVLINK_MESSAGE_INFO_FLEXIFUNCTION_COMMAND { \
"FLEXIFUNCTION_COMMAND", \
3, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_flexifunction_command_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_flexifunction_command_t, target_component) }, \
{ "command_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_flexifunction_command_t, command_type) }, \
} \
}
/**
* @brief Pack a flexifunction_command 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 command_type Flexifunction command type
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_command_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t command_type)
{
#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, command_type);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_flexifunction_command_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command_type = command_type;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND;
return mavlink_finalize_message(msg, system_id, component_id, 3, 133);
}
/**
* @brief Pack a flexifunction_command 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 command_type Flexifunction command type
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_command_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 command_type)
{
#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, command_type);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_flexifunction_command_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command_type = command_type;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 133);
}
/**
* @brief Encode a flexifunction_command 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 flexifunction_command C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_flexifunction_command_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flexifunction_command_t* flexifunction_command)
{
return mavlink_msg_flexifunction_command_pack(system_id, component_id, msg, flexifunction_command->target_system, flexifunction_command->target_component, flexifunction_command->command_type);
}
/**
* @brief Send a flexifunction_command message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param command_type Flexifunction command type
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_flexifunction_command_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t command_type)
{
#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, command_type);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND, buf, 3, 133);
#else
mavlink_flexifunction_command_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command_type = command_type;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND, (const char *)&packet, 3, 133);
#endif
}
#endif
// MESSAGE FLEXIFUNCTION_COMMAND UNPACKING
/**
* @brief Get field target_system from flexifunction_command message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_flexifunction_command_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from flexifunction_command message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_flexifunction_command_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field command_type from flexifunction_command message
*
* @return Flexifunction command type
*/
static inline uint8_t mavlink_msg_flexifunction_command_get_command_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Decode a flexifunction_command message into a struct
*
* @param msg The message to decode
* @param flexifunction_command C-struct to decode the message contents into
*/
static inline void mavlink_msg_flexifunction_command_decode(const mavlink_message_t* msg, mavlink_flexifunction_command_t* flexifunction_command)
{
#if MAVLINK_NEED_BYTE_SWAP
flexifunction_command->target_system = mavlink_msg_flexifunction_command_get_target_system(msg);
flexifunction_command->target_component = mavlink_msg_flexifunction_command_get_target_component(msg);
flexifunction_command->command_type = mavlink_msg_flexifunction_command_get_command_type(msg);
#else
memcpy(flexifunction_command, _MAV_PAYLOAD(msg), 3);
#endif
}
// MESSAGE FLEXIFUNCTION_COMMAND_ACK PACKING
#define MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK 158
typedef struct __mavlink_flexifunction_command_ack_t
{
uint16_t command_type; ///< Command acknowledged
uint16_t result; ///< result of acknowledge
} mavlink_flexifunction_command_ack_t;
#define MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK_LEN 4
#define MAVLINK_MSG_ID_158_LEN 4
#define MAVLINK_MESSAGE_INFO_FLEXIFUNCTION_COMMAND_ACK { \
"FLEXIFUNCTION_COMMAND_ACK", \
2, \
{ { "command_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_flexifunction_command_ack_t, command_type) }, \
{ "result", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_flexifunction_command_ack_t, result) }, \
} \
}
/**
* @brief Pack a flexifunction_command_ack 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 command_type Command acknowledged
* @param result result of acknowledge
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t command_type, uint16_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, command_type);
_mav_put_uint16_t(buf, 2, result);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_flexifunction_command_ack_t packet;
packet.command_type = command_type;
packet.result = result;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK;
return mavlink_finalize_message(msg, system_id, component_id, 4, 208);
}
/**
* @brief Pack a flexifunction_command_ack 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 command_type Command acknowledged
* @param result result of acknowledge
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t command_type,uint16_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, command_type);
_mav_put_uint16_t(buf, 2, result);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_flexifunction_command_ack_t packet;
packet.command_type = command_type;
packet.result = result;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 208);
}
/**
* @brief Encode a flexifunction_command_ack 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 flexifunction_command_ack C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_flexifunction_command_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flexifunction_command_ack_t* flexifunction_command_ack)
{
return mavlink_msg_flexifunction_command_ack_pack(system_id, component_id, msg, flexifunction_command_ack->command_type, flexifunction_command_ack->result);
}
/**
* @brief Send a flexifunction_command_ack message
* @param chan MAVLink channel to send the message
*
* @param command_type Command acknowledged
* @param result result of acknowledge
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_flexifunction_command_ack_send(mavlink_channel_t chan, uint16_t command_type, uint16_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, command_type);
_mav_put_uint16_t(buf, 2, result);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK, buf, 4, 208);
#else
mavlink_flexifunction_command_ack_t packet;
packet.command_type = command_type;
packet.result = result;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK, (const char *)&packet, 4, 208);
#endif
}
#endif
// MESSAGE FLEXIFUNCTION_COMMAND_ACK UNPACKING
/**
* @brief Get field command_type from flexifunction_command_ack message
*
* @return Command acknowledged
*/
static inline uint16_t mavlink_msg_flexifunction_command_ack_get_command_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field result from flexifunction_command_ack message
*
* @return result of acknowledge
*/
static inline uint16_t mavlink_msg_flexifunction_command_ack_get_result(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Decode a flexifunction_command_ack message into a struct
*
* @param msg The message to decode
* @param flexifunction_command_ack C-struct to decode the message contents into
*/
static inline void mavlink_msg_flexifunction_command_ack_decode(const mavlink_message_t* msg, mavlink_flexifunction_command_ack_t* flexifunction_command_ack)
{
#if MAVLINK_NEED_BYTE_SWAP
flexifunction_command_ack->command_type = mavlink_msg_flexifunction_command_ack_get_command_type(msg);
flexifunction_command_ack->result = mavlink_msg_flexifunction_command_ack_get_result(msg);
#else
memcpy(flexifunction_command_ack, _MAV_PAYLOAD(msg), 4);
#endif
}
// MESSAGE FLEXIFUNCTION_DIRECTORY PACKING
#define MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY 155
typedef struct __mavlink_flexifunction_directory_t
{
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
uint8_t directory_type; ///< 0=inputs, 1=outputs
uint8_t start_index; ///< index of first directory entry to write
uint8_t count; ///< count of directory entries to write
int8_t directory_data[48]; ///< Settings data
} mavlink_flexifunction_directory_t;
#define MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN 53
#define MAVLINK_MSG_ID_155_LEN 53
#define MAVLINK_MSG_FLEXIFUNCTION_DIRECTORY_FIELD_DIRECTORY_DATA_LEN 48
#define MAVLINK_MESSAGE_INFO_FLEXIFUNCTION_DIRECTORY { \
"FLEXIFUNCTION_DIRECTORY", \
6, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_flexifunction_directory_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_flexifunction_directory_t, target_component) }, \
{ "directory_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_flexifunction_directory_t, directory_type) }, \
{ "start_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_flexifunction_directory_t, start_index) }, \
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_flexifunction_directory_t, count) }, \
{ "directory_data", NULL, MAVLINK_TYPE_INT8_T, 48, 5, offsetof(mavlink_flexifunction_directory_t, directory_data) }, \
} \
}
/**
* @brief Pack a flexifunction_directory 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 directory_type 0=inputs, 1=outputs
* @param start_index index of first directory entry to write
* @param count count of directory entries to write
* @param directory_data Settings data
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_directory_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t directory_type, uint8_t start_index, uint8_t count, const int8_t *directory_data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[53];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, directory_type);
_mav_put_uint8_t(buf, 3, start_index);
_mav_put_uint8_t(buf, 4, count);
_mav_put_int8_t_array(buf, 5, directory_data, 48);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 53);
#else
mavlink_flexifunction_directory_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.directory_type = directory_type;
packet.start_index = start_index;
packet.count = count;
mav_array_memcpy(packet.directory_data, directory_data, sizeof(int8_t)*48);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 53);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY;
return mavlink_finalize_message(msg, system_id, component_id, 53, 12);
}
/**
* @brief Pack a flexifunction_directory 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 directory_type 0=inputs, 1=outputs
* @param start_index index of first directory entry to write
* @param count count of directory entries to write
* @param directory_data Settings data
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_flexifunction_directory_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 directory_type,uint8_t start_index,uint8_t count,const int8_t *directory_data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[53];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, directory_type);
_mav_put_uint8_t(buf, 3, start_index);
_mav_put_uint8_t(buf, 4, count);
_mav_put_int8_t_array(buf, 5, directory_data, 48);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 53);
#else
mavlink_flexifunction_directory_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.directory_type = directory_type;
packet.start_index = start_index;
packet.count = count;
mav_array_memcpy(packet.directory_data, directory_data, sizeof(int8_t)*48);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 53);
#endif
msg->msgid = MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 53, 12);
}
/**
* @brief Encode a flexifunction_directory 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 flexifunction_directory C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_flexifunction_directory_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flexifunction_directory_t* flexifunction_directory)
{
return mavlink_msg_flexifunction_directory_pack(system_id, component_id, msg, flexifunction_directory->target_system, flexifunction_directory->target_component, flexifunction_directory->directory_type, flexifunction_directory->start_index, flexifunction_directory->count, flexifunction_directory->directory_data);
}
/**
* @brief Send a flexifunction_directory message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param directory_type 0=inputs, 1=outputs
* @param start_index index of first directory entry to write
* @param count count of directory entries to write
* @param directory_data Settings data
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_flexifunction_directory_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t directory_type, uint8_t start_index, uint8_t count, const int8_t *directory_data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[53];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, directory_type);
_mav_put_uint8_t(buf, 3, start_index);
_mav_put_uint8_t(buf, 4, count);
_mav_put_int8_t_array(buf, 5, directory_data, 48);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY, buf, 53, 12);
#else
mavlink_flexifunction_directory_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.directory_type = directory_type;
packet.start_index = start_index;
packet.count = count;
mav_array_memcpy(packet.directory_data, directory_data, sizeof(int8_t)*48);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY, (const char *)&packet, 53, 12);
#endif
}
#endif
// MESSAGE FLEXIFUNCTION_DIRECTORY UNPACKING
/**
* @brief Get field target_system from flexifunction_directory message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_flexifunction_directory_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Get field target_component from flexifunction_directory message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_flexifunction_directory_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
* @brief Get field directory_type from flexifunction_directory message
*
* @return 0=inputs, 1=outputs
*/
static inline uint8_t mavlink_msg_flexifunction_directory_get_directory_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
* @brief Get field start_index from flexifunction_directory message
*
* @return index of first directory entry to write
*/
static inline uint8_t mavlink_msg_flexifunction_directory_get_start_index(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field count from flexifunction_directory message
*
* @return count of directory entries to write
*/
static inline uint8_t mavlink_msg_flexifunction_directory_get_count(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field directory_data from flexifunction_directory message
*
* @return Settings data
*/
static inline uint16_t mavlink_msg_flexifunction_directory_get_directory_data(const mavlink_message_t* msg, int8_t *directory_data)
{
return _MAV_RETURN_int8_t_array(msg, directory_data, 48, 5);
}
/**
* @brief Decode a flexifunction_directory message into a struct
*
* @param msg The message to decode
* @param flexifunction_directory C-struct to decode the message contents into
*/
static inline void mavlink_msg_flexifunction_directory_decode(const mavlink_message_t* msg, mavlink_flexifunction_directory_t* flexifunction_directory)
{
#if MAVLINK_NEED_BYTE_SWAP
flexifunction_directory->target_system = mavlink_msg_flexifunction_directory_get_target_system(msg);
flexifunction_directory->target_component = mavlink_msg_flexifunction_directory_get_target_component(msg);
flexifunction_directory->directory_type = mavlink_msg_flexifunction_directory_get_directory_type(msg);
flexifunction_directory->start_index = mavlink_msg_flexifunction_directory_get_start_index(msg);
flexifunction_directory->count = mavlink_msg_flexifunction_directory_get_count(msg);
mavlink_msg_flexifunction_directory_get_directory_data(msg, flexifunction_directory->directory_data);
#else
memcpy(flexifunction_directory, _MAV_PAYLOAD(msg), 53);
#endif
}
Supports Markdown
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