[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:
@@ -4,7 +4,7 @@
|
||||
|
||||
typedef struct __mavlink_statustext_t
|
||||
{
|
||||
uint8_t severity; ///< Severity of status, 0 = info message, 255 = critical fault
|
||||
uint8_t severity; ///< Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
|
||||
char text[50]; ///< Status text message, without null termination character
|
||||
} mavlink_statustext_t;
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct __mavlink_statustext_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param severity Severity of status, 0 = info message, 255 = critical fault
|
||||
* @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
|
||||
* @param text Status text message, without null termination character
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
@@ -39,12 +39,12 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co
|
||||
char buf[51];
|
||||
_mav_put_uint8_t(buf, 0, severity);
|
||||
_mav_put_char_array(buf, 1, text, 50);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 51);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51);
|
||||
#else
|
||||
mavlink_statustext_t packet;
|
||||
packet.severity = severity;
|
||||
mav_array_memcpy(packet.text, text, sizeof(char)*50);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 51);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_STATUSTEXT;
|
||||
@@ -57,7 +57,7 @@ static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t co
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param severity Severity of status, 0 = info message, 255 = critical fault
|
||||
* @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
|
||||
* @param text Status text message, without null termination character
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
@@ -69,12 +69,12 @@ static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8
|
||||
char buf[51];
|
||||
_mav_put_uint8_t(buf, 0, severity);
|
||||
_mav_put_char_array(buf, 1, text, 50);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 51);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51);
|
||||
#else
|
||||
mavlink_statustext_t packet;
|
||||
packet.severity = severity;
|
||||
mav_array_memcpy(packet.text, text, sizeof(char)*50);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 51);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_STATUSTEXT;
|
||||
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t
|
||||
* @brief Send a statustext message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param severity Severity of status, 0 = info message, 255 = critical fault
|
||||
* @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
|
||||
* @param text Status text message, without null termination character
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
@@ -126,7 +126,7 @@ static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t s
|
||||
/**
|
||||
* @brief Get field severity from statustext message
|
||||
*
|
||||
* @return Severity of status, 0 = info message, 255 = critical fault
|
||||
* @return Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user