[mavlink] Updated mavlink code to work with the current Arducopter (and probably plane and rover). Mavlink library has been updated to V 1.0.

This commit is contained in:
pienk@planet.nl
2013-05-20 12:02:17 +00:00
parent c107643d69
commit e41ae1fadc
150 changed files with 11617 additions and 2659 deletions
File diff suppressed because one or more lines are too long
@@ -5,9 +5,9 @@
typedef struct __mavlink_attitude_t
{
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
float roll; ///< Roll angle (rad)
float pitch; ///< Pitch angle (rad)
float yaw; ///< Yaw angle (rad)
float roll; ///< Roll angle (rad, -pi..+pi)
float pitch; ///< Pitch angle (rad, -pi..+pi)
float yaw; ///< Yaw angle (rad, -pi..+pi)
float rollspeed; ///< Roll angular speed (rad/s)
float pitchspeed; ///< Pitch angular speed (rad/s)
float yawspeed; ///< Yaw angular speed (rad/s)
@@ -39,9 +39,9 @@ typedef struct __mavlink_attitude_t
* @param msg The MAVLink message to compress the data into
*
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param roll Roll angle (rad)
* @param pitch Pitch angle (rad)
* @param yaw Yaw angle (rad)
* @param roll Roll angle (rad, -pi..+pi)
* @param pitch Pitch angle (rad, -pi..+pi)
* @param yaw Yaw angle (rad, -pi..+pi)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp
_mav_put_float(buf, 20, pitchspeed);
_mav_put_float(buf, 24, yawspeed);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_attitude_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp
packet.pitchspeed = pitchspeed;
packet.yawspeed = yawspeed;
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
@@ -85,9 +85,9 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp
* @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 roll Roll angle (rad)
* @param pitch Pitch angle (rad)
* @param yaw Yaw angle (rad)
* @param roll Roll angle (rad, -pi..+pi)
* @param pitch Pitch angle (rad, -pi..+pi)
* @param yaw Yaw angle (rad, -pi..+pi)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t
_mav_put_float(buf, 20, pitchspeed);
_mav_put_float(buf, 24, yawspeed);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_attitude_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t
packet.pitchspeed = pitchspeed;
packet.yawspeed = yawspeed;
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
@@ -143,9 +143,9 @@ static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t co
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param roll Roll angle (rad)
* @param pitch Pitch angle (rad)
* @param yaw Yaw angle (rad)
* @param roll Roll angle (rad, -pi..+pi)
* @param pitch Pitch angle (rad, -pi..+pi)
* @param yaw Yaw angle (rad, -pi..+pi)
* @param rollspeed Roll angular speed (rad/s)
* @param pitchspeed Pitch angular speed (rad/s)
* @param yawspeed Yaw angular speed (rad/s)
@@ -197,7 +197,7 @@ static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_messa
/**
* @brief Get field roll from attitude message
*
* @return Roll angle (rad)
* @return Roll angle (rad, -pi..+pi)
*/
static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
{
@@ -207,7 +207,7 @@ static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
/**
* @brief Get field pitch from attitude message
*
* @return Pitch angle (rad)
* @return Pitch angle (rad, -pi..+pi)
*/
static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
{
@@ -217,7 +217,7 @@ static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
/**
* @brief Get field yaw from attitude message
*
* @return Yaw angle (rad)
* @return Yaw angle (rad, -pi..+pi)
*/
static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
{
@@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u
_mav_put_float(buf, 24, pitchspeed);
_mav_put_float(buf, 28, yawspeed);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_attitude_quaternion_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u
packet.pitchspeed = pitchspeed;
packet.yawspeed = yawspeed;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
@@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_
_mav_put_float(buf, 24, pitchspeed);
_mav_put_float(buf, 28, yawspeed);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_attitude_quaternion_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_
packet.pitchspeed = pitchspeed;
packet.yawspeed = yawspeed;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
@@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t comp
char buf[32];
_mav_put_char_array(buf, 0, key, 32);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_auth_key_t packet;
mav_array_memcpy(packet.key, key, sizeof(char)*32);
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
@@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t
char buf[32];
_mav_put_char_array(buf, 0, key, 32);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_auth_key_t packet;
mav_array_memcpy(packet.key, key, sizeof(char)*32);
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
@@ -0,0 +1,320 @@
// MESSAGE BATTERY_STATUS PACKING
#define MAVLINK_MSG_ID_BATTERY_STATUS 147
typedef struct __mavlink_battery_status_t
{
uint16_t voltage_cell_1; ///< Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
uint16_t voltage_cell_2; ///< Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
uint16_t voltage_cell_3; ///< Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
uint16_t voltage_cell_4; ///< Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
uint16_t voltage_cell_5; ///< Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
uint16_t voltage_cell_6; ///< Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
int16_t current_battery; ///< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
uint8_t accu_id; ///< Accupack ID
int8_t battery_remaining; ///< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
} mavlink_battery_status_t;
#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 16
#define MAVLINK_MSG_ID_147_LEN 16
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
"BATTERY_STATUS", \
9, \
{ { "voltage_cell_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_battery_status_t, voltage_cell_1) }, \
{ "voltage_cell_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_battery_status_t, voltage_cell_2) }, \
{ "voltage_cell_3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_battery_status_t, voltage_cell_3) }, \
{ "voltage_cell_4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_battery_status_t, voltage_cell_4) }, \
{ "voltage_cell_5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_battery_status_t, voltage_cell_5) }, \
{ "voltage_cell_6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_battery_status_t, voltage_cell_6) }, \
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_battery_status_t, current_battery) }, \
{ "accu_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_battery_status_t, accu_id) }, \
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 15, offsetof(mavlink_battery_status_t, battery_remaining) }, \
} \
}
/**
* @brief Pack a battery_status message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param accu_id Accupack ID
* @param voltage_cell_1 Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
* @param voltage_cell_2 Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_3 Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_4 Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int8_t battery_remaining)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_uint16_t(buf, 0, voltage_cell_1);
_mav_put_uint16_t(buf, 2, voltage_cell_2);
_mav_put_uint16_t(buf, 4, voltage_cell_3);
_mav_put_uint16_t(buf, 6, voltage_cell_4);
_mav_put_uint16_t(buf, 8, voltage_cell_5);
_mav_put_uint16_t(buf, 10, voltage_cell_6);
_mav_put_int16_t(buf, 12, current_battery);
_mav_put_uint8_t(buf, 14, accu_id);
_mav_put_int8_t(buf, 15, battery_remaining);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
#else
mavlink_battery_status_t packet;
packet.voltage_cell_1 = voltage_cell_1;
packet.voltage_cell_2 = voltage_cell_2;
packet.voltage_cell_3 = voltage_cell_3;
packet.voltage_cell_4 = voltage_cell_4;
packet.voltage_cell_5 = voltage_cell_5;
packet.voltage_cell_6 = voltage_cell_6;
packet.current_battery = current_battery;
packet.accu_id = accu_id;
packet.battery_remaining = battery_remaining;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
#endif
msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
return mavlink_finalize_message(msg, system_id, component_id, 16, 42);
}
/**
* @brief Pack a battery_status message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param accu_id Accupack ID
* @param voltage_cell_1 Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
* @param voltage_cell_2 Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_3 Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_4 Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t accu_id,uint16_t voltage_cell_1,uint16_t voltage_cell_2,uint16_t voltage_cell_3,uint16_t voltage_cell_4,uint16_t voltage_cell_5,uint16_t voltage_cell_6,int16_t current_battery,int8_t battery_remaining)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_uint16_t(buf, 0, voltage_cell_1);
_mav_put_uint16_t(buf, 2, voltage_cell_2);
_mav_put_uint16_t(buf, 4, voltage_cell_3);
_mav_put_uint16_t(buf, 6, voltage_cell_4);
_mav_put_uint16_t(buf, 8, voltage_cell_5);
_mav_put_uint16_t(buf, 10, voltage_cell_6);
_mav_put_int16_t(buf, 12, current_battery);
_mav_put_uint8_t(buf, 14, accu_id);
_mav_put_int8_t(buf, 15, battery_remaining);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
#else
mavlink_battery_status_t packet;
packet.voltage_cell_1 = voltage_cell_1;
packet.voltage_cell_2 = voltage_cell_2;
packet.voltage_cell_3 = voltage_cell_3;
packet.voltage_cell_4 = voltage_cell_4;
packet.voltage_cell_5 = voltage_cell_5;
packet.voltage_cell_6 = voltage_cell_6;
packet.current_battery = current_battery;
packet.accu_id = accu_id;
packet.battery_remaining = battery_remaining;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
#endif
msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16, 42);
}
/**
* @brief Encode a battery_status struct into a message
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param battery_status C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
{
return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->accu_id, battery_status->voltage_cell_1, battery_status->voltage_cell_2, battery_status->voltage_cell_3, battery_status->voltage_cell_4, battery_status->voltage_cell_5, battery_status->voltage_cell_6, battery_status->current_battery, battery_status->battery_remaining);
}
/**
* @brief Send a battery_status message
* @param chan MAVLink channel to send the message
*
* @param accu_id Accupack ID
* @param voltage_cell_1 Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
* @param voltage_cell_2 Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_3 Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_4 Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int8_t battery_remaining)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[16];
_mav_put_uint16_t(buf, 0, voltage_cell_1);
_mav_put_uint16_t(buf, 2, voltage_cell_2);
_mav_put_uint16_t(buf, 4, voltage_cell_3);
_mav_put_uint16_t(buf, 6, voltage_cell_4);
_mav_put_uint16_t(buf, 8, voltage_cell_5);
_mav_put_uint16_t(buf, 10, voltage_cell_6);
_mav_put_int16_t(buf, 12, current_battery);
_mav_put_uint8_t(buf, 14, accu_id);
_mav_put_int8_t(buf, 15, battery_remaining);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, 16, 42);
#else
mavlink_battery_status_t packet;
packet.voltage_cell_1 = voltage_cell_1;
packet.voltage_cell_2 = voltage_cell_2;
packet.voltage_cell_3 = voltage_cell_3;
packet.voltage_cell_4 = voltage_cell_4;
packet.voltage_cell_5 = voltage_cell_5;
packet.voltage_cell_6 = voltage_cell_6;
packet.current_battery = current_battery;
packet.accu_id = accu_id;
packet.battery_remaining = battery_remaining;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, 16, 42);
#endif
}
#endif
// MESSAGE BATTERY_STATUS UNPACKING
/**
* @brief Get field accu_id from battery_status message
*
* @return Accupack ID
*/
static inline uint8_t mavlink_msg_battery_status_get_accu_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 14);
}
/**
* @brief Get field voltage_cell_1 from battery_status message
*
* @return Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
*/
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_1(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field voltage_cell_2 from battery_status message
*
* @return Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
*/
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_2(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Get field voltage_cell_3 from battery_status message
*
* @return Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
*/
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_3(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field voltage_cell_4 from battery_status message
*
* @return Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
*/
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_4(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field voltage_cell_5 from battery_status message
*
* @return Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
*/
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_5(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Get field voltage_cell_6 from battery_status message
*
* @return Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
*/
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_6(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 10);
}
/**
* @brief Get field current_battery from battery_status message
*
* @return Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
*/
static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 12);
}
/**
* @brief Get field battery_remaining from battery_status message
*
* @return Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
*/
static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavlink_message_t* msg)
{
return _MAV_RETURN_int8_t(msg, 15);
}
/**
* @brief Decode a battery_status message into a struct
*
* @param msg The message to decode
* @param battery_status C-struct to decode the message contents into
*/
static inline void mavlink_msg_battery_status_decode(const mavlink_message_t* msg, mavlink_battery_status_t* battery_status)
{
#if MAVLINK_NEED_BYTE_SWAP
battery_status->voltage_cell_1 = mavlink_msg_battery_status_get_voltage_cell_1(msg);
battery_status->voltage_cell_2 = mavlink_msg_battery_status_get_voltage_cell_2(msg);
battery_status->voltage_cell_3 = mavlink_msg_battery_status_get_voltage_cell_3(msg);
battery_status->voltage_cell_4 = mavlink_msg_battery_status_get_voltage_cell_4(msg);
battery_status->voltage_cell_5 = mavlink_msg_battery_status_get_voltage_cell_5(msg);
battery_status->voltage_cell_6 = mavlink_msg_battery_status_get_voltage_cell_6(msg);
battery_status->current_battery = mavlink_msg_battery_status_get_current_battery(msg);
battery_status->accu_id = mavlink_msg_battery_status_get_accu_id(msg);
battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg);
#else
memcpy(battery_status, _MAV_PAYLOAD(msg), 16);
#endif
}
@@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_i
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, version);
_mav_put_char_array(buf, 3, passkey, 25);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_change_operator_control_t packet;
packet.target_system = target_system;
packet.control_request = control_request;
packet.version = version;
mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
@@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t sys
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, version);
_mav_put_char_array(buf, 3, passkey, 25);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_change_operator_control_t packet;
packet.target_system = target_system;
packet.control_request = control_request;
packet.version = version;
mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t syst
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, ack);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_change_operator_control_ack_t packet;
packet.gcs_system_id = gcs_system_id;
packet.control_request = control_request;
packet.ack = ack;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, ack);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_change_operator_control_ack_t packet;
packet.gcs_system_id = gcs_system_id;
packet.control_request = control_request;
packet.ack = ack;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t c
_mav_put_uint16_t(buf, 0, command);
_mav_put_uint8_t(buf, 2, result);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_command_ack_t packet;
packet.command = command;
packet.result = result;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint
_mav_put_uint16_t(buf, 0, command);
_mav_put_uint8_t(buf, 2, result);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_command_ack_t packet;
packet.command = command;
packet.result = result;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t
_mav_put_uint8_t(buf, 31, target_component);
_mav_put_uint8_t(buf, 32, confirmation);
memcpy(_MAV_PAYLOAD(msg), buf, 33);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
#else
mavlink_command_long_t packet;
packet.param1 = param1;
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t
packet.target_component = target_component;
packet.confirmation = confirmation;
memcpy(_MAV_PAYLOAD(msg), &packet, 33);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin
_mav_put_uint8_t(buf, 31, target_component);
_mav_put_uint8_t(buf, 32, confirmation);
memcpy(_MAV_PAYLOAD(msg), buf, 33);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
#else
mavlink_command_long_t packet;
packet.param1 = param1;
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin
packet.target_component = target_component;
packet.confirmation = confirmation;
memcpy(_MAV_PAYLOAD(msg), &packet, 33);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t c
_mav_put_uint8_t(buf, 2, stream_id);
_mav_put_uint8_t(buf, 3, on_off);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_data_stream_t packet;
packet.message_rate = message_rate;
packet.stream_id = stream_id;
packet.on_off = on_off;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint
_mav_put_uint8_t(buf, 2, stream_id);
_mav_put_uint8_t(buf, 3, on_off);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_data_stream_t packet;
packet.message_rate = message_rate;
packet.stream_id = stream_id;
packet.on_off = on_off;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t compone
_mav_put_float(buf, 4, value);
_mav_put_uint8_t(buf, 8, ind);
memcpy(_MAV_PAYLOAD(msg), buf, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_debug_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
packet.ind = ind;
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_DEBUG;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t co
_mav_put_float(buf, 4, value);
_mav_put_uint8_t(buf, 8, ind);
memcpy(_MAV_PAYLOAD(msg), buf, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_debug_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
packet.ind = ind;
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_DEBUG;
@@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_char_array(buf, 20, name, 10);
memcpy(_MAV_PAYLOAD(msg), buf, 30);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30);
#else
mavlink_debug_vect_t packet;
packet.time_usec = time_usec;
@@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co
packet.y = y;
packet.z = z;
mav_array_memcpy(packet.name, name, sizeof(char)*10);
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30);
#endif
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
@@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_char_array(buf, 20, name, 10);
memcpy(_MAV_PAYLOAD(msg), buf, 30);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30);
#else
mavlink_debug_vect_t packet;
packet.time_usec = time_usec;
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8
packet.y = y;
packet.z = z;
mav_array_memcpy(packet.name, name, sizeof(char)*10);
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30);
#endif
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
@@ -0,0 +1,182 @@
// MESSAGE FILE_TRANSFER_DIR_LIST PACKING
#define MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST 111
typedef struct __mavlink_file_transfer_dir_list_t
{
uint64_t transfer_uid; ///< Unique transfer ID
char dir_path[240]; ///< Directory path to list
uint8_t flags; ///< RESERVED
} mavlink_file_transfer_dir_list_t;
#define MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN 249
#define MAVLINK_MSG_ID_111_LEN 249
#define MAVLINK_MSG_FILE_TRANSFER_DIR_LIST_FIELD_DIR_PATH_LEN 240
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_DIR_LIST { \
"FILE_TRANSFER_DIR_LIST", \
3, \
{ { "transfer_uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_file_transfer_dir_list_t, transfer_uid) }, \
{ "dir_path", NULL, MAVLINK_TYPE_CHAR, 240, 8, offsetof(mavlink_file_transfer_dir_list_t, dir_path) }, \
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 248, offsetof(mavlink_file_transfer_dir_list_t, flags) }, \
} \
}
/**
* @brief Pack a file_transfer_dir_list 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 transfer_uid Unique transfer ID
* @param dir_path Directory path to list
* @param flags RESERVED
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_file_transfer_dir_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t transfer_uid, const char *dir_path, uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[249];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint8_t(buf, 248, flags);
_mav_put_char_array(buf, 8, dir_path, 240);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 249);
#else
mavlink_file_transfer_dir_list_t packet;
packet.transfer_uid = transfer_uid;
packet.flags = flags;
mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 249);
#endif
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST;
return mavlink_finalize_message(msg, system_id, component_id, 249, 93);
}
/**
* @brief Pack a file_transfer_dir_list 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 transfer_uid Unique transfer ID
* @param dir_path Directory path to list
* @param flags RESERVED
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_file_transfer_dir_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t transfer_uid,const char *dir_path,uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[249];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint8_t(buf, 248, flags);
_mav_put_char_array(buf, 8, dir_path, 240);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 249);
#else
mavlink_file_transfer_dir_list_t packet;
packet.transfer_uid = transfer_uid;
packet.flags = flags;
mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 249);
#endif
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 249, 93);
}
/**
* @brief Encode a file_transfer_dir_list 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 file_transfer_dir_list C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_file_transfer_dir_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_dir_list_t* file_transfer_dir_list)
{
return mavlink_msg_file_transfer_dir_list_pack(system_id, component_id, msg, file_transfer_dir_list->transfer_uid, file_transfer_dir_list->dir_path, file_transfer_dir_list->flags);
}
/**
* @brief Send a file_transfer_dir_list message
* @param chan MAVLink channel to send the message
*
* @param transfer_uid Unique transfer ID
* @param dir_path Directory path to list
* @param flags RESERVED
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_file_transfer_dir_list_send(mavlink_channel_t chan, uint64_t transfer_uid, const char *dir_path, uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[249];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint8_t(buf, 248, flags);
_mav_put_char_array(buf, 8, dir_path, 240);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, buf, 249, 93);
#else
mavlink_file_transfer_dir_list_t packet;
packet.transfer_uid = transfer_uid;
packet.flags = flags;
mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, (const char *)&packet, 249, 93);
#endif
}
#endif
// MESSAGE FILE_TRANSFER_DIR_LIST UNPACKING
/**
* @brief Get field transfer_uid from file_transfer_dir_list message
*
* @return Unique transfer ID
*/
static inline uint64_t mavlink_msg_file_transfer_dir_list_get_transfer_uid(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field dir_path from file_transfer_dir_list message
*
* @return Directory path to list
*/
static inline uint16_t mavlink_msg_file_transfer_dir_list_get_dir_path(const mavlink_message_t* msg, char *dir_path)
{
return _MAV_RETURN_char_array(msg, dir_path, 240, 8);
}
/**
* @brief Get field flags from file_transfer_dir_list message
*
* @return RESERVED
*/
static inline uint8_t mavlink_msg_file_transfer_dir_list_get_flags(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 248);
}
/**
* @brief Decode a file_transfer_dir_list message into a struct
*
* @param msg The message to decode
* @param file_transfer_dir_list C-struct to decode the message contents into
*/
static inline void mavlink_msg_file_transfer_dir_list_decode(const mavlink_message_t* msg, mavlink_file_transfer_dir_list_t* file_transfer_dir_list)
{
#if MAVLINK_NEED_BYTE_SWAP
file_transfer_dir_list->transfer_uid = mavlink_msg_file_transfer_dir_list_get_transfer_uid(msg);
mavlink_msg_file_transfer_dir_list_get_dir_path(msg, file_transfer_dir_list->dir_path);
file_transfer_dir_list->flags = mavlink_msg_file_transfer_dir_list_get_flags(msg);
#else
memcpy(file_transfer_dir_list, _MAV_PAYLOAD(msg), 249);
#endif
}
@@ -0,0 +1,166 @@
// MESSAGE FILE_TRANSFER_RES PACKING
#define MAVLINK_MSG_ID_FILE_TRANSFER_RES 112
typedef struct __mavlink_file_transfer_res_t
{
uint64_t transfer_uid; ///< Unique transfer ID
uint8_t result; ///< 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
} mavlink_file_transfer_res_t;
#define MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN 9
#define MAVLINK_MSG_ID_112_LEN 9
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_RES { \
"FILE_TRANSFER_RES", \
2, \
{ { "transfer_uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_file_transfer_res_t, transfer_uid) }, \
{ "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_file_transfer_res_t, result) }, \
} \
}
/**
* @brief Pack a file_transfer_res 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 transfer_uid Unique transfer ID
* @param result 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_file_transfer_res_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t transfer_uid, uint8_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint8_t(buf, 8, result);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_file_transfer_res_t packet;
packet.transfer_uid = transfer_uid;
packet.result = result;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_RES;
return mavlink_finalize_message(msg, system_id, component_id, 9, 124);
}
/**
* @brief Pack a file_transfer_res 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 transfer_uid Unique transfer ID
* @param result 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_file_transfer_res_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t transfer_uid,uint8_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint8_t(buf, 8, result);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_file_transfer_res_t packet;
packet.transfer_uid = transfer_uid;
packet.result = result;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_RES;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 124);
}
/**
* @brief Encode a file_transfer_res 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 file_transfer_res C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_file_transfer_res_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_res_t* file_transfer_res)
{
return mavlink_msg_file_transfer_res_pack(system_id, component_id, msg, file_transfer_res->transfer_uid, file_transfer_res->result);
}
/**
* @brief Send a file_transfer_res message
* @param chan MAVLink channel to send the message
*
* @param transfer_uid Unique transfer ID
* @param result 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_file_transfer_res_send(mavlink_channel_t chan, uint64_t transfer_uid, uint8_t result)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint8_t(buf, 8, result);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, buf, 9, 124);
#else
mavlink_file_transfer_res_t packet;
packet.transfer_uid = transfer_uid;
packet.result = result;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, (const char *)&packet, 9, 124);
#endif
}
#endif
// MESSAGE FILE_TRANSFER_RES UNPACKING
/**
* @brief Get field transfer_uid from file_transfer_res message
*
* @return Unique transfer ID
*/
static inline uint64_t mavlink_msg_file_transfer_res_get_transfer_uid(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field result from file_transfer_res message
*
* @return 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
*/
static inline uint8_t mavlink_msg_file_transfer_res_get_result(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
* @brief Decode a file_transfer_res message into a struct
*
* @param msg The message to decode
* @param file_transfer_res C-struct to decode the message contents into
*/
static inline void mavlink_msg_file_transfer_res_decode(const mavlink_message_t* msg, mavlink_file_transfer_res_t* file_transfer_res)
{
#if MAVLINK_NEED_BYTE_SWAP
file_transfer_res->transfer_uid = mavlink_msg_file_transfer_res_get_transfer_uid(msg);
file_transfer_res->result = mavlink_msg_file_transfer_res_get_result(msg);
#else
memcpy(file_transfer_res, _MAV_PAYLOAD(msg), 9);
#endif
}
@@ -0,0 +1,226 @@
// MESSAGE FILE_TRANSFER_START PACKING
#define MAVLINK_MSG_ID_FILE_TRANSFER_START 110
typedef struct __mavlink_file_transfer_start_t
{
uint64_t transfer_uid; ///< Unique transfer ID
uint32_t file_size; ///< File size in bytes
char dest_path[240]; ///< Destination path
uint8_t direction; ///< Transfer direction: 0: from requester, 1: to requester
uint8_t flags; ///< RESERVED
} mavlink_file_transfer_start_t;
#define MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN 254
#define MAVLINK_MSG_ID_110_LEN 254
#define MAVLINK_MSG_FILE_TRANSFER_START_FIELD_DEST_PATH_LEN 240
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_START { \
"FILE_TRANSFER_START", \
5, \
{ { "transfer_uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_file_transfer_start_t, transfer_uid) }, \
{ "file_size", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_file_transfer_start_t, file_size) }, \
{ "dest_path", NULL, MAVLINK_TYPE_CHAR, 240, 12, offsetof(mavlink_file_transfer_start_t, dest_path) }, \
{ "direction", NULL, MAVLINK_TYPE_UINT8_T, 0, 252, offsetof(mavlink_file_transfer_start_t, direction) }, \
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 253, offsetof(mavlink_file_transfer_start_t, flags) }, \
} \
}
/**
* @brief Pack a file_transfer_start 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 transfer_uid Unique transfer ID
* @param dest_path Destination path
* @param direction Transfer direction: 0: from requester, 1: to requester
* @param file_size File size in bytes
* @param flags RESERVED
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_file_transfer_start_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t transfer_uid, const char *dest_path, uint8_t direction, uint32_t file_size, uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[254];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint32_t(buf, 8, file_size);
_mav_put_uint8_t(buf, 252, direction);
_mav_put_uint8_t(buf, 253, flags);
_mav_put_char_array(buf, 12, dest_path, 240);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 254);
#else
mavlink_file_transfer_start_t packet;
packet.transfer_uid = transfer_uid;
packet.file_size = file_size;
packet.direction = direction;
packet.flags = flags;
mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 254);
#endif
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_START;
return mavlink_finalize_message(msg, system_id, component_id, 254, 235);
}
/**
* @brief Pack a file_transfer_start 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 transfer_uid Unique transfer ID
* @param dest_path Destination path
* @param direction Transfer direction: 0: from requester, 1: to requester
* @param file_size File size in bytes
* @param flags RESERVED
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_file_transfer_start_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t transfer_uid,const char *dest_path,uint8_t direction,uint32_t file_size,uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[254];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint32_t(buf, 8, file_size);
_mav_put_uint8_t(buf, 252, direction);
_mav_put_uint8_t(buf, 253, flags);
_mav_put_char_array(buf, 12, dest_path, 240);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 254);
#else
mavlink_file_transfer_start_t packet;
packet.transfer_uid = transfer_uid;
packet.file_size = file_size;
packet.direction = direction;
packet.flags = flags;
mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 254);
#endif
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_START;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 254, 235);
}
/**
* @brief Encode a file_transfer_start 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 file_transfer_start C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_file_transfer_start_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_start_t* file_transfer_start)
{
return mavlink_msg_file_transfer_start_pack(system_id, component_id, msg, file_transfer_start->transfer_uid, file_transfer_start->dest_path, file_transfer_start->direction, file_transfer_start->file_size, file_transfer_start->flags);
}
/**
* @brief Send a file_transfer_start message
* @param chan MAVLink channel to send the message
*
* @param transfer_uid Unique transfer ID
* @param dest_path Destination path
* @param direction Transfer direction: 0: from requester, 1: to requester
* @param file_size File size in bytes
* @param flags RESERVED
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_file_transfer_start_send(mavlink_channel_t chan, uint64_t transfer_uid, const char *dest_path, uint8_t direction, uint32_t file_size, uint8_t flags)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[254];
_mav_put_uint64_t(buf, 0, transfer_uid);
_mav_put_uint32_t(buf, 8, file_size);
_mav_put_uint8_t(buf, 252, direction);
_mav_put_uint8_t(buf, 253, flags);
_mav_put_char_array(buf, 12, dest_path, 240);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, buf, 254, 235);
#else
mavlink_file_transfer_start_t packet;
packet.transfer_uid = transfer_uid;
packet.file_size = file_size;
packet.direction = direction;
packet.flags = flags;
mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, (const char *)&packet, 254, 235);
#endif
}
#endif
// MESSAGE FILE_TRANSFER_START UNPACKING
/**
* @brief Get field transfer_uid from file_transfer_start message
*
* @return Unique transfer ID
*/
static inline uint64_t mavlink_msg_file_transfer_start_get_transfer_uid(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field dest_path from file_transfer_start message
*
* @return Destination path
*/
static inline uint16_t mavlink_msg_file_transfer_start_get_dest_path(const mavlink_message_t* msg, char *dest_path)
{
return _MAV_RETURN_char_array(msg, dest_path, 240, 12);
}
/**
* @brief Get field direction from file_transfer_start message
*
* @return Transfer direction: 0: from requester, 1: to requester
*/
static inline uint8_t mavlink_msg_file_transfer_start_get_direction(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 252);
}
/**
* @brief Get field file_size from file_transfer_start message
*
* @return File size in bytes
*/
static inline uint32_t mavlink_msg_file_transfer_start_get_file_size(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 8);
}
/**
* @brief Get field flags from file_transfer_start message
*
* @return RESERVED
*/
static inline uint8_t mavlink_msg_file_transfer_start_get_flags(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 253);
}
/**
* @brief Decode a file_transfer_start message into a struct
*
* @param msg The message to decode
* @param file_transfer_start C-struct to decode the message contents into
*/
static inline void mavlink_msg_file_transfer_start_decode(const mavlink_message_t* msg, mavlink_file_transfer_start_t* file_transfer_start)
{
#if MAVLINK_NEED_BYTE_SWAP
file_transfer_start->transfer_uid = mavlink_msg_file_transfer_start_get_transfer_uid(msg);
file_transfer_start->file_size = mavlink_msg_file_transfer_start_get_file_size(msg);
mavlink_msg_file_transfer_start_get_dest_path(msg, file_transfer_start->dest_path);
file_transfer_start->direction = mavlink_msg_file_transfer_start_get_direction(msg);
file_transfer_start->flags = mavlink_msg_file_transfer_start_get_flags(msg);
#else
memcpy(file_transfer_start, _MAV_PAYLOAD(msg), 254);
#endif
}
@@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u
_mav_put_int16_t(buf, 24, vz);
_mav_put_uint16_t(buf, 26, hdg);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_global_position_int_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u
packet.vz = vz;
packet.hdg = hdg;
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
@@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_
_mav_put_int16_t(buf, 24, vz);
_mav_put_uint16_t(buf, 26, hdg);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_global_position_int_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_
packet.vz = vz;
packet.hdg = hdg;
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys
_mav_put_int16_t(buf, 12, yaw);
_mav_put_uint8_t(buf, 14, coordinate_frame);
memcpy(_MAV_PAYLOAD(msg), buf, 15);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
#else
mavlink_global_position_setpoint_int_t packet;
packet.latitude = latitude;
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys
packet.yaw = yaw;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT;
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack_chan(uint8_
_mav_put_int16_t(buf, 12, yaw);
_mav_put_uint8_t(buf, 14, coordinate_frame);
memcpy(_MAV_PAYLOAD(msg), buf, 15);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
#else
mavlink_global_position_setpoint_int_t packet;
packet.latitude = latitude;
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack_chan(uint8_
packet.yaw = yaw;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT;
@@ -4,7 +4,7 @@
typedef struct __mavlink_global_vision_position_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
@@ -38,7 +38,7 @@ typedef struct __mavlink_global_vision_position_estimate_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_global_vision_position_estimate_t packet;
packet.usec = usec;
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
@@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t
* @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 usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_global_vision_position_estimate_t packet;
packet.usec = usec;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_
* @brief Send a global_vision_position_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -187,7 +187,7 @@ static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_chan
/**
* @brief Get field usec from global_vision_position_estimate message
*
* @return Timestamp (milliseconds)
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/
static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg)
{
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uin
_mav_put_int32_t(buf, 4, longitude);
_mav_put_int32_t(buf, 8, altitude);
memcpy(_MAV_PAYLOAD(msg), buf, 12);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_gps_global_origin_t packet;
packet.latitude = latitude;
packet.longitude = longitude;
packet.altitude = altitude;
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id
_mav_put_int32_t(buf, 4, longitude);
_mav_put_int32_t(buf, 8, altitude);
memcpy(_MAV_PAYLOAD(msg), buf, 12);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_gps_global_origin_t packet;
packet.latitude = latitude;
packet.longitude = longitude;
packet.altitude = altitude;
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c
_mav_put_uint8_t(buf, 28, fix_type);
_mav_put_uint8_t(buf, 29, satellites_visible);
memcpy(_MAV_PAYLOAD(msg), buf, 30);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30);
#else
mavlink_gps_raw_int_t packet;
packet.time_usec = time_usec;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c
packet.fix_type = fix_type;
packet.satellites_visible = satellites_visible;
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30);
#endif
msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint
_mav_put_uint8_t(buf, 28, fix_type);
_mav_put_uint8_t(buf, 29, satellites_visible);
memcpy(_MAV_PAYLOAD(msg), buf, 30);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30);
#else
mavlink_gps_raw_int_t packet;
packet.time_usec = time_usec;
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint
packet.fix_type = fix_type;
packet.satellites_visible = satellites_visible;
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30);
#endif
msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
@@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co
_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
memcpy(_MAV_PAYLOAD(msg), buf, 101);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101);
#else
mavlink_gps_status_t packet;
packet.satellites_visible = satellites_visible;
@@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co
mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
memcpy(_MAV_PAYLOAD(msg), &packet, 101);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101);
#endif
msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
@@ -101,7 +101,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8
_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
memcpy(_MAV_PAYLOAD(msg), buf, 101);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101);
#else
mavlink_gps_status_t packet;
packet.satellites_visible = satellites_visible;
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8
mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
memcpy(_MAV_PAYLOAD(msg), &packet, 101);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101);
#endif
msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
@@ -4,12 +4,12 @@
typedef struct __mavlink_heartbeat_t
{
uint32_t custom_mode; ///< Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
uint32_t custom_mode; ///< A bitfield for use for autopilot-specific flags.
uint8_t type; ///< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
uint8_t autopilot; ///< Autopilot type / class. defined in MAV_CLASS ENUM
uint8_t autopilot; ///< Autopilot type / class. defined in MAV_AUTOPILOT ENUM
uint8_t base_mode; ///< System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
uint8_t system_status; ///< System status flag, see MAV_STATUS ENUM
uint8_t mavlink_version; ///< MAVLink version
uint8_t system_status; ///< System status flag, see MAV_STATE ENUM
uint8_t mavlink_version; ///< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
} mavlink_heartbeat_t;
#define MAVLINK_MSG_ID_HEARTBEAT_LEN 9
@@ -37,10 +37,10 @@ typedef struct __mavlink_heartbeat_t
* @param msg The MAVLink message to compress the data into
*
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
* @param autopilot Autopilot type / class. defined in MAV_CLASS ENUM
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
* @param system_status System status flag, see MAV_STATUS ENUM
* @param custom_mode A bitfield for use for autopilot-specific flags.
* @param system_status System status flag, see MAV_STATE ENUM
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
@@ -55,7 +55,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com
_mav_put_uint8_t(buf, 7, system_status);
_mav_put_uint8_t(buf, 8, 3);
memcpy(_MAV_PAYLOAD(msg), buf, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_heartbeat_t packet;
packet.custom_mode = custom_mode;
@@ -65,7 +65,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com
packet.system_status = system_status;
packet.mavlink_version = 3;
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
@@ -79,10 +79,10 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
* @param autopilot Autopilot type / class. defined in MAV_CLASS ENUM
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
* @param system_status System status flag, see MAV_STATUS ENUM
* @param custom_mode A bitfield for use for autopilot-specific flags.
* @param system_status System status flag, see MAV_STATE ENUM
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_
_mav_put_uint8_t(buf, 7, system_status);
_mav_put_uint8_t(buf, 8, 3);
memcpy(_MAV_PAYLOAD(msg), buf, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_heartbeat_t packet;
packet.custom_mode = custom_mode;
@@ -108,7 +108,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_
packet.system_status = system_status;
packet.mavlink_version = 3;
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
@@ -133,10 +133,10 @@ static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t c
* @param chan MAVLink channel to send the message
*
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
* @param autopilot Autopilot type / class. defined in MAV_CLASS ENUM
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
* @param system_status System status flag, see MAV_STATUS ENUM
* @param custom_mode A bitfield for use for autopilot-specific flags.
* @param system_status System status flag, see MAV_STATE ENUM
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@@ -183,7 +183,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* ms
/**
* @brief Get field autopilot from heartbeat message
*
* @return Autopilot type / class. defined in MAV_CLASS ENUM
* @return Autopilot type / class. defined in MAV_AUTOPILOT ENUM
*/
static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg)
{
@@ -203,7 +203,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_
/**
* @brief Get field custom_mode from heartbeat message
*
* @return Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
* @return A bitfield for use for autopilot-specific flags.
*/
static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg)
{
@@ -213,7 +213,7 @@ static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_messa
/**
* @brief Get field system_status from heartbeat message
*
* @return System status flag, see MAV_STATUS ENUM
* @return System status flag, see MAV_STATE ENUM
*/
static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg)
{
@@ -223,7 +223,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_mess
/**
* @brief Get field mavlink_version from heartbeat message
*
* @return MAVLink version
* @return MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
*/
static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg)
{
@@ -0,0 +1,452 @@
// MESSAGE HIGHRES_IMU PACKING
#define MAVLINK_MSG_ID_HIGHRES_IMU 105
typedef struct __mavlink_highres_imu_t
{
uint64_t time_usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float xacc; ///< X acceleration (m/s^2)
float yacc; ///< Y acceleration (m/s^2)
float zacc; ///< Z acceleration (m/s^2)
float xgyro; ///< Angular speed around X axis (rad / sec)
float ygyro; ///< Angular speed around Y axis (rad / sec)
float zgyro; ///< Angular speed around Z axis (rad / sec)
float xmag; ///< X Magnetic field (Gauss)
float ymag; ///< Y Magnetic field (Gauss)
float zmag; ///< Z Magnetic field (Gauss)
float abs_pressure; ///< Absolute pressure in millibar
float diff_pressure; ///< Differential pressure in millibar
float pressure_alt; ///< Altitude calculated from pressure
float temperature; ///< Temperature in degrees celsius
uint16_t fields_updated; ///< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
} mavlink_highres_imu_t;
#define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62
#define MAVLINK_MSG_ID_105_LEN 62
#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
"HIGHRES_IMU", \
15, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \
{ "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \
{ "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \
{ "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \
{ "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
{ "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
{ "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
} \
}
/**
* @brief Pack a highres_imu 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 xacc X acceleration (m/s^2)
* @param yacc Y acceleration (m/s^2)
* @param zacc Z acceleration (m/s^2)
* @param xgyro Angular speed around X axis (rad / sec)
* @param ygyro Angular speed around Y axis (rad / sec)
* @param zgyro Angular speed around Z axis (rad / sec)
* @param xmag X Magnetic field (Gauss)
* @param ymag Y Magnetic field (Gauss)
* @param zmag Z Magnetic field (Gauss)
* @param abs_pressure Absolute pressure in millibar
* @param diff_pressure Differential pressure in millibar
* @param pressure_alt Altitude calculated from pressure
* @param temperature Temperature in degrees celsius
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[62];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, xacc);
_mav_put_float(buf, 12, yacc);
_mav_put_float(buf, 16, zacc);
_mav_put_float(buf, 20, xgyro);
_mav_put_float(buf, 24, ygyro);
_mav_put_float(buf, 28, zgyro);
_mav_put_float(buf, 32, xmag);
_mav_put_float(buf, 36, ymag);
_mav_put_float(buf, 40, zmag);
_mav_put_float(buf, 44, abs_pressure);
_mav_put_float(buf, 48, diff_pressure);
_mav_put_float(buf, 52, pressure_alt);
_mav_put_float(buf, 56, temperature);
_mav_put_uint16_t(buf, 60, fields_updated);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 62);
#else
mavlink_highres_imu_t packet;
packet.time_usec = time_usec;
packet.xacc = xacc;
packet.yacc = yacc;
packet.zacc = zacc;
packet.xgyro = xgyro;
packet.ygyro = ygyro;
packet.zgyro = zgyro;
packet.xmag = xmag;
packet.ymag = ymag;
packet.zmag = zmag;
packet.abs_pressure = abs_pressure;
packet.diff_pressure = diff_pressure;
packet.pressure_alt = pressure_alt;
packet.temperature = temperature;
packet.fields_updated = fields_updated;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 62);
#endif
msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
return mavlink_finalize_message(msg, system_id, component_id, 62, 93);
}
/**
* @brief Pack a highres_imu 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 xacc X acceleration (m/s^2)
* @param yacc Y acceleration (m/s^2)
* @param zacc Z acceleration (m/s^2)
* @param xgyro Angular speed around X axis (rad / sec)
* @param ygyro Angular speed around Y axis (rad / sec)
* @param zgyro Angular speed around Z axis (rad / sec)
* @param xmag X Magnetic field (Gauss)
* @param ymag Y Magnetic field (Gauss)
* @param zmag Z Magnetic field (Gauss)
* @param abs_pressure Absolute pressure in millibar
* @param diff_pressure Differential pressure in millibar
* @param pressure_alt Altitude calculated from pressure
* @param temperature Temperature in degrees celsius
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[62];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, xacc);
_mav_put_float(buf, 12, yacc);
_mav_put_float(buf, 16, zacc);
_mav_put_float(buf, 20, xgyro);
_mav_put_float(buf, 24, ygyro);
_mav_put_float(buf, 28, zgyro);
_mav_put_float(buf, 32, xmag);
_mav_put_float(buf, 36, ymag);
_mav_put_float(buf, 40, zmag);
_mav_put_float(buf, 44, abs_pressure);
_mav_put_float(buf, 48, diff_pressure);
_mav_put_float(buf, 52, pressure_alt);
_mav_put_float(buf, 56, temperature);
_mav_put_uint16_t(buf, 60, fields_updated);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 62);
#else
mavlink_highres_imu_t packet;
packet.time_usec = time_usec;
packet.xacc = xacc;
packet.yacc = yacc;
packet.zacc = zacc;
packet.xgyro = xgyro;
packet.ygyro = ygyro;
packet.zgyro = zgyro;
packet.xmag = xmag;
packet.ymag = ymag;
packet.zmag = zmag;
packet.abs_pressure = abs_pressure;
packet.diff_pressure = diff_pressure;
packet.pressure_alt = pressure_alt;
packet.temperature = temperature;
packet.fields_updated = fields_updated;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 62);
#endif
msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 62, 93);
}
/**
* @brief Encode a highres_imu 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 highres_imu C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
{
return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
}
/**
* @brief Send a highres_imu message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param xacc X acceleration (m/s^2)
* @param yacc Y acceleration (m/s^2)
* @param zacc Z acceleration (m/s^2)
* @param xgyro Angular speed around X axis (rad / sec)
* @param ygyro Angular speed around Y axis (rad / sec)
* @param zgyro Angular speed around Z axis (rad / sec)
* @param xmag X Magnetic field (Gauss)
* @param ymag Y Magnetic field (Gauss)
* @param zmag Z Magnetic field (Gauss)
* @param abs_pressure Absolute pressure in millibar
* @param diff_pressure Differential pressure in millibar
* @param pressure_alt Altitude calculated from pressure
* @param temperature Temperature in degrees celsius
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[62];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, xacc);
_mav_put_float(buf, 12, yacc);
_mav_put_float(buf, 16, zacc);
_mav_put_float(buf, 20, xgyro);
_mav_put_float(buf, 24, ygyro);
_mav_put_float(buf, 28, zgyro);
_mav_put_float(buf, 32, xmag);
_mav_put_float(buf, 36, ymag);
_mav_put_float(buf, 40, zmag);
_mav_put_float(buf, 44, abs_pressure);
_mav_put_float(buf, 48, diff_pressure);
_mav_put_float(buf, 52, pressure_alt);
_mav_put_float(buf, 56, temperature);
_mav_put_uint16_t(buf, 60, fields_updated);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, 62, 93);
#else
mavlink_highres_imu_t packet;
packet.time_usec = time_usec;
packet.xacc = xacc;
packet.yacc = yacc;
packet.zacc = zacc;
packet.xgyro = xgyro;
packet.ygyro = ygyro;
packet.zgyro = zgyro;
packet.xmag = xmag;
packet.ymag = ymag;
packet.zmag = zmag;
packet.abs_pressure = abs_pressure;
packet.diff_pressure = diff_pressure;
packet.pressure_alt = pressure_alt;
packet.temperature = temperature;
packet.fields_updated = fields_updated;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, 62, 93);
#endif
}
#endif
// MESSAGE HIGHRES_IMU UNPACKING
/**
* @brief Get field time_usec from highres_imu message
*
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/
static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field xacc from highres_imu message
*
* @return X acceleration (m/s^2)
*/
static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field yacc from highres_imu message
*
* @return Y acceleration (m/s^2)
*/
static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field zacc from highres_imu message
*
* @return Z acceleration (m/s^2)
*/
static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field xgyro from highres_imu message
*
* @return Angular speed around X axis (rad / sec)
*/
static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field ygyro from highres_imu message
*
* @return Angular speed around Y axis (rad / sec)
*/
static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field zgyro from highres_imu message
*
* @return Angular speed around Z axis (rad / sec)
*/
static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field xmag from highres_imu message
*
* @return X Magnetic field (Gauss)
*/
static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 32);
}
/**
* @brief Get field ymag from highres_imu message
*
* @return Y Magnetic field (Gauss)
*/
static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 36);
}
/**
* @brief Get field zmag from highres_imu message
*
* @return Z Magnetic field (Gauss)
*/
static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 40);
}
/**
* @brief Get field abs_pressure from highres_imu message
*
* @return Absolute pressure in millibar
*/
static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 44);
}
/**
* @brief Get field diff_pressure from highres_imu message
*
* @return Differential pressure in millibar
*/
static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 48);
}
/**
* @brief Get field pressure_alt from highres_imu message
*
* @return Altitude calculated from pressure
*/
static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 52);
}
/**
* @brief Get field temperature from highres_imu message
*
* @return Temperature in degrees celsius
*/
static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 56);
}
/**
* @brief Get field fields_updated from highres_imu message
*
* @return Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
*/
static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 60);
}
/**
* @brief Decode a highres_imu message into a struct
*
* @param msg The message to decode
* @param highres_imu C-struct to decode the message contents into
*/
static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, mavlink_highres_imu_t* highres_imu)
{
#if MAVLINK_NEED_BYTE_SWAP
highres_imu->time_usec = mavlink_msg_highres_imu_get_time_usec(msg);
highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg);
highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg);
highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg);
highres_imu->xgyro = mavlink_msg_highres_imu_get_xgyro(msg);
highres_imu->ygyro = mavlink_msg_highres_imu_get_ygyro(msg);
highres_imu->zgyro = mavlink_msg_highres_imu_get_zgyro(msg);
highres_imu->xmag = mavlink_msg_highres_imu_get_xmag(msg);
highres_imu->ymag = mavlink_msg_highres_imu_get_ymag(msg);
highres_imu->zmag = mavlink_msg_highres_imu_get_zmag(msg);
highres_imu->abs_pressure = mavlink_msg_highres_imu_get_abs_pressure(msg);
highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg);
highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg);
highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg);
highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg);
#else
memcpy(highres_imu, _MAV_PAYLOAD(msg), 62);
#endif
}
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t
_mav_put_uint8_t(buf, 40, mode);
_mav_put_uint8_t(buf, 41, nav_mode);
memcpy(_MAV_PAYLOAD(msg), buf, 42);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42);
#else
mavlink_hil_controls_t packet;
packet.time_usec = time_usec;
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t
packet.mode = mode;
packet.nav_mode = nav_mode;
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42);
#endif
msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin
_mav_put_uint8_t(buf, 40, mode);
_mav_put_uint8_t(buf, 41, nav_mode);
memcpy(_MAV_PAYLOAD(msg), buf, 42);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42);
#else
mavlink_hil_controls_t packet;
packet.time_usec = time_usec;
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin
packet.mode = mode;
packet.nav_mode = nav_mode;
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42);
#endif
msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
@@ -88,7 +88,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin
_mav_put_uint16_t(buf, 30, chan12_raw);
_mav_put_uint8_t(buf, 32, rssi);
memcpy(_MAV_PAYLOAD(msg), buf, 33);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
#else
mavlink_hil_rc_inputs_raw_t packet;
packet.time_usec = time_usec;
@@ -106,7 +106,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin
packet.chan12_raw = chan12_raw;
packet.rssi = rssi;
memcpy(_MAV_PAYLOAD(msg), &packet, 33);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
#endif
msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
@@ -156,7 +156,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id
_mav_put_uint16_t(buf, 30, chan12_raw);
_mav_put_uint8_t(buf, 32, rssi);
memcpy(_MAV_PAYLOAD(msg), buf, 33);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
#else
mavlink_hil_rc_inputs_raw_t packet;
packet.time_usec = time_usec;
@@ -174,7 +174,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id
packet.chan12_raw = chan12_raw;
packet.rssi = rssi;
memcpy(_MAV_PAYLOAD(msg), &packet, 33);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
#endif
msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
@@ -96,7 +96,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com
_mav_put_int16_t(buf, 52, yacc);
_mav_put_int16_t(buf, 54, zacc);
memcpy(_MAV_PAYLOAD(msg), buf, 56);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56);
#else
mavlink_hil_state_t packet;
packet.time_usec = time_usec;
@@ -116,7 +116,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com
packet.yacc = yacc;
packet.zacc = zacc;
memcpy(_MAV_PAYLOAD(msg), &packet, 56);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56);
#endif
msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
@@ -170,7 +170,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_
_mav_put_int16_t(buf, 52, yacc);
_mav_put_int16_t(buf, 54, zacc);
memcpy(_MAV_PAYLOAD(msg), buf, 56);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56);
#else
mavlink_hil_state_t packet;
packet.time_usec = time_usec;
@@ -190,7 +190,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_
packet.yacc = yacc;
packet.zacc = zacc;
memcpy(_MAV_PAYLOAD(msg), &packet, 56);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56);
#endif
msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_local_position_ned_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui
packet.vy = vy;
packet.vz = vz;
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i
_mav_put_float(buf, 20, vy);
_mav_put_float(buf, 24, vz);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_local_position_ned_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i
packet.vy = vy;
packet.vz = vz;
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
@@ -0,0 +1,276 @@
// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET PACKING
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89
typedef struct __mavlink_local_position_ned_system_global_offset_t
{
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
float x; ///< X Position
float y; ///< Y Position
float z; ///< Z Position
float roll; ///< Roll
float pitch; ///< Pitch
float yaw; ///< Yaw
} mavlink_local_position_ned_system_global_offset_t;
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28
#define MAVLINK_MSG_ID_89_LEN 28
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \
"LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \
7, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_system_global_offset_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_system_global_offset_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \
} \
}
/**
* @brief Pack a local_position_ned_system_global_offset 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 x X Position
* @param y Y Position
* @param z Z Position
* @param roll Roll
* @param pitch Pitch
* @param yaw Yaw
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, x);
_mav_put_float(buf, 8, y);
_mav_put_float(buf, 12, z);
_mav_put_float(buf, 16, roll);
_mav_put_float(buf, 20, pitch);
_mav_put_float(buf, 24, yaw);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_local_position_ned_system_global_offset_t packet;
packet.time_boot_ms = time_boot_ms;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
return mavlink_finalize_message(msg, system_id, component_id, 28, 231);
}
/**
* @brief Pack a local_position_ned_system_global_offset 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 x X Position
* @param y Y Position
* @param z Z Position
* @param roll Roll
* @param pitch Pitch
* @param yaw Yaw
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,float x,float y,float z,float roll,float pitch,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, x);
_mav_put_float(buf, 8, y);
_mav_put_float(buf, 12, z);
_mav_put_float(buf, 16, roll);
_mav_put_float(buf, 20, pitch);
_mav_put_float(buf, 24, yaw);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
mavlink_local_position_ned_system_global_offset_t packet;
packet.time_boot_ms = time_boot_ms;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 231);
}
/**
* @brief Encode a local_position_ned_system_global_offset 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 local_position_ned_system_global_offset C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
{
return mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
}
/**
* @brief Send a local_position_ned_system_global_offset message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param x X Position
* @param y Y Position
* @param z Z Position
* @param roll Roll
* @param pitch Pitch
* @param yaw Yaw
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, x);
_mav_put_float(buf, 8, y);
_mav_put_float(buf, 12, z);
_mav_put_float(buf, 16, roll);
_mav_put_float(buf, 20, pitch);
_mav_put_float(buf, 24, yaw);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, 28, 231);
#else
mavlink_local_position_ned_system_global_offset_t packet;
packet.time_boot_ms = time_boot_ms;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, 28, 231);
#endif
}
#endif
// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET UNPACKING
/**
* @brief Get field time_boot_ms from local_position_ned_system_global_offset message
*
* @return Timestamp (milliseconds since system boot)
*/
static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field x from local_position_ned_system_global_offset message
*
* @return X Position
*/
static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field y from local_position_ned_system_global_offset message
*
* @return Y Position
*/
static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field z from local_position_ned_system_global_offset message
*
* @return Z Position
*/
static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field roll from local_position_ned_system_global_offset message
*
* @return Roll
*/
static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field pitch from local_position_ned_system_global_offset message
*
* @return Pitch
*/
static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field yaw from local_position_ned_system_global_offset message
*
* @return Yaw
*/
static inline float mavlink_msg_local_position_ned_system_global_offset_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Decode a local_position_ned_system_global_offset message into a struct
*
* @param msg The message to decode
* @param local_position_ned_system_global_offset C-struct to decode the message contents into
*/
static inline void mavlink_msg_local_position_ned_system_global_offset_decode(const mavlink_message_t* msg, mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
{
#if MAVLINK_NEED_BYTE_SWAP
local_position_ned_system_global_offset->time_boot_ms = mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(msg);
local_position_ned_system_global_offset->x = mavlink_msg_local_position_ned_system_global_offset_get_x(msg);
local_position_ned_system_global_offset->y = mavlink_msg_local_position_ned_system_global_offset_get_y(msg);
local_position_ned_system_global_offset->z = mavlink_msg_local_position_ned_system_global_offset_get_z(msg);
local_position_ned_system_global_offset->roll = mavlink_msg_local_position_ned_system_global_offset_get_roll(msg);
local_position_ned_system_global_offset->pitch = mavlink_msg_local_position_ned_system_global_offset_get_pitch(msg);
local_position_ned_system_global_offset->yaw = mavlink_msg_local_position_ned_system_global_offset_get_yaw(msg);
#else
memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), 28);
#endif
}
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, coordinate_frame);
memcpy(_MAV_PAYLOAD(msg), buf, 17);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17);
#else
mavlink_local_position_setpoint_t packet;
packet.x = x;
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i
packet.yaw = yaw;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 17);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17);
#endif
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT;
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, coordinate_frame);
memcpy(_MAV_PAYLOAD(msg), buf, 17);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17);
#else
mavlink_local_position_setpoint_t packet;
packet.x = x;
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys
packet.yaw = yaw;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 17);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17);
#endif
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT;
@@ -4,34 +4,28 @@
typedef struct __mavlink_manual_control_t
{
float roll; ///< roll
float pitch; ///< pitch
float yaw; ///< yaw
float thrust; ///< thrust
uint8_t target; ///< The system to be controlled
uint8_t roll_manual; ///< roll control enabled auto:0, manual:1
uint8_t pitch_manual; ///< pitch auto:0, manual:1
uint8_t yaw_manual; ///< yaw auto:0, manual:1
uint8_t thrust_manual; ///< thrust auto:0, manual:1
int16_t x; ///< X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
int16_t y; ///< Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
int16_t z; ///< Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
int16_t r; ///< R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
uint16_t buttons; ///< A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
uint8_t target; ///< The system to be controlled.
} mavlink_manual_control_t;
#define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 21
#define MAVLINK_MSG_ID_69_LEN 21
#define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 11
#define MAVLINK_MSG_ID_69_LEN 11
#define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \
"MANUAL_CONTROL", \
9, \
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_manual_control_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_control_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_control_t, yaw) }, \
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_control_t, thrust) }, \
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_manual_control_t, target) }, \
{ "roll_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_manual_control_t, roll_manual) }, \
{ "pitch_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_manual_control_t, pitch_manual) }, \
{ "yaw_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_manual_control_t, yaw_manual) }, \
{ "thrust_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_control_t, thrust_manual) }, \
6, \
{ { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \
{ "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \
{ "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \
} \
}
@@ -42,50 +36,41 @@ typedef struct __mavlink_manual_control_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
* @param target The system to be controlled.
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
char buf[11];
_mav_put_int16_t(buf, 0, x);
_mav_put_int16_t(buf, 2, y);
_mav_put_int16_t(buf, 4, z);
_mav_put_int16_t(buf, 6, r);
_mav_put_uint16_t(buf, 8, buttons);
_mav_put_uint8_t(buf, 10, target);
memcpy(_MAV_PAYLOAD(msg), buf, 21);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 11);
#else
mavlink_manual_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.x = x;
packet.y = y;
packet.z = z;
packet.r = r;
packet.buttons = buttons;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 11);
#endif
msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL;
return mavlink_finalize_message(msg, system_id, component_id, 21, 52);
return mavlink_finalize_message(msg, system_id, component_id, 11, 243);
}
/**
@@ -94,51 +79,42 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
* @param target The system to be controlled.
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,float roll,float pitch,float yaw,float thrust,uint8_t roll_manual,uint8_t pitch_manual,uint8_t yaw_manual,uint8_t thrust_manual)
uint8_t target,int16_t x,int16_t y,int16_t z,int16_t r,uint16_t buttons)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
char buf[11];
_mav_put_int16_t(buf, 0, x);
_mav_put_int16_t(buf, 2, y);
_mav_put_int16_t(buf, 4, z);
_mav_put_int16_t(buf, 6, r);
_mav_put_uint16_t(buf, 8, buttons);
_mav_put_uint8_t(buf, 10, target);
memcpy(_MAV_PAYLOAD(msg), buf, 21);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 11);
#else
mavlink_manual_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.x = x;
packet.y = y;
packet.z = z;
packet.r = r;
packet.buttons = buttons;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 11);
#endif
msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 21, 52);
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 11, 243);
}
/**
@@ -151,53 +127,44 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u
*/
static inline uint16_t mavlink_msg_manual_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control)
{
return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->roll, manual_control->pitch, manual_control->yaw, manual_control->thrust, manual_control->roll_manual, manual_control->pitch_manual, manual_control->yaw_manual, manual_control->thrust_manual);
return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons);
}
/**
* @brief Send a manual_control message
* @param chan MAVLink channel to send the message
*
* @param target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
* @param target The system to be controlled.
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[21];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
char buf[11];
_mav_put_int16_t(buf, 0, x);
_mav_put_int16_t(buf, 2, y);
_mav_put_int16_t(buf, 4, z);
_mav_put_int16_t(buf, 6, r);
_mav_put_uint16_t(buf, 8, buttons);
_mav_put_uint8_t(buf, 10, target);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, 21, 52);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, 11, 243);
#else
mavlink_manual_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.x = x;
packet.y = y;
packet.z = z;
packet.r = r;
packet.buttons = buttons;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, 21, 52);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, 11, 243);
#endif
}
@@ -209,91 +176,61 @@ static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8
/**
* @brief Get field target from manual_control message
*
* @return The system to be controlled
* @return The system to be controlled.
*/
static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
return _MAV_RETURN_uint8_t(msg, 10);
}
/**
* @brief Get field roll from manual_control message
* @brief Get field x from manual_control message
*
* @return roll
* @return X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
*/
static inline float mavlink_msg_manual_control_get_roll(const mavlink_message_t* msg)
static inline int16_t mavlink_msg_manual_control_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
return _MAV_RETURN_int16_t(msg, 0);
}
/**
* @brief Get field pitch from manual_control message
* @brief Get field y from manual_control message
*
* @return pitch
* @return Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
*/
static inline float mavlink_msg_manual_control_get_pitch(const mavlink_message_t* msg)
static inline int16_t mavlink_msg_manual_control_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
return _MAV_RETURN_int16_t(msg, 2);
}
/**
* @brief Get field yaw from manual_control message
* @brief Get field z from manual_control message
*
* @return yaw
* @return Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
*/
static inline float mavlink_msg_manual_control_get_yaw(const mavlink_message_t* msg)
static inline int16_t mavlink_msg_manual_control_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
return _MAV_RETURN_int16_t(msg, 4);
}
/**
* @brief Get field thrust from manual_control message
* @brief Get field r from manual_control message
*
* @return thrust
* @return R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
*/
static inline float mavlink_msg_manual_control_get_thrust(const mavlink_message_t* msg)
static inline int16_t mavlink_msg_manual_control_get_r(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
return _MAV_RETURN_int16_t(msg, 6);
}
/**
* @brief Get field roll_manual from manual_control message
* @brief Get field buttons from manual_control message
*
* @return roll control enabled auto:0, manual:1
* @return A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
*/
static inline uint8_t mavlink_msg_manual_control_get_roll_manual(const mavlink_message_t* msg)
static inline uint16_t mavlink_msg_manual_control_get_buttons(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 17);
}
/**
* @brief Get field pitch_manual from manual_control message
*
* @return pitch auto:0, manual:1
*/
static inline uint8_t mavlink_msg_manual_control_get_pitch_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 18);
}
/**
* @brief Get field yaw_manual from manual_control message
*
* @return yaw auto:0, manual:1
*/
static inline uint8_t mavlink_msg_manual_control_get_yaw_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 19);
}
/**
* @brief Get field thrust_manual from manual_control message
*
* @return thrust auto:0, manual:1
*/
static inline uint8_t mavlink_msg_manual_control_get_thrust_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 20);
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
@@ -305,16 +242,13 @@ static inline uint8_t mavlink_msg_manual_control_get_thrust_manual(const mavlink
static inline void mavlink_msg_manual_control_decode(const mavlink_message_t* msg, mavlink_manual_control_t* manual_control)
{
#if MAVLINK_NEED_BYTE_SWAP
manual_control->roll = mavlink_msg_manual_control_get_roll(msg);
manual_control->pitch = mavlink_msg_manual_control_get_pitch(msg);
manual_control->yaw = mavlink_msg_manual_control_get_yaw(msg);
manual_control->thrust = mavlink_msg_manual_control_get_thrust(msg);
manual_control->x = mavlink_msg_manual_control_get_x(msg);
manual_control->y = mavlink_msg_manual_control_get_y(msg);
manual_control->z = mavlink_msg_manual_control_get_z(msg);
manual_control->r = mavlink_msg_manual_control_get_r(msg);
manual_control->buttons = mavlink_msg_manual_control_get_buttons(msg);
manual_control->target = mavlink_msg_manual_control_get_target(msg);
manual_control->roll_manual = mavlink_msg_manual_control_get_roll_manual(msg);
manual_control->pitch_manual = mavlink_msg_manual_control_get_pitch_manual(msg);
manual_control->yaw_manual = mavlink_msg_manual_control_get_yaw_manual(msg);
manual_control->thrust_manual = mavlink_msg_manual_control_get_thrust_manual(msg);
#else
memcpy(manual_control, _MAV_PAYLOAD(msg), 21);
memcpy(manual_control, _MAV_PAYLOAD(msg), 11);
#endif
}
@@ -0,0 +1,276 @@
// MESSAGE MANUAL_SETPOINT PACKING
#define MAVLINK_MSG_ID_MANUAL_SETPOINT 81
typedef struct __mavlink_manual_setpoint_t
{
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot
float roll; ///< Desired roll rate in radians per second
float pitch; ///< Desired pitch rate in radians per second
float yaw; ///< Desired yaw rate in radians per second
float thrust; ///< Collective thrust, normalized to 0 .. 1
uint8_t mode_switch; ///< Flight mode switch position, 0.. 255
uint8_t manual_override_switch; ///< Override mode switch position, 0.. 255
} mavlink_manual_setpoint_t;
#define MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN 22
#define MAVLINK_MSG_ID_81_LEN 22
#define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \
"MANUAL_SETPOINT", \
7, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_setpoint_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_setpoint_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_setpoint_t, yaw) }, \
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_manual_setpoint_t, thrust) }, \
{ "mode_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_setpoint_t, mode_switch) }, \
{ "manual_override_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_manual_setpoint_t, manual_override_switch) }, \
} \
}
/**
* @brief Pack a manual_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 time_boot_ms Timestamp in milliseconds since system boot
* @param roll Desired roll rate in radians per second
* @param pitch Desired pitch rate in radians per second
* @param yaw Desired yaw rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1
* @param mode_switch Flight mode switch position, 0.. 255
* @param manual_override_switch Override mode switch position, 0.. 255
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[22];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll);
_mav_put_float(buf, 8, pitch);
_mav_put_float(buf, 12, yaw);
_mav_put_float(buf, 16, thrust);
_mav_put_uint8_t(buf, 20, mode_switch);
_mav_put_uint8_t(buf, 21, manual_override_switch);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
#else
mavlink_manual_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.mode_switch = mode_switch;
packet.manual_override_switch = manual_override_switch;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
#endif
msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT;
return mavlink_finalize_message(msg, system_id, component_id, 22, 106);
}
/**
* @brief Pack a manual_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 time_boot_ms Timestamp in milliseconds since system boot
* @param roll Desired roll rate in radians per second
* @param pitch Desired pitch rate in radians per second
* @param yaw Desired yaw rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1
* @param mode_switch Flight mode switch position, 0.. 255
* @param manual_override_switch Override mode switch position, 0.. 255
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,float roll,float pitch,float yaw,float thrust,uint8_t mode_switch,uint8_t manual_override_switch)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[22];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll);
_mav_put_float(buf, 8, pitch);
_mav_put_float(buf, 12, yaw);
_mav_put_float(buf, 16, thrust);
_mav_put_uint8_t(buf, 20, mode_switch);
_mav_put_uint8_t(buf, 21, manual_override_switch);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
#else
mavlink_manual_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.mode_switch = mode_switch;
packet.manual_override_switch = manual_override_switch;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
#endif
msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 106);
}
/**
* @brief Encode a manual_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 manual_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_manual_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_setpoint_t* manual_setpoint)
{
return mavlink_msg_manual_setpoint_pack(system_id, component_id, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch);
}
/**
* @brief Send a manual_setpoint message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp in milliseconds since system boot
* @param roll Desired roll rate in radians per second
* @param pitch Desired pitch rate in radians per second
* @param yaw Desired yaw rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1
* @param mode_switch Flight mode switch position, 0.. 255
* @param manual_override_switch Override mode switch position, 0.. 255
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[22];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll);
_mav_put_float(buf, 8, pitch);
_mav_put_float(buf, 12, yaw);
_mav_put_float(buf, 16, thrust);
_mav_put_uint8_t(buf, 20, mode_switch);
_mav_put_uint8_t(buf, 21, manual_override_switch);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, 22, 106);
#else
mavlink_manual_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.mode_switch = mode_switch;
packet.manual_override_switch = manual_override_switch;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, 22, 106);
#endif
}
#endif
// MESSAGE MANUAL_SETPOINT UNPACKING
/**
* @brief Get field time_boot_ms from manual_setpoint message
*
* @return Timestamp in milliseconds since system boot
*/
static inline uint32_t mavlink_msg_manual_setpoint_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field roll from manual_setpoint message
*
* @return Desired roll rate in radians per second
*/
static inline float mavlink_msg_manual_setpoint_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field pitch from manual_setpoint message
*
* @return Desired pitch rate in radians per second
*/
static inline float mavlink_msg_manual_setpoint_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field yaw from manual_setpoint message
*
* @return Desired yaw rate in radians per second
*/
static inline float mavlink_msg_manual_setpoint_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field thrust from manual_setpoint message
*
* @return Collective thrust, normalized to 0 .. 1
*/
static inline float mavlink_msg_manual_setpoint_get_thrust(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field mode_switch from manual_setpoint message
*
* @return Flight mode switch position, 0.. 255
*/
static inline uint8_t mavlink_msg_manual_setpoint_get_mode_switch(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 20);
}
/**
* @brief Get field manual_override_switch from manual_setpoint message
*
* @return Override mode switch position, 0.. 255
*/
static inline uint8_t mavlink_msg_manual_setpoint_get_manual_override_switch(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 21);
}
/**
* @brief Decode a manual_setpoint message into a struct
*
* @param msg The message to decode
* @param manual_setpoint C-struct to decode the message contents into
*/
static inline void mavlink_msg_manual_setpoint_decode(const mavlink_message_t* msg, mavlink_manual_setpoint_t* manual_setpoint)
{
#if MAVLINK_NEED_BYTE_SWAP
manual_setpoint->time_boot_ms = mavlink_msg_manual_setpoint_get_time_boot_ms(msg);
manual_setpoint->roll = mavlink_msg_manual_setpoint_get_roll(msg);
manual_setpoint->pitch = mavlink_msg_manual_setpoint_get_pitch(msg);
manual_setpoint->yaw = mavlink_msg_manual_setpoint_get_yaw(msg);
manual_setpoint->thrust = mavlink_msg_manual_setpoint_get_thrust(msg);
manual_setpoint->mode_switch = mavlink_msg_manual_setpoint_get_mode_switch(msg);
manual_setpoint->manual_override_switch = mavlink_msg_manual_setpoint_get_manual_override_switch(msg);
#else
memcpy(manual_setpoint, _MAV_PAYLOAD(msg), 22);
#endif
}
@@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t c
_mav_put_uint8_t(buf, 2, ver);
_mav_put_uint8_t(buf, 3, type);
_mav_put_int8_t_array(buf, 4, value, 32);
memcpy(_MAV_PAYLOAD(msg), buf, 36);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36);
#else
mavlink_memory_vect_t packet;
packet.address = address;
packet.ver = ver;
packet.type = type;
mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
memcpy(_MAV_PAYLOAD(msg), &packet, 36);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36);
#endif
msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT;
@@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint
_mav_put_uint8_t(buf, 2, ver);
_mav_put_uint8_t(buf, 3, type);
_mav_put_int8_t_array(buf, 4, value, 32);
memcpy(_MAV_PAYLOAD(msg), buf, 36);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36);
#else
mavlink_memory_vect_t packet;
packet.address = address;
packet.ver = ver;
packet.type = type;
mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
memcpy(_MAV_PAYLOAD(msg), &packet, 36);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36);
#endif
msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT;
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t c
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, type);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_mission_ack_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.type = type;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_ACK;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, type);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
#else
mavlink_mission_ack_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.type = type;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_ACK;
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uin
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_mission_clear_all_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_mission_clear_all_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t
_mav_put_uint8_t(buf, 2, target_system);
_mav_put_uint8_t(buf, 3, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_mission_count_t packet;
packet.count = count;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, ui
_mav_put_uint8_t(buf, 2, target_system);
_mav_put_uint8_t(buf, 3, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_mission_count_t packet;
packet.count = count;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT;
@@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8
char buf[2];
_mav_put_uint16_t(buf, 0, seq);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_mission_current_t packet;
packet.seq = seq;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT;
@@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id,
char buf[2];
_mav_put_uint16_t(buf, 0, seq);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_mission_current_t packet;
packet.seq = seq;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT;
@@ -88,7 +88,7 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t
_mav_put_uint8_t(buf, 35, current);
_mav_put_uint8_t(buf, 36, autocontinue);
memcpy(_MAV_PAYLOAD(msg), buf, 37);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37);
#else
mavlink_mission_item_t packet;
packet.param1 = param1;
@@ -106,7 +106,7 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t
packet.current = current;
packet.autocontinue = autocontinue;
memcpy(_MAV_PAYLOAD(msg), &packet, 37);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM;
@@ -156,7 +156,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin
_mav_put_uint8_t(buf, 35, current);
_mav_put_uint8_t(buf, 36, autocontinue);
memcpy(_MAV_PAYLOAD(msg), buf, 37);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37);
#else
mavlink_mission_item_t packet;
packet.param1 = param1;
@@ -174,7 +174,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin
packet.current = current;
packet.autocontinue = autocontinue;
memcpy(_MAV_PAYLOAD(msg), &packet, 37);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM;
@@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id,
char buf[2];
_mav_put_uint16_t(buf, 0, seq);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_mission_item_reached_t packet;
packet.seq = seq;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
@@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system
char buf[2];
_mav_put_uint16_t(buf, 0, seq);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_mission_item_reached_t packet;
packet.seq = seq;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8
_mav_put_uint8_t(buf, 2, target_system);
_mav_put_uint8_t(buf, 3, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_mission_request_t packet;
packet.seq = seq;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id,
_mav_put_uint8_t(buf, 2, target_system);
_mav_put_uint8_t(buf, 3, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_mission_request_t packet;
packet.seq = seq;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST;
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id,
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_mission_request_list_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_mission_request_list_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_mission_request_partial_list_t packet;
packet.start_index = start_index;
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_mission_request_partial_list_t packet;
packet.start_index = start_index;
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST;
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, u
_mav_put_uint8_t(buf, 2, target_system);
_mav_put_uint8_t(buf, 3, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_mission_set_current_t packet;
packet.seq = seq;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_
_mav_put_uint8_t(buf, 2, target_system);
_mav_put_uint8_t(buf, 3, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
#else
mavlink_mission_set_current_t packet;
packet.seq = seq;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT;
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_mission_write_partial_list_t packet;
packet.start_index = start_index;
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_mission_write_partial_list_t packet;
packet.start_index = start_index;
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST;
@@ -43,13 +43,13 @@ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uin
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, value);
_mav_put_char_array(buf, 8, name, 10);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_named_value_float_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
mav_array_memcpy(packet.name, name, sizeof(char)*10);
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT;
@@ -76,13 +76,13 @@ static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, value);
_mav_put_char_array(buf, 8, name, 10);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_named_value_float_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
mav_array_memcpy(packet.name, name, sizeof(char)*10);
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT;
@@ -43,13 +43,13 @@ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, value);
_mav_put_char_array(buf, 8, name, 10);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_named_value_int_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
mav_array_memcpy(packet.name, name, sizeof(char)*10);
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT;
@@ -76,13 +76,13 @@ static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id,
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, value);
_mav_put_char_array(buf, 8, name, 10);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_named_value_int_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
mav_array_memcpy(packet.name, name, sizeof(char)*10);
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT;
@@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id,
_mav_put_int16_t(buf, 22, target_bearing);
_mav_put_uint16_t(buf, 24, wp_dist);
memcpy(_MAV_PAYLOAD(msg), buf, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
#else
mavlink_nav_controller_output_t packet;
packet.nav_roll = nav_roll;
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id,
packet.target_bearing = target_bearing;
packet.wp_dist = wp_dist;
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
#endif
msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT;
@@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste
_mav_put_int16_t(buf, 22, target_bearing);
_mav_put_uint16_t(buf, 24, wp_dist);
memcpy(_MAV_PAYLOAD(msg), buf, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
#else
mavlink_nav_controller_output_t packet;
packet.nav_roll = nav_roll;
@@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste
packet.target_bearing = target_bearing;
packet.wp_dist = wp_dist;
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
#endif
msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT;
@@ -0,0 +1,249 @@
// 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
}
@@ -5,27 +5,31 @@
typedef struct __mavlink_optical_flow_t
{
uint64_t time_usec; ///< Timestamp (UNIX)
float ground_distance; ///< Ground distance in meters
float flow_comp_m_x; ///< Flow in meters in x-sensor direction, angular-speed compensated
float flow_comp_m_y; ///< Flow in meters in y-sensor direction, angular-speed compensated
float ground_distance; ///< Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
int16_t flow_x; ///< Flow in pixels in x-sensor direction
int16_t flow_y; ///< Flow in pixels in y-sensor direction
uint8_t sensor_id; ///< Sensor ID
uint8_t quality; ///< Optical flow quality / confidence. 0: bad, 255: maximum quality
} mavlink_optical_flow_t;
#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 18
#define MAVLINK_MSG_ID_100_LEN 18
#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 26
#define MAVLINK_MSG_ID_100_LEN 26
#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \
"OPTICAL_FLOW", \
6, \
8, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \
{ "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, ground_distance) }, \
{ "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_optical_flow_t, flow_x) }, \
{ "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_optical_flow_t, flow_y) }, \
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_optical_flow_t, sensor_id) }, \
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_optical_flow_t, quality) }, \
{ "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \
{ "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \
{ "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \
{ "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_optical_flow_t, flow_x) }, \
{ "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_optical_flow_t, flow_y) }, \
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \
} \
}
@@ -40,37 +44,43 @@ typedef struct __mavlink_optical_flow_t
* @param sensor_id Sensor ID
* @param flow_x Flow in pixels in x-sensor direction
* @param flow_y Flow in pixels in y-sensor direction
* @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
* @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
* @param ground_distance Ground distance in meters
* @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, uint8_t quality, float ground_distance)
uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
char buf[26];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, ground_distance);
_mav_put_int16_t(buf, 12, flow_x);
_mav_put_int16_t(buf, 14, flow_y);
_mav_put_uint8_t(buf, 16, sensor_id);
_mav_put_uint8_t(buf, 17, quality);
_mav_put_float(buf, 8, flow_comp_m_x);
_mav_put_float(buf, 12, flow_comp_m_y);
_mav_put_float(buf, 16, ground_distance);
_mav_put_int16_t(buf, 20, flow_x);
_mav_put_int16_t(buf, 22, flow_y);
_mav_put_uint8_t(buf, 24, sensor_id);
_mav_put_uint8_t(buf, 25, quality);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
#else
mavlink_optical_flow_t packet;
packet.time_usec = time_usec;
packet.flow_comp_m_x = flow_comp_m_x;
packet.flow_comp_m_y = flow_comp_m_y;
packet.ground_distance = ground_distance;
packet.flow_x = flow_x;
packet.flow_y = flow_y;
packet.sensor_id = sensor_id;
packet.quality = quality;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
#endif
msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW;
return mavlink_finalize_message(msg, system_id, component_id, 18, 19);
return mavlink_finalize_message(msg, system_id, component_id, 26, 175);
}
/**
@@ -83,38 +93,44 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t
* @param sensor_id Sensor ID
* @param flow_x Flow in pixels in x-sensor direction
* @param flow_y Flow in pixels in y-sensor direction
* @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
* @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
* @param ground_distance Ground distance in meters
* @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_optical_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,int16_t flow_x,int16_t flow_y,uint8_t quality,float ground_distance)
uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,float flow_comp_m_x,float flow_comp_m_y,uint8_t quality,float ground_distance)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
char buf[26];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, ground_distance);
_mav_put_int16_t(buf, 12, flow_x);
_mav_put_int16_t(buf, 14, flow_y);
_mav_put_uint8_t(buf, 16, sensor_id);
_mav_put_uint8_t(buf, 17, quality);
_mav_put_float(buf, 8, flow_comp_m_x);
_mav_put_float(buf, 12, flow_comp_m_y);
_mav_put_float(buf, 16, ground_distance);
_mav_put_int16_t(buf, 20, flow_x);
_mav_put_int16_t(buf, 22, flow_y);
_mav_put_uint8_t(buf, 24, sensor_id);
_mav_put_uint8_t(buf, 25, quality);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
#else
mavlink_optical_flow_t packet;
packet.time_usec = time_usec;
packet.flow_comp_m_x = flow_comp_m_x;
packet.flow_comp_m_y = flow_comp_m_y;
packet.ground_distance = ground_distance;
packet.flow_x = flow_x;
packet.flow_y = flow_y;
packet.sensor_id = sensor_id;
packet.quality = quality;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
#endif
msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 19);
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26, 175);
}
/**
@@ -127,7 +143,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin
*/
static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow)
{
return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->quality, optical_flow->ground_distance);
return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance);
}
/**
@@ -138,33 +154,39 @@ static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_
* @param sensor_id Sensor ID
* @param flow_x Flow in pixels in x-sensor direction
* @param flow_y Flow in pixels in y-sensor direction
* @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
* @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
* @param ground_distance Ground distance in meters
* @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, uint8_t quality, float ground_distance)
static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[18];
char buf[26];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, ground_distance);
_mav_put_int16_t(buf, 12, flow_x);
_mav_put_int16_t(buf, 14, flow_y);
_mav_put_uint8_t(buf, 16, sensor_id);
_mav_put_uint8_t(buf, 17, quality);
_mav_put_float(buf, 8, flow_comp_m_x);
_mav_put_float(buf, 12, flow_comp_m_y);
_mav_put_float(buf, 16, ground_distance);
_mav_put_int16_t(buf, 20, flow_x);
_mav_put_int16_t(buf, 22, flow_y);
_mav_put_uint8_t(buf, 24, sensor_id);
_mav_put_uint8_t(buf, 25, quality);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, 18, 19);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, 26, 175);
#else
mavlink_optical_flow_t packet;
packet.time_usec = time_usec;
packet.flow_comp_m_x = flow_comp_m_x;
packet.flow_comp_m_y = flow_comp_m_y;
packet.ground_distance = ground_distance;
packet.flow_x = flow_x;
packet.flow_y = flow_y;
packet.sensor_id = sensor_id;
packet.quality = quality;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, 18, 19);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, 26, 175);
#endif
}
@@ -190,7 +212,7 @@ static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_mess
*/
static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
return _MAV_RETURN_uint8_t(msg, 24);
}
/**
@@ -200,7 +222,7 @@ static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_messa
*/
static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 12);
return _MAV_RETURN_int16_t(msg, 20);
}
/**
@@ -210,7 +232,27 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_
*/
static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 14);
return _MAV_RETURN_int16_t(msg, 22);
}
/**
* @brief Get field flow_comp_m_x from optical_flow message
*
* @return Flow in meters in x-sensor direction, angular-speed compensated
*/
static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field flow_comp_m_y from optical_flow message
*
* @return Flow in meters in y-sensor direction, angular-speed compensated
*/
static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
@@ -220,17 +262,17 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_
*/
static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 17);
return _MAV_RETURN_uint8_t(msg, 25);
}
/**
* @brief Get field ground_distance from optical_flow message
*
* @return Ground distance in meters
* @return Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
*/
static inline float mavlink_msg_optical_flow_get_ground_distance(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
return _MAV_RETURN_float(msg, 16);
}
/**
@@ -243,12 +285,14 @@ static inline void mavlink_msg_optical_flow_decode(const mavlink_message_t* msg,
{
#if MAVLINK_NEED_BYTE_SWAP
optical_flow->time_usec = mavlink_msg_optical_flow_get_time_usec(msg);
optical_flow->flow_comp_m_x = mavlink_msg_optical_flow_get_flow_comp_m_x(msg);
optical_flow->flow_comp_m_y = mavlink_msg_optical_flow_get_flow_comp_m_y(msg);
optical_flow->ground_distance = mavlink_msg_optical_flow_get_ground_distance(msg);
optical_flow->flow_x = mavlink_msg_optical_flow_get_flow_x(msg);
optical_flow->flow_y = mavlink_msg_optical_flow_get_flow_y(msg);
optical_flow->sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg);
optical_flow->quality = mavlink_msg_optical_flow_get_quality(msg);
#else
memcpy(optical_flow, _MAV_PAYLOAD(msg), 18);
memcpy(optical_flow, _MAV_PAYLOAD(msg), 26);
#endif
}
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, ui
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_param_request_list_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST;
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_i
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
#else
mavlink_param_request_list_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
#endif
msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST;
@@ -4,10 +4,10 @@
typedef struct __mavlink_param_request_read_t
{
int16_t param_index; ///< Parameter index. Send -1 to use the param ID field as identifier
int16_t param_index; ///< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
char param_id[16]; ///< Onboard parameter id
char param_id[16]; ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
} mavlink_param_request_read_t;
#define MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN 20
@@ -34,8 +34,8 @@ typedef struct __mavlink_param_request_read_t
*
* @param target_system System ID
* @param target_component Component ID
* @param param_id Onboard parameter id
* @param param_index Parameter index. Send -1 to use the param ID field as identifier
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
@@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui
_mav_put_uint8_t(buf, 2, target_system);
_mav_put_uint8_t(buf, 3, target_component);
_mav_put_char_array(buf, 4, param_id, 16);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_param_request_read_t packet;
packet.param_index = param_index;
packet.target_system = target_system;
packet.target_component = target_component;
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ;
@@ -69,8 +69,8 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param param_id Onboard parameter id
* @param param_index Parameter index. Send -1 to use the param ID field as identifier
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
@@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_i
_mav_put_uint8_t(buf, 2, target_system);
_mav_put_uint8_t(buf, 3, target_component);
_mav_put_char_array(buf, 4, param_id, 16);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_param_request_read_t packet;
packet.param_index = param_index;
packet.target_system = target_system;
packet.target_component = target_component;
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ;
@@ -116,8 +116,8 @@ static inline uint16_t mavlink_msg_param_request_read_encode(uint8_t system_id,
*
* @param target_system System ID
* @param target_component Component ID
* @param param_id Onboard parameter id
* @param param_index Parameter index. Send -1 to use the param ID field as identifier
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@@ -168,7 +168,7 @@ static inline uint8_t mavlink_msg_param_request_read_get_target_component(const
/**
* @brief Get field param_id from param_request_read message
*
* @return Onboard parameter id
* @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
*/
static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink_message_t* msg, char *param_id)
{
@@ -178,7 +178,7 @@ static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink
/**
* @brief Get field param_index from param_request_read message
*
* @return Parameter index. Send -1 to use the param ID field as identifier
* @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
*/
static inline int16_t mavlink_msg_param_request_read_get_param_index(const mavlink_message_t* msg)
{
@@ -7,8 +7,8 @@ typedef struct __mavlink_param_set_t
float param_value; ///< Onboard parameter value
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
char param_id[16]; ///< Onboard parameter id
uint8_t param_type; ///< Onboard parameter type: see MAV_VAR enum
char param_id[16]; ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
uint8_t param_type; ///< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
} mavlink_param_set_t;
#define MAVLINK_MSG_ID_PARAM_SET_LEN 23
@@ -36,9 +36,9 @@ typedef struct __mavlink_param_set_t
*
* @param target_system System ID
* @param target_component Component ID
* @param param_id Onboard parameter id
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_value Onboard parameter value
* @param param_type Onboard parameter type: see MAV_VAR enum
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
@@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com
_mav_put_uint8_t(buf, 5, target_component);
_mav_put_uint8_t(buf, 22, param_type);
_mav_put_char_array(buf, 6, param_id, 16);
memcpy(_MAV_PAYLOAD(msg), buf, 23);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23);
#else
mavlink_param_set_t packet;
packet.param_value = param_value;
@@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com
packet.target_component = target_component;
packet.param_type = param_type;
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
memcpy(_MAV_PAYLOAD(msg), &packet, 23);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23);
#endif
msg->msgid = MAVLINK_MSG_ID_PARAM_SET;
@@ -74,9 +74,9 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param param_id Onboard parameter id
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_value Onboard parameter value
* @param param_type Onboard parameter type: see MAV_VAR enum
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
@@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_
_mav_put_uint8_t(buf, 5, target_component);
_mav_put_uint8_t(buf, 22, param_type);
_mav_put_char_array(buf, 6, param_id, 16);
memcpy(_MAV_PAYLOAD(msg), buf, 23);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23);
#else
mavlink_param_set_t packet;
packet.param_value = param_value;
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_
packet.target_component = target_component;
packet.param_type = param_type;
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
memcpy(_MAV_PAYLOAD(msg), &packet, 23);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23);
#endif
msg->msgid = MAVLINK_MSG_ID_PARAM_SET;
@@ -124,9 +124,9 @@ static inline uint16_t mavlink_msg_param_set_encode(uint8_t system_id, uint8_t c
*
* @param target_system System ID
* @param target_component Component ID
* @param param_id Onboard parameter id
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_value Onboard parameter value
* @param param_type Onboard parameter type: see MAV_VAR enum
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@@ -179,7 +179,7 @@ static inline uint8_t mavlink_msg_param_set_get_target_component(const mavlink_m
/**
* @brief Get field param_id from param_set message
*
* @return Onboard parameter id
* @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
*/
static inline uint16_t mavlink_msg_param_set_get_param_id(const mavlink_message_t* msg, char *param_id)
{
@@ -199,7 +199,7 @@ static inline float mavlink_msg_param_set_get_param_value(const mavlink_message_
/**
* @brief Get field param_type from param_set message
*
* @return Onboard parameter type: see MAV_VAR enum
* @return Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
*/
static inline uint8_t mavlink_msg_param_set_get_param_type(const mavlink_message_t* msg)
{
@@ -7,8 +7,8 @@ typedef struct __mavlink_param_value_t
float param_value; ///< Onboard parameter value
uint16_t param_count; ///< Total number of onboard parameters
uint16_t param_index; ///< Index of this onboard parameter
char param_id[16]; ///< Onboard parameter id
uint8_t param_type; ///< Onboard parameter type: see MAV_VAR enum
char param_id[16]; ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
uint8_t param_type; ///< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
} mavlink_param_value_t;
#define MAVLINK_MSG_ID_PARAM_VALUE_LEN 25
@@ -34,9 +34,9 @@ typedef struct __mavlink_param_value_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param param_id Onboard parameter id
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_value Onboard parameter value
* @param param_type Onboard parameter type: see MAV_VAR enum
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
* @param param_count Total number of onboard parameters
* @param param_index Index of this onboard parameter
* @return length of the message in bytes (excluding serial stream start sign)
@@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c
_mav_put_uint16_t(buf, 6, param_index);
_mav_put_uint8_t(buf, 24, param_type);
_mav_put_char_array(buf, 8, param_id, 16);
memcpy(_MAV_PAYLOAD(msg), buf, 25);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
#else
mavlink_param_value_t packet;
packet.param_value = param_value;
@@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c
packet.param_index = param_index;
packet.param_type = param_type;
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
memcpy(_MAV_PAYLOAD(msg), &packet, 25);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
#endif
msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE;
@@ -72,9 +72,9 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c
* @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 param_id Onboard parameter id
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_value Onboard parameter value
* @param param_type Onboard parameter type: see MAV_VAR enum
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
* @param param_count Total number of onboard parameters
* @param param_index Index of this onboard parameter
* @return length of the message in bytes (excluding serial stream start sign)
@@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint
_mav_put_uint16_t(buf, 6, param_index);
_mav_put_uint8_t(buf, 24, param_type);
_mav_put_char_array(buf, 8, param_id, 16);
memcpy(_MAV_PAYLOAD(msg), buf, 25);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
#else
mavlink_param_value_t packet;
packet.param_value = param_value;
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint
packet.param_index = param_index;
packet.param_type = param_type;
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
memcpy(_MAV_PAYLOAD(msg), &packet, 25);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
#endif
msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE;
@@ -122,9 +122,9 @@ static inline uint16_t mavlink_msg_param_value_encode(uint8_t system_id, uint8_t
* @brief Send a param_value message
* @param chan MAVLink channel to send the message
*
* @param param_id Onboard parameter id
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
* @param param_value Onboard parameter value
* @param param_type Onboard parameter type: see MAV_VAR enum
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
* @param param_count Total number of onboard parameters
* @param param_index Index of this onboard parameter
*/
@@ -159,7 +159,7 @@ static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const ch
/**
* @brief Get field param_id from param_value message
*
* @return Onboard parameter id
* @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
*/
static inline uint16_t mavlink_msg_param_value_get_param_id(const mavlink_message_t* msg, char *param_id)
{
@@ -179,7 +179,7 @@ static inline float mavlink_msg_param_value_get_param_value(const mavlink_messag
/**
* @brief Get field param_type from param_value message
*
* @return Onboard parameter type: see MAV_VAR enum
* @return Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
*/
static inline uint8_t mavlink_msg_param_value_get_param_type(const mavlink_message_t* msg)
{
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen
_mav_put_uint8_t(buf, 12, target_system);
_mav_put_uint8_t(buf, 13, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
#else
mavlink_ping_t packet;
packet.time_usec = time_usec;
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
#endif
msg->msgid = MAVLINK_MSG_ID_PING;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com
_mav_put_uint8_t(buf, 12, target_system);
_mav_put_uint8_t(buf, 13, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
#else
mavlink_ping_t packet;
packet.time_usec = time_usec;
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
#endif
msg->msgid = MAVLINK_MSG_ID_PING;
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo
_mav_put_int16_t(buf, 22, ymag);
_mav_put_int16_t(buf, 24, zmag);
memcpy(_MAV_PAYLOAD(msg), buf, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
#else
mavlink_raw_imu_t packet;
packet.time_usec = time_usec;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo
packet.ymag = ymag;
packet.zmag = zmag;
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
#endif
msg->msgid = MAVLINK_MSG_ID_RAW_IMU;
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t
_mav_put_int16_t(buf, 22, ymag);
_mav_put_int16_t(buf, 24, zmag);
memcpy(_MAV_PAYLOAD(msg), buf, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
#else
mavlink_raw_imu_t packet;
packet.time_usec = time_usec;
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t
packet.ymag = ymag;
packet.zmag = zmag;
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
#endif
msg->msgid = MAVLINK_MSG_ID_RAW_IMU;
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t
_mav_put_int16_t(buf, 12, press_diff2);
_mav_put_int16_t(buf, 14, temperature);
memcpy(_MAV_PAYLOAD(msg), buf, 16);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
#else
mavlink_raw_pressure_t packet;
packet.time_usec = time_usec;
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t
packet.press_diff2 = press_diff2;
packet.temperature = temperature;
memcpy(_MAV_PAYLOAD(msg), &packet, 16);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
#endif
msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE;
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin
_mav_put_int16_t(buf, 12, press_diff2);
_mav_put_int16_t(buf, 14, temperature);
memcpy(_MAV_PAYLOAD(msg), buf, 16);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
#else
mavlink_raw_pressure_t packet;
packet.time_usec = time_usec;
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin
packet.press_diff2 = press_diff2;
packet.temperature = temperature;
memcpy(_MAV_PAYLOAD(msg), &packet, 16);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
#endif
msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE;
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id,
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_rc_channels_override_t packet;
packet.chan1_raw = chan1_raw;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id,
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_rc_channels_override_t packet;
packet.chan1_raw = chan1_raw;
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
@@ -5,16 +5,16 @@
typedef struct __mavlink_rc_channels_raw_t
{
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
uint16_t chan1_raw; ///< RC channel 1 value, in microseconds
uint16_t chan2_raw; ///< RC channel 2 value, in microseconds
uint16_t chan3_raw; ///< RC channel 3 value, in microseconds
uint16_t chan4_raw; ///< RC channel 4 value, in microseconds
uint16_t chan5_raw; ///< RC channel 5 value, in microseconds
uint16_t chan6_raw; ///< RC channel 6 value, in microseconds
uint16_t chan7_raw; ///< RC channel 7 value, in microseconds
uint16_t chan8_raw; ///< RC channel 8 value, in microseconds
uint8_t 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.
uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 255: 100%
uint16_t chan1_raw; ///< RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
uint16_t chan2_raw; ///< RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
uint16_t chan3_raw; ///< RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
uint16_t chan4_raw; ///< RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
uint16_t chan5_raw; ///< RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
uint16_t chan6_raw; ///< RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
uint16_t chan7_raw; ///< RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
uint16_t chan8_raw; ///< RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
uint8_t port; ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
} mavlink_rc_channels_raw_t;
#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22
@@ -47,16 +47,16 @@ typedef struct __mavlink_rc_channels_raw_t
* @param msg The MAVLink message to compress the data into
*
* @param time_boot_ms Timestamp (milliseconds 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 chan1_raw RC channel 1 value, in microseconds
* @param chan2_raw RC channel 2 value, in microseconds
* @param chan3_raw RC channel 3 value, in microseconds
* @param chan4_raw RC channel 4 value, in microseconds
* @param chan5_raw RC channel 5 value, in microseconds
* @param chan6_raw RC channel 6 value, in microseconds
* @param chan7_raw RC channel 7 value, in microseconds
* @param chan8_raw RC channel 8 value, in microseconds
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
* @param chan1_raw RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan2_raw RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan3_raw RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan4_raw RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan5_raw RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan6_raw RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan7_raw RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan8_raw RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8
_mav_put_uint8_t(buf, 20, port);
_mav_put_uint8_t(buf, 21, rssi);
memcpy(_MAV_PAYLOAD(msg), buf, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
#else
mavlink_rc_channels_raw_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8
packet.port = port;
packet.rssi = rssi;
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
#endif
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW;
@@ -105,16 +105,16 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8
* @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 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 chan1_raw RC channel 1 value, in microseconds
* @param chan2_raw RC channel 2 value, in microseconds
* @param chan3_raw RC channel 3 value, in microseconds
* @param chan4_raw RC channel 4 value, in microseconds
* @param chan5_raw RC channel 5 value, in microseconds
* @param chan6_raw RC channel 6 value, in microseconds
* @param chan7_raw RC channel 7 value, in microseconds
* @param chan8_raw RC channel 8 value, in microseconds
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
* @param chan1_raw RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan2_raw RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan3_raw RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan4_raw RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan5_raw RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan6_raw RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan7_raw RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan8_raw RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id,
_mav_put_uint8_t(buf, 20, port);
_mav_put_uint8_t(buf, 21, rssi);
memcpy(_MAV_PAYLOAD(msg), buf, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
#else
mavlink_rc_channels_raw_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id,
packet.port = port;
packet.rssi = rssi;
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
#endif
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW;
@@ -175,16 +175,16 @@ static inline uint16_t mavlink_msg_rc_channels_raw_encode(uint8_t system_id, uin
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (milliseconds 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 chan1_raw RC channel 1 value, in microseconds
* @param chan2_raw RC channel 2 value, in microseconds
* @param chan3_raw RC channel 3 value, in microseconds
* @param chan4_raw RC channel 4 value, in microseconds
* @param chan5_raw RC channel 5 value, in microseconds
* @param chan6_raw RC channel 6 value, in microseconds
* @param chan7_raw RC channel 7 value, in microseconds
* @param chan8_raw RC channel 8 value, in microseconds
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
* @param chan1_raw RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan2_raw RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan3_raw RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan4_raw RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan5_raw RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan6_raw RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan7_raw RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
* @param chan8_raw RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@@ -241,7 +241,7 @@ static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlin
/**
* @brief Get field port from rc_channels_raw message
*
* @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
* @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
*/
static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message_t* msg)
{
@@ -251,7 +251,7 @@ static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message
/**
* @brief Get field chan1_raw from rc_channels_raw message
*
* @return RC channel 1 value, in microseconds
* @return RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
*/
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_message_t* msg)
{
@@ -261,7 +261,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_m
/**
* @brief Get field chan2_raw from rc_channels_raw message
*
* @return RC channel 2 value, in microseconds
* @return RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
*/
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_message_t* msg)
{
@@ -271,7 +271,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_m
/**
* @brief Get field chan3_raw from rc_channels_raw message
*
* @return RC channel 3 value, in microseconds
* @return RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
*/
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_message_t* msg)
{
@@ -281,7 +281,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_m
/**
* @brief Get field chan4_raw from rc_channels_raw message
*
* @return RC channel 4 value, in microseconds
* @return RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
*/
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_message_t* msg)
{
@@ -291,7 +291,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_m
/**
* @brief Get field chan5_raw from rc_channels_raw message
*
* @return RC channel 5 value, in microseconds
* @return RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
*/
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_message_t* msg)
{
@@ -301,7 +301,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_m
/**
* @brief Get field chan6_raw from rc_channels_raw message
*
* @return RC channel 6 value, in microseconds
* @return RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
*/
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_message_t* msg)
{
@@ -311,7 +311,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_m
/**
* @brief Get field chan7_raw from rc_channels_raw message
*
* @return RC channel 7 value, in microseconds
* @return RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
*/
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_message_t* msg)
{
@@ -321,7 +321,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_m
/**
* @brief Get field chan8_raw from rc_channels_raw message
*
* @return RC channel 8 value, in microseconds
* @return RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
*/
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_message_t* msg)
{
@@ -331,7 +331,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_m
/**
* @brief Get field rssi from rc_channels_raw message
*
* @return Receive signal strength indicator, 0: 0%, 255: 100%
* @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
*/
static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message_t* msg)
{
@@ -5,16 +5,16 @@
typedef struct __mavlink_rc_channels_scaled_t
{
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
int16_t chan1_scaled; ///< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
int16_t chan2_scaled; ///< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
int16_t chan3_scaled; ///< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
int16_t chan4_scaled; ///< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
int16_t chan5_scaled; ///< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
int16_t chan6_scaled; ///< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
int16_t chan7_scaled; ///< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
int16_t chan8_scaled; ///< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
uint8_t 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.
uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 255: 100%
int16_t chan1_scaled; ///< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
int16_t chan2_scaled; ///< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
int16_t chan3_scaled; ///< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
int16_t chan4_scaled; ///< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
int16_t chan5_scaled; ///< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
int16_t chan6_scaled; ///< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
int16_t chan7_scaled; ///< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
int16_t chan8_scaled; ///< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
uint8_t port; ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
} mavlink_rc_channels_scaled_t;
#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22
@@ -47,16 +47,16 @@ typedef struct __mavlink_rc_channels_scaled_t
* @param msg The MAVLink message to compress the data into
*
* @param time_boot_ms Timestamp (milliseconds 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 chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui
_mav_put_uint8_t(buf, 20, port);
_mav_put_uint8_t(buf, 21, rssi);
memcpy(_MAV_PAYLOAD(msg), buf, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
#else
mavlink_rc_channels_scaled_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui
packet.port = port;
packet.rssi = rssi;
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
#endif
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED;
@@ -105,16 +105,16 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui
* @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 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 chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i
_mav_put_uint8_t(buf, 20, port);
_mav_put_uint8_t(buf, 21, rssi);
memcpy(_MAV_PAYLOAD(msg), buf, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
#else
mavlink_rc_channels_scaled_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i
packet.port = port;
packet.rssi = rssi;
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
#endif
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED;
@@ -175,16 +175,16 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_encode(uint8_t system_id,
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (milliseconds 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 chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@@ -241,7 +241,7 @@ static inline uint32_t mavlink_msg_rc_channels_scaled_get_time_boot_ms(const mav
/**
* @brief Get field port from rc_channels_scaled message
*
* @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
* @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
*/
static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_message_t* msg)
{
@@ -251,7 +251,7 @@ static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_mess
/**
* @brief Get field chan1_scaled from rc_channels_scaled message
*
* @return RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @return RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
*/
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavlink_message_t* msg)
{
@@ -261,7 +261,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavl
/**
* @brief Get field chan2_scaled from rc_channels_scaled message
*
* @return RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @return RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
*/
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavlink_message_t* msg)
{
@@ -271,7 +271,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavl
/**
* @brief Get field chan3_scaled from rc_channels_scaled message
*
* @return RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @return RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
*/
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavlink_message_t* msg)
{
@@ -281,7 +281,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavl
/**
* @brief Get field chan4_scaled from rc_channels_scaled message
*
* @return RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @return RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
*/
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavlink_message_t* msg)
{
@@ -291,7 +291,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavl
/**
* @brief Get field chan5_scaled from rc_channels_scaled message
*
* @return RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @return RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
*/
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavlink_message_t* msg)
{
@@ -301,7 +301,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavl
/**
* @brief Get field chan6_scaled from rc_channels_scaled message
*
* @return RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @return RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
*/
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavlink_message_t* msg)
{
@@ -311,7 +311,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavl
/**
* @brief Get field chan7_scaled from rc_channels_scaled message
*
* @return RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @return RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
*/
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavlink_message_t* msg)
{
@@ -321,7 +321,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavl
/**
* @brief Get field chan8_scaled from rc_channels_scaled message
*
* @return RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
* @return RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
*/
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavlink_message_t* msg)
{
@@ -331,7 +331,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavl
/**
* @brief Get field rssi from rc_channels_scaled message
*
* @return Receive signal strength indicator, 0: 0%, 255: 100%
* @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
*/
static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_message_t* msg)
{
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u
_mav_put_uint8_t(buf, 4, req_stream_id);
_mav_put_uint8_t(buf, 5, start_stop);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_request_data_stream_t packet;
packet.req_message_rate = req_message_rate;
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u
packet.req_stream_id = req_stream_id;
packet.start_stop = start_stop;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM;
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_
_mav_put_uint8_t(buf, 4, req_stream_id);
_mav_put_uint8_t(buf, 5, start_stop);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_request_data_stream_t packet;
packet.req_message_rate = req_message_rate;
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_
packet.req_stream_id = req_stream_id;
packet.start_stop = start_stop;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM;
@@ -0,0 +1,232 @@
// MESSAGE ROLL_PITCH_YAW_RATES_THRUST_SETPOINT PACKING
#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT 80
typedef struct __mavlink_roll_pitch_yaw_rates_thrust_setpoint_t
{
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot
float roll_rate; ///< Desired roll rate in radians per second
float pitch_rate; ///< Desired pitch rate in radians per second
float yaw_rate; ///< Desired yaw rate in radians per second
float thrust; ///< Collective thrust, normalized to 0 .. 1
} mavlink_roll_pitch_yaw_rates_thrust_setpoint_t;
#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN 20
#define MAVLINK_MSG_ID_80_LEN 20
#define MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT { \
"ROLL_PITCH_YAW_RATES_THRUST_SETPOINT", \
5, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, time_boot_ms) }, \
{ "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, roll_rate) }, \
{ "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, pitch_rate) }, \
{ "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, yaw_rate) }, \
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, thrust) }, \
} \
}
/**
* @brief Pack a roll_pitch_yaw_rates_thrust_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 time_boot_ms Timestamp in milliseconds since system boot
* @param roll_rate Desired roll rate in radians per second
* @param pitch_rate Desired pitch rate in radians per second
* @param yaw_rate Desired yaw rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll_rate);
_mav_put_float(buf, 8, pitch_rate);
_mav_put_float(buf, 12, yaw_rate);
_mav_put_float(buf, 16, thrust);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll_rate = roll_rate;
packet.pitch_rate = pitch_rate;
packet.yaw_rate = yaw_rate;
packet.thrust = thrust;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT;
return mavlink_finalize_message(msg, system_id, component_id, 20, 127);
}
/**
* @brief Pack a roll_pitch_yaw_rates_thrust_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 time_boot_ms Timestamp in milliseconds since system boot
* @param roll_rate Desired roll rate in radians per second
* @param pitch_rate Desired pitch rate in radians per second
* @param yaw_rate Desired yaw rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,float roll_rate,float pitch_rate,float yaw_rate,float thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll_rate);
_mav_put_float(buf, 8, pitch_rate);
_mav_put_float(buf, 12, yaw_rate);
_mav_put_float(buf, 16, thrust);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll_rate = roll_rate;
packet.pitch_rate = pitch_rate;
packet.yaw_rate = yaw_rate;
packet.thrust = thrust;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 127);
}
/**
* @brief Encode a roll_pitch_yaw_rates_thrust_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 roll_pitch_yaw_rates_thrust_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_roll_pitch_yaw_rates_thrust_setpoint_t* roll_pitch_yaw_rates_thrust_setpoint)
{
return mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(system_id, component_id, msg, roll_pitch_yaw_rates_thrust_setpoint->time_boot_ms, roll_pitch_yaw_rates_thrust_setpoint->roll_rate, roll_pitch_yaw_rates_thrust_setpoint->pitch_rate, roll_pitch_yaw_rates_thrust_setpoint->yaw_rate, roll_pitch_yaw_rates_thrust_setpoint->thrust);
}
/**
* @brief Send a roll_pitch_yaw_rates_thrust_setpoint message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp in milliseconds since system boot
* @param roll_rate Desired roll rate in radians per second
* @param pitch_rate Desired pitch rate in radians per second
* @param yaw_rate Desired yaw rate in radians per second
* @param thrust Collective thrust, normalized to 0 .. 1
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll_rate);
_mav_put_float(buf, 8, pitch_rate);
_mav_put_float(buf, 12, yaw_rate);
_mav_put_float(buf, 16, thrust);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, 20, 127);
#else
mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll_rate = roll_rate;
packet.pitch_rate = pitch_rate;
packet.yaw_rate = yaw_rate;
packet.thrust = thrust;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)&packet, 20, 127);
#endif
}
#endif
// MESSAGE ROLL_PITCH_YAW_RATES_THRUST_SETPOINT UNPACKING
/**
* @brief Get field time_boot_ms from roll_pitch_yaw_rates_thrust_setpoint message
*
* @return Timestamp in milliseconds since system boot
*/
static inline uint32_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field roll_rate from roll_pitch_yaw_rates_thrust_setpoint message
*
* @return Desired roll rate in radians per second
*/
static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_roll_rate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field pitch_rate from roll_pitch_yaw_rates_thrust_setpoint message
*
* @return Desired pitch rate in radians per second
*/
static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_pitch_rate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field yaw_rate from roll_pitch_yaw_rates_thrust_setpoint message
*
* @return Desired yaw rate in radians per second
*/
static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_yaw_rate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field thrust from roll_pitch_yaw_rates_thrust_setpoint message
*
* @return Collective thrust, normalized to 0 .. 1
*/
static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_thrust(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Decode a roll_pitch_yaw_rates_thrust_setpoint message into a struct
*
* @param msg The message to decode
* @param roll_pitch_yaw_rates_thrust_setpoint C-struct to decode the message contents into
*/
static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_decode(const mavlink_message_t* msg, mavlink_roll_pitch_yaw_rates_thrust_setpoint_t* roll_pitch_yaw_rates_thrust_setpoint)
{
#if MAVLINK_NEED_BYTE_SWAP
roll_pitch_yaw_rates_thrust_setpoint->time_boot_ms = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_time_boot_ms(msg);
roll_pitch_yaw_rates_thrust_setpoint->roll_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_roll_rate(msg);
roll_pitch_yaw_rates_thrust_setpoint->pitch_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_pitch_rate(msg);
roll_pitch_yaw_rates_thrust_setpoint->yaw_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_yaw_rate(msg);
roll_pitch_yaw_rates_thrust_setpoint->thrust = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_thrust(msg);
#else
memcpy(roll_pitch_yaw_rates_thrust_setpoint, _MAV_PAYLOAD(msg), 20);
#endif
}
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin
_mav_put_float(buf, 12, yaw_speed);
_mav_put_float(buf, 16, thrust);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin
packet.yaw_speed = yaw_speed;
packet.thrust = thrust;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT;
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha
_mav_put_float(buf, 12, yaw_speed);
_mav_put_float(buf, 16, thrust);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha
packet.yaw_speed = yaw_speed;
packet.thrust = thrust;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT;
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s
_mav_put_float(buf, 12, yaw);
_mav_put_float(buf, 16, thrust);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_roll_pitch_yaw_thrust_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s
packet.yaw = yaw;
packet.thrust = thrust;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT;
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint
_mav_put_float(buf, 12, yaw);
_mav_put_float(buf, 16, thrust);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_roll_pitch_yaw_thrust_setpoint_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint
packet.yaw = yaw;
packet.thrust = thrust;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT;
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u
_mav_put_float(buf, 20, p2z);
_mav_put_uint8_t(buf, 24, frame);
memcpy(_MAV_PAYLOAD(msg), buf, 25);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
#else
mavlink_safety_allowed_area_t packet;
packet.p1x = p1x;
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u
packet.p2z = p2z;
packet.frame = frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 25);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
#endif
msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA;
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_
_mav_put_float(buf, 20, p2z);
_mav_put_uint8_t(buf, 24, frame);
memcpy(_MAV_PAYLOAD(msg), buf, 25);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
#else
mavlink_safety_allowed_area_t packet;
packet.p1x = p1x;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_
packet.p2z = p2z;
packet.frame = frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 25);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
#endif
msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA;
@@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i
_mav_put_uint8_t(buf, 25, target_component);
_mav_put_uint8_t(buf, 26, frame);
memcpy(_MAV_PAYLOAD(msg), buf, 27);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27);
#else
mavlink_safety_set_allowed_area_t packet;
packet.p1x = p1x;
@@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i
packet.target_component = target_component;
packet.frame = frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 27);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27);
#endif
msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA;
@@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys
_mav_put_uint8_t(buf, 25, target_component);
_mav_put_uint8_t(buf, 26, frame);
memcpy(_MAV_PAYLOAD(msg), buf, 27);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27);
#else
mavlink_safety_set_allowed_area_t packet;
packet.p1x = p1x;
@@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys
packet.target_component = target_component;
packet.frame = frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 27);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27);
#endif
msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA;
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co
_mav_put_int16_t(buf, 18, ymag);
_mav_put_int16_t(buf, 20, zmag);
memcpy(_MAV_PAYLOAD(msg), buf, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
#else
mavlink_scaled_imu_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co
packet.ymag = ymag;
packet.zmag = zmag;
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
#endif
msg->msgid = MAVLINK_MSG_ID_SCALED_IMU;
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8
_mav_put_int16_t(buf, 18, ymag);
_mav_put_int16_t(buf, 20, zmag);
memcpy(_MAV_PAYLOAD(msg), buf, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
#else
mavlink_scaled_imu_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8
packet.ymag = ymag;
packet.zmag = zmag;
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
#endif
msg->msgid = MAVLINK_MSG_ID_SCALED_IMU;
@@ -4,7 +4,7 @@
typedef struct __mavlink_scaled_pressure_t
{
uint32_t time_boot_ms; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot)
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
float press_abs; ///< Absolute pressure (hectopascal)
float press_diff; ///< Differential pressure 1 (hectopascal)
int16_t temperature; ///< Temperature measurement (0.01 degrees celsius)
@@ -32,7 +32,7 @@ typedef struct __mavlink_scaled_pressure_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 UNIX epoch or microseconds since system boot)
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param press_abs Absolute pressure (hectopascal)
* @param press_diff Differential pressure 1 (hectopascal)
* @param temperature Temperature measurement (0.01 degrees celsius)
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8
_mav_put_float(buf, 8, press_diff);
_mav_put_int16_t(buf, 12, temperature);
memcpy(_MAV_PAYLOAD(msg), buf, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
#else
mavlink_scaled_pressure_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8
packet.press_diff = press_diff;
packet.temperature = temperature;
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
#endif
msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE;
@@ -69,7 +69,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8
* @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 UNIX epoch or microseconds since system boot)
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param press_abs Absolute pressure (hectopascal)
* @param press_diff Differential pressure 1 (hectopascal)
* @param temperature Temperature measurement (0.01 degrees celsius)
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id,
_mav_put_float(buf, 8, press_diff);
_mav_put_int16_t(buf, 12, temperature);
memcpy(_MAV_PAYLOAD(msg), buf, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
#else
mavlink_scaled_pressure_t packet;
packet.time_boot_ms = time_boot_ms;
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id,
packet.press_diff = press_diff;
packet.temperature = temperature;
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
#endif
msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_encode(uint8_t system_id, uin
* @brief Send a scaled_pressure message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms Timestamp (microseconds since UNIX epoch or microseconds since system boot)
* @param time_boot_ms Timestamp (milliseconds since system boot)
* @param press_abs Absolute pressure (hectopascal)
* @param press_diff Differential pressure 1 (hectopascal)
* @param temperature Temperature measurement (0.01 degrees celsius)
@@ -154,7 +154,7 @@ static inline void mavlink_msg_scaled_pressure_send(mavlink_channel_t chan, uint
/**
* @brief Get field time_boot_ms from scaled_pressure message
*
* @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
* @return Timestamp (milliseconds since system boot)
*/
static inline uint32_t mavlink_msg_scaled_pressure_get_time_boot_ms(const mavlink_message_t* msg)
{
@@ -4,7 +4,7 @@
typedef struct __mavlink_servo_output_raw_t
{
uint32_t time_usec; ///< Timestamp (since UNIX epoch or 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
@@ -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_usec Timestamp (since UNIX epoch or 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
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
_mav_put_uint16_t(buf, 18, servo8_raw);
_mav_put_uint8_t(buf, 20, port);
memcpy(_MAV_PAYLOAD(msg), buf, 21);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21);
#else
mavlink_servo_output_raw_t packet;
packet.time_usec = time_usec;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
packet.servo8_raw = servo8_raw;
packet.port = port;
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21);
#endif
msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
@@ -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_usec Timestamp (since UNIX epoch or 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
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id,
_mav_put_uint16_t(buf, 18, servo8_raw);
_mav_put_uint8_t(buf, 20, port);
memcpy(_MAV_PAYLOAD(msg), buf, 21);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21);
#else
mavlink_servo_output_raw_t packet;
packet.time_usec = time_usec;
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id,
packet.servo8_raw = servo8_raw;
packet.port = port;
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21);
#endif
msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
@@ -166,7 +166,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, ui
* @brief Send a servo_output_raw message
* @param chan MAVLink channel to send the message
*
* @param time_usec Timestamp (since UNIX epoch or 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
@@ -220,7 +220,7 @@ static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uin
/**
* @brief Get field time_usec from servo_output_raw message
*
* @return Timestamp (since UNIX epoch or microseconds since system boot)
* @return Timestamp (microseconds since system boot)
*/
static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_message_t* msg)
{
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t
_mav_put_int16_t(buf, 12, yaw);
_mav_put_uint8_t(buf, 14, coordinate_frame);
memcpy(_MAV_PAYLOAD(msg), buf, 15);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
#else
mavlink_set_global_position_setpoint_int_t packet;
packet.latitude = latitude;
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t
packet.yaw = yaw;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT;
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack_chan(ui
_mav_put_int16_t(buf, 12, yaw);
_mav_put_uint8_t(buf, 14, coordinate_frame);
memcpy(_MAV_PAYLOAD(msg), buf, 15);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
#else
mavlink_set_global_position_setpoint_int_t packet;
packet.latitude = latitude;
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack_chan(ui
packet.yaw = yaw;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT;
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id,
_mav_put_int32_t(buf, 8, altitude);
_mav_put_uint8_t(buf, 12, target_system);
memcpy(_MAV_PAYLOAD(msg), buf, 13);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13);
#else
mavlink_set_gps_global_origin_t packet;
packet.latitude = latitude;
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id,
packet.altitude = altitude;
packet.target_system = target_system;
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN;
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste
_mav_put_int32_t(buf, 8, altitude);
_mav_put_uint8_t(buf, 12, target_system);
memcpy(_MAV_PAYLOAD(msg), buf, 13);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13);
#else
mavlink_set_gps_global_origin_t packet;
packet.latitude = latitude;
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste
packet.altitude = altitude;
packet.target_system = target_system;
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN;
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack(uint8_t syst
_mav_put_uint8_t(buf, 17, target_component);
_mav_put_uint8_t(buf, 18, coordinate_frame);
memcpy(_MAV_PAYLOAD(msg), buf, 19);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 19);
#else
mavlink_set_local_position_setpoint_t packet;
packet.x = x;
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack(uint8_t syst
packet.target_component = target_component;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 19);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 19);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT;
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack_chan(uint8_t
_mav_put_uint8_t(buf, 17, target_component);
_mav_put_uint8_t(buf, 18, coordinate_frame);
memcpy(_MAV_PAYLOAD(msg), buf, 19);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 19);
#else
mavlink_set_local_position_setpoint_t packet;
packet.x = x;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_set_local_position_setpoint_pack_chan(uint8_t
packet.target_component = target_component;
packet.coordinate_frame = coordinate_frame;
memcpy(_MAV_PAYLOAD(msg), &packet, 19);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 19);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT;
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t comp
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, base_mode);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_set_mode_t packet;
packet.custom_mode = custom_mode;
packet.target_system = target_system;
packet.base_mode = base_mode;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_MODE;
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t
_mav_put_uint8_t(buf, 4, target_system);
_mav_put_uint8_t(buf, 5, base_mode);
memcpy(_MAV_PAYLOAD(msg), buf, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
#else
mavlink_set_mode_t packet;
packet.custom_mode = custom_mode;
packet.target_system = target_system;
packet.base_mode = base_mode;
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_MODE;
@@ -0,0 +1,232 @@
// MESSAGE SET_QUAD_MOTORS_SETPOINT PACKING
#define MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT 60
typedef struct __mavlink_set_quad_motors_setpoint_t
{
uint16_t motor_front_nw; ///< Front motor in + configuration, front left motor in x configuration
uint16_t motor_right_ne; ///< Right motor in + configuration, front right motor in x configuration
uint16_t motor_back_se; ///< Back motor in + configuration, back right motor in x configuration
uint16_t motor_left_sw; ///< Left motor in + configuration, back left motor in x configuration
uint8_t target_system; ///< System ID of the system that should set these motor commands
} mavlink_set_quad_motors_setpoint_t;
#define MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT_LEN 9
#define MAVLINK_MSG_ID_60_LEN 9
#define MAVLINK_MESSAGE_INFO_SET_QUAD_MOTORS_SETPOINT { \
"SET_QUAD_MOTORS_SETPOINT", \
5, \
{ { "motor_front_nw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_set_quad_motors_setpoint_t, motor_front_nw) }, \
{ "motor_right_ne", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_set_quad_motors_setpoint_t, motor_right_ne) }, \
{ "motor_back_se", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_set_quad_motors_setpoint_t, motor_back_se) }, \
{ "motor_left_sw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_set_quad_motors_setpoint_t, motor_left_sw) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_set_quad_motors_setpoint_t, target_system) }, \
} \
}
/**
* @brief Pack a set_quad_motors_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 of the system that should set these motor commands
* @param motor_front_nw Front motor in + configuration, front left motor in x configuration
* @param motor_right_ne Right motor in + configuration, front right motor in x configuration
* @param motor_back_se Back motor in + configuration, back right motor in x configuration
* @param motor_left_sw Left motor in + configuration, back left motor in x configuration
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_quad_motors_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint16_t motor_front_nw, uint16_t motor_right_ne, uint16_t motor_back_se, uint16_t motor_left_sw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint16_t(buf, 0, motor_front_nw);
_mav_put_uint16_t(buf, 2, motor_right_ne);
_mav_put_uint16_t(buf, 4, motor_back_se);
_mav_put_uint16_t(buf, 6, motor_left_sw);
_mav_put_uint8_t(buf, 8, target_system);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_set_quad_motors_setpoint_t packet;
packet.motor_front_nw = motor_front_nw;
packet.motor_right_ne = motor_right_ne;
packet.motor_back_se = motor_back_se;
packet.motor_left_sw = motor_left_sw;
packet.target_system = target_system;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT;
return mavlink_finalize_message(msg, system_id, component_id, 9, 30);
}
/**
* @brief Pack a set_quad_motors_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 of the system that should set these motor commands
* @param motor_front_nw Front motor in + configuration, front left motor in x configuration
* @param motor_right_ne Right motor in + configuration, front right motor in x configuration
* @param motor_back_se Back motor in + configuration, back right motor in x configuration
* @param motor_left_sw Left motor in + configuration, back left motor in x configuration
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_quad_motors_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint16_t motor_front_nw,uint16_t motor_right_ne,uint16_t motor_back_se,uint16_t motor_left_sw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint16_t(buf, 0, motor_front_nw);
_mav_put_uint16_t(buf, 2, motor_right_ne);
_mav_put_uint16_t(buf, 4, motor_back_se);
_mav_put_uint16_t(buf, 6, motor_left_sw);
_mav_put_uint8_t(buf, 8, target_system);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
#else
mavlink_set_quad_motors_setpoint_t packet;
packet.motor_front_nw = motor_front_nw;
packet.motor_right_ne = motor_right_ne;
packet.motor_back_se = motor_back_se;
packet.motor_left_sw = motor_left_sw;
packet.target_system = target_system;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 30);
}
/**
* @brief Encode a set_quad_motors_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 set_quad_motors_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_quad_motors_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_quad_motors_setpoint_t* set_quad_motors_setpoint)
{
return mavlink_msg_set_quad_motors_setpoint_pack(system_id, component_id, msg, set_quad_motors_setpoint->target_system, set_quad_motors_setpoint->motor_front_nw, set_quad_motors_setpoint->motor_right_ne, set_quad_motors_setpoint->motor_back_se, set_quad_motors_setpoint->motor_left_sw);
}
/**
* @brief Send a set_quad_motors_setpoint message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID of the system that should set these motor commands
* @param motor_front_nw Front motor in + configuration, front left motor in x configuration
* @param motor_right_ne Right motor in + configuration, front right motor in x configuration
* @param motor_back_se Back motor in + configuration, back right motor in x configuration
* @param motor_left_sw Left motor in + configuration, back left motor in x configuration
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_quad_motors_setpoint_send(mavlink_channel_t chan, uint8_t target_system, uint16_t motor_front_nw, uint16_t motor_right_ne, uint16_t motor_back_se, uint16_t motor_left_sw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint16_t(buf, 0, motor_front_nw);
_mav_put_uint16_t(buf, 2, motor_right_ne);
_mav_put_uint16_t(buf, 4, motor_back_se);
_mav_put_uint16_t(buf, 6, motor_left_sw);
_mav_put_uint8_t(buf, 8, target_system);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, buf, 9, 30);
#else
mavlink_set_quad_motors_setpoint_t packet;
packet.motor_front_nw = motor_front_nw;
packet.motor_right_ne = motor_right_ne;
packet.motor_back_se = motor_back_se;
packet.motor_left_sw = motor_left_sw;
packet.target_system = target_system;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT, (const char *)&packet, 9, 30);
#endif
}
#endif
// MESSAGE SET_QUAD_MOTORS_SETPOINT UNPACKING
/**
* @brief Get field target_system from set_quad_motors_setpoint message
*
* @return System ID of the system that should set these motor commands
*/
static inline uint8_t mavlink_msg_set_quad_motors_setpoint_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
* @brief Get field motor_front_nw from set_quad_motors_setpoint message
*
* @return Front motor in + configuration, front left motor in x configuration
*/
static inline uint16_t mavlink_msg_set_quad_motors_setpoint_get_motor_front_nw(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field motor_right_ne from set_quad_motors_setpoint message
*
* @return Right motor in + configuration, front right motor in x configuration
*/
static inline uint16_t mavlink_msg_set_quad_motors_setpoint_get_motor_right_ne(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Get field motor_back_se from set_quad_motors_setpoint message
*
* @return Back motor in + configuration, back right motor in x configuration
*/
static inline uint16_t mavlink_msg_set_quad_motors_setpoint_get_motor_back_se(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field motor_left_sw from set_quad_motors_setpoint message
*
* @return Left motor in + configuration, back left motor in x configuration
*/
static inline uint16_t mavlink_msg_set_quad_motors_setpoint_get_motor_left_sw(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Decode a set_quad_motors_setpoint message into a struct
*
* @param msg The message to decode
* @param set_quad_motors_setpoint C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_quad_motors_setpoint_decode(const mavlink_message_t* msg, mavlink_set_quad_motors_setpoint_t* set_quad_motors_setpoint)
{
#if MAVLINK_NEED_BYTE_SWAP
set_quad_motors_setpoint->motor_front_nw = mavlink_msg_set_quad_motors_setpoint_get_motor_front_nw(msg);
set_quad_motors_setpoint->motor_right_ne = mavlink_msg_set_quad_motors_setpoint_get_motor_right_ne(msg);
set_quad_motors_setpoint->motor_back_se = mavlink_msg_set_quad_motors_setpoint_get_motor_back_se(msg);
set_quad_motors_setpoint->motor_left_sw = mavlink_msg_set_quad_motors_setpoint_get_motor_left_sw(msg);
set_quad_motors_setpoint->target_system = mavlink_msg_set_quad_motors_setpoint_get_target_system(msg);
#else
memcpy(set_quad_motors_setpoint, _MAV_PAYLOAD(msg), 9);
#endif
}
@@ -0,0 +1,320 @@
// MESSAGE SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST PACKING
#define MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST 63
typedef struct __mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t
{
int16_t roll[4]; ///< Desired roll angle in radians +-PI (+-32767)
int16_t pitch[4]; ///< Desired pitch angle in radians +-PI (+-32767)
int16_t yaw[4]; ///< Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
uint16_t thrust[4]; ///< Collective thrust, scaled to uint16 (0..65535)
uint8_t group; ///< ID of the quadrotor group (0 - 255, up to 256 groups supported)
uint8_t mode; ///< ID of the flight mode (0 - 255, up to 256 modes supported)
uint8_t led_red[4]; ///< RGB red channel (0-255)
uint8_t led_blue[4]; ///< RGB green channel (0-255)
uint8_t led_green[4]; ///< RGB blue channel (0-255)
} mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t;
#define MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_LEN 46
#define MAVLINK_MSG_ID_63_LEN 46
#define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_ROLL_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_PITCH_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_YAW_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_THRUST_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_LED_RED_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_LED_BLUE_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST_FIELD_LED_GREEN_LEN 4
#define MAVLINK_MESSAGE_INFO_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST { \
"SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST", \
9, \
{ { "roll", NULL, MAVLINK_TYPE_INT16_T, 4, 0, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_INT16_T, 4, 8, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_INT16_T, 4, 16, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, yaw) }, \
{ "thrust", NULL, MAVLINK_TYPE_UINT16_T, 4, 24, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, thrust) }, \
{ "group", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, group) }, \
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, mode) }, \
{ "led_red", NULL, MAVLINK_TYPE_UINT8_T, 4, 34, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, led_red) }, \
{ "led_blue", NULL, MAVLINK_TYPE_UINT8_T, 4, 38, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, led_blue) }, \
{ "led_green", NULL, MAVLINK_TYPE_UINT8_T, 4, 42, offsetof(mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t, led_green) }, \
} \
}
/**
* @brief Pack a set_quad_swarm_led_roll_pitch_yaw_thrust 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 group ID of the quadrotor group (0 - 255, up to 256 groups supported)
* @param mode ID of the flight mode (0 - 255, up to 256 modes supported)
* @param led_red RGB red channel (0-255)
* @param led_blue RGB green channel (0-255)
* @param led_green RGB blue channel (0-255)
* @param roll Desired roll angle in radians +-PI (+-32767)
* @param pitch Desired pitch angle in radians +-PI (+-32767)
* @param yaw Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
* @param thrust Collective thrust, scaled to uint16 (0..65535)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t group, uint8_t mode, const uint8_t *led_red, const uint8_t *led_blue, const uint8_t *led_green, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[46];
_mav_put_uint8_t(buf, 32, group);
_mav_put_uint8_t(buf, 33, mode);
_mav_put_int16_t_array(buf, 0, roll, 4);
_mav_put_int16_t_array(buf, 8, pitch, 4);
_mav_put_int16_t_array(buf, 16, yaw, 4);
_mav_put_uint16_t_array(buf, 24, thrust, 4);
_mav_put_uint8_t_array(buf, 34, led_red, 4);
_mav_put_uint8_t_array(buf, 38, led_blue, 4);
_mav_put_uint8_t_array(buf, 42, led_green, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 46);
#else
mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet;
packet.group = group;
packet.mode = mode;
mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
mav_array_memcpy(packet.led_red, led_red, sizeof(uint8_t)*4);
mav_array_memcpy(packet.led_blue, led_blue, sizeof(uint8_t)*4);
mav_array_memcpy(packet.led_green, led_green, sizeof(uint8_t)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 46);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST;
return mavlink_finalize_message(msg, system_id, component_id, 46, 130);
}
/**
* @brief Pack a set_quad_swarm_led_roll_pitch_yaw_thrust 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 group ID of the quadrotor group (0 - 255, up to 256 groups supported)
* @param mode ID of the flight mode (0 - 255, up to 256 modes supported)
* @param led_red RGB red channel (0-255)
* @param led_blue RGB green channel (0-255)
* @param led_green RGB blue channel (0-255)
* @param roll Desired roll angle in radians +-PI (+-32767)
* @param pitch Desired pitch angle in radians +-PI (+-32767)
* @param yaw Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
* @param thrust Collective thrust, scaled to uint16 (0..65535)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t group,uint8_t mode,const uint8_t *led_red,const uint8_t *led_blue,const uint8_t *led_green,const int16_t *roll,const int16_t *pitch,const int16_t *yaw,const uint16_t *thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[46];
_mav_put_uint8_t(buf, 32, group);
_mav_put_uint8_t(buf, 33, mode);
_mav_put_int16_t_array(buf, 0, roll, 4);
_mav_put_int16_t_array(buf, 8, pitch, 4);
_mav_put_int16_t_array(buf, 16, yaw, 4);
_mav_put_uint16_t_array(buf, 24, thrust, 4);
_mav_put_uint8_t_array(buf, 34, led_red, 4);
_mav_put_uint8_t_array(buf, 38, led_blue, 4);
_mav_put_uint8_t_array(buf, 42, led_green, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 46);
#else
mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet;
packet.group = group;
packet.mode = mode;
mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
mav_array_memcpy(packet.led_red, led_red, sizeof(uint8_t)*4);
mav_array_memcpy(packet.led_blue, led_blue, sizeof(uint8_t)*4);
mav_array_memcpy(packet.led_green, led_green, sizeof(uint8_t)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 46);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 46, 130);
}
/**
* @brief Encode a set_quad_swarm_led_roll_pitch_yaw_thrust struct into a message
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param set_quad_swarm_led_roll_pitch_yaw_thrust C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t* set_quad_swarm_led_roll_pitch_yaw_thrust)
{
return mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack(system_id, component_id, msg, set_quad_swarm_led_roll_pitch_yaw_thrust->group, set_quad_swarm_led_roll_pitch_yaw_thrust->mode, set_quad_swarm_led_roll_pitch_yaw_thrust->led_red, set_quad_swarm_led_roll_pitch_yaw_thrust->led_blue, set_quad_swarm_led_roll_pitch_yaw_thrust->led_green, set_quad_swarm_led_roll_pitch_yaw_thrust->roll, set_quad_swarm_led_roll_pitch_yaw_thrust->pitch, set_quad_swarm_led_roll_pitch_yaw_thrust->yaw, set_quad_swarm_led_roll_pitch_yaw_thrust->thrust);
}
/**
* @brief Send a set_quad_swarm_led_roll_pitch_yaw_thrust message
* @param chan MAVLink channel to send the message
*
* @param group ID of the quadrotor group (0 - 255, up to 256 groups supported)
* @param mode ID of the flight mode (0 - 255, up to 256 modes supported)
* @param led_red RGB red channel (0-255)
* @param led_blue RGB green channel (0-255)
* @param led_green RGB blue channel (0-255)
* @param roll Desired roll angle in radians +-PI (+-32767)
* @param pitch Desired pitch angle in radians +-PI (+-32767)
* @param yaw Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
* @param thrust Collective thrust, scaled to uint16 (0..65535)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, uint8_t group, uint8_t mode, const uint8_t *led_red, const uint8_t *led_blue, const uint8_t *led_green, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[46];
_mav_put_uint8_t(buf, 32, group);
_mav_put_uint8_t(buf, 33, mode);
_mav_put_int16_t_array(buf, 0, roll, 4);
_mav_put_int16_t_array(buf, 8, pitch, 4);
_mav_put_int16_t_array(buf, 16, yaw, 4);
_mav_put_uint16_t_array(buf, 24, thrust, 4);
_mav_put_uint8_t_array(buf, 34, led_red, 4);
_mav_put_uint8_t_array(buf, 38, led_blue, 4);
_mav_put_uint8_t_array(buf, 42, led_green, 4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, buf, 46, 130);
#else
mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet;
packet.group = group;
packet.mode = mode;
mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
mav_array_memcpy(packet.led_red, led_red, sizeof(uint8_t)*4);
mav_array_memcpy(packet.led_blue, led_blue, sizeof(uint8_t)*4);
mav_array_memcpy(packet.led_green, led_green, sizeof(uint8_t)*4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST, (const char *)&packet, 46, 130);
#endif
}
#endif
// MESSAGE SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST UNPACKING
/**
* @brief Get field group from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return ID of the quadrotor group (0 - 255, up to 256 groups supported)
*/
static inline uint8_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_group(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 32);
}
/**
* @brief Get field mode from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return ID of the flight mode (0 - 255, up to 256 modes supported)
*/
static inline uint8_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 33);
}
/**
* @brief Get field led_red from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return RGB red channel (0-255)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_led_red(const mavlink_message_t* msg, uint8_t *led_red)
{
return _MAV_RETURN_uint8_t_array(msg, led_red, 4, 34);
}
/**
* @brief Get field led_blue from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return RGB green channel (0-255)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_led_blue(const mavlink_message_t* msg, uint8_t *led_blue)
{
return _MAV_RETURN_uint8_t_array(msg, led_blue, 4, 38);
}
/**
* @brief Get field led_green from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return RGB blue channel (0-255)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_led_green(const mavlink_message_t* msg, uint8_t *led_green)
{
return _MAV_RETURN_uint8_t_array(msg, led_green, 4, 42);
}
/**
* @brief Get field roll from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return Desired roll angle in radians +-PI (+-32767)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_roll(const mavlink_message_t* msg, int16_t *roll)
{
return _MAV_RETURN_int16_t_array(msg, roll, 4, 0);
}
/**
* @brief Get field pitch from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return Desired pitch angle in radians +-PI (+-32767)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_pitch(const mavlink_message_t* msg, int16_t *pitch)
{
return _MAV_RETURN_int16_t_array(msg, pitch, 4, 8);
}
/**
* @brief Get field yaw from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_yaw(const mavlink_message_t* msg, int16_t *yaw)
{
return _MAV_RETURN_int16_t_array(msg, yaw, 4, 16);
}
/**
* @brief Get field thrust from set_quad_swarm_led_roll_pitch_yaw_thrust message
*
* @return Collective thrust, scaled to uint16 (0..65535)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_thrust(const mavlink_message_t* msg, uint16_t *thrust)
{
return _MAV_RETURN_uint16_t_array(msg, thrust, 4, 24);
}
/**
* @brief Decode a set_quad_swarm_led_roll_pitch_yaw_thrust message into a struct
*
* @param msg The message to decode
* @param set_quad_swarm_led_roll_pitch_yaw_thrust C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(const mavlink_message_t* msg, mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t* set_quad_swarm_led_roll_pitch_yaw_thrust)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_roll(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->roll);
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_pitch(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->pitch);
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_yaw(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->yaw);
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_thrust(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->thrust);
set_quad_swarm_led_roll_pitch_yaw_thrust->group = mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_group(msg);
set_quad_swarm_led_roll_pitch_yaw_thrust->mode = mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_mode(msg);
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_led_red(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->led_red);
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_led_blue(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->led_blue);
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_get_led_green(msg, set_quad_swarm_led_roll_pitch_yaw_thrust->led_green);
#else
memcpy(set_quad_swarm_led_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), 46);
#endif
}
@@ -0,0 +1,251 @@
// MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST PACKING
#define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST 61
typedef struct __mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t
{
int16_t roll[4]; ///< Desired roll angle in radians +-PI (+-32767)
int16_t pitch[4]; ///< Desired pitch angle in radians +-PI (+-32767)
int16_t yaw[4]; ///< Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
uint16_t thrust[4]; ///< Collective thrust, scaled to uint16 (0..65535)
uint8_t group; ///< ID of the quadrotor group (0 - 255, up to 256 groups supported)
uint8_t mode; ///< ID of the flight mode (0 - 255, up to 256 modes supported)
} mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t;
#define MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_LEN 34
#define MAVLINK_MSG_ID_61_LEN 34
#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_ROLL_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_PITCH_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_YAW_LEN 4
#define MAVLINK_MSG_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST_FIELD_THRUST_LEN 4
#define MAVLINK_MESSAGE_INFO_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST { \
"SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST", \
6, \
{ { "roll", NULL, MAVLINK_TYPE_INT16_T, 4, 0, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_INT16_T, 4, 8, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_INT16_T, 4, 16, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, yaw) }, \
{ "thrust", NULL, MAVLINK_TYPE_UINT16_T, 4, 24, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, thrust) }, \
{ "group", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, group) }, \
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t, mode) }, \
} \
}
/**
* @brief Pack a set_quad_swarm_roll_pitch_yaw_thrust 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 group ID of the quadrotor group (0 - 255, up to 256 groups supported)
* @param mode ID of the flight mode (0 - 255, up to 256 modes supported)
* @param roll Desired roll angle in radians +-PI (+-32767)
* @param pitch Desired pitch angle in radians +-PI (+-32767)
* @param yaw Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
* @param thrust Collective thrust, scaled to uint16 (0..65535)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t group, uint8_t mode, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[34];
_mav_put_uint8_t(buf, 32, group);
_mav_put_uint8_t(buf, 33, mode);
_mav_put_int16_t_array(buf, 0, roll, 4);
_mav_put_int16_t_array(buf, 8, pitch, 4);
_mav_put_int16_t_array(buf, 16, yaw, 4);
_mav_put_uint16_t_array(buf, 24, thrust, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34);
#else
mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet;
packet.group = group;
packet.mode = mode;
mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST;
return mavlink_finalize_message(msg, system_id, component_id, 34, 240);
}
/**
* @brief Pack a set_quad_swarm_roll_pitch_yaw_thrust 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 group ID of the quadrotor group (0 - 255, up to 256 groups supported)
* @param mode ID of the flight mode (0 - 255, up to 256 modes supported)
* @param roll Desired roll angle in radians +-PI (+-32767)
* @param pitch Desired pitch angle in radians +-PI (+-32767)
* @param yaw Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
* @param thrust Collective thrust, scaled to uint16 (0..65535)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t group,uint8_t mode,const int16_t *roll,const int16_t *pitch,const int16_t *yaw,const uint16_t *thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[34];
_mav_put_uint8_t(buf, 32, group);
_mav_put_uint8_t(buf, 33, mode);
_mav_put_int16_t_array(buf, 0, roll, 4);
_mav_put_int16_t_array(buf, 8, pitch, 4);
_mav_put_int16_t_array(buf, 16, yaw, 4);
_mav_put_uint16_t_array(buf, 24, thrust, 4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34);
#else
mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet;
packet.group = group;
packet.mode = mode;
mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 34, 240);
}
/**
* @brief Encode a set_quad_swarm_roll_pitch_yaw_thrust struct into a message
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param set_quad_swarm_roll_pitch_yaw_thrust C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t* set_quad_swarm_roll_pitch_yaw_thrust)
{
return mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(system_id, component_id, msg, set_quad_swarm_roll_pitch_yaw_thrust->group, set_quad_swarm_roll_pitch_yaw_thrust->mode, set_quad_swarm_roll_pitch_yaw_thrust->roll, set_quad_swarm_roll_pitch_yaw_thrust->pitch, set_quad_swarm_roll_pitch_yaw_thrust->yaw, set_quad_swarm_roll_pitch_yaw_thrust->thrust);
}
/**
* @brief Send a set_quad_swarm_roll_pitch_yaw_thrust message
* @param chan MAVLink channel to send the message
*
* @param group ID of the quadrotor group (0 - 255, up to 256 groups supported)
* @param mode ID of the flight mode (0 - 255, up to 256 modes supported)
* @param roll Desired roll angle in radians +-PI (+-32767)
* @param pitch Desired pitch angle in radians +-PI (+-32767)
* @param yaw Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
* @param thrust Collective thrust, scaled to uint16 (0..65535)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send(mavlink_channel_t chan, uint8_t group, uint8_t mode, const int16_t *roll, const int16_t *pitch, const int16_t *yaw, const uint16_t *thrust)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[34];
_mav_put_uint8_t(buf, 32, group);
_mav_put_uint8_t(buf, 33, mode);
_mav_put_int16_t_array(buf, 0, roll, 4);
_mav_put_int16_t_array(buf, 8, pitch, 4);
_mav_put_int16_t_array(buf, 16, yaw, 4);
_mav_put_uint16_t_array(buf, 24, thrust, 4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, buf, 34, 240);
#else
mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet;
packet.group = group;
packet.mode = mode;
mav_array_memcpy(packet.roll, roll, sizeof(int16_t)*4);
mav_array_memcpy(packet.pitch, pitch, sizeof(int16_t)*4);
mav_array_memcpy(packet.yaw, yaw, sizeof(int16_t)*4);
mav_array_memcpy(packet.thrust, thrust, sizeof(uint16_t)*4);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, (const char *)&packet, 34, 240);
#endif
}
#endif
// MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST UNPACKING
/**
* @brief Get field group from set_quad_swarm_roll_pitch_yaw_thrust message
*
* @return ID of the quadrotor group (0 - 255, up to 256 groups supported)
*/
static inline uint8_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_group(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 32);
}
/**
* @brief Get field mode from set_quad_swarm_roll_pitch_yaw_thrust message
*
* @return ID of the flight mode (0 - 255, up to 256 modes supported)
*/
static inline uint8_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 33);
}
/**
* @brief Get field roll from set_quad_swarm_roll_pitch_yaw_thrust message
*
* @return Desired roll angle in radians +-PI (+-32767)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_roll(const mavlink_message_t* msg, int16_t *roll)
{
return _MAV_RETURN_int16_t_array(msg, roll, 4, 0);
}
/**
* @brief Get field pitch from set_quad_swarm_roll_pitch_yaw_thrust message
*
* @return Desired pitch angle in radians +-PI (+-32767)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_pitch(const mavlink_message_t* msg, int16_t *pitch)
{
return _MAV_RETURN_int16_t_array(msg, pitch, 4, 8);
}
/**
* @brief Get field yaw from set_quad_swarm_roll_pitch_yaw_thrust message
*
* @return Desired yaw angle in radians, scaled to int16 +-PI (+-32767)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_yaw(const mavlink_message_t* msg, int16_t *yaw)
{
return _MAV_RETURN_int16_t_array(msg, yaw, 4, 16);
}
/**
* @brief Get field thrust from set_quad_swarm_roll_pitch_yaw_thrust message
*
* @return Collective thrust, scaled to uint16 (0..65535)
*/
static inline uint16_t mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_thrust(const mavlink_message_t* msg, uint16_t *thrust)
{
return _MAV_RETURN_uint16_t_array(msg, thrust, 4, 24);
}
/**
* @brief Decode a set_quad_swarm_roll_pitch_yaw_thrust message into a struct
*
* @param msg The message to decode
* @param set_quad_swarm_roll_pitch_yaw_thrust C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(const mavlink_message_t* msg, mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t* set_quad_swarm_roll_pitch_yaw_thrust)
{
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_roll(msg, set_quad_swarm_roll_pitch_yaw_thrust->roll);
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_pitch(msg, set_quad_swarm_roll_pitch_yaw_thrust->pitch);
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_yaw(msg, set_quad_swarm_roll_pitch_yaw_thrust->yaw);
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_thrust(msg, set_quad_swarm_roll_pitch_yaw_thrust->thrust);
set_quad_swarm_roll_pitch_yaw_thrust->group = mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_group(msg);
set_quad_swarm_roll_pitch_yaw_thrust->mode = mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_get_mode(msg);
#else
memcpy(set_quad_swarm_roll_pitch_yaw_thrust, _MAV_PAYLOAD(msg), 34);
#endif
}
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_set_roll_pitch_yaw_speed_thrust_t packet;
packet.roll_speed = roll_speed;
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(uint8_t
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST;
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_set_roll_pitch_yaw_speed_thrust_t packet;
packet.roll_speed = roll_speed;
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(uin
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST;
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_set_roll_pitch_yaw_thrust_t packet;
packet.roll = roll;
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack(uint8_t system
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST;
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
#else
mavlink_set_roll_pitch_yaw_thrust_t packet;
packet.roll = roll;
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(uint8_t s
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST;
@@ -0,0 +1,276 @@
// MESSAGE SETPOINT_6DOF PACKING
#define MAVLINK_MSG_ID_SETPOINT_6DOF 149
typedef struct __mavlink_setpoint_6dof_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_setpoint_6dof_t;
#define MAVLINK_MSG_ID_SETPOINT_6DOF_LEN 25
#define MAVLINK_MSG_ID_149_LEN 25
#define MAVLINK_MESSAGE_INFO_SETPOINT_6DOF { \
"SETPOINT_6DOF", \
7, \
{ { "trans_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_setpoint_6dof_t, trans_x) }, \
{ "trans_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_setpoint_6dof_t, trans_y) }, \
{ "trans_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_setpoint_6dof_t, trans_z) }, \
{ "rot_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_setpoint_6dof_t, rot_x) }, \
{ "rot_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_setpoint_6dof_t, rot_y) }, \
{ "rot_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_setpoint_6dof_t, rot_z) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_setpoint_6dof_t, target_system) }, \
} \
}
/**
* @brief Pack a setpoint_6dof 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_setpoint_6dof_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_setpoint_6dof_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_SETPOINT_6DOF;
return mavlink_finalize_message(msg, system_id, component_id, 25, 15);
}
/**
* @brief Pack a setpoint_6dof 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_setpoint_6dof_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_setpoint_6dof_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_SETPOINT_6DOF;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 25, 15);
}
/**
* @brief Encode a setpoint_6dof 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 setpoint_6dof C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_setpoint_6dof_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_setpoint_6dof_t* setpoint_6dof)
{
return mavlink_msg_setpoint_6dof_pack(system_id, component_id, msg, setpoint_6dof->target_system, setpoint_6dof->trans_x, setpoint_6dof->trans_y, setpoint_6dof->trans_z, setpoint_6dof->rot_x, setpoint_6dof->rot_y, setpoint_6dof->rot_z);
}
/**
* @brief Send a setpoint_6dof 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_setpoint_6dof_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_SETPOINT_6DOF, buf, 25, 15);
#else
mavlink_setpoint_6dof_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_SETPOINT_6DOF, (const char *)&packet, 25, 15);
#endif
}
#endif
// MESSAGE SETPOINT_6DOF UNPACKING
/**
* @brief Get field target_system from setpoint_6dof message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_setpoint_6dof_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 24);
}
/**
* @brief Get field trans_x from setpoint_6dof message
*
* @return Translational Component in x
*/
static inline float mavlink_msg_setpoint_6dof_get_trans_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field trans_y from setpoint_6dof message
*
* @return Translational Component in y
*/
static inline float mavlink_msg_setpoint_6dof_get_trans_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field trans_z from setpoint_6dof message
*
* @return Translational Component in z
*/
static inline float mavlink_msg_setpoint_6dof_get_trans_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field rot_x from setpoint_6dof message
*
* @return Rotational Component in x
*/
static inline float mavlink_msg_setpoint_6dof_get_rot_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field rot_y from setpoint_6dof message
*
* @return Rotational Component in y
*/
static inline float mavlink_msg_setpoint_6dof_get_rot_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field rot_z from setpoint_6dof message
*
* @return Rotational Component in z
*/
static inline float mavlink_msg_setpoint_6dof_get_rot_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Decode a setpoint_6dof message into a struct
*
* @param msg The message to decode
* @param setpoint_6dof C-struct to decode the message contents into
*/
static inline void mavlink_msg_setpoint_6dof_decode(const mavlink_message_t* msg, mavlink_setpoint_6dof_t* setpoint_6dof)
{
#if MAVLINK_NEED_BYTE_SWAP
setpoint_6dof->trans_x = mavlink_msg_setpoint_6dof_get_trans_x(msg);
setpoint_6dof->trans_y = mavlink_msg_setpoint_6dof_get_trans_y(msg);
setpoint_6dof->trans_z = mavlink_msg_setpoint_6dof_get_trans_z(msg);
setpoint_6dof->rot_x = mavlink_msg_setpoint_6dof_get_rot_x(msg);
setpoint_6dof->rot_y = mavlink_msg_setpoint_6dof_get_rot_y(msg);
setpoint_6dof->rot_z = mavlink_msg_setpoint_6dof_get_rot_z(msg);
setpoint_6dof->target_system = mavlink_msg_setpoint_6dof_get_target_system(msg);
#else
memcpy(setpoint_6dof, _MAV_PAYLOAD(msg), 25);
#endif
}
@@ -0,0 +1,320 @@
// MESSAGE SETPOINT_8DOF PACKING
#define MAVLINK_MSG_ID_SETPOINT_8DOF 148
typedef struct __mavlink_setpoint_8dof_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_setpoint_8dof_t;
#define MAVLINK_MSG_ID_SETPOINT_8DOF_LEN 33
#define MAVLINK_MSG_ID_148_LEN 33
#define MAVLINK_MESSAGE_INFO_SETPOINT_8DOF { \
"SETPOINT_8DOF", \
9, \
{ { "val1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_setpoint_8dof_t, val1) }, \
{ "val2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_setpoint_8dof_t, val2) }, \
{ "val3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_setpoint_8dof_t, val3) }, \
{ "val4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_setpoint_8dof_t, val4) }, \
{ "val5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_setpoint_8dof_t, val5) }, \
{ "val6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_setpoint_8dof_t, val6) }, \
{ "val7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_setpoint_8dof_t, val7) }, \
{ "val8", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_setpoint_8dof_t, val8) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_setpoint_8dof_t, target_system) }, \
} \
}
/**
* @brief Pack a setpoint_8dof 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_setpoint_8dof_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_setpoint_8dof_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_SETPOINT_8DOF;
return mavlink_finalize_message(msg, system_id, component_id, 33, 241);
}
/**
* @brief Pack a setpoint_8dof 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_setpoint_8dof_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_setpoint_8dof_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_SETPOINT_8DOF;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 33, 241);
}
/**
* @brief Encode a setpoint_8dof 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 setpoint_8dof C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_setpoint_8dof_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_setpoint_8dof_t* setpoint_8dof)
{
return mavlink_msg_setpoint_8dof_pack(system_id, component_id, msg, setpoint_8dof->target_system, setpoint_8dof->val1, setpoint_8dof->val2, setpoint_8dof->val3, setpoint_8dof->val4, setpoint_8dof->val5, setpoint_8dof->val6, setpoint_8dof->val7, setpoint_8dof->val8);
}
/**
* @brief Send a setpoint_8dof 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_setpoint_8dof_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_SETPOINT_8DOF, buf, 33, 241);
#else
mavlink_setpoint_8dof_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_SETPOINT_8DOF, (const char *)&packet, 33, 241);
#endif
}
#endif
// MESSAGE SETPOINT_8DOF UNPACKING
/**
* @brief Get field target_system from setpoint_8dof message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_setpoint_8dof_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 32);
}
/**
* @brief Get field val1 from setpoint_8dof message
*
* @return Value 1
*/
static inline float mavlink_msg_setpoint_8dof_get_val1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field val2 from setpoint_8dof message
*
* @return Value 2
*/
static inline float mavlink_msg_setpoint_8dof_get_val2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field val3 from setpoint_8dof message
*
* @return Value 3
*/
static inline float mavlink_msg_setpoint_8dof_get_val3(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field val4 from setpoint_8dof message
*
* @return Value 4
*/
static inline float mavlink_msg_setpoint_8dof_get_val4(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field val5 from setpoint_8dof message
*
* @return Value 5
*/
static inline float mavlink_msg_setpoint_8dof_get_val5(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field val6 from setpoint_8dof message
*
* @return Value 6
*/
static inline float mavlink_msg_setpoint_8dof_get_val6(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field val7 from setpoint_8dof message
*
* @return Value 7
*/
static inline float mavlink_msg_setpoint_8dof_get_val7(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field val8 from setpoint_8dof message
*
* @return Value 8
*/
static inline float mavlink_msg_setpoint_8dof_get_val8(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a setpoint_8dof message into a struct
*
* @param msg The message to decode
* @param setpoint_8dof C-struct to decode the message contents into
*/
static inline void mavlink_msg_setpoint_8dof_decode(const mavlink_message_t* msg, mavlink_setpoint_8dof_t* setpoint_8dof)
{
#if MAVLINK_NEED_BYTE_SWAP
setpoint_8dof->val1 = mavlink_msg_setpoint_8dof_get_val1(msg);
setpoint_8dof->val2 = mavlink_msg_setpoint_8dof_get_val2(msg);
setpoint_8dof->val3 = mavlink_msg_setpoint_8dof_get_val3(msg);
setpoint_8dof->val4 = mavlink_msg_setpoint_8dof_get_val4(msg);
setpoint_8dof->val5 = mavlink_msg_setpoint_8dof_get_val5(msg);
setpoint_8dof->val6 = mavlink_msg_setpoint_8dof_get_val6(msg);
setpoint_8dof->val7 = mavlink_msg_setpoint_8dof_get_val7(msg);
setpoint_8dof->val8 = mavlink_msg_setpoint_8dof_get_val8(msg);
setpoint_8dof->target_system = mavlink_msg_setpoint_8dof_get_target_system(msg);
#else
memcpy(setpoint_8dof, _MAV_PAYLOAD(msg), 33);
#endif
}
@@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint
_mav_put_float(buf, 28, vyErr);
_mav_put_float(buf, 32, vzErr);
memcpy(_MAV_PAYLOAD(msg), buf, 36);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36);
#else
mavlink_state_correction_t packet;
packet.xErr = xErr;
@@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_state_correction_pack(uint8_t system_id, uint
packet.vyErr = vyErr;
packet.vzErr = vzErr;
memcpy(_MAV_PAYLOAD(msg), &packet, 36);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36);
#endif
msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION;
@@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id,
_mav_put_float(buf, 28, vyErr);
_mav_put_float(buf, 32, vzErr);
memcpy(_MAV_PAYLOAD(msg), buf, 36);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36);
#else
mavlink_state_correction_t packet;
packet.xErr = xErr;
@@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_state_correction_pack_chan(uint8_t system_id,
packet.vyErr = vyErr;
packet.vzErr = vzErr;
memcpy(_MAV_PAYLOAD(msg), &packet, 36);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36);
#endif
msg->msgid = MAVLINK_MSG_ID_STATE_CORRECTION;
@@ -4,7 +4,7 @@
typedef struct __mavlink_statustext_t
{
uint8_t severity; ///< Severity of status, 0 = info message, 255 = critical fault
uint8_t severity; ///< Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
char text[50]; ///< Status text message, without null termination character
} mavlink_statustext_t;
@@ -28,7 +28,7 @@ typedef struct __mavlink_statustext_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param severity Severity of status, 0 = info message, 255 = critical fault
* @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
* @param text Status text message, without null termination character
* @return length of the message in bytes (excluding serial stream start sign)
*/
@@ -39,12 +39,12 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co
char buf[51];
_mav_put_uint8_t(buf, 0, severity);
_mav_put_char_array(buf, 1, text, 50);
memcpy(_MAV_PAYLOAD(msg), buf, 51);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51);
#else
mavlink_statustext_t packet;
packet.severity = severity;
mav_array_memcpy(packet.text, text, sizeof(char)*50);
memcpy(_MAV_PAYLOAD(msg), &packet, 51);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51);
#endif
msg->msgid = MAVLINK_MSG_ID_STATUSTEXT;
@@ -57,7 +57,7 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co
* @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 severity Severity of status, 0 = info message, 255 = critical fault
* @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
* @param text Status text message, without null termination character
* @return length of the message in bytes (excluding serial stream start sign)
*/
@@ -69,12 +69,12 @@ static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8
char buf[51];
_mav_put_uint8_t(buf, 0, severity);
_mav_put_char_array(buf, 1, text, 50);
memcpy(_MAV_PAYLOAD(msg), buf, 51);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51);
#else
mavlink_statustext_t packet;
packet.severity = severity;
mav_array_memcpy(packet.text, text, sizeof(char)*50);
memcpy(_MAV_PAYLOAD(msg), &packet, 51);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51);
#endif
msg->msgid = MAVLINK_MSG_ID_STATUSTEXT;
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t
* @brief Send a statustext message
* @param chan MAVLink channel to send the message
*
* @param severity Severity of status, 0 = info message, 255 = critical fault
* @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
* @param text Status text message, without null termination character
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
@@ -126,7 +126,7 @@ static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t s
/**
* @brief Get field severity from statustext message
*
* @return Severity of status, 0 = info message, 255 = critical fault
* @return Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
*/
static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_t* msg)
{
@@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co
_mav_put_uint16_t(buf, 28, errors_count4);
_mav_put_int8_t(buf, 30, battery_remaining);
memcpy(_MAV_PAYLOAD(msg), buf, 31);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 31);
#else
mavlink_sys_status_t packet;
packet.onboard_control_sensors_present = onboard_control_sensors_present;
@@ -101,7 +101,7 @@ static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t co
packet.errors_count4 = errors_count4;
packet.battery_remaining = battery_remaining;
memcpy(_MAV_PAYLOAD(msg), &packet, 31);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 31);
#endif
msg->msgid = MAVLINK_MSG_ID_SYS_STATUS;
@@ -149,7 +149,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8
_mav_put_uint16_t(buf, 28, errors_count4);
_mav_put_int8_t(buf, 30, battery_remaining);
memcpy(_MAV_PAYLOAD(msg), buf, 31);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 31);
#else
mavlink_sys_status_t packet;
packet.onboard_control_sensors_present = onboard_control_sensors_present;
@@ -166,7 +166,7 @@ static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8
packet.errors_count4 = errors_count4;
packet.battery_remaining = battery_remaining;
memcpy(_MAV_PAYLOAD(msg), &packet, 31);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 31);
#endif
msg->msgid = MAVLINK_MSG_ID_SYS_STATUS;
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t c
_mav_put_uint64_t(buf, 0, time_unix_usec);
_mav_put_uint32_t(buf, 8, time_boot_ms);
memcpy(_MAV_PAYLOAD(msg), buf, 12);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_system_time_t packet;
packet.time_unix_usec = time_unix_usec;
packet.time_boot_ms = time_boot_ms;
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME;
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint
_mav_put_uint64_t(buf, 0, time_unix_usec);
_mav_put_uint32_t(buf, 8, time_boot_ms);
memcpy(_MAV_PAYLOAD(msg), buf, 12);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
#else
mavlink_system_time_t packet;
packet.time_unix_usec = time_unix_usec;
packet.time_boot_ms = time_boot_ms;
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
#endif
msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME;
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo
_mav_put_int16_t(buf, 16, heading);
_mav_put_uint16_t(buf, 18, throttle);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_vfr_hud_t packet;
packet.airspeed = airspeed;
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack(uint8_t system_id, uint8_t compo
packet.heading = heading;
packet.throttle = throttle;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_VFR_HUD;
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t
_mav_put_int16_t(buf, 16, heading);
_mav_put_uint16_t(buf, 18, throttle);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_vfr_hud_t packet;
packet.airspeed = airspeed;
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_vfr_hud_pack_chan(uint8_t system_id, uint8_t
packet.heading = heading;
packet.throttle = throttle;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_VFR_HUD;
@@ -4,7 +4,7 @@
typedef struct __mavlink_vicon_position_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
@@ -38,7 +38,7 @@ typedef struct __mavlink_vicon_position_estimate_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_vicon_position_estimate_t packet;
packet.usec = usec;
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
@@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i
* @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 usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_vicon_position_estimate_t packet;
packet.usec = usec;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system
* @brief Send a vicon_position_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -187,7 +187,7 @@ static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t ch
/**
* @brief Get field usec from vicon_position_estimate message
*
* @return Timestamp (milliseconds)
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/
static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg)
{
@@ -4,7 +4,7 @@
typedef struct __mavlink_vision_position_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
@@ -38,7 +38,7 @@ typedef struct __mavlink_vision_position_estimate_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_vision_position_estimate_t packet;
packet.usec = usec;
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
@@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t 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 usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy
_mav_put_float(buf, 24, pitch);
_mav_put_float(buf, 28, yaw);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
#else
mavlink_vision_position_estimate_t packet;
packet.usec = usec;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy
packet.pitch = pitch;
packet.yaw = yaw;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t syste
* @brief Send a vision_position_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position
* @param y Global Y position
* @param z Global Z position
@@ -187,7 +187,7 @@ static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t c
/**
* @brief Get field usec from vision_position_estimate message
*
* @return Timestamp (milliseconds)
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/
static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg)
{
@@ -4,7 +4,7 @@
typedef struct __mavlink_vision_speed_estimate_t
{
uint64_t usec; ///< Timestamp (milliseconds)
uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float x; ///< Global X speed
float y; ///< Global Y speed
float z; ///< Global Z speed
@@ -32,7 +32,7 @@ typedef struct __mavlink_vision_speed_estimate_t
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id,
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_vision_speed_estimate_t packet;
packet.usec = usec;
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id,
packet.y = y;
packet.z = z;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
@@ -69,7 +69,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id,
* @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 usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
#else
mavlink_vision_speed_estimate_t packet;
packet.usec = usec;
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste
packet.y = y;
packet.z = z;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_i
* @brief Send a vision_speed_estimate message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (milliseconds)
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X speed
* @param y Global Y speed
* @param z Global Z speed
@@ -154,7 +154,7 @@ static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan
/**
* @brief Get field usec from vision_speed_estimate message
*
* @return Timestamp (milliseconds)
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/
static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg)
{
+803 -75
View File
@@ -2526,6 +2526,110 @@ static void mavlink_test_roll_pitch_yaw_speed_thrust_setpoint(uint8_t system_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_set_quad_motors_setpoint(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_set_quad_motors_setpoint_t packet_in = {
17235,
17339,
17443,
17547,
29,
};
mavlink_set_quad_motors_setpoint_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.motor_front_nw = packet_in.motor_front_nw;
packet1.motor_right_ne = packet_in.motor_right_ne;
packet1.motor_back_se = packet_in.motor_back_se;
packet1.motor_left_sw = packet_in.motor_left_sw;
packet1.target_system = packet_in.target_system;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_motors_setpoint_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_set_quad_motors_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_motors_setpoint_pack(system_id, component_id, &msg , packet1.target_system , packet1.motor_front_nw , packet1.motor_right_ne , packet1.motor_back_se , packet1.motor_left_sw );
mavlink_msg_set_quad_motors_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_motors_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.motor_front_nw , packet1.motor_right_ne , packet1.motor_back_se , packet1.motor_left_sw );
mavlink_msg_set_quad_motors_setpoint_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_set_quad_motors_setpoint_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_motors_setpoint_send(MAVLINK_COMM_1 , packet1.target_system , packet1.motor_front_nw , packet1.motor_right_ne , packet1.motor_back_se , packet1.motor_left_sw );
mavlink_msg_set_quad_motors_setpoint_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_set_quad_swarm_roll_pitch_yaw_thrust(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_set_quad_swarm_roll_pitch_yaw_thrust_t packet_in = {
{ 17235, 17236, 17237, 17238 },
{ 17651, 17652, 17653, 17654 },
{ 18067, 18068, 18069, 18070 },
{ 18483, 18484, 18485, 18486 },
101,
168,
};
mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.group = packet_in.group;
packet1.mode = packet_in.mode;
mav_array_memcpy(packet1.roll, packet_in.roll, sizeof(int16_t)*4);
mav_array_memcpy(packet1.pitch, packet_in.pitch, sizeof(int16_t)*4);
mav_array_memcpy(packet1.yaw, packet_in.yaw, sizeof(int16_t)*4);
mav_array_memcpy(packet1.thrust, packet_in.thrust, sizeof(uint16_t)*4);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(system_id, component_id, &msg , packet1.group , packet1.mode , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.group , packet1.mode , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_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_set_quad_swarm_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send(MAVLINK_COMM_1 , packet1.group , packet1.mode , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
@@ -2583,6 +2687,65 @@ static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t compon
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_set_quad_swarm_led_roll_pitch_yaw_thrust(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_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet_in = {
{ 17235, 17236, 17237, 17238 },
{ 17651, 17652, 17653, 17654 },
{ 18067, 18068, 18069, 18070 },
{ 18483, 18484, 18485, 18486 },
101,
168,
{ 235, 236, 237, 238 },
{ 247, 248, 249, 250 },
{ 3, 4, 5, 6 },
};
mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.group = packet_in.group;
packet1.mode = packet_in.mode;
mav_array_memcpy(packet1.roll, packet_in.roll, sizeof(int16_t)*4);
mav_array_memcpy(packet1.pitch, packet_in.pitch, sizeof(int16_t)*4);
mav_array_memcpy(packet1.yaw, packet_in.yaw, sizeof(int16_t)*4);
mav_array_memcpy(packet1.thrust, packet_in.thrust, sizeof(uint16_t)*4);
mav_array_memcpy(packet1.led_red, packet_in.led_red, sizeof(uint8_t)*4);
mav_array_memcpy(packet1.led_blue, packet_in.led_blue, sizeof(uint8_t)*4);
mav_array_memcpy(packet1.led_green, packet_in.led_green, sizeof(uint8_t)*4);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack(system_id, component_id, &msg , packet1.group , packet1.mode , packet1.led_red , packet1.led_blue , packet1.led_green , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.group , packet1.mode , packet1.led_red , packet1.led_blue , packet1.led_green , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_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_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_send(MAVLINK_COMM_1 , packet1.group , packet1.mode , packet1.led_red , packet1.led_blue , packet1.led_green , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_state_correction(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
@@ -2746,27 +2909,21 @@ static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id,
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_manual_control_t packet_in = {
17.0,
45.0,
73.0,
101.0,
53,
120,
187,
254,
65,
17235,
17339,
17443,
17547,
17651,
163,
};
mavlink_manual_control_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
packet1.thrust = packet_in.thrust;
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.r = packet_in.r;
packet1.buttons = packet_in.buttons;
packet1.target = packet_in.target;
packet1.roll_manual = packet_in.roll_manual;
packet1.pitch_manual = packet_in.pitch_manual;
packet1.yaw_manual = packet_in.yaw_manual;
packet1.thrust_manual = packet_in.thrust_manual;
@@ -2776,12 +2933,12 @@ static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.roll_manual , packet1.pitch_manual , packet1.yaw_manual , packet1.thrust_manual );
mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
mavlink_msg_manual_control_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.roll_manual , packet1.pitch_manual , packet1.yaw_manual , packet1.thrust_manual );
mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
mavlink_msg_manual_control_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
@@ -2794,7 +2951,7 @@ static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_manual_control_send(MAVLINK_COMM_1 , packet1.target , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.roll_manual , packet1.pitch_manual , packet1.yaw_manual , packet1.thrust_manual );
mavlink_msg_manual_control_send(MAVLINK_COMM_1 , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
mavlink_msg_manual_control_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
@@ -3021,6 +3178,167 @@ static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, ma
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_roll_pitch_yaw_rates_thrust_setpoint(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_roll_pitch_yaw_rates_thrust_setpoint_t packet_in = {
963497464,
45.0,
73.0,
101.0,
129.0,
};
mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_boot_ms = packet_in.time_boot_ms;
packet1.roll_rate = packet_in.roll_rate;
packet1.pitch_rate = packet_in.pitch_rate;
packet1.yaw_rate = packet_in.yaw_rate;
packet1.thrust = packet_in.thrust;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate , packet1.thrust );
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate , packet1.thrust );
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_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_roll_pitch_yaw_rates_thrust_setpoint_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate , packet1.thrust );
mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_manual_setpoint(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_manual_setpoint_t packet_in = {
963497464,
45.0,
73.0,
101.0,
129.0,
65,
132,
};
mavlink_manual_setpoint_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_boot_ms = packet_in.time_boot_ms;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
packet1.thrust = packet_in.thrust;
packet1.mode_switch = packet_in.mode_switch;
packet1.manual_override_switch = packet_in.manual_override_switch;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_manual_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_manual_setpoint_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
mavlink_msg_manual_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
mavlink_msg_manual_setpoint_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_manual_setpoint_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_manual_setpoint_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_local_position_ned_system_global_offset(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_local_position_ned_system_global_offset_t packet_in = {
963497464,
45.0,
73.0,
101.0,
129.0,
157.0,
185.0,
};
mavlink_local_position_ned_system_global_offset_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_boot_ms = packet_in.time_boot_ms;
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_local_position_ned_system_global_offset_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_local_position_ned_system_global_offset_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_local_position_ned_system_global_offset_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_hil_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
@@ -3234,14 +3552,18 @@ static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, m
mavlink_optical_flow_t packet_in = {
93372036854775807ULL,
73.0,
17859,
17963,
53,
120,
101.0,
129.0,
18275,
18379,
77,
144,
};
mavlink_optical_flow_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_usec = packet_in.time_usec;
packet1.flow_comp_m_x = packet_in.flow_comp_m_x;
packet1.flow_comp_m_y = packet_in.flow_comp_m_y;
packet1.ground_distance = packet_in.ground_distance;
packet1.flow_x = packet_in.flow_x;
packet1.flow_y = packet_in.flow_y;
@@ -3256,12 +3578,12 @@ static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, m
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.quality , packet1.ground_distance );
mavlink_msg_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance );
mavlink_msg_optical_flow_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.quality , packet1.ground_distance );
mavlink_msg_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance );
mavlink_msg_optical_flow_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
@@ -3274,7 +3596,7 @@ static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, m
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.quality , packet1.ground_distance );
mavlink_msg_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance );
mavlink_msg_optical_flow_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
@@ -3493,6 +3815,446 @@ static void mavlink_test_vicon_position_estimate(uint8_t system_id, uint8_t comp
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_highres_imu(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_highres_imu_t packet_in = {
93372036854775807ULL,
73.0,
101.0,
129.0,
157.0,
185.0,
213.0,
241.0,
269.0,
297.0,
325.0,
353.0,
381.0,
409.0,
20355,
};
mavlink_highres_imu_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.time_usec = packet_in.time_usec;
packet1.xacc = packet_in.xacc;
packet1.yacc = packet_in.yacc;
packet1.zacc = packet_in.zacc;
packet1.xgyro = packet_in.xgyro;
packet1.ygyro = packet_in.ygyro;
packet1.zgyro = packet_in.zgyro;
packet1.xmag = packet_in.xmag;
packet1.ymag = packet_in.ymag;
packet1.zmag = packet_in.zmag;
packet1.abs_pressure = packet_in.abs_pressure;
packet1.diff_pressure = packet_in.diff_pressure;
packet1.pressure_alt = packet_in.pressure_alt;
packet1.temperature = packet_in.temperature;
packet1.fields_updated = packet_in.fields_updated;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_highres_imu_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_highres_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
mavlink_msg_highres_imu_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_highres_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
mavlink_msg_highres_imu_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_highres_imu_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_highres_imu_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
mavlink_msg_highres_imu_decode(last_msg, &packet2);
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;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_file_transfer_start_t packet_in = {
93372036854775807ULL,
963497880,
"MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",
249,
60,
};
mavlink_file_transfer_start_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.transfer_uid = packet_in.transfer_uid;
packet1.file_size = packet_in.file_size;
packet1.direction = packet_in.direction;
packet1.flags = packet_in.flags;
mav_array_memcpy(packet1.dest_path, packet_in.dest_path, sizeof(char)*240);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_start_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_file_transfer_start_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_start_pack(system_id, component_id, &msg , packet1.transfer_uid , packet1.dest_path , packet1.direction , packet1.file_size , packet1.flags );
mavlink_msg_file_transfer_start_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_start_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.transfer_uid , packet1.dest_path , packet1.direction , packet1.file_size , packet1.flags );
mavlink_msg_file_transfer_start_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_file_transfer_start_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_start_send(MAVLINK_COMM_1 , packet1.transfer_uid , packet1.dest_path , packet1.direction , packet1.file_size , packet1.flags );
mavlink_msg_file_transfer_start_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_file_transfer_dir_list(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_file_transfer_dir_list_t packet_in = {
93372036854775807ULL,
"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM",
237,
};
mavlink_file_transfer_dir_list_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.transfer_uid = packet_in.transfer_uid;
packet1.flags = packet_in.flags;
mav_array_memcpy(packet1.dir_path, packet_in.dir_path, sizeof(char)*240);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_dir_list_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_file_transfer_dir_list_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_dir_list_pack(system_id, component_id, &msg , packet1.transfer_uid , packet1.dir_path , packet1.flags );
mavlink_msg_file_transfer_dir_list_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_dir_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.transfer_uid , packet1.dir_path , packet1.flags );
mavlink_msg_file_transfer_dir_list_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_file_transfer_dir_list_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_dir_list_send(MAVLINK_COMM_1 , packet1.transfer_uid , packet1.dir_path , packet1.flags );
mavlink_msg_file_transfer_dir_list_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_file_transfer_res(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_file_transfer_res_t packet_in = {
93372036854775807ULL,
29,
};
mavlink_file_transfer_res_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.transfer_uid = packet_in.transfer_uid;
packet1.result = packet_in.result;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_res_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_file_transfer_res_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_res_pack(system_id, component_id, &msg , packet1.transfer_uid , packet1.result );
mavlink_msg_file_transfer_res_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_res_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.transfer_uid , packet1.result );
mavlink_msg_file_transfer_res_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_file_transfer_res_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_file_transfer_res_send(MAVLINK_COMM_1 , packet1.transfer_uid , packet1.result );
mavlink_msg_file_transfer_res_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_battery_status(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_battery_status_t packet_in = {
17235,
17339,
17443,
17547,
17651,
17755,
17859,
175,
242,
};
mavlink_battery_status_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.voltage_cell_1 = packet_in.voltage_cell_1;
packet1.voltage_cell_2 = packet_in.voltage_cell_2;
packet1.voltage_cell_3 = packet_in.voltage_cell_3;
packet1.voltage_cell_4 = packet_in.voltage_cell_4;
packet1.voltage_cell_5 = packet_in.voltage_cell_5;
packet1.voltage_cell_6 = packet_in.voltage_cell_6;
packet1.current_battery = packet_in.current_battery;
packet1.accu_id = packet_in.accu_id;
packet1.battery_remaining = packet_in.battery_remaining;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_battery_status_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_battery_status_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.accu_id , packet1.voltage_cell_1 , packet1.voltage_cell_2 , packet1.voltage_cell_3 , packet1.voltage_cell_4 , packet1.voltage_cell_5 , packet1.voltage_cell_6 , packet1.current_battery , packet1.battery_remaining );
mavlink_msg_battery_status_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.accu_id , packet1.voltage_cell_1 , packet1.voltage_cell_2 , packet1.voltage_cell_3 , packet1.voltage_cell_4 , packet1.voltage_cell_5 , packet1.voltage_cell_6 , packet1.current_battery , packet1.battery_remaining );
mavlink_msg_battery_status_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_battery_status_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_battery_status_send(MAVLINK_COMM_1 , packet1.accu_id , packet1.voltage_cell_1 , packet1.voltage_cell_2 , packet1.voltage_cell_3 , packet1.voltage_cell_4 , packet1.voltage_cell_5 , packet1.voltage_cell_6 , packet1.current_battery , packet1.battery_remaining );
mavlink_msg_battery_status_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_setpoint_8dof(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_setpoint_8dof_t packet_in = {
17.0,
45.0,
73.0,
101.0,
129.0,
157.0,
185.0,
213.0,
101,
};
mavlink_setpoint_8dof_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.val1 = packet_in.val1;
packet1.val2 = packet_in.val2;
packet1.val3 = packet_in.val3;
packet1.val4 = packet_in.val4;
packet1.val5 = packet_in.val5;
packet1.val6 = packet_in.val6;
packet1.val7 = packet_in.val7;
packet1.val8 = packet_in.val8;
packet1.target_system = packet_in.target_system;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_setpoint_8dof_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_setpoint_8dof_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_setpoint_8dof_pack(system_id, component_id, &msg , packet1.target_system , packet1.val1 , packet1.val2 , packet1.val3 , packet1.val4 , packet1.val5 , packet1.val6 , packet1.val7 , packet1.val8 );
mavlink_msg_setpoint_8dof_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_setpoint_8dof_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.val1 , packet1.val2 , packet1.val3 , packet1.val4 , packet1.val5 , packet1.val6 , packet1.val7 , packet1.val8 );
mavlink_msg_setpoint_8dof_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_setpoint_8dof_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_setpoint_8dof_send(MAVLINK_COMM_1 , packet1.target_system , packet1.val1 , packet1.val2 , packet1.val3 , packet1.val4 , packet1.val5 , packet1.val6 , packet1.val7 , packet1.val8 );
mavlink_msg_setpoint_8dof_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_setpoint_6dof(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_setpoint_6dof_t packet_in = {
17.0,
45.0,
73.0,
101.0,
129.0,
157.0,
77,
};
mavlink_setpoint_6dof_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.trans_x = packet_in.trans_x;
packet1.trans_y = packet_in.trans_y;
packet1.trans_z = packet_in.trans_z;
packet1.rot_x = packet_in.rot_x;
packet1.rot_y = packet_in.rot_y;
packet1.rot_z = packet_in.rot_z;
packet1.target_system = packet_in.target_system;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_setpoint_6dof_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_setpoint_6dof_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_setpoint_6dof_pack(system_id, component_id, &msg , packet1.target_system , packet1.trans_x , packet1.trans_y , packet1.trans_z , packet1.rot_x , packet1.rot_y , packet1.rot_z );
mavlink_msg_setpoint_6dof_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_setpoint_6dof_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.trans_x , packet1.trans_y , packet1.trans_z , packet1.rot_x , packet1.rot_y , packet1.rot_z );
mavlink_msg_setpoint_6dof_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_setpoint_6dof_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_setpoint_6dof_send(MAVLINK_COMM_1 , packet1.target_system , packet1.trans_x , packet1.trans_y , packet1.trans_z , packet1.rot_x , packet1.rot_y , packet1.rot_z );
mavlink_msg_setpoint_6dof_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_memory_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
@@ -3779,53 +4541,6 @@ static void mavlink_test_debug(uint8_t system_id, uint8_t component_id, mavlink_
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_extended_message(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_extended_message_t packet_in = {
5,
72,
139,
};
mavlink_extended_message_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.target_system = packet_in.target_system;
packet1.target_component = packet_in.target_component;
packet1.protocol_flags = packet_in.protocol_flags;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_extended_message_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_extended_message_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_extended_message_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.protocol_flags );
mavlink_msg_extended_message_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_extended_message_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.protocol_flags );
mavlink_msg_extended_message_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_extended_message_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_extended_message_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.protocol_flags );
mavlink_msg_extended_message_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_heartbeat(system_id, component_id, last_msg);
@@ -3876,7 +4591,10 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_set_roll_pitch_yaw_speed_thrust(system_id, component_id, last_msg);
mavlink_test_roll_pitch_yaw_thrust_setpoint(system_id, component_id, last_msg);
mavlink_test_roll_pitch_yaw_speed_thrust_setpoint(system_id, component_id, last_msg);
mavlink_test_set_quad_motors_setpoint(system_id, component_id, last_msg);
mavlink_test_set_quad_swarm_roll_pitch_yaw_thrust(system_id, component_id, last_msg);
mavlink_test_nav_controller_output(system_id, component_id, last_msg);
mavlink_test_set_quad_swarm_led_roll_pitch_yaw_thrust(system_id, component_id, last_msg);
mavlink_test_state_correction(system_id, component_id, last_msg);
mavlink_test_request_data_stream(system_id, component_id, last_msg);
mavlink_test_data_stream(system_id, component_id, last_msg);
@@ -3885,6 +4603,9 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_vfr_hud(system_id, component_id, last_msg);
mavlink_test_command_long(system_id, component_id, last_msg);
mavlink_test_command_ack(system_id, component_id, last_msg);
mavlink_test_roll_pitch_yaw_rates_thrust_setpoint(system_id, component_id, last_msg);
mavlink_test_manual_setpoint(system_id, component_id, last_msg);
mavlink_test_local_position_ned_system_global_offset(system_id, component_id, last_msg);
mavlink_test_hil_state(system_id, component_id, last_msg);
mavlink_test_hil_controls(system_id, component_id, last_msg);
mavlink_test_hil_rc_inputs_raw(system_id, component_id, last_msg);
@@ -3893,13 +4614,20 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
mavlink_test_vision_position_estimate(system_id, component_id, last_msg);
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);
mavlink_test_battery_status(system_id, component_id, last_msg);
mavlink_test_setpoint_8dof(system_id, component_id, last_msg);
mavlink_test_setpoint_6dof(system_id, component_id, last_msg);
mavlink_test_memory_vect(system_id, component_id, last_msg);
mavlink_test_debug_vect(system_id, component_id, last_msg);
mavlink_test_named_value_float(system_id, component_id, last_msg);
mavlink_test_named_value_int(system_id, component_id, last_msg);
mavlink_test_statustext(system_id, component_id, last_msg);
mavlink_test_debug(system_id, component_id, last_msg);
mavlink_test_extended_message(system_id, component_id, last_msg);
}
#ifdef __cplusplus
@@ -5,8 +5,8 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Sat Oct 29 18:27:33 2011"
#define MAVLINK_BUILD_DATE "Thu Apr 4 18:57:14 2013"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254
#endif // MAVLINK_VERSION_H