[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:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,276 @@
|
||||
// MESSAGE AHRS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS 163
|
||||
|
||||
typedef struct __mavlink_ahrs_t
|
||||
{
|
||||
float omegaIx; ///< X gyro drift estimate rad/s
|
||||
float omegaIy; ///< Y gyro drift estimate rad/s
|
||||
float omegaIz; ///< Z gyro drift estimate rad/s
|
||||
float accel_weight; ///< average accel_weight
|
||||
float renorm_val; ///< average renormalisation value
|
||||
float error_rp; ///< average error_roll_pitch value
|
||||
float error_yaw; ///< average error_yaw value
|
||||
} mavlink_ahrs_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS_LEN 28
|
||||
#define MAVLINK_MSG_ID_163_LEN 28
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_AHRS { \
|
||||
"AHRS", \
|
||||
7, \
|
||||
{ { "omegaIx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs_t, omegaIx) }, \
|
||||
{ "omegaIy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs_t, omegaIy) }, \
|
||||
{ "omegaIz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs_t, omegaIz) }, \
|
||||
{ "accel_weight", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs_t, accel_weight) }, \
|
||||
{ "renorm_val", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_ahrs_t, renorm_val) }, \
|
||||
{ "error_rp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_ahrs_t, error_rp) }, \
|
||||
{ "error_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_ahrs_t, error_yaw) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a ahrs 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 omegaIx X gyro drift estimate rad/s
|
||||
* @param omegaIy Y gyro drift estimate rad/s
|
||||
* @param omegaIz Z gyro drift estimate rad/s
|
||||
* @param accel_weight average accel_weight
|
||||
* @param renorm_val average renormalisation value
|
||||
* @param error_rp average error_roll_pitch value
|
||||
* @param error_yaw average error_yaw value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_float(buf, 0, omegaIx);
|
||||
_mav_put_float(buf, 4, omegaIy);
|
||||
_mav_put_float(buf, 8, omegaIz);
|
||||
_mav_put_float(buf, 12, accel_weight);
|
||||
_mav_put_float(buf, 16, renorm_val);
|
||||
_mav_put_float(buf, 20, error_rp);
|
||||
_mav_put_float(buf, 24, error_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_ahrs_t packet;
|
||||
packet.omegaIx = omegaIx;
|
||||
packet.omegaIy = omegaIy;
|
||||
packet.omegaIz = omegaIz;
|
||||
packet.accel_weight = accel_weight;
|
||||
packet.renorm_val = renorm_val;
|
||||
packet.error_rp = error_rp;
|
||||
packet.error_yaw = error_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 28, 127);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a ahrs 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 omegaIx X gyro drift estimate rad/s
|
||||
* @param omegaIy Y gyro drift estimate rad/s
|
||||
* @param omegaIz Z gyro drift estimate rad/s
|
||||
* @param accel_weight average accel_weight
|
||||
* @param renorm_val average renormalisation value
|
||||
* @param error_rp average error_roll_pitch value
|
||||
* @param error_yaw average error_yaw value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float omegaIx,float omegaIy,float omegaIz,float accel_weight,float renorm_val,float error_rp,float error_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_float(buf, 0, omegaIx);
|
||||
_mav_put_float(buf, 4, omegaIy);
|
||||
_mav_put_float(buf, 8, omegaIz);
|
||||
_mav_put_float(buf, 12, accel_weight);
|
||||
_mav_put_float(buf, 16, renorm_val);
|
||||
_mav_put_float(buf, 20, error_rp);
|
||||
_mav_put_float(buf, 24, error_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_ahrs_t packet;
|
||||
packet.omegaIx = omegaIx;
|
||||
packet.omegaIy = omegaIy;
|
||||
packet.omegaIz = omegaIz;
|
||||
packet.accel_weight = accel_weight;
|
||||
packet.renorm_val = renorm_val;
|
||||
packet.error_rp = error_rp;
|
||||
packet.error_yaw = error_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 127);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ahrs 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 ahrs C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ahrs_t* ahrs)
|
||||
{
|
||||
return mavlink_msg_ahrs_pack(system_id, component_id, msg, ahrs->omegaIx, ahrs->omegaIy, ahrs->omegaIz, ahrs->accel_weight, ahrs->renorm_val, ahrs->error_rp, ahrs->error_yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ahrs message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param omegaIx X gyro drift estimate rad/s
|
||||
* @param omegaIy Y gyro drift estimate rad/s
|
||||
* @param omegaIz Z gyro drift estimate rad/s
|
||||
* @param accel_weight average accel_weight
|
||||
* @param renorm_val average renormalisation value
|
||||
* @param error_rp average error_roll_pitch value
|
||||
* @param error_yaw average error_yaw value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_ahrs_send(mavlink_channel_t chan, float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_float(buf, 0, omegaIx);
|
||||
_mav_put_float(buf, 4, omegaIy);
|
||||
_mav_put_float(buf, 8, omegaIz);
|
||||
_mav_put_float(buf, 12, accel_weight);
|
||||
_mav_put_float(buf, 16, renorm_val);
|
||||
_mav_put_float(buf, 20, error_rp);
|
||||
_mav_put_float(buf, 24, error_yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, buf, 28, 127);
|
||||
#else
|
||||
mavlink_ahrs_t packet;
|
||||
packet.omegaIx = omegaIx;
|
||||
packet.omegaIy = omegaIy;
|
||||
packet.omegaIz = omegaIz;
|
||||
packet.accel_weight = accel_weight;
|
||||
packet.renorm_val = renorm_val;
|
||||
packet.error_rp = error_rp;
|
||||
packet.error_yaw = error_yaw;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, (const char *)&packet, 28, 127);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AHRS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field omegaIx from ahrs message
|
||||
*
|
||||
* @return X gyro drift estimate rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_omegaIx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field omegaIy from ahrs message
|
||||
*
|
||||
* @return Y gyro drift estimate rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_omegaIy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field omegaIz from ahrs message
|
||||
*
|
||||
* @return Z gyro drift estimate rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_omegaIz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accel_weight from ahrs message
|
||||
*
|
||||
* @return average accel_weight
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_accel_weight(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field renorm_val from ahrs message
|
||||
*
|
||||
* @return average renormalisation value
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_renorm_val(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field error_rp from ahrs message
|
||||
*
|
||||
* @return average error_roll_pitch value
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_error_rp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field error_yaw from ahrs message
|
||||
*
|
||||
* @return average error_yaw value
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_error_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a ahrs message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param ahrs C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs_decode(const mavlink_message_t* msg, mavlink_ahrs_t* ahrs)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
ahrs->omegaIx = mavlink_msg_ahrs_get_omegaIx(msg);
|
||||
ahrs->omegaIy = mavlink_msg_ahrs_get_omegaIy(msg);
|
||||
ahrs->omegaIz = mavlink_msg_ahrs_get_omegaIz(msg);
|
||||
ahrs->accel_weight = mavlink_msg_ahrs_get_accel_weight(msg);
|
||||
ahrs->renorm_val = mavlink_msg_ahrs_get_renorm_val(msg);
|
||||
ahrs->error_rp = mavlink_msg_ahrs_get_error_rp(msg);
|
||||
ahrs->error_yaw = mavlink_msg_ahrs_get_error_yaw(msg);
|
||||
#else
|
||||
memcpy(ahrs, _MAV_PAYLOAD(msg), 28);
|
||||
#endif
|
||||
}
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon
|
||||
_mav_put_uint16_t(buf, 8, adc5);
|
||||
_mav_put_uint16_t(buf, 10, adc6);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_ap_adc_t packet;
|
||||
packet.adc1 = adc1;
|
||||
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon
|
||||
packet.adc5 = adc5;
|
||||
packet.adc6 = adc6;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AP_ADC;
|
||||
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint16_t(buf, 8, adc5);
|
||||
_mav_put_uint16_t(buf, 10, adc6);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_ap_adc_t packet;
|
||||
packet.adc1 = adc1;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c
|
||||
packet.adc5 = adc5;
|
||||
packet.adc6 = adc6;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AP_ADC;
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE DATA16 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA16 169
|
||||
|
||||
typedef struct __mavlink_data16_t
|
||||
{
|
||||
uint8_t type; ///< data type
|
||||
uint8_t len; ///< data length
|
||||
uint8_t data[16]; ///< raw data
|
||||
} mavlink_data16_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA16_LEN 18
|
||||
#define MAVLINK_MSG_ID_169_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_DATA16_FIELD_DATA_LEN 16
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_DATA16 { \
|
||||
"DATA16", \
|
||||
3, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_data16_t, type) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_data16_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 16, 2, offsetof(mavlink_data16_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a data16 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 type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_data16_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA16;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 18, 234);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data16 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 type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_data16_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA16;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 234);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data16 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 data16 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data16_t* data16)
|
||||
{
|
||||
return mavlink_msg_data16_pack(system_id, component_id, msg, data16->type, data16->len, data16->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data16 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data16_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 16);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, buf, 18, 234);
|
||||
#else
|
||||
mavlink_data16_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, (const char *)&packet, 18, 234);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA16 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data16 message
|
||||
*
|
||||
* @return data type
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data16_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from data16 message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data16_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from data16 message
|
||||
*
|
||||
* @return raw data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 16, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data16 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data16 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data16_decode(const mavlink_message_t* msg, mavlink_data16_t* data16)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
data16->type = mavlink_msg_data16_get_type(msg);
|
||||
data16->len = mavlink_msg_data16_get_len(msg);
|
||||
mavlink_msg_data16_get_data(msg, data16->data);
|
||||
#else
|
||||
memcpy(data16, _MAV_PAYLOAD(msg), 18);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE DATA32 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA32 170
|
||||
|
||||
typedef struct __mavlink_data32_t
|
||||
{
|
||||
uint8_t type; ///< data type
|
||||
uint8_t len; ///< data length
|
||||
uint8_t data[32]; ///< raw data
|
||||
} mavlink_data32_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA32_LEN 34
|
||||
#define MAVLINK_MSG_ID_170_LEN 34
|
||||
|
||||
#define MAVLINK_MSG_DATA32_FIELD_DATA_LEN 32
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_DATA32 { \
|
||||
"DATA32", \
|
||||
3, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_data32_t, type) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_data32_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 32, 2, offsetof(mavlink_data32_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a data32 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 type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[34];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34);
|
||||
#else
|
||||
mavlink_data32_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA32;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 34, 73);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data32 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 type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[34];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34);
|
||||
#else
|
||||
mavlink_data32_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA32;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 34, 73);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data32 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 data32 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data32_t* data32)
|
||||
{
|
||||
return mavlink_msg_data32_pack(system_id, component_id, msg, data32->type, data32->len, data32->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data32 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data32_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[34];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, buf, 34, 73);
|
||||
#else
|
||||
mavlink_data32_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, (const char *)&packet, 34, 73);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA32 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data32 message
|
||||
*
|
||||
* @return data type
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data32_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from data32 message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data32_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from data32 message
|
||||
*
|
||||
* @return raw data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 32, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data32 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data32 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data32_decode(const mavlink_message_t* msg, mavlink_data32_t* data32)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
data32->type = mavlink_msg_data32_get_type(msg);
|
||||
data32->len = mavlink_msg_data32_get_len(msg);
|
||||
mavlink_msg_data32_get_data(msg, data32->data);
|
||||
#else
|
||||
memcpy(data32, _MAV_PAYLOAD(msg), 34);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE DATA64 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA64 171
|
||||
|
||||
typedef struct __mavlink_data64_t
|
||||
{
|
||||
uint8_t type; ///< data type
|
||||
uint8_t len; ///< data length
|
||||
uint8_t data[64]; ///< raw data
|
||||
} mavlink_data64_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA64_LEN 66
|
||||
#define MAVLINK_MSG_ID_171_LEN 66
|
||||
|
||||
#define MAVLINK_MSG_DATA64_FIELD_DATA_LEN 64
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_DATA64 { \
|
||||
"DATA64", \
|
||||
3, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_data64_t, type) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_data64_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 64, 2, offsetof(mavlink_data64_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a data64 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 type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[66];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 64);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 66);
|
||||
#else
|
||||
mavlink_data64_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 66);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA64;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 66, 181);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data64 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 type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[66];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 64);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 66);
|
||||
#else
|
||||
mavlink_data64_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 66);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA64;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 66, 181);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data64 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 data64 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data64_t* data64)
|
||||
{
|
||||
return mavlink_msg_data64_pack(system_id, component_id, msg, data64->type, data64->len, data64->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data64 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data64_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[66];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 64);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, buf, 66, 181);
|
||||
#else
|
||||
mavlink_data64_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, (const char *)&packet, 66, 181);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA64 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data64 message
|
||||
*
|
||||
* @return data type
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data64_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from data64 message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data64_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from data64 message
|
||||
*
|
||||
* @return raw data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 64, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data64 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data64 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data64_decode(const mavlink_message_t* msg, mavlink_data64_t* data64)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
data64->type = mavlink_msg_data64_get_type(msg);
|
||||
data64->len = mavlink_msg_data64_get_len(msg);
|
||||
mavlink_msg_data64_get_data(msg, data64->data);
|
||||
#else
|
||||
memcpy(data64, _MAV_PAYLOAD(msg), 66);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE DATA96 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA96 172
|
||||
|
||||
typedef struct __mavlink_data96_t
|
||||
{
|
||||
uint8_t type; ///< data type
|
||||
uint8_t len; ///< data length
|
||||
uint8_t data[96]; ///< raw data
|
||||
} mavlink_data96_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA96_LEN 98
|
||||
#define MAVLINK_MSG_ID_172_LEN 98
|
||||
|
||||
#define MAVLINK_MSG_DATA96_FIELD_DATA_LEN 96
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_DATA96 { \
|
||||
"DATA96", \
|
||||
3, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_data96_t, type) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_data96_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 96, 2, offsetof(mavlink_data96_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a data96 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 type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[98];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 96);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 98);
|
||||
#else
|
||||
mavlink_data96_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 98);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA96;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 98, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data96 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 type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[98];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 96);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 98);
|
||||
#else
|
||||
mavlink_data96_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 98);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA96;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 98, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data96 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 data96 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data96_t* data96)
|
||||
{
|
||||
return mavlink_msg_data96_pack(system_id, component_id, msg, data96->type, data96->len, data96->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data96 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data96_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[98];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 96);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, buf, 98, 22);
|
||||
#else
|
||||
mavlink_data96_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, (const char *)&packet, 98, 22);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA96 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data96 message
|
||||
*
|
||||
* @return data type
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data96_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from data96 message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data96_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from data96 message
|
||||
*
|
||||
* @return raw data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 96, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data96 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data96 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data96_decode(const mavlink_message_t* msg, mavlink_data96_t* data96)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
data96->type = mavlink_msg_data96_get_type(msg);
|
||||
data96->len = mavlink_msg_data96_get_len(msg);
|
||||
mavlink_msg_data96_get_data(msg, data96->data);
|
||||
#else
|
||||
memcpy(data96, _MAV_PAYLOAD(msg), 98);
|
||||
#endif
|
||||
}
|
||||
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 13, engine_cut_off);
|
||||
_mav_put_uint8_t(buf, 14, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_digicam_configure_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin
|
||||
packet.engine_cut_off = engine_cut_off;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE;
|
||||
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id
|
||||
_mav_put_uint8_t(buf, 13, engine_cut_off);
|
||||
_mav_put_uint8_t(buf, 14, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_digicam_configure_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id
|
||||
packet.engine_cut_off = engine_cut_off;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE;
|
||||
|
||||
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t(buf, 11, command_id);
|
||||
_mav_put_uint8_t(buf, 12, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13);
|
||||
#else
|
||||
mavlink_digicam_control_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8
|
||||
packet.command_id = command_id;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL;
|
||||
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 11, command_id);
|
||||
_mav_put_uint8_t(buf, 12, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13);
|
||||
#else
|
||||
mavlink_digicam_control_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id,
|
||||
packet.command_id = command_id;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_fence_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_fence_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT;
|
||||
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint8_t(buf, 10, idx);
|
||||
_mav_put_uint8_t(buf, 11, count);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_fence_point_t packet;
|
||||
packet.lat = lat;
|
||||
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT;
|
||||
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint
|
||||
_mav_put_uint8_t(buf, 10, idx);
|
||||
_mav_put_uint8_t(buf, 11, count);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_fence_point_t packet;
|
||||
packet.lat = lat;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT;
|
||||
|
||||
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 6, breach_status);
|
||||
_mav_put_uint8_t(buf, 7, breach_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_fence_status_t packet;
|
||||
packet.breach_time = breach_time;
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t
|
||||
packet.breach_status = breach_status;
|
||||
packet.breach_type = breach_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 6, breach_status);
|
||||
_mav_put_uint8_t(buf, 7, breach_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_fence_status_t packet;
|
||||
packet.breach_time = breach_time;
|
||||
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin
|
||||
packet.breach_status = breach_status;
|
||||
packet.breach_type = breach_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS;
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
// MESSAGE HWSTATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HWSTATUS 165
|
||||
|
||||
typedef struct __mavlink_hwstatus_t
|
||||
{
|
||||
uint16_t Vcc; ///< board voltage (mV)
|
||||
uint8_t I2Cerr; ///< I2C error count
|
||||
} mavlink_hwstatus_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HWSTATUS_LEN 3
|
||||
#define MAVLINK_MSG_ID_165_LEN 3
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_HWSTATUS { \
|
||||
"HWSTATUS", \
|
||||
2, \
|
||||
{ { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_hwstatus_t, Vcc) }, \
|
||||
{ "I2Cerr", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_hwstatus_t, I2Cerr) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a hwstatus message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param Vcc board voltage (mV)
|
||||
* @param I2Cerr I2C error count
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t Vcc, uint8_t I2Cerr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[3];
|
||||
_mav_put_uint16_t(buf, 0, Vcc);
|
||||
_mav_put_uint8_t(buf, 2, I2Cerr);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HWSTATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 3, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hwstatus message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param Vcc board voltage (mV)
|
||||
* @param I2Cerr I2C error count
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t Vcc,uint8_t I2Cerr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[3];
|
||||
_mav_put_uint16_t(buf, 0, Vcc);
|
||||
_mav_put_uint8_t(buf, 2, I2Cerr);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HWSTATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hwstatus struct into a message
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hwstatus C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hwstatus_t* hwstatus)
|
||||
{
|
||||
return mavlink_msg_hwstatus_pack(system_id, component_id, msg, hwstatus->Vcc, hwstatus->I2Cerr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hwstatus message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param Vcc board voltage (mV)
|
||||
* @param I2Cerr I2C error count
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hwstatus_send(mavlink_channel_t chan, uint16_t Vcc, uint8_t I2Cerr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[3];
|
||||
_mav_put_uint16_t(buf, 0, Vcc);
|
||||
_mav_put_uint8_t(buf, 2, I2Cerr);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, buf, 3, 21);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, 3, 21);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HWSTATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field Vcc from hwstatus message
|
||||
*
|
||||
* @return board voltage (mV)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_get_Vcc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field I2Cerr from hwstatus message
|
||||
*
|
||||
* @return I2C error count
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hwstatus_get_I2Cerr(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hwstatus message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hwstatus C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hwstatus_decode(const mavlink_message_t* msg, mavlink_hwstatus_t* hwstatus)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
hwstatus->Vcc = mavlink_msg_hwstatus_get_Vcc(msg);
|
||||
hwstatus->I2Cerr = mavlink_msg_hwstatus_get_I2Cerr(msg);
|
||||
#else
|
||||
memcpy(hwstatus, _MAV_PAYLOAD(msg), 3);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
// MESSAGE LIMITS_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LIMITS_STATUS 167
|
||||
|
||||
typedef struct __mavlink_limits_status_t
|
||||
{
|
||||
uint32_t last_trigger; ///< time of last breach in milliseconds since boot
|
||||
uint32_t last_action; ///< time of last recovery action in milliseconds since boot
|
||||
uint32_t last_recovery; ///< time of last successful recovery in milliseconds since boot
|
||||
uint32_t last_clear; ///< time of last all-clear in milliseconds since boot
|
||||
uint16_t breach_count; ///< number of fence breaches
|
||||
uint8_t limits_state; ///< state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
uint8_t mods_enabled; ///< AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
uint8_t mods_required; ///< AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
uint8_t mods_triggered; ///< AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
} mavlink_limits_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LIMITS_STATUS_LEN 22
|
||||
#define MAVLINK_MSG_ID_167_LEN 22
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LIMITS_STATUS { \
|
||||
"LIMITS_STATUS", \
|
||||
9, \
|
||||
{ { "last_trigger", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_limits_status_t, last_trigger) }, \
|
||||
{ "last_action", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_limits_status_t, last_action) }, \
|
||||
{ "last_recovery", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_limits_status_t, last_recovery) }, \
|
||||
{ "last_clear", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_limits_status_t, last_clear) }, \
|
||||
{ "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_limits_status_t, breach_count) }, \
|
||||
{ "limits_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_limits_status_t, limits_state) }, \
|
||||
{ "mods_enabled", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_limits_status_t, mods_enabled) }, \
|
||||
{ "mods_required", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_limits_status_t, mods_required) }, \
|
||||
{ "mods_triggered", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_limits_status_t, mods_triggered) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a limits_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 limits_state state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
* @param last_trigger time of last breach in milliseconds since boot
|
||||
* @param last_action time of last recovery action in milliseconds since boot
|
||||
* @param last_recovery time of last successful recovery in milliseconds since boot
|
||||
* @param last_clear time of last all-clear in milliseconds since boot
|
||||
* @param breach_count number of fence breaches
|
||||
* @param mods_enabled AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_required AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_triggered AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, last_trigger);
|
||||
_mav_put_uint32_t(buf, 4, last_action);
|
||||
_mav_put_uint32_t(buf, 8, last_recovery);
|
||||
_mav_put_uint32_t(buf, 12, last_clear);
|
||||
_mav_put_uint16_t(buf, 16, breach_count);
|
||||
_mav_put_uint8_t(buf, 18, limits_state);
|
||||
_mav_put_uint8_t(buf, 19, mods_enabled);
|
||||
_mav_put_uint8_t(buf, 20, mods_required);
|
||||
_mav_put_uint8_t(buf, 21, mods_triggered);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_limits_status_t packet;
|
||||
packet.last_trigger = last_trigger;
|
||||
packet.last_action = last_action;
|
||||
packet.last_recovery = last_recovery;
|
||||
packet.last_clear = last_clear;
|
||||
packet.breach_count = breach_count;
|
||||
packet.limits_state = limits_state;
|
||||
packet.mods_enabled = mods_enabled;
|
||||
packet.mods_required = mods_required;
|
||||
packet.mods_triggered = mods_triggered;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 22, 144);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a limits_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 limits_state state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
* @param last_trigger time of last breach in milliseconds since boot
|
||||
* @param last_action time of last recovery action in milliseconds since boot
|
||||
* @param last_recovery time of last successful recovery in milliseconds since boot
|
||||
* @param last_clear time of last all-clear in milliseconds since boot
|
||||
* @param breach_count number of fence breaches
|
||||
* @param mods_enabled AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_required AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_triggered AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t limits_state,uint32_t last_trigger,uint32_t last_action,uint32_t last_recovery,uint32_t last_clear,uint16_t breach_count,uint8_t mods_enabled,uint8_t mods_required,uint8_t mods_triggered)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, last_trigger);
|
||||
_mav_put_uint32_t(buf, 4, last_action);
|
||||
_mav_put_uint32_t(buf, 8, last_recovery);
|
||||
_mav_put_uint32_t(buf, 12, last_clear);
|
||||
_mav_put_uint16_t(buf, 16, breach_count);
|
||||
_mav_put_uint8_t(buf, 18, limits_state);
|
||||
_mav_put_uint8_t(buf, 19, mods_enabled);
|
||||
_mav_put_uint8_t(buf, 20, mods_required);
|
||||
_mav_put_uint8_t(buf, 21, mods_triggered);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_limits_status_t packet;
|
||||
packet.last_trigger = last_trigger;
|
||||
packet.last_action = last_action;
|
||||
packet.last_recovery = last_recovery;
|
||||
packet.last_clear = last_clear;
|
||||
packet.breach_count = breach_count;
|
||||
packet.limits_state = limits_state;
|
||||
packet.mods_enabled = mods_enabled;
|
||||
packet.mods_required = mods_required;
|
||||
packet.mods_triggered = mods_triggered;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 144);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a limits_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 limits_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_limits_status_t* limits_status)
|
||||
{
|
||||
return mavlink_msg_limits_status_pack(system_id, component_id, msg, limits_status->limits_state, limits_status->last_trigger, limits_status->last_action, limits_status->last_recovery, limits_status->last_clear, limits_status->breach_count, limits_status->mods_enabled, limits_status->mods_required, limits_status->mods_triggered);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a limits_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param limits_state state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
* @param last_trigger time of last breach in milliseconds since boot
|
||||
* @param last_action time of last recovery action in milliseconds since boot
|
||||
* @param last_recovery time of last successful recovery in milliseconds since boot
|
||||
* @param last_clear time of last all-clear in milliseconds since boot
|
||||
* @param breach_count number of fence breaches
|
||||
* @param mods_enabled AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_required AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_triggered AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_limits_status_send(mavlink_channel_t chan, uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, last_trigger);
|
||||
_mav_put_uint32_t(buf, 4, last_action);
|
||||
_mav_put_uint32_t(buf, 8, last_recovery);
|
||||
_mav_put_uint32_t(buf, 12, last_clear);
|
||||
_mav_put_uint16_t(buf, 16, breach_count);
|
||||
_mav_put_uint8_t(buf, 18, limits_state);
|
||||
_mav_put_uint8_t(buf, 19, mods_enabled);
|
||||
_mav_put_uint8_t(buf, 20, mods_required);
|
||||
_mav_put_uint8_t(buf, 21, mods_triggered);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, 22, 144);
|
||||
#else
|
||||
mavlink_limits_status_t packet;
|
||||
packet.last_trigger = last_trigger;
|
||||
packet.last_action = last_action;
|
||||
packet.last_recovery = last_recovery;
|
||||
packet.last_clear = last_clear;
|
||||
packet.breach_count = breach_count;
|
||||
packet.limits_state = limits_state;
|
||||
packet.mods_enabled = mods_enabled;
|
||||
packet.mods_required = mods_required;
|
||||
packet.mods_triggered = mods_triggered;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)&packet, 22, 144);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LIMITS_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field limits_state from limits_status message
|
||||
*
|
||||
* @return state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_limits_status_get_limits_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_trigger from limits_status message
|
||||
*
|
||||
* @return time of last breach in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_limits_status_get_last_trigger(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_action from limits_status message
|
||||
*
|
||||
* @return time of last recovery action in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_limits_status_get_last_action(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_recovery from limits_status message
|
||||
*
|
||||
* @return time of last successful recovery in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_limits_status_get_last_recovery(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_clear from limits_status message
|
||||
*
|
||||
* @return time of last all-clear in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_limits_status_get_last_clear(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field breach_count from limits_status message
|
||||
*
|
||||
* @return number of fence breaches
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_get_breach_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mods_enabled from limits_status message
|
||||
*
|
||||
* @return AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_limits_status_get_mods_enabled(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 19);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mods_required from limits_status message
|
||||
*
|
||||
* @return AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_limits_status_get_mods_required(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mods_triggered from limits_status message
|
||||
*
|
||||
* @return AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_limits_status_get_mods_triggered(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a limits_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param limits_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_limits_status_decode(const mavlink_message_t* msg, mavlink_limits_status_t* limits_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
limits_status->last_trigger = mavlink_msg_limits_status_get_last_trigger(msg);
|
||||
limits_status->last_action = mavlink_msg_limits_status_get_last_action(msg);
|
||||
limits_status->last_recovery = mavlink_msg_limits_status_get_last_recovery(msg);
|
||||
limits_status->last_clear = mavlink_msg_limits_status_get_last_clear(msg);
|
||||
limits_status->breach_count = mavlink_msg_limits_status_get_breach_count(msg);
|
||||
limits_status->limits_state = mavlink_msg_limits_status_get_limits_state(msg);
|
||||
limits_status->mods_enabled = mavlink_msg_limits_status_get_mods_enabled(msg);
|
||||
limits_status->mods_required = mavlink_msg_limits_status_get_mods_required(msg);
|
||||
limits_status->mods_triggered = mavlink_msg_limits_status_get_mods_triggered(msg);
|
||||
#else
|
||||
memcpy(limits_status, _MAV_PAYLOAD(msg), 22);
|
||||
#endif
|
||||
}
|
||||
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t compo
|
||||
_mav_put_uint16_t(buf, 0, brkval);
|
||||
_mav_put_uint16_t(buf, 2, freemem);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_meminfo_t packet;
|
||||
packet.brkval = brkval;
|
||||
packet.freemem = freemem;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMINFO;
|
||||
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t
|
||||
_mav_put_uint16_t(buf, 0, brkval);
|
||||
_mav_put_uint16_t(buf, 2, freemem);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_meminfo_t packet;
|
||||
packet.brkval = brkval;
|
||||
packet.freemem = freemem;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMINFO;
|
||||
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t(buf, 4, stab_pitch);
|
||||
_mav_put_uint8_t(buf, 5, stab_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_mount_configure_t packet;
|
||||
packet.target_system = target_system;
|
||||
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8
|
||||
packet.stab_pitch = stab_pitch;
|
||||
packet.stab_yaw = stab_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
|
||||
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 4, stab_pitch);
|
||||
_mav_put_uint8_t(buf, 5, stab_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_mount_configure_t packet;
|
||||
packet.target_system = target_system;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id,
|
||||
packet.stab_pitch = stab_pitch;
|
||||
packet.stab_yaw = stab_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
|
||||
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
_mav_put_uint8_t(buf, 14, save_position);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_mount_control_t packet;
|
||||
packet.input_a = input_a;
|
||||
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t
|
||||
packet.target_component = target_component;
|
||||
packet.save_position = save_position;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL;
|
||||
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
_mav_put_uint8_t(buf, 14, save_position);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_mount_control_t packet;
|
||||
packet.input_a = input_a;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui
|
||||
packet.target_component = target_component;
|
||||
packet.save_position = save_position;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL;
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t
|
||||
_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_mount_status_t packet;
|
||||
packet.pointing_a = pointing_a;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t
|
||||
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_MOUNT_STATUS;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin
|
||||
_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_mount_status_t packet;
|
||||
packet.pointing_a = pointing_a;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin
|
||||
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_MOUNT_STATUS;
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
// MESSAGE RADIO PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RADIO 166
|
||||
|
||||
typedef struct __mavlink_radio_t
|
||||
{
|
||||
uint16_t rxerrors; ///< receive errors
|
||||
uint16_t fixed; ///< count of error corrected packets
|
||||
uint8_t rssi; ///< local signal strength
|
||||
uint8_t remrssi; ///< remote signal strength
|
||||
uint8_t txbuf; ///< how full the tx buffer is as a percentage
|
||||
uint8_t noise; ///< background noise level
|
||||
uint8_t remnoise; ///< remote background noise level
|
||||
} mavlink_radio_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RADIO_LEN 9
|
||||
#define MAVLINK_MSG_ID_166_LEN 9
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_RADIO { \
|
||||
"RADIO", \
|
||||
7, \
|
||||
{ { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_t, rxerrors) }, \
|
||||
{ "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_t, fixed) }, \
|
||||
{ "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_t, rssi) }, \
|
||||
{ "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_t, remrssi) }, \
|
||||
{ "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_t, txbuf) }, \
|
||||
{ "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_t, noise) }, \
|
||||
{ "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_t, remnoise) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a radio message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint16_t(buf, 0, rxerrors);
|
||||
_mav_put_uint16_t(buf, 2, fixed);
|
||||
_mav_put_uint8_t(buf, 4, rssi);
|
||||
_mav_put_uint8_t(buf, 5, remrssi);
|
||||
_mav_put_uint8_t(buf, 6, txbuf);
|
||||
_mav_put_uint8_t(buf, 7, noise);
|
||||
_mav_put_uint8_t(buf, 8, remnoise);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_radio_t packet;
|
||||
packet.rxerrors = rxerrors;
|
||||
packet.fixed = fixed;
|
||||
packet.rssi = rssi;
|
||||
packet.remrssi = remrssi;
|
||||
packet.txbuf = txbuf;
|
||||
packet.noise = noise;
|
||||
packet.remnoise = remnoise;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RADIO;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 9, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a radio message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint16_t(buf, 0, rxerrors);
|
||||
_mav_put_uint16_t(buf, 2, fixed);
|
||||
_mav_put_uint8_t(buf, 4, rssi);
|
||||
_mav_put_uint8_t(buf, 5, remrssi);
|
||||
_mav_put_uint8_t(buf, 6, txbuf);
|
||||
_mav_put_uint8_t(buf, 7, noise);
|
||||
_mav_put_uint8_t(buf, 8, remnoise);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_radio_t packet;
|
||||
packet.rxerrors = rxerrors;
|
||||
packet.fixed = fixed;
|
||||
packet.rssi = rssi;
|
||||
packet.remrssi = remrssi;
|
||||
packet.txbuf = txbuf;
|
||||
packet.noise = noise;
|
||||
packet.remnoise = remnoise;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RADIO;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a radio struct into a message
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param radio C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_radio_t* radio)
|
||||
{
|
||||
return mavlink_msg_radio_pack(system_id, component_id, msg, radio->rssi, radio->remrssi, radio->txbuf, radio->noise, radio->remnoise, radio->rxerrors, radio->fixed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a radio message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_radio_send(mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint16_t(buf, 0, rxerrors);
|
||||
_mav_put_uint16_t(buf, 2, fixed);
|
||||
_mav_put_uint8_t(buf, 4, rssi);
|
||||
_mav_put_uint8_t(buf, 5, remrssi);
|
||||
_mav_put_uint8_t(buf, 6, txbuf);
|
||||
_mav_put_uint8_t(buf, 7, noise);
|
||||
_mav_put_uint8_t(buf, 8, remnoise);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, 9, 21);
|
||||
#else
|
||||
mavlink_radio_t packet;
|
||||
packet.rxerrors = rxerrors;
|
||||
packet.fixed = fixed;
|
||||
packet.rssi = rssi;
|
||||
packet.remrssi = remrssi;
|
||||
packet.txbuf = txbuf;
|
||||
packet.noise = noise;
|
||||
packet.remnoise = remnoise;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (const char *)&packet, 9, 21);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RADIO UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field rssi from radio message
|
||||
*
|
||||
* @return local signal strength
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_rssi(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field remrssi from radio message
|
||||
*
|
||||
* @return remote signal strength
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_remrssi(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field txbuf from radio message
|
||||
*
|
||||
* @return how full the tx buffer is as a percentage
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_txbuf(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field noise from radio message
|
||||
*
|
||||
* @return background noise level
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_noise(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field remnoise from radio message
|
||||
*
|
||||
* @return remote background noise level
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_remnoise(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rxerrors from radio message
|
||||
*
|
||||
* @return receive errors
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_get_rxerrors(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fixed from radio message
|
||||
*
|
||||
* @return count of error corrected packets
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_get_fixed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a radio message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param radio C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_radio_decode(const mavlink_message_t* msg, mavlink_radio_t* radio)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
radio->rxerrors = mavlink_msg_radio_get_rxerrors(msg);
|
||||
radio->fixed = mavlink_msg_radio_get_fixed(msg);
|
||||
radio->rssi = mavlink_msg_radio_get_rssi(msg);
|
||||
radio->remrssi = mavlink_msg_radio_get_remrssi(msg);
|
||||
radio->txbuf = mavlink_msg_radio_get_txbuf(msg);
|
||||
radio->noise = mavlink_msg_radio_get_noise(msg);
|
||||
radio->remnoise = mavlink_msg_radio_get_remnoise(msg);
|
||||
#else
|
||||
memcpy(radio, _MAV_PAYLOAD(msg), 9);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
// MESSAGE RANGEFINDER PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RANGEFINDER 173
|
||||
|
||||
typedef struct __mavlink_rangefinder_t
|
||||
{
|
||||
float distance; ///< distance in meters
|
||||
float voltage; ///< raw voltage if available, zero otherwise
|
||||
} mavlink_rangefinder_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RANGEFINDER_LEN 8
|
||||
#define MAVLINK_MSG_ID_173_LEN 8
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_RANGEFINDER { \
|
||||
"RANGEFINDER", \
|
||||
2, \
|
||||
{ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_rangefinder_t, distance) }, \
|
||||
{ "voltage", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_rangefinder_t, voltage) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a rangefinder 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 distance distance in meters
|
||||
* @param voltage raw voltage if available, zero otherwise
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rangefinder_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float distance, float voltage)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[8];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RANGEFINDER;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 8, 83);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a rangefinder 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 distance distance in meters
|
||||
* @param voltage raw voltage if available, zero otherwise
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rangefinder_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float distance,float voltage)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[8];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RANGEFINDER;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 83);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rangefinder 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 rangefinder C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rangefinder_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rangefinder_t* rangefinder)
|
||||
{
|
||||
return mavlink_msg_rangefinder_pack(system_id, component_id, msg, rangefinder->distance, rangefinder->voltage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rangefinder message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param distance distance in meters
|
||||
* @param voltage raw voltage if available, zero otherwise
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_rangefinder_send(mavlink_channel_t chan, float distance, float voltage)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[8];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, buf, 8, 83);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, (const char *)&packet, 8, 83);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RANGEFINDER UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field distance from rangefinder message
|
||||
*
|
||||
* @return distance in meters
|
||||
*/
|
||||
static inline float mavlink_msg_rangefinder_get_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage from rangefinder message
|
||||
*
|
||||
* @return raw voltage if available, zero otherwise
|
||||
*/
|
||||
static inline float mavlink_msg_rangefinder_get_voltage(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a rangefinder message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param rangefinder C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_rangefinder_decode(const mavlink_message_t* msg, mavlink_rangefinder_t* rangefinder)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
rangefinder->distance = mavlink_msg_rangefinder_get_distance(msg);
|
||||
rangefinder->voltage = mavlink_msg_rangefinder_get_voltage(msg);
|
||||
#else
|
||||
memcpy(rangefinder, _MAV_PAYLOAD(msg), 8);
|
||||
#endif
|
||||
}
|
||||
@@ -80,7 +80,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_
|
||||
_mav_put_int16_t(buf, 38, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 40, mag_ofs_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42);
|
||||
#else
|
||||
mavlink_sensor_offsets_t packet;
|
||||
packet.mag_declination = mag_declination;
|
||||
@@ -96,7 +96,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u
|
||||
_mav_put_int16_t(buf, 38, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 40, mag_ofs_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42);
|
||||
#else
|
||||
mavlink_sensor_offsets_t packet;
|
||||
packet.mag_declination = mag_declination;
|
||||
@@ -158,7 +158,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_set_mag_offsets_t packet;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_set_mag_offsets_t packet;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id,
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
|
||||
|
||||
@@ -0,0 +1,364 @@
|
||||
// MESSAGE SIMSTATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SIMSTATE 164
|
||||
|
||||
typedef struct __mavlink_simstate_t
|
||||
{
|
||||
float roll; ///< Roll angle (rad)
|
||||
float pitch; ///< Pitch angle (rad)
|
||||
float yaw; ///< Yaw angle (rad)
|
||||
float xacc; ///< X acceleration m/s/s
|
||||
float yacc; ///< Y acceleration m/s/s
|
||||
float zacc; ///< Z acceleration m/s/s
|
||||
float xgyro; ///< Angular speed around X axis rad/s
|
||||
float ygyro; ///< Angular speed around Y axis rad/s
|
||||
float zgyro; ///< Angular speed around Z axis rad/s
|
||||
float lat; ///< Latitude in degrees
|
||||
float lng; ///< Longitude in degrees
|
||||
} mavlink_simstate_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SIMSTATE_LEN 44
|
||||
#define MAVLINK_MSG_ID_164_LEN 44
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_SIMSTATE { \
|
||||
"SIMSTATE", \
|
||||
11, \
|
||||
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_simstate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_simstate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_simstate_t, yaw) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_simstate_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_simstate_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_simstate_t, zacc) }, \
|
||||
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_simstate_t, xgyro) }, \
|
||||
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_simstate_t, ygyro) }, \
|
||||
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_simstate_t, zgyro) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_simstate_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_simstate_t, lng) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a simstate 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 Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param xacc X acceleration m/s/s
|
||||
* @param yacc Y acceleration m/s/s
|
||||
* @param zacc Z acceleration m/s/s
|
||||
* @param xgyro Angular speed around X axis rad/s
|
||||
* @param ygyro Angular speed around Y axis rad/s
|
||||
* @param zgyro Angular speed around Z axis rad/s
|
||||
* @param lat Latitude in degrees
|
||||
* @param lng Longitude in degrees
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[44];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, xacc);
|
||||
_mav_put_float(buf, 16, yacc);
|
||||
_mav_put_float(buf, 20, zacc);
|
||||
_mav_put_float(buf, 24, xgyro);
|
||||
_mav_put_float(buf, 28, ygyro);
|
||||
_mav_put_float(buf, 32, zgyro);
|
||||
_mav_put_float(buf, 36, lat);
|
||||
_mav_put_float(buf, 40, lng);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 44);
|
||||
#else
|
||||
mavlink_simstate_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 44);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SIMSTATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 44, 111);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a simstate 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 roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param xacc X acceleration m/s/s
|
||||
* @param yacc Y acceleration m/s/s
|
||||
* @param zacc Z acceleration m/s/s
|
||||
* @param xgyro Angular speed around X axis rad/s
|
||||
* @param ygyro Angular speed around Y axis rad/s
|
||||
* @param zgyro Angular speed around Z axis rad/s
|
||||
* @param lat Latitude in degrees
|
||||
* @param lng Longitude in degrees
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float lat,float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[44];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, xacc);
|
||||
_mav_put_float(buf, 16, yacc);
|
||||
_mav_put_float(buf, 20, zacc);
|
||||
_mav_put_float(buf, 24, xgyro);
|
||||
_mav_put_float(buf, 28, ygyro);
|
||||
_mav_put_float(buf, 32, zgyro);
|
||||
_mav_put_float(buf, 36, lat);
|
||||
_mav_put_float(buf, 40, lng);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 44);
|
||||
#else
|
||||
mavlink_simstate_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 44);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SIMSTATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 44, 111);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a simstate 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 simstate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_simstate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_simstate_t* simstate)
|
||||
{
|
||||
return mavlink_msg_simstate_pack(system_id, component_id, msg, simstate->roll, simstate->pitch, simstate->yaw, simstate->xacc, simstate->yacc, simstate->zacc, simstate->xgyro, simstate->ygyro, simstate->zgyro, simstate->lat, simstate->lng);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a simstate message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param xacc X acceleration m/s/s
|
||||
* @param yacc Y acceleration m/s/s
|
||||
* @param zacc Z acceleration m/s/s
|
||||
* @param xgyro Angular speed around X axis rad/s
|
||||
* @param ygyro Angular speed around Y axis rad/s
|
||||
* @param zgyro Angular speed around Z axis rad/s
|
||||
* @param lat Latitude in degrees
|
||||
* @param lng Longitude in degrees
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_simstate_send(mavlink_channel_t chan, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[44];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, xacc);
|
||||
_mav_put_float(buf, 16, yacc);
|
||||
_mav_put_float(buf, 20, zacc);
|
||||
_mav_put_float(buf, 24, xgyro);
|
||||
_mav_put_float(buf, 28, ygyro);
|
||||
_mav_put_float(buf, 32, zgyro);
|
||||
_mav_put_float(buf, 36, lat);
|
||||
_mav_put_float(buf, 40, lng);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, buf, 44, 111);
|
||||
#else
|
||||
mavlink_simstate_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, (const char *)&packet, 44, 111);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SIMSTATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field roll from simstate message
|
||||
*
|
||||
* @return Roll angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from simstate message
|
||||
*
|
||||
* @return Pitch angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from simstate message
|
||||
*
|
||||
* @return Yaw angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from simstate message
|
||||
*
|
||||
* @return X acceleration m/s/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_xacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yacc from simstate message
|
||||
*
|
||||
* @return Y acceleration m/s/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_yacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zacc from simstate message
|
||||
*
|
||||
* @return Z acceleration m/s/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_zacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xgyro from simstate message
|
||||
*
|
||||
* @return Angular speed around X axis rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_xgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ygyro from simstate message
|
||||
*
|
||||
* @return Angular speed around Y axis rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_ygyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zgyro from simstate message
|
||||
*
|
||||
* @return Angular speed around Z axis rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_zgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from simstate message
|
||||
*
|
||||
* @return Latitude in degrees
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from simstate message
|
||||
*
|
||||
* @return Longitude in degrees
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a simstate message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param simstate C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_simstate_decode(const mavlink_message_t* msg, mavlink_simstate_t* simstate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
simstate->roll = mavlink_msg_simstate_get_roll(msg);
|
||||
simstate->pitch = mavlink_msg_simstate_get_pitch(msg);
|
||||
simstate->yaw = mavlink_msg_simstate_get_yaw(msg);
|
||||
simstate->xacc = mavlink_msg_simstate_get_xacc(msg);
|
||||
simstate->yacc = mavlink_msg_simstate_get_yacc(msg);
|
||||
simstate->zacc = mavlink_msg_simstate_get_zacc(msg);
|
||||
simstate->xgyro = mavlink_msg_simstate_get_xgyro(msg);
|
||||
simstate->ygyro = mavlink_msg_simstate_get_ygyro(msg);
|
||||
simstate->zgyro = mavlink_msg_simstate_get_zgyro(msg);
|
||||
simstate->lat = mavlink_msg_simstate_get_lat(msg);
|
||||
simstate->lng = mavlink_msg_simstate_get_lng(msg);
|
||||
#else
|
||||
memcpy(simstate, _MAV_PAYLOAD(msg), 44);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
// MESSAGE WIND PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_WIND 168
|
||||
|
||||
typedef struct __mavlink_wind_t
|
||||
{
|
||||
float direction; ///< wind direction that wind is coming from (degrees)
|
||||
float speed; ///< wind speed in ground plane (m/s)
|
||||
float speed_z; ///< vertical wind speed (m/s)
|
||||
} mavlink_wind_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_WIND_LEN 12
|
||||
#define MAVLINK_MSG_ID_168_LEN 12
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_WIND { \
|
||||
"WIND", \
|
||||
3, \
|
||||
{ { "direction", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_wind_t, direction) }, \
|
||||
{ "speed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_wind_t, speed) }, \
|
||||
{ "speed_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_t, speed_z) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a wind 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 direction wind direction that wind is coming from (degrees)
|
||||
* @param speed wind speed in ground plane (m/s)
|
||||
* @param speed_z vertical wind speed (m/s)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float direction, float speed, float speed_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[12];
|
||||
_mav_put_float(buf, 0, direction);
|
||||
_mav_put_float(buf, 4, speed);
|
||||
_mav_put_float(buf, 8, speed_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_wind_t packet;
|
||||
packet.direction = direction;
|
||||
packet.speed = speed;
|
||||
packet.speed_z = speed_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_WIND;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 12, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a wind 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 direction wind direction that wind is coming from (degrees)
|
||||
* @param speed wind speed in ground plane (m/s)
|
||||
* @param speed_z vertical wind speed (m/s)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_wind_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float direction,float speed,float speed_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[12];
|
||||
_mav_put_float(buf, 0, direction);
|
||||
_mav_put_float(buf, 4, speed);
|
||||
_mav_put_float(buf, 8, speed_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_wind_t packet;
|
||||
packet.direction = direction;
|
||||
packet.speed = speed;
|
||||
packet.speed_z = speed_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_WIND;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a wind 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 wind C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_wind_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_t* wind)
|
||||
{
|
||||
return mavlink_msg_wind_pack(system_id, component_id, msg, wind->direction, wind->speed, wind->speed_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a wind message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param direction wind direction that wind is coming from (degrees)
|
||||
* @param speed wind speed in ground plane (m/s)
|
||||
* @param speed_z vertical wind speed (m/s)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_wind_send(mavlink_channel_t chan, float direction, float speed, float speed_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[12];
|
||||
_mav_put_float(buf, 0, direction);
|
||||
_mav_put_float(buf, 4, speed);
|
||||
_mav_put_float(buf, 8, speed_z);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, 12, 1);
|
||||
#else
|
||||
mavlink_wind_t packet;
|
||||
packet.direction = direction;
|
||||
packet.speed = speed;
|
||||
packet.speed_z = speed_z;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)&packet, 12, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE WIND UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field direction from wind message
|
||||
*
|
||||
* @return wind direction that wind is coming from (degrees)
|
||||
*/
|
||||
static inline float mavlink_msg_wind_get_direction(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field speed from wind message
|
||||
*
|
||||
* @return wind speed in ground plane (m/s)
|
||||
*/
|
||||
static inline float mavlink_msg_wind_get_speed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field speed_z from wind message
|
||||
*
|
||||
* @return vertical wind speed (m/s)
|
||||
*/
|
||||
static inline float mavlink_msg_wind_get_speed_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a wind message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param wind C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_wind_decode(const mavlink_message_t* msg, mavlink_wind_t* wind)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
wind->direction = mavlink_msg_wind_get_direction(msg);
|
||||
wind->speed = mavlink_msg_wind_get_speed(msg);
|
||||
wind->speed_z = mavlink_msg_wind_get_speed_z(msg);
|
||||
#else
|
||||
memcpy(wind, _MAV_PAYLOAD(msg), 12);
|
||||
#endif
|
||||
}
|
||||
@@ -534,14 +534,14 @@ static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, ma
|
||||
};
|
||||
mavlink_fence_point_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lng = packet_in.lng;
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
packet1.idx = packet_in.idx;
|
||||
packet1.count = packet_in.count;
|
||||
|
||||
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lng = packet_in.lng;
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
packet1.idx = packet_in.idx;
|
||||
packet1.count = packet_in.count;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_point_encode(system_id, component_id, &msg, &packet1);
|
||||
@@ -561,11 +561,11 @@ static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, ma
|
||||
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]);
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_fence_point_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
|
||||
mavlink_msg_fence_point_decode(last_msg, &packet2);
|
||||
@@ -584,11 +584,11 @@ static void mavlink_test_fence_fetch_point(uint8_t system_id, uint8_t component_
|
||||
};
|
||||
mavlink_fence_fetch_point_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
packet1.idx = packet_in.idx;
|
||||
|
||||
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
packet1.idx = packet_in.idx;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_fetch_point_encode(system_id, component_id, &msg, &packet1);
|
||||
@@ -608,11 +608,11 @@ static void mavlink_test_fence_fetch_point(uint8_t system_id, uint8_t component_
|
||||
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]);
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx );
|
||||
mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
|
||||
@@ -632,12 +632,12 @@ static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, m
|
||||
};
|
||||
mavlink_fence_status_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.breach_time = packet_in.breach_time;
|
||||
packet1.breach_count = packet_in.breach_count;
|
||||
packet1.breach_status = packet_in.breach_status;
|
||||
packet1.breach_type = packet_in.breach_type;
|
||||
|
||||
|
||||
packet1.breach_time = packet_in.breach_time;
|
||||
packet1.breach_count = packet_in.breach_count;
|
||||
packet1.breach_status = packet_in.breach_status;
|
||||
packet1.breach_type = packet_in.breach_type;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1);
|
||||
@@ -657,17 +657,574 @@ static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, m
|
||||
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]);
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_fence_status_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_status_send(MAVLINK_COMM_1 , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time );
|
||||
mavlink_msg_fence_status_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_ahrs(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_ahrs_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
185.0,
|
||||
};
|
||||
mavlink_ahrs_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.omegaIx = packet_in.omegaIx;
|
||||
packet1.omegaIy = packet_in.omegaIy;
|
||||
packet1.omegaIz = packet_in.omegaIz;
|
||||
packet1.accel_weight = packet_in.accel_weight;
|
||||
packet1.renorm_val = packet_in.renorm_val;
|
||||
packet1.error_rp = packet_in.error_rp;
|
||||
packet1.error_yaw = packet_in.error_yaw;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_ahrs_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_ahrs_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_ahrs_pack(system_id, component_id, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
|
||||
mavlink_msg_ahrs_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_ahrs_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
|
||||
mavlink_msg_ahrs_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_ahrs_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_ahrs_send(MAVLINK_COMM_1 , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
|
||||
mavlink_msg_ahrs_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_simstate(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_simstate_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
185.0,
|
||||
213.0,
|
||||
241.0,
|
||||
269.0,
|
||||
297.0,
|
||||
};
|
||||
mavlink_simstate_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.roll = packet_in.roll;
|
||||
packet1.pitch = packet_in.pitch;
|
||||
packet1.yaw = packet_in.yaw;
|
||||
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.lat = packet_in.lat;
|
||||
packet1.lng = packet_in.lng;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_simstate_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_simstate_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_simstate_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
|
||||
mavlink_msg_simstate_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_simstate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
|
||||
mavlink_msg_simstate_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_simstate_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_simstate_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
|
||||
mavlink_msg_simstate_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_hwstatus(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_hwstatus_t packet_in = {
|
||||
17235,
|
||||
139,
|
||||
};
|
||||
mavlink_hwstatus_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.Vcc = packet_in.Vcc;
|
||||
packet1.I2Cerr = packet_in.I2Cerr;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_hwstatus_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_hwstatus_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_hwstatus_pack(system_id, component_id, &msg , packet1.Vcc , packet1.I2Cerr );
|
||||
mavlink_msg_hwstatus_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_hwstatus_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.I2Cerr );
|
||||
mavlink_msg_hwstatus_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_hwstatus_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_hwstatus_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.I2Cerr );
|
||||
mavlink_msg_hwstatus_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_radio(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_radio_t packet_in = {
|
||||
17235,
|
||||
17339,
|
||||
17,
|
||||
84,
|
||||
151,
|
||||
218,
|
||||
29,
|
||||
};
|
||||
mavlink_radio_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.rxerrors = packet_in.rxerrors;
|
||||
packet1.fixed = packet_in.fixed;
|
||||
packet1.rssi = packet_in.rssi;
|
||||
packet1.remrssi = packet_in.remrssi;
|
||||
packet1.txbuf = packet_in.txbuf;
|
||||
packet1.noise = packet_in.noise;
|
||||
packet1.remnoise = packet_in.remnoise;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_radio_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_radio_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_radio_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
|
||||
mavlink_msg_radio_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_radio_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
|
||||
mavlink_msg_radio_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_radio_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_radio_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
|
||||
mavlink_msg_radio_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_limits_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_limits_status_t packet_in = {
|
||||
963497464,
|
||||
963497672,
|
||||
963497880,
|
||||
963498088,
|
||||
18067,
|
||||
187,
|
||||
254,
|
||||
65,
|
||||
132,
|
||||
};
|
||||
mavlink_limits_status_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.last_trigger = packet_in.last_trigger;
|
||||
packet1.last_action = packet_in.last_action;
|
||||
packet1.last_recovery = packet_in.last_recovery;
|
||||
packet1.last_clear = packet_in.last_clear;
|
||||
packet1.breach_count = packet_in.breach_count;
|
||||
packet1.limits_state = packet_in.limits_state;
|
||||
packet1.mods_enabled = packet_in.mods_enabled;
|
||||
packet1.mods_required = packet_in.mods_required;
|
||||
packet1.mods_triggered = packet_in.mods_triggered;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_limits_status_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_limits_status_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_limits_status_pack(system_id, component_id, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
|
||||
mavlink_msg_limits_status_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_limits_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
|
||||
mavlink_msg_limits_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_limits_status_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_limits_status_send(MAVLINK_COMM_1 , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
|
||||
mavlink_msg_limits_status_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_wind(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_wind_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
};
|
||||
mavlink_wind_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.direction = packet_in.direction;
|
||||
packet1.speed = packet_in.speed;
|
||||
packet1.speed_z = packet_in.speed_z;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_wind_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_wind_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_wind_pack(system_id, component_id, &msg , packet1.direction , packet1.speed , packet1.speed_z );
|
||||
mavlink_msg_wind_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_wind_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.direction , packet1.speed , packet1.speed_z );
|
||||
mavlink_msg_wind_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_wind_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_wind_send(MAVLINK_COMM_1 , packet1.direction , packet1.speed , packet1.speed_z );
|
||||
mavlink_msg_wind_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_data16(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_data16_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154 },
|
||||
};
|
||||
mavlink_data16_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.type = packet_in.type;
|
||||
packet1.len = packet_in.len;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*16);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data16_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_data16_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data16_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data16_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data16_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data16_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_data16_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data16_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data16_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_data32(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_data32_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 },
|
||||
};
|
||||
mavlink_data32_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.type = packet_in.type;
|
||||
packet1.len = packet_in.len;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*32);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data32_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_data32_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data32_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data32_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data32_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data32_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_data32_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data32_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data32_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_data64(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_data64_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202 },
|
||||
};
|
||||
mavlink_data64_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.type = packet_in.type;
|
||||
packet1.len = packet_in.len;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*64);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data64_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_data64_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data64_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data64_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data64_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data64_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_data64_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data64_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data64_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_data96(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_data96_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234 },
|
||||
};
|
||||
mavlink_data96_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.type = packet_in.type;
|
||||
packet1.len = packet_in.len;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*96);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data96_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_data96_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data96_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data96_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data96_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data96_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_data96_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data96_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data96_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_rangefinder(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_rangefinder_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
};
|
||||
mavlink_rangefinder_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.distance = packet_in.distance;
|
||||
packet1.voltage = packet_in.voltage;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_rangefinder_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_rangefinder_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_rangefinder_pack(system_id, component_id, &msg , packet1.distance , packet1.voltage );
|
||||
mavlink_msg_rangefinder_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_rangefinder_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.distance , packet1.voltage );
|
||||
mavlink_msg_rangefinder_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_rangefinder_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_rangefinder_send(MAVLINK_COMM_1 , packet1.distance , packet1.voltage );
|
||||
mavlink_msg_rangefinder_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_test_sensor_offsets(system_id, component_id, last_msg);
|
||||
@@ -682,6 +1239,17 @@ static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id,
|
||||
mavlink_test_fence_point(system_id, component_id, last_msg);
|
||||
mavlink_test_fence_fetch_point(system_id, component_id, last_msg);
|
||||
mavlink_test_fence_status(system_id, component_id, last_msg);
|
||||
mavlink_test_ahrs(system_id, component_id, last_msg);
|
||||
mavlink_test_simstate(system_id, component_id, last_msg);
|
||||
mavlink_test_hwstatus(system_id, component_id, last_msg);
|
||||
mavlink_test_radio(system_id, component_id, last_msg);
|
||||
mavlink_test_limits_status(system_id, component_id, last_msg);
|
||||
mavlink_test_wind(system_id, component_id, last_msg);
|
||||
mavlink_test_data16(system_id, component_id, last_msg);
|
||||
mavlink_test_data32(system_id, component_id, last_msg);
|
||||
mavlink_test_data64(system_id, component_id, last_msg);
|
||||
mavlink_test_data96(system_id, component_id, last_msg);
|
||||
mavlink_test_rangefinder(system_id, component_id, last_msg);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Fri Dec 16 12:39:10 2011"
|
||||
#define MAVLINK_BUILD_DATE "Thu Apr 4 18:57:12 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
|
||||
|
||||
Reference in New Issue
Block a user