feat: 更好兼容matlab

uin64->uint32
payload64->payload
This commit is contained in:
matt
2020-09-20 10:12:24 +08:00
parent 1465895353
commit e79d1f21fb
289 changed files with 6428 additions and 15915 deletions
+39 -39
View File
@@ -3,20 +3,20 @@
#define MAVLINK_MSG_ID_AOA_SSA 11020
MAVPACKED(
typedef struct __mavlink_aoa_ssa_t {
uint64_t time_usec; /*< [us] Timestamp (since boot or Unix epoch).*/
uint32_t time_usec; /*< [us] Timestamp (since boot or Unix epoch).*/
float AOA; /*< [deg] Angle of Attack.*/
float SSA; /*< [deg] Side Slip Angle.*/
}) mavlink_aoa_ssa_t;
} mavlink_aoa_ssa_t;
#define MAVLINK_MSG_ID_AOA_SSA_LEN 16
#define MAVLINK_MSG_ID_AOA_SSA_MIN_LEN 16
#define MAVLINK_MSG_ID_11020_LEN 16
#define MAVLINK_MSG_ID_11020_MIN_LEN 16
#define MAVLINK_MSG_ID_AOA_SSA_LEN 12
#define MAVLINK_MSG_ID_AOA_SSA_MIN_LEN 12
#define MAVLINK_MSG_ID_11020_LEN 12
#define MAVLINK_MSG_ID_11020_MIN_LEN 12
#define MAVLINK_MSG_ID_AOA_SSA_CRC 205
#define MAVLINK_MSG_ID_11020_CRC 205
#define MAVLINK_MSG_ID_AOA_SSA_CRC 26
#define MAVLINK_MSG_ID_11020_CRC 26
@@ -25,18 +25,18 @@ typedef struct __mavlink_aoa_ssa_t {
11020, \
"AOA_SSA", \
3, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_aoa_ssa_t, time_usec) }, \
{ "AOA", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_aoa_ssa_t, AOA) }, \
{ "SSA", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_aoa_ssa_t, SSA) }, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_aoa_ssa_t, time_usec) }, \
{ "AOA", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_aoa_ssa_t, AOA) }, \
{ "SSA", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_aoa_ssa_t, SSA) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_AOA_SSA { \
"AOA_SSA", \
3, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_aoa_ssa_t, time_usec) }, \
{ "AOA", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_aoa_ssa_t, AOA) }, \
{ "SSA", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_aoa_ssa_t, SSA) }, \
{ { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_aoa_ssa_t, time_usec) }, \
{ "AOA", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_aoa_ssa_t, AOA) }, \
{ "SSA", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_aoa_ssa_t, SSA) }, \
} \
}
#endif
@@ -52,14 +52,14 @@ typedef struct __mavlink_aoa_ssa_t {
* @param SSA [deg] Side Slip Angle.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_aoa_ssa_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_usec, float AOA, float SSA)
static inline uint16_t mavlink_msg_aoa_ssa_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_usec, float AOA, float SSA)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_AOA_SSA_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, AOA);
_mav_put_float(buf, 12, SSA);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_float(buf, 4, AOA);
_mav_put_float(buf, 8, SSA);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AOA_SSA_LEN);
#else
@@ -86,15 +86,15 @@ static inline uint16_t mavlink_msg_aoa_ssa_pack(uint8_t system_id, uint8_t compo
* @param SSA [deg] Side Slip Angle.
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_aoa_ssa_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
static inline uint16_t mavlink_msg_aoa_ssa_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t time_usec,float AOA,float SSA)
uint32_t time_usec,float AOA,float SSA)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_AOA_SSA_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, AOA);
_mav_put_float(buf, 12, SSA);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_float(buf, 4, AOA);
_mav_put_float(buf, 8, SSA);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AOA_SSA_LEN);
#else
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_aoa_ssa_pack_chan(uint8_t system_id, uint8_t
* @param msg The MAVLink message to compress the data into
* @param aoa_ssa C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_aoa_ssa_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_aoa_ssa_t* aoa_ssa)
static inline uint16_t mavlink_msg_aoa_ssa_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_aoa_ssa_t* aoa_ssa)
{
return mavlink_msg_aoa_ssa_pack(system_id, component_id, msg, aoa_ssa->time_usec, aoa_ssa->AOA, aoa_ssa->SSA);
}
@@ -132,7 +132,7 @@ static inline uint16_t mavlink_msg_aoa_ssa_encode(uint8_t system_id, uint8_t com
* @param msg The MAVLink message to compress the data into
* @param aoa_ssa C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_aoa_ssa_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_aoa_ssa_t* aoa_ssa)
static inline uint16_t mavlink_msg_aoa_ssa_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_aoa_ssa_t* aoa_ssa)
{
return mavlink_msg_aoa_ssa_pack_chan(system_id, component_id, chan, msg, aoa_ssa->time_usec, aoa_ssa->AOA, aoa_ssa->SSA);
}
@@ -147,13 +147,13 @@ static inline uint16_t mavlink_msg_aoa_ssa_encode_chan(uint8_t system_id, uint8_
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_aoa_ssa_send(mavlink_channel_t chan, uint64_t time_usec, float AOA, float SSA)
static inline void mavlink_msg_aoa_ssa_send(mavlink_channel_t chan, uint32_t time_usec, float AOA, float SSA)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_AOA_SSA_LEN];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, AOA);
_mav_put_float(buf, 12, SSA);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_float(buf, 4, AOA);
_mav_put_float(buf, 8, SSA);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AOA_SSA, buf, MAVLINK_MSG_ID_AOA_SSA_MIN_LEN, MAVLINK_MSG_ID_AOA_SSA_LEN, MAVLINK_MSG_ID_AOA_SSA_CRC);
#else
@@ -188,13 +188,13 @@ static inline void mavlink_msg_aoa_ssa_send_struct(mavlink_channel_t chan, const
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_aoa_ssa_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float AOA, float SSA)
static inline void mavlink_msg_aoa_ssa_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_usec, float AOA, float SSA)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, AOA);
_mav_put_float(buf, 12, SSA);
_mav_put_uint32_t(buf, 0, time_usec);
_mav_put_float(buf, 4, AOA);
_mav_put_float(buf, 8, SSA);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AOA_SSA, buf, MAVLINK_MSG_ID_AOA_SSA_MIN_LEN, MAVLINK_MSG_ID_AOA_SSA_LEN, MAVLINK_MSG_ID_AOA_SSA_CRC);
#else
@@ -218,9 +218,9 @@ static inline void mavlink_msg_aoa_ssa_send_buf(mavlink_message_t *msgbuf, mavli
*
* @return [us] Timestamp (since boot or Unix epoch).
*/
static inline uint64_t mavlink_msg_aoa_ssa_get_time_usec(const mavlink_message_t* msg)
static inline uint32_t mavlink_msg_aoa_ssa_get_time_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
@@ -230,7 +230,7 @@ static inline uint64_t mavlink_msg_aoa_ssa_get_time_usec(const mavlink_message_t
*/
static inline float mavlink_msg_aoa_ssa_get_AOA(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
return _MAV_RETURN_float(msg, 4);
}
/**
@@ -240,7 +240,7 @@ static inline float mavlink_msg_aoa_ssa_get_AOA(const mavlink_message_t* msg)
*/
static inline float mavlink_msg_aoa_ssa_get_SSA(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
return _MAV_RETURN_float(msg, 8);
}
/**