Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • avn/swd/mavlink/mavlink-skyward-lib
1 result
Select Git revision
Show changes
Commits on Source (2)
Showing
with 2497 additions and 1656 deletions
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
......@@ -6,7 +6,7 @@
#ifndef MAVLINK_H
#define MAVLINK_H
#define MAVLINK_PRIMARY_XML_HASH -9164606166033445911
#define MAVLINK_PRIMARY_XML_HASH -8212031089336132932
#ifndef MAVLINK_STX
#define MAVLINK_STX 254
......
#pragma once
// MESSAGE ADC_TM PACKING
#define MAVLINK_MSG_ID_ADC_TM 105
#define MAVLINK_MSG_ID_ADC_TM 106
typedef struct __mavlink_adc_tm_t {
......@@ -19,17 +19,17 @@ typedef struct __mavlink_adc_tm_t {
#define MAVLINK_MSG_ID_ADC_TM_LEN 60
#define MAVLINK_MSG_ID_ADC_TM_MIN_LEN 60
#define MAVLINK_MSG_ID_105_LEN 60
#define MAVLINK_MSG_ID_105_MIN_LEN 60
#define MAVLINK_MSG_ID_106_LEN 60
#define MAVLINK_MSG_ID_106_MIN_LEN 60
#define MAVLINK_MSG_ID_ADC_TM_CRC 229
#define MAVLINK_MSG_ID_105_CRC 229
#define MAVLINK_MSG_ID_106_CRC 229
#define MAVLINK_MSG_ADC_TM_FIELD_SENSOR_NAME_LEN 20
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_ADC_TM { \
105, \
106, \
"ADC_TM", \
10, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_adc_tm_t, timestamp) }, \
......
#pragma once
// MESSAGE ARP_COMMAND_TC PACKING
#define MAVLINK_MSG_ID_ARP_COMMAND_TC 65
typedef struct __mavlink_arp_command_tc_t {
uint8_t command_id; /*< A member of the MavArpCommandList enum*/
} mavlink_arp_command_tc_t;
#define MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN 1
#define MAVLINK_MSG_ID_ARP_COMMAND_TC_MIN_LEN 1
#define MAVLINK_MSG_ID_65_LEN 1
#define MAVLINK_MSG_ID_65_MIN_LEN 1
#define MAVLINK_MSG_ID_ARP_COMMAND_TC_CRC 181
#define MAVLINK_MSG_ID_65_CRC 181
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_ARP_COMMAND_TC { \
65, \
"ARP_COMMAND_TC", \
1, \
{ { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_arp_command_tc_t, command_id) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_ARP_COMMAND_TC { \
"ARP_COMMAND_TC", \
1, \
{ { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_arp_command_tc_t, command_id) }, \
} \
}
#endif
/**
* @brief Pack a arp_command_tc message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param command_id A member of the MavArpCommandList enum
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_arp_command_tc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN];
_mav_put_uint8_t(buf, 0, command_id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN);
#else
mavlink_arp_command_tc_t packet;
packet.command_id = command_id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ARP_COMMAND_TC;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ARP_COMMAND_TC_MIN_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_CRC);
}
/**
* @brief Pack a arp_command_tc message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param command_id A member of the MavArpCommandList enum
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_arp_command_tc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN];
_mav_put_uint8_t(buf, 0, command_id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN);
#else
mavlink_arp_command_tc_t packet;
packet.command_id = command_id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ARP_COMMAND_TC;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ARP_COMMAND_TC_MIN_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_CRC);
}
/**
* @brief Encode a arp_command_tc struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param arp_command_tc C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_arp_command_tc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_arp_command_tc_t* arp_command_tc)
{
return mavlink_msg_arp_command_tc_pack(system_id, component_id, msg, arp_command_tc->command_id);
}
/**
* @brief Encode a arp_command_tc struct on a channel
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param arp_command_tc C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_arp_command_tc_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_arp_command_tc_t* arp_command_tc)
{
return mavlink_msg_arp_command_tc_pack_chan(system_id, component_id, chan, msg, arp_command_tc->command_id);
}
/**
* @brief Send a arp_command_tc message
* @param chan MAVLink channel to send the message
*
* @param command_id A member of the MavArpCommandList enum
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_arp_command_tc_send(mavlink_channel_t chan, uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN];
_mav_put_uint8_t(buf, 0, command_id);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ARP_COMMAND_TC, buf, MAVLINK_MSG_ID_ARP_COMMAND_TC_MIN_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_CRC);
#else
mavlink_arp_command_tc_t packet;
packet.command_id = command_id;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ARP_COMMAND_TC, (const char *)&packet, MAVLINK_MSG_ID_ARP_COMMAND_TC_MIN_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_CRC);
#endif
}
/**
* @brief Send a arp_command_tc message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_arp_command_tc_send_struct(mavlink_channel_t chan, const mavlink_arp_command_tc_t* arp_command_tc)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_arp_command_tc_send(chan, arp_command_tc->command_id);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ARP_COMMAND_TC, (const char *)arp_command_tc, MAVLINK_MSG_ID_ARP_COMMAND_TC_MIN_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_CRC);
#endif
}
#if MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This variant of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
mavlink_message_t which is the size of a full mavlink message. This
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_arp_command_tc_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint8_t(buf, 0, command_id);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ARP_COMMAND_TC, buf, MAVLINK_MSG_ID_ARP_COMMAND_TC_MIN_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_CRC);
#else
mavlink_arp_command_tc_t *packet = (mavlink_arp_command_tc_t *)msgbuf;
packet->command_id = command_id;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ARP_COMMAND_TC, (const char *)packet, MAVLINK_MSG_ID_ARP_COMMAND_TC_MIN_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN, MAVLINK_MSG_ID_ARP_COMMAND_TC_CRC);
#endif
}
#endif
#endif
// MESSAGE ARP_COMMAND_TC UNPACKING
/**
* @brief Get field command_id from arp_command_tc message
*
* @return A member of the MavArpCommandList enum
*/
static inline uint8_t mavlink_msg_arp_command_tc_get_command_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Decode a arp_command_tc message into a struct
*
* @param msg The message to decode
* @param arp_command_tc C-struct to decode the message contents into
*/
static inline void mavlink_msg_arp_command_tc_decode(const mavlink_message_t* msg, mavlink_arp_command_tc_t* arp_command_tc)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
arp_command_tc->command_id = mavlink_msg_arp_command_tc_get_command_id(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN? msg->len : MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN;
memset(arp_command_tc, 0, MAVLINK_MSG_ID_ARP_COMMAND_TC_LEN);
memcpy(arp_command_tc, _MAV_PAYLOAD(msg), len);
#endif
}
This diff is collapsed.
#pragma once
// MESSAGE ATTITUDE_TM PACKING
#define MAVLINK_MSG_ID_ATTITUDE_TM 110
#define MAVLINK_MSG_ID_ATTITUDE_TM 111
typedef struct __mavlink_attitude_tm_t {
......@@ -18,17 +18,17 @@ typedef struct __mavlink_attitude_tm_t {
#define MAVLINK_MSG_ID_ATTITUDE_TM_LEN 56
#define MAVLINK_MSG_ID_ATTITUDE_TM_MIN_LEN 56
#define MAVLINK_MSG_ID_110_LEN 56
#define MAVLINK_MSG_ID_110_MIN_LEN 56
#define MAVLINK_MSG_ID_111_LEN 56
#define MAVLINK_MSG_ID_111_MIN_LEN 56
#define MAVLINK_MSG_ID_ATTITUDE_TM_CRC 6
#define MAVLINK_MSG_ID_110_CRC 6
#define MAVLINK_MSG_ID_111_CRC 6
#define MAVLINK_MSG_ATTITUDE_TM_FIELD_SENSOR_NAME_LEN 20
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_ATTITUDE_TM { \
110, \
111, \
"ATTITUDE_TM", \
9, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_tm_t, timestamp) }, \
......
#pragma once
// MESSAGE CAN_STATS_TM PACKING
#define MAVLINK_MSG_ID_CAN_STATS_TM 203
typedef struct __mavlink_can_stats_tm_t {
uint64_t timestamp; /*< [us] When was this logged*/
float payload_bit_rate; /*< Payload only bitrate*/
float total_bit_rate; /*< Total bitrate*/
float load_percent; /*< Load percent of the BUS*/
} mavlink_can_stats_tm_t;
#define MAVLINK_MSG_ID_CAN_STATS_TM_LEN 20
#define MAVLINK_MSG_ID_CAN_STATS_TM_MIN_LEN 20
#define MAVLINK_MSG_ID_203_LEN 20
#define MAVLINK_MSG_ID_203_MIN_LEN 20
#define MAVLINK_MSG_ID_CAN_STATS_TM_CRC 39
#define MAVLINK_MSG_ID_203_CRC 39
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_CAN_STATS_TM { \
203, \
"CAN_STATS_TM", \
4, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_can_stats_tm_t, timestamp) }, \
{ "payload_bit_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_can_stats_tm_t, payload_bit_rate) }, \
{ "total_bit_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_can_stats_tm_t, total_bit_rate) }, \
{ "load_percent", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_can_stats_tm_t, load_percent) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_CAN_STATS_TM { \
"CAN_STATS_TM", \
4, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_can_stats_tm_t, timestamp) }, \
{ "payload_bit_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_can_stats_tm_t, payload_bit_rate) }, \
{ "total_bit_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_can_stats_tm_t, total_bit_rate) }, \
{ "load_percent", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_can_stats_tm_t, load_percent) }, \
} \
}
#endif
/**
* @brief Pack a can_stats_tm 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 timestamp [us] When was this logged
* @param payload_bit_rate Payload only bitrate
* @param total_bit_rate Total bitrate
* @param load_percent Load percent of the BUS
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_can_stats_tm_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t timestamp, float payload_bit_rate, float total_bit_rate, float load_percent)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAN_STATS_TM_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, payload_bit_rate);
_mav_put_float(buf, 12, total_bit_rate);
_mav_put_float(buf, 16, load_percent);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAN_STATS_TM_LEN);
#else
mavlink_can_stats_tm_t packet;
packet.timestamp = timestamp;
packet.payload_bit_rate = payload_bit_rate;
packet.total_bit_rate = total_bit_rate;
packet.load_percent = load_percent;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAN_STATS_TM_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_CAN_STATS_TM;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAN_STATS_TM_MIN_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_CRC);
}
/**
* @brief Pack a can_stats_tm message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param timestamp [us] When was this logged
* @param payload_bit_rate Payload only bitrate
* @param total_bit_rate Total bitrate
* @param load_percent Load percent of the BUS
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_can_stats_tm_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t timestamp,float payload_bit_rate,float total_bit_rate,float load_percent)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAN_STATS_TM_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, payload_bit_rate);
_mav_put_float(buf, 12, total_bit_rate);
_mav_put_float(buf, 16, load_percent);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAN_STATS_TM_LEN);
#else
mavlink_can_stats_tm_t packet;
packet.timestamp = timestamp;
packet.payload_bit_rate = payload_bit_rate;
packet.total_bit_rate = total_bit_rate;
packet.load_percent = load_percent;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAN_STATS_TM_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_CAN_STATS_TM;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAN_STATS_TM_MIN_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_CRC);
}
/**
* @brief Encode a can_stats_tm struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param can_stats_tm C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_can_stats_tm_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_can_stats_tm_t* can_stats_tm)
{
return mavlink_msg_can_stats_tm_pack(system_id, component_id, msg, can_stats_tm->timestamp, can_stats_tm->payload_bit_rate, can_stats_tm->total_bit_rate, can_stats_tm->load_percent);
}
/**
* @brief Encode a can_stats_tm struct on a channel
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param can_stats_tm C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_can_stats_tm_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_can_stats_tm_t* can_stats_tm)
{
return mavlink_msg_can_stats_tm_pack_chan(system_id, component_id, chan, msg, can_stats_tm->timestamp, can_stats_tm->payload_bit_rate, can_stats_tm->total_bit_rate, can_stats_tm->load_percent);
}
/**
* @brief Send a can_stats_tm message
* @param chan MAVLink channel to send the message
*
* @param timestamp [us] When was this logged
* @param payload_bit_rate Payload only bitrate
* @param total_bit_rate Total bitrate
* @param load_percent Load percent of the BUS
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_can_stats_tm_send(mavlink_channel_t chan, uint64_t timestamp, float payload_bit_rate, float total_bit_rate, float load_percent)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_CAN_STATS_TM_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, payload_bit_rate);
_mav_put_float(buf, 12, total_bit_rate);
_mav_put_float(buf, 16, load_percent);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAN_STATS_TM, buf, MAVLINK_MSG_ID_CAN_STATS_TM_MIN_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_CRC);
#else
mavlink_can_stats_tm_t packet;
packet.timestamp = timestamp;
packet.payload_bit_rate = payload_bit_rate;
packet.total_bit_rate = total_bit_rate;
packet.load_percent = load_percent;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAN_STATS_TM, (const char *)&packet, MAVLINK_MSG_ID_CAN_STATS_TM_MIN_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_CRC);
#endif
}
/**
* @brief Send a can_stats_tm message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_can_stats_tm_send_struct(mavlink_channel_t chan, const mavlink_can_stats_tm_t* can_stats_tm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_can_stats_tm_send(chan, can_stats_tm->timestamp, can_stats_tm->payload_bit_rate, can_stats_tm->total_bit_rate, can_stats_tm->load_percent);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAN_STATS_TM, (const char *)can_stats_tm, MAVLINK_MSG_ID_CAN_STATS_TM_MIN_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_CRC);
#endif
}
#if MAVLINK_MSG_ID_CAN_STATS_TM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This variant of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
mavlink_message_t which is the size of a full mavlink message. This
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_can_stats_tm_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, float payload_bit_rate, float total_bit_rate, float load_percent)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_float(buf, 8, payload_bit_rate);
_mav_put_float(buf, 12, total_bit_rate);
_mav_put_float(buf, 16, load_percent);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAN_STATS_TM, buf, MAVLINK_MSG_ID_CAN_STATS_TM_MIN_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_CRC);
#else
mavlink_can_stats_tm_t *packet = (mavlink_can_stats_tm_t *)msgbuf;
packet->timestamp = timestamp;
packet->payload_bit_rate = payload_bit_rate;
packet->total_bit_rate = total_bit_rate;
packet->load_percent = load_percent;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAN_STATS_TM, (const char *)packet, MAVLINK_MSG_ID_CAN_STATS_TM_MIN_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_LEN, MAVLINK_MSG_ID_CAN_STATS_TM_CRC);
#endif
}
#endif
#endif
// MESSAGE CAN_STATS_TM UNPACKING
/**
* @brief Get field timestamp from can_stats_tm message
*
* @return [us] When was this logged
*/
static inline uint64_t mavlink_msg_can_stats_tm_get_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field payload_bit_rate from can_stats_tm message
*
* @return Payload only bitrate
*/
static inline float mavlink_msg_can_stats_tm_get_payload_bit_rate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field total_bit_rate from can_stats_tm message
*
* @return Total bitrate
*/
static inline float mavlink_msg_can_stats_tm_get_total_bit_rate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field load_percent from can_stats_tm message
*
* @return Load percent of the BUS
*/
static inline float mavlink_msg_can_stats_tm_get_load_percent(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Decode a can_stats_tm message into a struct
*
* @param msg The message to decode
* @param can_stats_tm C-struct to decode the message contents into
*/
static inline void mavlink_msg_can_stats_tm_decode(const mavlink_message_t* msg, mavlink_can_stats_tm_t* can_stats_tm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
can_stats_tm->timestamp = mavlink_msg_can_stats_tm_get_timestamp(msg);
can_stats_tm->payload_bit_rate = mavlink_msg_can_stats_tm_get_payload_bit_rate(msg);
can_stats_tm->total_bit_rate = mavlink_msg_can_stats_tm_get_total_bit_rate(msg);
can_stats_tm->load_percent = mavlink_msg_can_stats_tm_get_load_percent(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_CAN_STATS_TM_LEN? msg->len : MAVLINK_MSG_ID_CAN_STATS_TM_LEN;
memset(can_stats_tm, 0, MAVLINK_MSG_ID_CAN_STATS_TM_LEN);
memcpy(can_stats_tm, _MAV_PAYLOAD(msg), len);
#endif
}
#pragma once
// MESSAGE CONRIG_STATE_TC PACKING
#define MAVLINK_MSG_ID_CONRIG_STATE_TC 19
#define MAVLINK_MSG_ID_CONRIG_STATE_TC 32
typedef struct __mavlink_conrig_state_tc_t {
......@@ -16,17 +16,17 @@ typedef struct __mavlink_conrig_state_tc_t {
#define MAVLINK_MSG_ID_CONRIG_STATE_TC_LEN 7
#define MAVLINK_MSG_ID_CONRIG_STATE_TC_MIN_LEN 7
#define MAVLINK_MSG_ID_19_LEN 7
#define MAVLINK_MSG_ID_19_MIN_LEN 7
#define MAVLINK_MSG_ID_32_LEN 7
#define MAVLINK_MSG_ID_32_MIN_LEN 7
#define MAVLINK_MSG_ID_CONRIG_STATE_TC_CRC 65
#define MAVLINK_MSG_ID_19_CRC 65
#define MAVLINK_MSG_ID_32_CRC 65
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_CONRIG_STATE_TC { \
19, \
32, \
"CONRIG_STATE_TC", \
7, \
{ { "ignition_btn", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_conrig_state_tc_t, ignition_btn) }, \
......
#pragma once
// MESSAGE CURRENT_TM PACKING
#define MAVLINK_MSG_ID_CURRENT_TM 107
#define MAVLINK_MSG_ID_CURRENT_TM 108
typedef struct __mavlink_current_tm_t {
......@@ -12,17 +12,17 @@ typedef struct __mavlink_current_tm_t {
#define MAVLINK_MSG_ID_CURRENT_TM_LEN 32
#define MAVLINK_MSG_ID_CURRENT_TM_MIN_LEN 32
#define MAVLINK_MSG_ID_107_LEN 32
#define MAVLINK_MSG_ID_107_MIN_LEN 32
#define MAVLINK_MSG_ID_108_LEN 32
#define MAVLINK_MSG_ID_108_MIN_LEN 32
#define MAVLINK_MSG_ID_CURRENT_TM_CRC 212
#define MAVLINK_MSG_ID_107_CRC 212
#define MAVLINK_MSG_ID_108_CRC 212
#define MAVLINK_MSG_CURRENT_TM_FIELD_SENSOR_NAME_LEN 20
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_CURRENT_TM { \
107, \
108, \
"CURRENT_TM", \
3, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_current_tm_t, timestamp) }, \
......
#pragma once
// MESSAGE FSM_TM PACKING
#define MAVLINK_MSG_ID_FSM_TM 201
typedef struct __mavlink_fsm_tm_t {
uint64_t timestamp; /*< [us] Timestamp*/
uint8_t ada_state; /*< Apogee Detection Algorithm state*/
uint8_t abk_state; /*< Air Brakes state*/
uint8_t dpl_state; /*< Deployment state*/
uint8_t fmm_state; /*< Flight Mode Manager state*/
uint8_t nas_state; /*< Navigation and Attitude System state*/
uint8_t wes_state; /*< Wind Estimation System state*/
} mavlink_fsm_tm_t;
#define MAVLINK_MSG_ID_FSM_TM_LEN 14
#define MAVLINK_MSG_ID_FSM_TM_MIN_LEN 14
#define MAVLINK_MSG_ID_201_LEN 14
#define MAVLINK_MSG_ID_201_MIN_LEN 14
#define MAVLINK_MSG_ID_FSM_TM_CRC 242
#define MAVLINK_MSG_ID_201_CRC 242
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_FSM_TM { \
201, \
"FSM_TM", \
7, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_fsm_tm_t, timestamp) }, \
{ "ada_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_fsm_tm_t, ada_state) }, \
{ "abk_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_fsm_tm_t, abk_state) }, \
{ "dpl_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_fsm_tm_t, dpl_state) }, \
{ "fmm_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_fsm_tm_t, fmm_state) }, \
{ "nas_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_fsm_tm_t, nas_state) }, \
{ "wes_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_fsm_tm_t, wes_state) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_FSM_TM { \
"FSM_TM", \
7, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_fsm_tm_t, timestamp) }, \
{ "ada_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_fsm_tm_t, ada_state) }, \
{ "abk_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_fsm_tm_t, abk_state) }, \
{ "dpl_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_fsm_tm_t, dpl_state) }, \
{ "fmm_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_fsm_tm_t, fmm_state) }, \
{ "nas_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_fsm_tm_t, nas_state) }, \
{ "wes_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_fsm_tm_t, wes_state) }, \
} \
}
#endif
/**
* @brief Pack a fsm_tm 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 timestamp [us] Timestamp
* @param ada_state Apogee Detection Algorithm state
* @param abk_state Air Brakes state
* @param dpl_state Deployment state
* @param fmm_state Flight Mode Manager state
* @param nas_state Navigation and Attitude System state
* @param wes_state Wind Estimation System state
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_fsm_tm_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t timestamp, uint8_t ada_state, uint8_t abk_state, uint8_t dpl_state, uint8_t fmm_state, uint8_t nas_state, uint8_t wes_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_FSM_TM_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint8_t(buf, 8, ada_state);
_mav_put_uint8_t(buf, 9, abk_state);
_mav_put_uint8_t(buf, 10, dpl_state);
_mav_put_uint8_t(buf, 11, fmm_state);
_mav_put_uint8_t(buf, 12, nas_state);
_mav_put_uint8_t(buf, 13, wes_state);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FSM_TM_LEN);
#else
mavlink_fsm_tm_t packet;
packet.timestamp = timestamp;
packet.ada_state = ada_state;
packet.abk_state = abk_state;
packet.dpl_state = dpl_state;
packet.fmm_state = fmm_state;
packet.nas_state = nas_state;
packet.wes_state = wes_state;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FSM_TM_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_FSM_TM;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FSM_TM_MIN_LEN, MAVLINK_MSG_ID_FSM_TM_LEN, MAVLINK_MSG_ID_FSM_TM_CRC);
}
/**
* @brief Pack a fsm_tm message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param timestamp [us] Timestamp
* @param ada_state Apogee Detection Algorithm state
* @param abk_state Air Brakes state
* @param dpl_state Deployment state
* @param fmm_state Flight Mode Manager state
* @param nas_state Navigation and Attitude System state
* @param wes_state Wind Estimation System state
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_fsm_tm_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t timestamp,uint8_t ada_state,uint8_t abk_state,uint8_t dpl_state,uint8_t fmm_state,uint8_t nas_state,uint8_t wes_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_FSM_TM_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint8_t(buf, 8, ada_state);
_mav_put_uint8_t(buf, 9, abk_state);
_mav_put_uint8_t(buf, 10, dpl_state);
_mav_put_uint8_t(buf, 11, fmm_state);
_mav_put_uint8_t(buf, 12, nas_state);
_mav_put_uint8_t(buf, 13, wes_state);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FSM_TM_LEN);
#else
mavlink_fsm_tm_t packet;
packet.timestamp = timestamp;
packet.ada_state = ada_state;
packet.abk_state = abk_state;
packet.dpl_state = dpl_state;
packet.fmm_state = fmm_state;
packet.nas_state = nas_state;
packet.wes_state = wes_state;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FSM_TM_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_FSM_TM;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FSM_TM_MIN_LEN, MAVLINK_MSG_ID_FSM_TM_LEN, MAVLINK_MSG_ID_FSM_TM_CRC);
}
/**
* @brief Encode a fsm_tm struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param fsm_tm C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_fsm_tm_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fsm_tm_t* fsm_tm)
{
return mavlink_msg_fsm_tm_pack(system_id, component_id, msg, fsm_tm->timestamp, fsm_tm->ada_state, fsm_tm->abk_state, fsm_tm->dpl_state, fsm_tm->fmm_state, fsm_tm->nas_state, fsm_tm->wes_state);
}
/**
* @brief Encode a fsm_tm struct on a channel
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param fsm_tm C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_fsm_tm_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_fsm_tm_t* fsm_tm)
{
return mavlink_msg_fsm_tm_pack_chan(system_id, component_id, chan, msg, fsm_tm->timestamp, fsm_tm->ada_state, fsm_tm->abk_state, fsm_tm->dpl_state, fsm_tm->fmm_state, fsm_tm->nas_state, fsm_tm->wes_state);
}
/**
* @brief Send a fsm_tm message
* @param chan MAVLink channel to send the message
*
* @param timestamp [us] Timestamp
* @param ada_state Apogee Detection Algorithm state
* @param abk_state Air Brakes state
* @param dpl_state Deployment state
* @param fmm_state Flight Mode Manager state
* @param nas_state Navigation and Attitude System state
* @param wes_state Wind Estimation System state
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_fsm_tm_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t ada_state, uint8_t abk_state, uint8_t dpl_state, uint8_t fmm_state, uint8_t nas_state, uint8_t wes_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_FSM_TM_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint8_t(buf, 8, ada_state);
_mav_put_uint8_t(buf, 9, abk_state);
_mav_put_uint8_t(buf, 10, dpl_state);
_mav_put_uint8_t(buf, 11, fmm_state);
_mav_put_uint8_t(buf, 12, nas_state);
_mav_put_uint8_t(buf, 13, wes_state);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FSM_TM, buf, MAVLINK_MSG_ID_FSM_TM_MIN_LEN, MAVLINK_MSG_ID_FSM_TM_LEN, MAVLINK_MSG_ID_FSM_TM_CRC);
#else
mavlink_fsm_tm_t packet;
packet.timestamp = timestamp;
packet.ada_state = ada_state;
packet.abk_state = abk_state;
packet.dpl_state = dpl_state;
packet.fmm_state = fmm_state;
packet.nas_state = nas_state;
packet.wes_state = wes_state;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FSM_TM, (const char *)&packet, MAVLINK_MSG_ID_FSM_TM_MIN_LEN, MAVLINK_MSG_ID_FSM_TM_LEN, MAVLINK_MSG_ID_FSM_TM_CRC);
#endif
}
/**
* @brief Send a fsm_tm message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_fsm_tm_send_struct(mavlink_channel_t chan, const mavlink_fsm_tm_t* fsm_tm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_fsm_tm_send(chan, fsm_tm->timestamp, fsm_tm->ada_state, fsm_tm->abk_state, fsm_tm->dpl_state, fsm_tm->fmm_state, fsm_tm->nas_state, fsm_tm->wes_state);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FSM_TM, (const char *)fsm_tm, MAVLINK_MSG_ID_FSM_TM_MIN_LEN, MAVLINK_MSG_ID_FSM_TM_LEN, MAVLINK_MSG_ID_FSM_TM_CRC);
#endif
}
#if MAVLINK_MSG_ID_FSM_TM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This variant of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
mavlink_message_t which is the size of a full mavlink message. This
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_fsm_tm_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint8_t ada_state, uint8_t abk_state, uint8_t dpl_state, uint8_t fmm_state, uint8_t nas_state, uint8_t wes_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint8_t(buf, 8, ada_state);
_mav_put_uint8_t(buf, 9, abk_state);
_mav_put_uint8_t(buf, 10, dpl_state);
_mav_put_uint8_t(buf, 11, fmm_state);
_mav_put_uint8_t(buf, 12, nas_state);
_mav_put_uint8_t(buf, 13, wes_state);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FSM_TM, buf, MAVLINK_MSG_ID_FSM_TM_MIN_LEN, MAVLINK_MSG_ID_FSM_TM_LEN, MAVLINK_MSG_ID_FSM_TM_CRC);
#else
mavlink_fsm_tm_t *packet = (mavlink_fsm_tm_t *)msgbuf;
packet->timestamp = timestamp;
packet->ada_state = ada_state;
packet->abk_state = abk_state;
packet->dpl_state = dpl_state;
packet->fmm_state = fmm_state;
packet->nas_state = nas_state;
packet->wes_state = wes_state;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FSM_TM, (const char *)packet, MAVLINK_MSG_ID_FSM_TM_MIN_LEN, MAVLINK_MSG_ID_FSM_TM_LEN, MAVLINK_MSG_ID_FSM_TM_CRC);
#endif
}
#endif
#endif
// MESSAGE FSM_TM UNPACKING
/**
* @brief Get field timestamp from fsm_tm message
*
* @return [us] Timestamp
*/
static inline uint64_t mavlink_msg_fsm_tm_get_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field ada_state from fsm_tm message
*
* @return Apogee Detection Algorithm state
*/
static inline uint8_t mavlink_msg_fsm_tm_get_ada_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
* @brief Get field abk_state from fsm_tm message
*
* @return Air Brakes state
*/
static inline uint8_t mavlink_msg_fsm_tm_get_abk_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 9);
}
/**
* @brief Get field dpl_state from fsm_tm message
*
* @return Deployment state
*/
static inline uint8_t mavlink_msg_fsm_tm_get_dpl_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 10);
}
/**
* @brief Get field fmm_state from fsm_tm message
*
* @return Flight Mode Manager state
*/
static inline uint8_t mavlink_msg_fsm_tm_get_fmm_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 11);
}
/**
* @brief Get field nas_state from fsm_tm message
*
* @return Navigation and Attitude System state
*/
static inline uint8_t mavlink_msg_fsm_tm_get_nas_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 12);
}
/**
* @brief Get field wes_state from fsm_tm message
*
* @return Wind Estimation System state
*/
static inline uint8_t mavlink_msg_fsm_tm_get_wes_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 13);
}
/**
* @brief Decode a fsm_tm message into a struct
*
* @param msg The message to decode
* @param fsm_tm C-struct to decode the message contents into
*/
static inline void mavlink_msg_fsm_tm_decode(const mavlink_message_t* msg, mavlink_fsm_tm_t* fsm_tm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
fsm_tm->timestamp = mavlink_msg_fsm_tm_get_timestamp(msg);
fsm_tm->ada_state = mavlink_msg_fsm_tm_get_ada_state(msg);
fsm_tm->abk_state = mavlink_msg_fsm_tm_get_abk_state(msg);
fsm_tm->dpl_state = mavlink_msg_fsm_tm_get_dpl_state(msg);
fsm_tm->fmm_state = mavlink_msg_fsm_tm_get_fmm_state(msg);
fsm_tm->nas_state = mavlink_msg_fsm_tm_get_nas_state(msg);
fsm_tm->wes_state = mavlink_msg_fsm_tm_get_wes_state(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_FSM_TM_LEN? msg->len : MAVLINK_MSG_ID_FSM_TM_LEN;
memset(fsm_tm, 0, MAVLINK_MSG_ID_FSM_TM_LEN);
memcpy(fsm_tm, _MAV_PAYLOAD(msg), len);
#endif
}
#pragma once
// MESSAGE GPS_TM PACKING
#define MAVLINK_MSG_ID_GPS_TM 102
#define MAVLINK_MSG_ID_GPS_TM 103
typedef struct __mavlink_gps_tm_t {
......@@ -21,17 +21,17 @@ typedef struct __mavlink_gps_tm_t {
#define MAVLINK_MSG_ID_GPS_TM_LEN 74
#define MAVLINK_MSG_ID_GPS_TM_MIN_LEN 74
#define MAVLINK_MSG_ID_102_LEN 74
#define MAVLINK_MSG_ID_102_MIN_LEN 74
#define MAVLINK_MSG_ID_103_LEN 74
#define MAVLINK_MSG_ID_103_MIN_LEN 74
#define MAVLINK_MSG_ID_GPS_TM_CRC 57
#define MAVLINK_MSG_ID_102_CRC 57
#define MAVLINK_MSG_ID_103_CRC 57
#define MAVLINK_MSG_GPS_TM_FIELD_SENSOR_NAME_LEN 20
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_GPS_TM { \
102, \
103, \
"GPS_TM", \
12, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_tm_t, timestamp) }, \
......
This diff is collapsed.
#pragma once
// MESSAGE IMU_TM PACKING
#define MAVLINK_MSG_ID_IMU_TM 103
#define MAVLINK_MSG_ID_IMU_TM 104
typedef struct __mavlink_imu_tm_t {
......@@ -20,17 +20,17 @@ typedef struct __mavlink_imu_tm_t {
#define MAVLINK_MSG_ID_IMU_TM_LEN 64
#define MAVLINK_MSG_ID_IMU_TM_MIN_LEN 64
#define MAVLINK_MSG_ID_103_LEN 64
#define MAVLINK_MSG_ID_103_MIN_LEN 64
#define MAVLINK_MSG_ID_104_LEN 64
#define MAVLINK_MSG_ID_104_MIN_LEN 64
#define MAVLINK_MSG_ID_IMU_TM_CRC 72
#define MAVLINK_MSG_ID_103_CRC 72
#define MAVLINK_MSG_ID_104_CRC 72
#define MAVLINK_MSG_IMU_TM_FIELD_SENSOR_NAME_LEN 20
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_IMU_TM { \
103, \
104, \
"IMU_TM", \
11, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_imu_tm_t, timestamp) }, \
......
#pragma once
// MESSAGE LOAD_TM PACKING
#define MAVLINK_MSG_ID_LOAD_TM 109
#define MAVLINK_MSG_ID_LOAD_TM 110
typedef struct __mavlink_load_tm_t {
......@@ -12,17 +12,17 @@ typedef struct __mavlink_load_tm_t {
#define MAVLINK_MSG_ID_LOAD_TM_LEN 32
#define MAVLINK_MSG_ID_LOAD_TM_MIN_LEN 32
#define MAVLINK_MSG_ID_109_LEN 32
#define MAVLINK_MSG_ID_109_MIN_LEN 32
#define MAVLINK_MSG_ID_110_LEN 32
#define MAVLINK_MSG_ID_110_MIN_LEN 32
#define MAVLINK_MSG_ID_LOAD_TM_CRC 148
#define MAVLINK_MSG_ID_109_CRC 148
#define MAVLINK_MSG_ID_110_CRC 148
#define MAVLINK_MSG_LOAD_TM_FIELD_SENSOR_NAME_LEN 20
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_LOAD_TM { \
109, \
110, \
"LOAD_TM", \
3, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_load_tm_t, timestamp) }, \
......
#pragma once
// MESSAGE LOGGER_TM PACKING
#define MAVLINK_MSG_ID_LOGGER_TM 202
#define MAVLINK_MSG_ID_LOGGER_TM 201
typedef struct __mavlink_logger_tm_t {
......@@ -20,17 +20,17 @@ typedef struct __mavlink_logger_tm_t {
#define MAVLINK_MSG_ID_LOGGER_TM_LEN 46
#define MAVLINK_MSG_ID_LOGGER_TM_MIN_LEN 46
#define MAVLINK_MSG_ID_202_LEN 46
#define MAVLINK_MSG_ID_202_MIN_LEN 46
#define MAVLINK_MSG_ID_201_LEN 46
#define MAVLINK_MSG_ID_201_MIN_LEN 46
#define MAVLINK_MSG_ID_LOGGER_TM_CRC 142
#define MAVLINK_MSG_ID_202_CRC 142
#define MAVLINK_MSG_ID_201_CRC 142
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_LOGGER_TM { \
202, \
201, \
"LOGGER_TM", \
11, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_logger_tm_t, timestamp) }, \
......
#pragma once
// MESSAGE MAVLINK_STATS_TM PACKING
#define MAVLINK_MSG_ID_MAVLINK_STATS_TM 203
#define MAVLINK_MSG_ID_MAVLINK_STATS_TM 202
typedef struct __mavlink_mavlink_stats_tm_t {
......@@ -22,17 +22,17 @@ typedef struct __mavlink_mavlink_stats_tm_t {
#define MAVLINK_MSG_ID_MAVLINK_STATS_TM_LEN 28
#define MAVLINK_MSG_ID_MAVLINK_STATS_TM_MIN_LEN 28
#define MAVLINK_MSG_ID_203_LEN 28
#define MAVLINK_MSG_ID_203_MIN_LEN 28
#define MAVLINK_MSG_ID_202_LEN 28
#define MAVLINK_MSG_ID_202_MIN_LEN 28
#define MAVLINK_MSG_ID_MAVLINK_STATS_TM_CRC 108
#define MAVLINK_MSG_ID_203_CRC 108
#define MAVLINK_MSG_ID_202_CRC 108
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_MAVLINK_STATS_TM { \
203, \
202, \
"MAVLINK_STATS_TM", \
13, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_mavlink_stats_tm_t, timestamp) }, \
......
......@@ -10,7 +10,7 @@ typedef struct __mavlink_mea_tm_t {
float kalman_x1; /*< Kalman state variable 1 */
float kalman_x2; /*< Kalman state variable 2 (mass)*/
float mass; /*< [kg] Mass estimated*/
float corrected_pressure; /*< [kg] Corrected pressure*/
float corrected_pressure; /*< [Pa] Corrected pressure*/
uint8_t state; /*< MEA current state*/
} mavlink_mea_tm_t;
......@@ -65,7 +65,7 @@ typedef struct __mavlink_mea_tm_t {
* @param kalman_x1 Kalman state variable 1
* @param kalman_x2 Kalman state variable 2 (mass)
* @param mass [kg] Mass estimated
* @param corrected_pressure [kg] Corrected pressure
* @param corrected_pressure [Pa] Corrected pressure
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mea_tm_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
......@@ -111,7 +111,7 @@ static inline uint16_t mavlink_msg_mea_tm_pack(uint8_t system_id, uint8_t compon
* @param kalman_x1 Kalman state variable 1
* @param kalman_x2 Kalman state variable 2 (mass)
* @param mass [kg] Mass estimated
* @param corrected_pressure [kg] Corrected pressure
* @param corrected_pressure [Pa] Corrected pressure
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_mea_tm_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
......@@ -183,7 +183,7 @@ static inline uint16_t mavlink_msg_mea_tm_encode_chan(uint8_t system_id, uint8_t
* @param kalman_x1 Kalman state variable 1
* @param kalman_x2 Kalman state variable 2 (mass)
* @param mass [kg] Mass estimated
* @param corrected_pressure [kg] Corrected pressure
* @param corrected_pressure [Pa] Corrected pressure
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
......@@ -332,7 +332,7 @@ static inline float mavlink_msg_mea_tm_get_mass(const mavlink_message_t* msg)
/**
* @brief Get field corrected_pressure from mea_tm message
*
* @return [kg] Corrected pressure
* @return [Pa] Corrected pressure
*/
static inline float mavlink_msg_mea_tm_get_corrected_pressure(const mavlink_message_t* msg)
{
......
This diff is collapsed.
......@@ -5,17 +5,18 @@
typedef struct __mavlink_nack_tm_t {
uint16_t err_id; /*< Error core that generated the NACK*/
uint8_t recv_msgid; /*< Message id of the received message*/
uint8_t seq_ack; /*< Sequence number of the received message*/
} mavlink_nack_tm_t;
#define MAVLINK_MSG_ID_NACK_TM_LEN 2
#define MAVLINK_MSG_ID_NACK_TM_MIN_LEN 2
#define MAVLINK_MSG_ID_101_LEN 2
#define MAVLINK_MSG_ID_101_MIN_LEN 2
#define MAVLINK_MSG_ID_NACK_TM_LEN 4
#define MAVLINK_MSG_ID_NACK_TM_MIN_LEN 4
#define MAVLINK_MSG_ID_101_LEN 4
#define MAVLINK_MSG_ID_101_MIN_LEN 4
#define MAVLINK_MSG_ID_NACK_TM_CRC 146
#define MAVLINK_MSG_ID_101_CRC 146
#define MAVLINK_MSG_ID_NACK_TM_CRC 251
#define MAVLINK_MSG_ID_101_CRC 251
......@@ -23,17 +24,19 @@ typedef struct __mavlink_nack_tm_t {
#define MAVLINK_MESSAGE_INFO_NACK_TM { \
101, \
"NACK_TM", \
2, \
{ { "recv_msgid", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_nack_tm_t, recv_msgid) }, \
{ "seq_ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_nack_tm_t, seq_ack) }, \
3, \
{ { "recv_msgid", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_nack_tm_t, recv_msgid) }, \
{ "seq_ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_nack_tm_t, seq_ack) }, \
{ "err_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_nack_tm_t, err_id) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_NACK_TM { \
"NACK_TM", \
2, \
{ { "recv_msgid", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_nack_tm_t, recv_msgid) }, \
{ "seq_ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_nack_tm_t, seq_ack) }, \
3, \
{ { "recv_msgid", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_nack_tm_t, recv_msgid) }, \
{ "seq_ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_nack_tm_t, seq_ack) }, \
{ "err_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_nack_tm_t, err_id) }, \
} \
}
#endif
......@@ -46,19 +49,22 @@ typedef struct __mavlink_nack_tm_t {
*
* @param recv_msgid Message id of the received message
* @param seq_ack Sequence number of the received message
* @param err_id Error core that generated the NACK
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_nack_tm_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t recv_msgid, uint8_t seq_ack)
uint8_t recv_msgid, uint8_t seq_ack, uint16_t err_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_NACK_TM_LEN];
_mav_put_uint8_t(buf, 0, recv_msgid);
_mav_put_uint8_t(buf, 1, seq_ack);
_mav_put_uint16_t(buf, 0, err_id);
_mav_put_uint8_t(buf, 2, recv_msgid);
_mav_put_uint8_t(buf, 3, seq_ack);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NACK_TM_LEN);
#else
mavlink_nack_tm_t packet;
packet.err_id = err_id;
packet.recv_msgid = recv_msgid;
packet.seq_ack = seq_ack;
......@@ -77,20 +83,23 @@ static inline uint16_t mavlink_msg_nack_tm_pack(uint8_t system_id, uint8_t compo
* @param msg The MAVLink message to compress the data into
* @param recv_msgid Message id of the received message
* @param seq_ack Sequence number of the received message
* @param err_id Error core that generated the NACK
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_nack_tm_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t recv_msgid,uint8_t seq_ack)
uint8_t recv_msgid,uint8_t seq_ack,uint16_t err_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_NACK_TM_LEN];
_mav_put_uint8_t(buf, 0, recv_msgid);
_mav_put_uint8_t(buf, 1, seq_ack);
_mav_put_uint16_t(buf, 0, err_id);
_mav_put_uint8_t(buf, 2, recv_msgid);
_mav_put_uint8_t(buf, 3, seq_ack);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NACK_TM_LEN);
#else
mavlink_nack_tm_t packet;
packet.err_id = err_id;
packet.recv_msgid = recv_msgid;
packet.seq_ack = seq_ack;
......@@ -111,7 +120,7 @@ static inline uint16_t mavlink_msg_nack_tm_pack_chan(uint8_t system_id, uint8_t
*/
static inline uint16_t mavlink_msg_nack_tm_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_nack_tm_t* nack_tm)
{
return mavlink_msg_nack_tm_pack(system_id, component_id, msg, nack_tm->recv_msgid, nack_tm->seq_ack);
return mavlink_msg_nack_tm_pack(system_id, component_id, msg, nack_tm->recv_msgid, nack_tm->seq_ack, nack_tm->err_id);
}
/**
......@@ -125,7 +134,7 @@ static inline uint16_t mavlink_msg_nack_tm_encode(uint8_t system_id, uint8_t com
*/
static inline uint16_t mavlink_msg_nack_tm_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_nack_tm_t* nack_tm)
{
return mavlink_msg_nack_tm_pack_chan(system_id, component_id, chan, msg, nack_tm->recv_msgid, nack_tm->seq_ack);
return mavlink_msg_nack_tm_pack_chan(system_id, component_id, chan, msg, nack_tm->recv_msgid, nack_tm->seq_ack, nack_tm->err_id);
}
/**
......@@ -134,19 +143,22 @@ static inline uint16_t mavlink_msg_nack_tm_encode_chan(uint8_t system_id, uint8_
*
* @param recv_msgid Message id of the received message
* @param seq_ack Sequence number of the received message
* @param err_id Error core that generated the NACK
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_nack_tm_send(mavlink_channel_t chan, uint8_t recv_msgid, uint8_t seq_ack)
static inline void mavlink_msg_nack_tm_send(mavlink_channel_t chan, uint8_t recv_msgid, uint8_t seq_ack, uint16_t err_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_NACK_TM_LEN];
_mav_put_uint8_t(buf, 0, recv_msgid);
_mav_put_uint8_t(buf, 1, seq_ack);
_mav_put_uint16_t(buf, 0, err_id);
_mav_put_uint8_t(buf, 2, recv_msgid);
_mav_put_uint8_t(buf, 3, seq_ack);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NACK_TM, buf, MAVLINK_MSG_ID_NACK_TM_MIN_LEN, MAVLINK_MSG_ID_NACK_TM_LEN, MAVLINK_MSG_ID_NACK_TM_CRC);
#else
mavlink_nack_tm_t packet;
packet.err_id = err_id;
packet.recv_msgid = recv_msgid;
packet.seq_ack = seq_ack;
......@@ -162,7 +174,7 @@ static inline void mavlink_msg_nack_tm_send(mavlink_channel_t chan, uint8_t recv
static inline void mavlink_msg_nack_tm_send_struct(mavlink_channel_t chan, const mavlink_nack_tm_t* nack_tm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_nack_tm_send(chan, nack_tm->recv_msgid, nack_tm->seq_ack);
mavlink_msg_nack_tm_send(chan, nack_tm->recv_msgid, nack_tm->seq_ack, nack_tm->err_id);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NACK_TM, (const char *)nack_tm, MAVLINK_MSG_ID_NACK_TM_MIN_LEN, MAVLINK_MSG_ID_NACK_TM_LEN, MAVLINK_MSG_ID_NACK_TM_CRC);
#endif
......@@ -176,16 +188,18 @@ static inline void mavlink_msg_nack_tm_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_nack_tm_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t recv_msgid, uint8_t seq_ack)
static inline void mavlink_msg_nack_tm_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t recv_msgid, uint8_t seq_ack, uint16_t err_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint8_t(buf, 0, recv_msgid);
_mav_put_uint8_t(buf, 1, seq_ack);
_mav_put_uint16_t(buf, 0, err_id);
_mav_put_uint8_t(buf, 2, recv_msgid);
_mav_put_uint8_t(buf, 3, seq_ack);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NACK_TM, buf, MAVLINK_MSG_ID_NACK_TM_MIN_LEN, MAVLINK_MSG_ID_NACK_TM_LEN, MAVLINK_MSG_ID_NACK_TM_CRC);
#else
mavlink_nack_tm_t *packet = (mavlink_nack_tm_t *)msgbuf;
packet->err_id = err_id;
packet->recv_msgid = recv_msgid;
packet->seq_ack = seq_ack;
......@@ -206,7 +220,7 @@ static inline void mavlink_msg_nack_tm_send_buf(mavlink_message_t *msgbuf, mavli
*/
static inline uint8_t mavlink_msg_nack_tm_get_recv_msgid(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
......@@ -216,7 +230,17 @@ static inline uint8_t mavlink_msg_nack_tm_get_recv_msgid(const mavlink_message_t
*/
static inline uint8_t mavlink_msg_nack_tm_get_seq_ack(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 1);
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
* @brief Get field err_id from nack_tm message
*
* @return Error core that generated the NACK
*/
static inline uint16_t mavlink_msg_nack_tm_get_err_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
......@@ -228,6 +252,7 @@ static inline uint8_t mavlink_msg_nack_tm_get_seq_ack(const mavlink_message_t* m
static inline void mavlink_msg_nack_tm_decode(const mavlink_message_t* msg, mavlink_nack_tm_t* nack_tm)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
nack_tm->err_id = mavlink_msg_nack_tm_get_err_id(msg);
nack_tm->recv_msgid = mavlink_msg_nack_tm_get_recv_msgid(msg);
nack_tm->seq_ack = mavlink_msg_nack_tm_get_seq_ack(msg);
#else
......