Commit 24d7ea4d authored by PX4BuildBot's avatar PX4BuildBot

autogenerated headers for rev...

autogenerated headers for rev https://github.com/mavlink/mavlink/tree/c071b31de53384fe48202ac5cad390e400ee886f
parent 8a4dc5a3
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:20:30 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:25:07 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:19:42 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:24:22 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:19:50 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:24:30 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:20:42 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:25:21 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:19:57 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:24:39 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:20:05 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:24:48 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 9
......
/** @file
* @brief MAVLink comm protocol built from pixhawk.xml
* @see http://mavlink.org
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 254
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 1
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 1
#endif
#include "version.h"
#include "pixhawk.h"
#endif // MAVLINK_H
// MESSAGE ATTITUDE_CONTROL PACKING
#define MAVLINK_MSG_ID_ATTITUDE_CONTROL 200
typedef struct __mavlink_attitude_control_t
{
float roll; /*< roll*/
float pitch; /*< pitch*/
float yaw; /*< yaw*/
float thrust; /*< thrust*/
uint8_t target; /*< The system to be controlled*/
uint8_t roll_manual; /*< roll control enabled auto:0, manual:1*/
uint8_t pitch_manual; /*< pitch auto:0, manual:1*/
uint8_t yaw_manual; /*< yaw auto:0, manual:1*/
uint8_t thrust_manual; /*< thrust auto:0, manual:1*/
} mavlink_attitude_control_t;
#define MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN 21
#define MAVLINK_MSG_ID_200_LEN 21
#define MAVLINK_MSG_ID_ATTITUDE_CONTROL_CRC 254
#define MAVLINK_MSG_ID_200_CRC 254
#define MAVLINK_MESSAGE_INFO_ATTITUDE_CONTROL { \
"ATTITUDE_CONTROL", \
9, \
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_attitude_control_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_control_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_control_t, yaw) }, \
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_control_t, thrust) }, \
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_attitude_control_t, target) }, \
{ "roll_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_attitude_control_t, roll_manual) }, \
{ "pitch_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_attitude_control_t, pitch_manual) }, \
{ "yaw_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_attitude_control_t, yaw_manual) }, \
{ "thrust_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_attitude_control_t, thrust_manual) }, \
} \
}
/**
* @brief Pack a attitude_control message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_attitude_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#else
mavlink_attitude_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN, MAVLINK_MSG_ID_ATTITUDE_CONTROL_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
}
/**
* @brief Pack a attitude_control 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 target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_attitude_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target,float roll,float pitch,float yaw,float thrust,uint8_t roll_manual,uint8_t pitch_manual,uint8_t yaw_manual,uint8_t thrust_manual)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#else
mavlink_attitude_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN, MAVLINK_MSG_ID_ATTITUDE_CONTROL_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
}
/**
* @brief Encode a attitude_control 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 attitude_control C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_attitude_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_control_t* attitude_control)
{
return mavlink_msg_attitude_control_pack(system_id, component_id, msg, attitude_control->target, attitude_control->roll, attitude_control->pitch, attitude_control->yaw, attitude_control->thrust, attitude_control->roll_manual, attitude_control->pitch_manual, attitude_control->yaw_manual, attitude_control->thrust_manual);
}
/**
* @brief Encode a attitude_control 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 attitude_control C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_attitude_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_control_t* attitude_control)
{
return mavlink_msg_attitude_control_pack_chan(system_id, component_id, chan, msg, attitude_control->target, attitude_control->roll, attitude_control->pitch, attitude_control->yaw, attitude_control->thrust, attitude_control->roll_manual, attitude_control->pitch_manual, attitude_control->yaw_manual, attitude_control->thrust_manual);
}
/**
* @brief Send a attitude_control message
* @param chan MAVLink channel to send the message
*
* @param target The system to be controlled
* @param roll roll
* @param pitch pitch
* @param yaw yaw
* @param thrust thrust
* @param roll_manual roll control enabled auto:0, manual:1
* @param pitch_manual pitch auto:0, manual:1
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_attitude_control_send(mavlink_channel_t chan, uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN];
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, buf, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN, MAVLINK_MSG_ID_ATTITUDE_CONTROL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, buf, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
#else
mavlink_attitude_control_t packet;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.thrust = thrust;
packet.target = target;
packet.roll_manual = roll_manual;
packet.pitch_manual = pitch_manual;
packet.yaw_manual = yaw_manual;
packet.thrust_manual = thrust_manual;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN, MAVLINK_MSG_ID_ATTITUDE_CONTROL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_attitude_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, roll);
_mav_put_float(buf, 4, pitch);
_mav_put_float(buf, 8, yaw);
_mav_put_float(buf, 12, thrust);
_mav_put_uint8_t(buf, 16, target);
_mav_put_uint8_t(buf, 17, roll_manual);
_mav_put_uint8_t(buf, 18, pitch_manual);
_mav_put_uint8_t(buf, 19, yaw_manual);
_mav_put_uint8_t(buf, 20, thrust_manual);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, buf, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN, MAVLINK_MSG_ID_ATTITUDE_CONTROL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, buf, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
#else
mavlink_attitude_control_t *packet = (mavlink_attitude_control_t *)msgbuf;
packet->roll = roll;
packet->pitch = pitch;
packet->yaw = yaw;
packet->thrust = thrust;
packet->target = target;
packet->roll_manual = roll_manual;
packet->pitch_manual = pitch_manual;
packet->yaw_manual = yaw_manual;
packet->thrust_manual = thrust_manual;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN, MAVLINK_MSG_ID_ATTITUDE_CONTROL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE ATTITUDE_CONTROL UNPACKING
/**
* @brief Get field target from attitude_control message
*
* @return The system to be controlled
*/
static inline uint8_t mavlink_msg_attitude_control_get_target(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
* @brief Get field roll from attitude_control message
*
* @return roll
*/
static inline float mavlink_msg_attitude_control_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field pitch from attitude_control message
*
* @return pitch
*/
static inline float mavlink_msg_attitude_control_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field yaw from attitude_control message
*
* @return yaw
*/
static inline float mavlink_msg_attitude_control_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field thrust from attitude_control message
*
* @return thrust
*/
static inline float mavlink_msg_attitude_control_get_thrust(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field roll_manual from attitude_control message
*
* @return roll control enabled auto:0, manual:1
*/
static inline uint8_t mavlink_msg_attitude_control_get_roll_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 17);
}
/**
* @brief Get field pitch_manual from attitude_control message
*
* @return pitch auto:0, manual:1
*/
static inline uint8_t mavlink_msg_attitude_control_get_pitch_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 18);
}
/**
* @brief Get field yaw_manual from attitude_control message
*
* @return yaw auto:0, manual:1
*/
static inline uint8_t mavlink_msg_attitude_control_get_yaw_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 19);
}
/**
* @brief Get field thrust_manual from attitude_control message
*
* @return thrust auto:0, manual:1
*/
static inline uint8_t mavlink_msg_attitude_control_get_thrust_manual(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 20);
}
/**
* @brief Decode a attitude_control message into a struct
*
* @param msg The message to decode
* @param attitude_control C-struct to decode the message contents into
*/
static inline void mavlink_msg_attitude_control_decode(const mavlink_message_t* msg, mavlink_attitude_control_t* attitude_control)
{
#if MAVLINK_NEED_BYTE_SWAP
attitude_control->roll = mavlink_msg_attitude_control_get_roll(msg);
attitude_control->pitch = mavlink_msg_attitude_control_get_pitch(msg);
attitude_control->yaw = mavlink_msg_attitude_control_get_yaw(msg);
attitude_control->thrust = mavlink_msg_attitude_control_get_thrust(msg);
attitude_control->target = mavlink_msg_attitude_control_get_target(msg);
attitude_control->roll_manual = mavlink_msg_attitude_control_get_roll_manual(msg);
attitude_control->pitch_manual = mavlink_msg_attitude_control_get_pitch_manual(msg);
attitude_control->yaw_manual = mavlink_msg_attitude_control_get_yaw_manual(msg);
attitude_control->thrust_manual = mavlink_msg_attitude_control_get_thrust_manual(msg);
#else
memcpy(attitude_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
#endif
}
// MESSAGE BRIEF_FEATURE PACKING
#define MAVLINK_MSG_ID_BRIEF_FEATURE 195
typedef struct __mavlink_brief_feature_t
{
float x; /*< x position in m*/
float y; /*< y position in m*/
float z; /*< z position in m*/
float response; /*< Harris operator response at this location*/
uint16_t size; /*< Size in pixels*/
uint16_t orientation; /*< Orientation*/
uint8_t orientation_assignment; /*< Orientation assignment 0: false, 1:true*/
uint8_t descriptor[32]; /*< Descriptor*/
} mavlink_brief_feature_t;
#define MAVLINK_MSG_ID_BRIEF_FEATURE_LEN 53
#define MAVLINK_MSG_ID_195_LEN 53
#define MAVLINK_MSG_ID_BRIEF_FEATURE_CRC 88
#define MAVLINK_MSG_ID_195_CRC 88
#define MAVLINK_MSG_BRIEF_FEATURE_FIELD_DESCRIPTOR_LEN 32
#define MAVLINK_MESSAGE_INFO_BRIEF_FEATURE { \
"BRIEF_FEATURE", \
8, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_brief_feature_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_brief_feature_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_brief_feature_t, z) }, \
{ "response", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_brief_feature_t, response) }, \
{ "size", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_brief_feature_t, size) }, \
{ "orientation", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_brief_feature_t, orientation) }, \
{ "orientation_assignment", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_brief_feature_t, orientation_assignment) }, \
{ "descriptor", NULL, MAVLINK_TYPE_UINT8_T, 32, 21, offsetof(mavlink_brief_feature_t, descriptor) }, \
} \
}
/**
* @brief Pack a brief_feature 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 x x position in m
* @param y y position in m
* @param z z position in m
* @param orientation_assignment Orientation assignment 0: false, 1:true
* @param size Size in pixels
* @param orientation Orientation
* @param descriptor Descriptor
* @param response Harris operator response at this location
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_brief_feature_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t *descriptor, float response)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BRIEF_FEATURE_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, response);
_mav_put_uint16_t(buf, 16, size);
_mav_put_uint16_t(buf, 18, orientation);
_mav_put_uint8_t(buf, 20, orientation_assignment);
_mav_put_uint8_t_array(buf, 21, descriptor, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#else
mavlink_brief_feature_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.response = response;
packet.size = size;
packet.orientation = orientation;
packet.orientation_assignment = orientation_assignment;
mav_array_memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_BRIEF_FEATURE;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN, MAVLINK_MSG_ID_BRIEF_FEATURE_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
}
/**
* @brief Pack a brief_feature 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 x x position in m
* @param y y position in m
* @param z z position in m
* @param orientation_assignment Orientation assignment 0: false, 1:true
* @param size Size in pixels
* @param orientation Orientation
* @param descriptor Descriptor
* @param response Harris operator response at this location
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_brief_feature_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float x,float y,float z,uint8_t orientation_assignment,uint16_t size,uint16_t orientation,const uint8_t *descriptor,float response)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BRIEF_FEATURE_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, response);
_mav_put_uint16_t(buf, 16, size);
_mav_put_uint16_t(buf, 18, orientation);
_mav_put_uint8_t(buf, 20, orientation_assignment);
_mav_put_uint8_t_array(buf, 21, descriptor, 32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#else
mavlink_brief_feature_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.response = response;
packet.size = size;
packet.orientation = orientation;
packet.orientation_assignment = orientation_assignment;
mav_array_memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_BRIEF_FEATURE;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN, MAVLINK_MSG_ID_BRIEF_FEATURE_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
}
/**
* @brief Encode a brief_feature 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 brief_feature C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_brief_feature_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_brief_feature_t* brief_feature)
{
return mavlink_msg_brief_feature_pack(system_id, component_id, msg, brief_feature->x, brief_feature->y, brief_feature->z, brief_feature->orientation_assignment, brief_feature->size, brief_feature->orientation, brief_feature->descriptor, brief_feature->response);
}
/**
* @brief Encode a brief_feature 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 brief_feature C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_brief_feature_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_brief_feature_t* brief_feature)
{
return mavlink_msg_brief_feature_pack_chan(system_id, component_id, chan, msg, brief_feature->x, brief_feature->y, brief_feature->z, brief_feature->orientation_assignment, brief_feature->size, brief_feature->orientation, brief_feature->descriptor, brief_feature->response);
}
/**
* @brief Send a brief_feature message
* @param chan MAVLink channel to send the message
*
* @param x x position in m
* @param y y position in m
* @param z z position in m
* @param orientation_assignment Orientation assignment 0: false, 1:true
* @param size Size in pixels
* @param orientation Orientation
* @param descriptor Descriptor
* @param response Harris operator response at this location
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_brief_feature_send(mavlink_channel_t chan, float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t *descriptor, float response)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BRIEF_FEATURE_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, response);
_mav_put_uint16_t(buf, 16, size);
_mav_put_uint16_t(buf, 18, orientation);
_mav_put_uint8_t(buf, 20, orientation_assignment);
_mav_put_uint8_t_array(buf, 21, descriptor, 32);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, buf, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN, MAVLINK_MSG_ID_BRIEF_FEATURE_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, buf, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
#else
mavlink_brief_feature_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.response = response;
packet.size = size;
packet.orientation = orientation;
packet.orientation_assignment = orientation_assignment;
mav_array_memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)&packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN, MAVLINK_MSG_ID_BRIEF_FEATURE_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)&packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_BRIEF_FEATURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_brief_feature_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t *descriptor, float response)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, response);
_mav_put_uint16_t(buf, 16, size);
_mav_put_uint16_t(buf, 18, orientation);
_mav_put_uint8_t(buf, 20, orientation_assignment);
_mav_put_uint8_t_array(buf, 21, descriptor, 32);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, buf, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN, MAVLINK_MSG_ID_BRIEF_FEATURE_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, buf, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
#else
mavlink_brief_feature_t *packet = (mavlink_brief_feature_t *)msgbuf;
packet->x = x;
packet->y = y;
packet->z = z;
packet->response = response;
packet->size = size;
packet->orientation = orientation;
packet->orientation_assignment = orientation_assignment;
mav_array_memcpy(packet->descriptor, descriptor, sizeof(uint8_t)*32);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN, MAVLINK_MSG_ID_BRIEF_FEATURE_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE BRIEF_FEATURE UNPACKING
/**
* @brief Get field x from brief_feature message
*
* @return x position in m
*/
static inline float mavlink_msg_brief_feature_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from brief_feature message
*
* @return y position in m
*/
static inline float mavlink_msg_brief_feature_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from brief_feature message
*
* @return z position in m
*/
static inline float mavlink_msg_brief_feature_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field orientation_assignment from brief_feature message
*
* @return Orientation assignment 0: false, 1:true
*/
static inline uint8_t mavlink_msg_brief_feature_get_orientation_assignment(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 20);
}
/**
* @brief Get field size from brief_feature message
*
* @return Size in pixels
*/
static inline uint16_t mavlink_msg_brief_feature_get_size(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 16);
}
/**
* @brief Get field orientation from brief_feature message
*
* @return Orientation
*/
static inline uint16_t mavlink_msg_brief_feature_get_orientation(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 18);
}
/**
* @brief Get field descriptor from brief_feature message
*
* @return Descriptor
*/
static inline uint16_t mavlink_msg_brief_feature_get_descriptor(const mavlink_message_t* msg, uint8_t *descriptor)
{
return _MAV_RETURN_uint8_t_array(msg, descriptor, 32, 21);
}
/**
* @brief Get field response from brief_feature message
*
* @return Harris operator response at this location
*/
static inline float mavlink_msg_brief_feature_get_response(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Decode a brief_feature message into a struct
*
* @param msg The message to decode
* @param brief_feature C-struct to decode the message contents into
*/
static inline void mavlink_msg_brief_feature_decode(const mavlink_message_t* msg, mavlink_brief_feature_t* brief_feature)
{
#if MAVLINK_NEED_BYTE_SWAP
brief_feature->x = mavlink_msg_brief_feature_get_x(msg);
brief_feature->y = mavlink_msg_brief_feature_get_y(msg);
brief_feature->z = mavlink_msg_brief_feature_get_z(msg);
brief_feature->response = mavlink_msg_brief_feature_get_response(msg);
brief_feature->size = mavlink_msg_brief_feature_get_size(msg);
brief_feature->orientation = mavlink_msg_brief_feature_get_orientation(msg);
brief_feature->orientation_assignment = mavlink_msg_brief_feature_get_orientation_assignment(msg);
mavlink_msg_brief_feature_get_descriptor(msg, brief_feature->descriptor);
#else
memcpy(brief_feature, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
#endif
}
// MESSAGE DETECTION_STATS PACKING
#define MAVLINK_MSG_ID_DETECTION_STATS 205
typedef struct __mavlink_detection_stats_t
{
uint32_t detections; /*< Number of detections*/
uint32_t cluster_iters; /*< Number of cluster iterations*/
float best_score; /*< Best score*/
int32_t best_lat; /*< Latitude of the best detection * 1E7*/
int32_t best_lon; /*< Longitude of the best detection * 1E7*/
int32_t best_alt; /*< Altitude of the best detection * 1E3*/
uint32_t best_detection_id; /*< Best detection ID*/
uint32_t best_cluster_id; /*< Best cluster ID*/
uint32_t best_cluster_iter_id; /*< Best cluster ID*/
uint32_t images_done; /*< Number of images already processed*/
uint32_t images_todo; /*< Number of images still to process*/
float fps; /*< Average images per seconds processed*/
} mavlink_detection_stats_t;
#define MAVLINK_MSG_ID_DETECTION_STATS_LEN 48
#define MAVLINK_MSG_ID_205_LEN 48
#define MAVLINK_MSG_ID_DETECTION_STATS_CRC 87
#define MAVLINK_MSG_ID_205_CRC 87
#define MAVLINK_MESSAGE_INFO_DETECTION_STATS { \
"DETECTION_STATS", \
12, \
{ { "detections", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_detection_stats_t, detections) }, \
{ "cluster_iters", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_detection_stats_t, cluster_iters) }, \
{ "best_score", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_detection_stats_t, best_score) }, \
{ "best_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_detection_stats_t, best_lat) }, \
{ "best_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_detection_stats_t, best_lon) }, \
{ "best_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_detection_stats_t, best_alt) }, \
{ "best_detection_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_detection_stats_t, best_detection_id) }, \
{ "best_cluster_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_detection_stats_t, best_cluster_id) }, \
{ "best_cluster_iter_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_detection_stats_t, best_cluster_iter_id) }, \
{ "images_done", NULL, MAVLINK_TYPE_UINT32_T, 0, 36, offsetof(mavlink_detection_stats_t, images_done) }, \
{ "images_todo", NULL, MAVLINK_TYPE_UINT32_T, 0, 40, offsetof(mavlink_detection_stats_t, images_todo) }, \
{ "fps", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_detection_stats_t, fps) }, \
} \
}
/**
* @brief Pack a detection_stats 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 detections Number of detections
* @param cluster_iters Number of cluster iterations
* @param best_score Best score
* @param best_lat Latitude of the best detection * 1E7
* @param best_lon Longitude of the best detection * 1E7
* @param best_alt Altitude of the best detection * 1E3
* @param best_detection_id Best detection ID
* @param best_cluster_id Best cluster ID
* @param best_cluster_iter_id Best cluster ID
* @param images_done Number of images already processed
* @param images_todo Number of images still to process
* @param fps Average images per seconds processed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_detection_stats_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t detections, uint32_t cluster_iters, float best_score, int32_t best_lat, int32_t best_lon, int32_t best_alt, uint32_t best_detection_id, uint32_t best_cluster_id, uint32_t best_cluster_iter_id, uint32_t images_done, uint32_t images_todo, float fps)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DETECTION_STATS_LEN];
_mav_put_uint32_t(buf, 0, detections);
_mav_put_uint32_t(buf, 4, cluster_iters);
_mav_put_float(buf, 8, best_score);
_mav_put_int32_t(buf, 12, best_lat);
_mav_put_int32_t(buf, 16, best_lon);
_mav_put_int32_t(buf, 20, best_alt);
_mav_put_uint32_t(buf, 24, best_detection_id);
_mav_put_uint32_t(buf, 28, best_cluster_id);
_mav_put_uint32_t(buf, 32, best_cluster_iter_id);
_mav_put_uint32_t(buf, 36, images_done);
_mav_put_uint32_t(buf, 40, images_todo);
_mav_put_float(buf, 44, fps);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#else
mavlink_detection_stats_t packet;
packet.detections = detections;
packet.cluster_iters = cluster_iters;
packet.best_score = best_score;
packet.best_lat = best_lat;
packet.best_lon = best_lon;
packet.best_alt = best_alt;
packet.best_detection_id = best_detection_id;
packet.best_cluster_id = best_cluster_id;
packet.best_cluster_iter_id = best_cluster_iter_id;
packet.images_done = images_done;
packet.images_todo = images_todo;
packet.fps = fps;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_DETECTION_STATS;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DETECTION_STATS_LEN, MAVLINK_MSG_ID_DETECTION_STATS_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
}
/**
* @brief Pack a detection_stats 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 detections Number of detections
* @param cluster_iters Number of cluster iterations
* @param best_score Best score
* @param best_lat Latitude of the best detection * 1E7
* @param best_lon Longitude of the best detection * 1E7
* @param best_alt Altitude of the best detection * 1E3
* @param best_detection_id Best detection ID
* @param best_cluster_id Best cluster ID
* @param best_cluster_iter_id Best cluster ID
* @param images_done Number of images already processed
* @param images_todo Number of images still to process
* @param fps Average images per seconds processed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_detection_stats_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t detections,uint32_t cluster_iters,float best_score,int32_t best_lat,int32_t best_lon,int32_t best_alt,uint32_t best_detection_id,uint32_t best_cluster_id,uint32_t best_cluster_iter_id,uint32_t images_done,uint32_t images_todo,float fps)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DETECTION_STATS_LEN];
_mav_put_uint32_t(buf, 0, detections);
_mav_put_uint32_t(buf, 4, cluster_iters);
_mav_put_float(buf, 8, best_score);
_mav_put_int32_t(buf, 12, best_lat);
_mav_put_int32_t(buf, 16, best_lon);
_mav_put_int32_t(buf, 20, best_alt);
_mav_put_uint32_t(buf, 24, best_detection_id);
_mav_put_uint32_t(buf, 28, best_cluster_id);
_mav_put_uint32_t(buf, 32, best_cluster_iter_id);
_mav_put_uint32_t(buf, 36, images_done);
_mav_put_uint32_t(buf, 40, images_todo);
_mav_put_float(buf, 44, fps);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#else
mavlink_detection_stats_t packet;
packet.detections = detections;
packet.cluster_iters = cluster_iters;
packet.best_score = best_score;
packet.best_lat = best_lat;
packet.best_lon = best_lon;
packet.best_alt = best_alt;
packet.best_detection_id = best_detection_id;
packet.best_cluster_id = best_cluster_id;
packet.best_cluster_iter_id = best_cluster_iter_id;
packet.images_done = images_done;
packet.images_todo = images_todo;
packet.fps = fps;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_DETECTION_STATS;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DETECTION_STATS_LEN, MAVLINK_MSG_ID_DETECTION_STATS_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
}
/**
* @brief Encode a detection_stats 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 detection_stats C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_detection_stats_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_detection_stats_t* detection_stats)
{
return mavlink_msg_detection_stats_pack(system_id, component_id, msg, detection_stats->detections, detection_stats->cluster_iters, detection_stats->best_score, detection_stats->best_lat, detection_stats->best_lon, detection_stats->best_alt, detection_stats->best_detection_id, detection_stats->best_cluster_id, detection_stats->best_cluster_iter_id, detection_stats->images_done, detection_stats->images_todo, detection_stats->fps);
}
/**
* @brief Encode a detection_stats 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 detection_stats C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_detection_stats_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_detection_stats_t* detection_stats)
{
return mavlink_msg_detection_stats_pack_chan(system_id, component_id, chan, msg, detection_stats->detections, detection_stats->cluster_iters, detection_stats->best_score, detection_stats->best_lat, detection_stats->best_lon, detection_stats->best_alt, detection_stats->best_detection_id, detection_stats->best_cluster_id, detection_stats->best_cluster_iter_id, detection_stats->images_done, detection_stats->images_todo, detection_stats->fps);
}
/**
* @brief Send a detection_stats message
* @param chan MAVLink channel to send the message
*
* @param detections Number of detections
* @param cluster_iters Number of cluster iterations
* @param best_score Best score
* @param best_lat Latitude of the best detection * 1E7
* @param best_lon Longitude of the best detection * 1E7
* @param best_alt Altitude of the best detection * 1E3
* @param best_detection_id Best detection ID
* @param best_cluster_id Best cluster ID
* @param best_cluster_iter_id Best cluster ID
* @param images_done Number of images already processed
* @param images_todo Number of images still to process
* @param fps Average images per seconds processed
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_detection_stats_send(mavlink_channel_t chan, uint32_t detections, uint32_t cluster_iters, float best_score, int32_t best_lat, int32_t best_lon, int32_t best_alt, uint32_t best_detection_id, uint32_t best_cluster_id, uint32_t best_cluster_iter_id, uint32_t images_done, uint32_t images_todo, float fps)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DETECTION_STATS_LEN];
_mav_put_uint32_t(buf, 0, detections);
_mav_put_uint32_t(buf, 4, cluster_iters);
_mav_put_float(buf, 8, best_score);
_mav_put_int32_t(buf, 12, best_lat);
_mav_put_int32_t(buf, 16, best_lon);
_mav_put_int32_t(buf, 20, best_alt);
_mav_put_uint32_t(buf, 24, best_detection_id);
_mav_put_uint32_t(buf, 28, best_cluster_id);
_mav_put_uint32_t(buf, 32, best_cluster_iter_id);
_mav_put_uint32_t(buf, 36, images_done);
_mav_put_uint32_t(buf, 40, images_todo);
_mav_put_float(buf, 44, fps);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN, MAVLINK_MSG_ID_DETECTION_STATS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
#else
mavlink_detection_stats_t packet;
packet.detections = detections;
packet.cluster_iters = cluster_iters;
packet.best_score = best_score;
packet.best_lat = best_lat;
packet.best_lon = best_lon;
packet.best_alt = best_alt;
packet.best_detection_id = best_detection_id;
packet.best_cluster_id = best_cluster_id;
packet.best_cluster_iter_id = best_cluster_iter_id;
packet.images_done = images_done;
packet.images_todo = images_todo;
packet.fps = fps;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, (const char *)&packet, MAVLINK_MSG_ID_DETECTION_STATS_LEN, MAVLINK_MSG_ID_DETECTION_STATS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, (const char *)&packet, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_DETECTION_STATS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_detection_stats_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t detections, uint32_t cluster_iters, float best_score, int32_t best_lat, int32_t best_lon, int32_t best_alt, uint32_t best_detection_id, uint32_t best_cluster_id, uint32_t best_cluster_iter_id, uint32_t images_done, uint32_t images_todo, float fps)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, detections);
_mav_put_uint32_t(buf, 4, cluster_iters);
_mav_put_float(buf, 8, best_score);
_mav_put_int32_t(buf, 12, best_lat);
_mav_put_int32_t(buf, 16, best_lon);
_mav_put_int32_t(buf, 20, best_alt);
_mav_put_uint32_t(buf, 24, best_detection_id);
_mav_put_uint32_t(buf, 28, best_cluster_id);
_mav_put_uint32_t(buf, 32, best_cluster_iter_id);
_mav_put_uint32_t(buf, 36, images_done);
_mav_put_uint32_t(buf, 40, images_todo);
_mav_put_float(buf, 44, fps);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN, MAVLINK_MSG_ID_DETECTION_STATS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
#else
mavlink_detection_stats_t *packet = (mavlink_detection_stats_t *)msgbuf;
packet->detections = detections;
packet->cluster_iters = cluster_iters;
packet->best_score = best_score;
packet->best_lat = best_lat;
packet->best_lon = best_lon;
packet->best_alt = best_alt;
packet->best_detection_id = best_detection_id;
packet->best_cluster_id = best_cluster_id;
packet->best_cluster_iter_id = best_cluster_iter_id;
packet->images_done = images_done;
packet->images_todo = images_todo;
packet->fps = fps;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, (const char *)packet, MAVLINK_MSG_ID_DETECTION_STATS_LEN, MAVLINK_MSG_ID_DETECTION_STATS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, (const char *)packet, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE DETECTION_STATS UNPACKING
/**
* @brief Get field detections from detection_stats message
*
* @return Number of detections
*/
static inline uint32_t mavlink_msg_detection_stats_get_detections(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field cluster_iters from detection_stats message
*
* @return Number of cluster iterations
*/
static inline uint32_t mavlink_msg_detection_stats_get_cluster_iters(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 4);
}
/**
* @brief Get field best_score from detection_stats message
*
* @return Best score
*/
static inline float mavlink_msg_detection_stats_get_best_score(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field best_lat from detection_stats message
*
* @return Latitude of the best detection * 1E7
*/
static inline int32_t mavlink_msg_detection_stats_get_best_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 12);
}
/**
* @brief Get field best_lon from detection_stats message
*
* @return Longitude of the best detection * 1E7
*/
static inline int32_t mavlink_msg_detection_stats_get_best_lon(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 16);
}
/**
* @brief Get field best_alt from detection_stats message
*
* @return Altitude of the best detection * 1E3
*/
static inline int32_t mavlink_msg_detection_stats_get_best_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 20);
}
/**
* @brief Get field best_detection_id from detection_stats message
*
* @return Best detection ID
*/
static inline uint32_t mavlink_msg_detection_stats_get_best_detection_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 24);
}
/**
* @brief Get field best_cluster_id from detection_stats message
*
* @return Best cluster ID
*/
static inline uint32_t mavlink_msg_detection_stats_get_best_cluster_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 28);
}
/**
* @brief Get field best_cluster_iter_id from detection_stats message
*
* @return Best cluster ID
*/
static inline uint32_t mavlink_msg_detection_stats_get_best_cluster_iter_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 32);
}
/**
* @brief Get field images_done from detection_stats message
*
* @return Number of images already processed
*/
static inline uint32_t mavlink_msg_detection_stats_get_images_done(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 36);
}
/**
* @brief Get field images_todo from detection_stats message
*
* @return Number of images still to process
*/
static inline uint32_t mavlink_msg_detection_stats_get_images_todo(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 40);
}
/**
* @brief Get field fps from detection_stats message
*
* @return Average images per seconds processed
*/
static inline float mavlink_msg_detection_stats_get_fps(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 44);
}
/**
* @brief Decode a detection_stats message into a struct
*
* @param msg The message to decode
* @param detection_stats C-struct to decode the message contents into
*/
static inline void mavlink_msg_detection_stats_decode(const mavlink_message_t* msg, mavlink_detection_stats_t* detection_stats)
{
#if MAVLINK_NEED_BYTE_SWAP
detection_stats->detections = mavlink_msg_detection_stats_get_detections(msg);
detection_stats->cluster_iters = mavlink_msg_detection_stats_get_cluster_iters(msg);
detection_stats->best_score = mavlink_msg_detection_stats_get_best_score(msg);
detection_stats->best_lat = mavlink_msg_detection_stats_get_best_lat(msg);
detection_stats->best_lon = mavlink_msg_detection_stats_get_best_lon(msg);
detection_stats->best_alt = mavlink_msg_detection_stats_get_best_alt(msg);
detection_stats->best_detection_id = mavlink_msg_detection_stats_get_best_detection_id(msg);
detection_stats->best_cluster_id = mavlink_msg_detection_stats_get_best_cluster_id(msg);
detection_stats->best_cluster_iter_id = mavlink_msg_detection_stats_get_best_cluster_iter_id(msg);
detection_stats->images_done = mavlink_msg_detection_stats_get_images_done(msg);
detection_stats->images_todo = mavlink_msg_detection_stats_get_images_todo(msg);
detection_stats->fps = mavlink_msg_detection_stats_get_fps(msg);
#else
memcpy(detection_stats, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#endif
}
// MESSAGE IMAGE_AVAILABLE PACKING
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE 154
typedef struct __mavlink_image_available_t
{
uint64_t cam_id; /*< Camera id*/
uint64_t timestamp; /*< Timestamp*/
uint64_t valid_until; /*< Until which timestamp this buffer will stay valid*/
uint32_t img_seq; /*< The image sequence number*/
uint32_t img_buf_index; /*< Position of the image in the buffer, starts with 0*/
uint32_t key; /*< Shared memory area key*/
uint32_t exposure; /*< Exposure time, in microseconds*/
float gain; /*< Camera gain*/
float roll; /*< Roll angle in rad*/
float pitch; /*< Pitch angle in rad*/
float yaw; /*< Yaw angle in rad*/
float local_z; /*< Local frame Z coordinate (height over ground)*/
float lat; /*< GPS X coordinate*/
float lon; /*< GPS Y coordinate*/
float alt; /*< Global frame altitude*/
float ground_x; /*< Ground truth X*/
float ground_y; /*< Ground truth Y*/
float ground_z; /*< Ground truth Z*/
uint16_t width; /*< Image width*/
uint16_t height; /*< Image height*/
uint16_t depth; /*< Image depth*/
uint8_t cam_no; /*< Camera # (starts with 0)*/
uint8_t channels; /*< Image channels*/
} mavlink_image_available_t;
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN 92
#define MAVLINK_MSG_ID_154_LEN 92
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE_CRC 224
#define MAVLINK_MSG_ID_154_CRC 224
#define MAVLINK_MESSAGE_INFO_IMAGE_AVAILABLE { \
"IMAGE_AVAILABLE", \
23, \
{ { "cam_id", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_image_available_t, cam_id) }, \
{ "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_image_available_t, timestamp) }, \
{ "valid_until", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_image_available_t, valid_until) }, \
{ "img_seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_image_available_t, img_seq) }, \
{ "img_buf_index", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_image_available_t, img_buf_index) }, \
{ "key", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_image_available_t, key) }, \
{ "exposure", NULL, MAVLINK_TYPE_UINT32_T, 0, 36, offsetof(mavlink_image_available_t, exposure) }, \
{ "gain", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_image_available_t, gain) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_image_available_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_image_available_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_image_available_t, yaw) }, \
{ "local_z", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_image_available_t, local_z) }, \
{ "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_image_available_t, lat) }, \
{ "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_image_available_t, lon) }, \
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_image_available_t, alt) }, \
{ "ground_x", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_image_available_t, ground_x) }, \
{ "ground_y", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_image_available_t, ground_y) }, \
{ "ground_z", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_image_available_t, ground_z) }, \
{ "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 84, offsetof(mavlink_image_available_t, width) }, \
{ "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 86, offsetof(mavlink_image_available_t, height) }, \
{ "depth", NULL, MAVLINK_TYPE_UINT16_T, 0, 88, offsetof(mavlink_image_available_t, depth) }, \
{ "cam_no", NULL, MAVLINK_TYPE_UINT8_T, 0, 90, offsetof(mavlink_image_available_t, cam_no) }, \
{ "channels", NULL, MAVLINK_TYPE_UINT8_T, 0, 91, offsetof(mavlink_image_available_t, channels) }, \
} \
}
/**
* @brief Pack a image_available 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 cam_id Camera id
* @param cam_no Camera # (starts with 0)
* @param timestamp Timestamp
* @param valid_until Until which timestamp this buffer will stay valid
* @param img_seq The image sequence number
* @param img_buf_index Position of the image in the buffer, starts with 0
* @param width Image width
* @param height Image height
* @param depth Image depth
* @param channels Image channels
* @param key Shared memory area key
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_available_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t cam_id, uint8_t cam_no, uint64_t timestamp, uint64_t valid_until, uint32_t img_seq, uint32_t img_buf_index, uint16_t width, uint16_t height, uint16_t depth, uint8_t channels, uint32_t key, uint32_t exposure, float gain, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN];
_mav_put_uint64_t(buf, 0, cam_id);
_mav_put_uint64_t(buf, 8, timestamp);
_mav_put_uint64_t(buf, 16, valid_until);
_mav_put_uint32_t(buf, 24, img_seq);
_mav_put_uint32_t(buf, 28, img_buf_index);
_mav_put_uint32_t(buf, 32, key);
_mav_put_uint32_t(buf, 36, exposure);
_mav_put_float(buf, 40, gain);
_mav_put_float(buf, 44, roll);
_mav_put_float(buf, 48, pitch);
_mav_put_float(buf, 52, yaw);
_mav_put_float(buf, 56, local_z);
_mav_put_float(buf, 60, lat);
_mav_put_float(buf, 64, lon);
_mav_put_float(buf, 68, alt);
_mav_put_float(buf, 72, ground_x);
_mav_put_float(buf, 76, ground_y);
_mav_put_float(buf, 80, ground_z);
_mav_put_uint16_t(buf, 84, width);
_mav_put_uint16_t(buf, 86, height);
_mav_put_uint16_t(buf, 88, depth);
_mav_put_uint8_t(buf, 90, cam_no);
_mav_put_uint8_t(buf, 91, channels);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#else
mavlink_image_available_t packet;
packet.cam_id = cam_id;
packet.timestamp = timestamp;
packet.valid_until = valid_until;
packet.img_seq = img_seq;
packet.img_buf_index = img_buf_index;
packet.key = key;
packet.exposure = exposure;
packet.gain = gain;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
packet.width = width;
packet.height = height;
packet.depth = depth;
packet.cam_no = cam_no;
packet.channels = channels;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN, MAVLINK_MSG_ID_IMAGE_AVAILABLE_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
}
/**
* @brief Pack a image_available 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 cam_id Camera id
* @param cam_no Camera # (starts with 0)
* @param timestamp Timestamp
* @param valid_until Until which timestamp this buffer will stay valid
* @param img_seq The image sequence number
* @param img_buf_index Position of the image in the buffer, starts with 0
* @param width Image width
* @param height Image height
* @param depth Image depth
* @param channels Image channels
* @param key Shared memory area key
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_available_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t cam_id,uint8_t cam_no,uint64_t timestamp,uint64_t valid_until,uint32_t img_seq,uint32_t img_buf_index,uint16_t width,uint16_t height,uint16_t depth,uint8_t channels,uint32_t key,uint32_t exposure,float gain,float roll,float pitch,float yaw,float local_z,float lat,float lon,float alt,float ground_x,float ground_y,float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN];
_mav_put_uint64_t(buf, 0, cam_id);
_mav_put_uint64_t(buf, 8, timestamp);
_mav_put_uint64_t(buf, 16, valid_until);
_mav_put_uint32_t(buf, 24, img_seq);
_mav_put_uint32_t(buf, 28, img_buf_index);
_mav_put_uint32_t(buf, 32, key);
_mav_put_uint32_t(buf, 36, exposure);
_mav_put_float(buf, 40, gain);
_mav_put_float(buf, 44, roll);
_mav_put_float(buf, 48, pitch);
_mav_put_float(buf, 52, yaw);
_mav_put_float(buf, 56, local_z);
_mav_put_float(buf, 60, lat);
_mav_put_float(buf, 64, lon);
_mav_put_float(buf, 68, alt);
_mav_put_float(buf, 72, ground_x);
_mav_put_float(buf, 76, ground_y);
_mav_put_float(buf, 80, ground_z);
_mav_put_uint16_t(buf, 84, width);
_mav_put_uint16_t(buf, 86, height);
_mav_put_uint16_t(buf, 88, depth);
_mav_put_uint8_t(buf, 90, cam_no);
_mav_put_uint8_t(buf, 91, channels);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#else
mavlink_image_available_t packet;
packet.cam_id = cam_id;
packet.timestamp = timestamp;
packet.valid_until = valid_until;
packet.img_seq = img_seq;
packet.img_buf_index = img_buf_index;
packet.key = key;
packet.exposure = exposure;
packet.gain = gain;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
packet.width = width;
packet.height = height;
packet.depth = depth;
packet.cam_no = cam_no;
packet.channels = channels;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_AVAILABLE;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN, MAVLINK_MSG_ID_IMAGE_AVAILABLE_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
}
/**
* @brief Encode a image_available 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 image_available C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_available_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_available_t* image_available)
{
return mavlink_msg_image_available_pack(system_id, component_id, msg, image_available->cam_id, image_available->cam_no, image_available->timestamp, image_available->valid_until, image_available->img_seq, image_available->img_buf_index, image_available->width, image_available->height, image_available->depth, image_available->channels, image_available->key, image_available->exposure, image_available->gain, image_available->roll, image_available->pitch, image_available->yaw, image_available->local_z, image_available->lat, image_available->lon, image_available->alt, image_available->ground_x, image_available->ground_y, image_available->ground_z);
}
/**
* @brief Encode a image_available 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 image_available C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_available_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_image_available_t* image_available)
{
return mavlink_msg_image_available_pack_chan(system_id, component_id, chan, msg, image_available->cam_id, image_available->cam_no, image_available->timestamp, image_available->valid_until, image_available->img_seq, image_available->img_buf_index, image_available->width, image_available->height, image_available->depth, image_available->channels, image_available->key, image_available->exposure, image_available->gain, image_available->roll, image_available->pitch, image_available->yaw, image_available->local_z, image_available->lat, image_available->lon, image_available->alt, image_available->ground_x, image_available->ground_y, image_available->ground_z);
}
/**
* @brief Send a image_available message
* @param chan MAVLink channel to send the message
*
* @param cam_id Camera id
* @param cam_no Camera # (starts with 0)
* @param timestamp Timestamp
* @param valid_until Until which timestamp this buffer will stay valid
* @param img_seq The image sequence number
* @param img_buf_index Position of the image in the buffer, starts with 0
* @param width Image width
* @param height Image height
* @param depth Image depth
* @param channels Image channels
* @param key Shared memory area key
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_available_send(mavlink_channel_t chan, uint64_t cam_id, uint8_t cam_no, uint64_t timestamp, uint64_t valid_until, uint32_t img_seq, uint32_t img_buf_index, uint16_t width, uint16_t height, uint16_t depth, uint8_t channels, uint32_t key, uint32_t exposure, float gain, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN];
_mav_put_uint64_t(buf, 0, cam_id);
_mav_put_uint64_t(buf, 8, timestamp);
_mav_put_uint64_t(buf, 16, valid_until);
_mav_put_uint32_t(buf, 24, img_seq);
_mav_put_uint32_t(buf, 28, img_buf_index);
_mav_put_uint32_t(buf, 32, key);
_mav_put_uint32_t(buf, 36, exposure);
_mav_put_float(buf, 40, gain);
_mav_put_float(buf, 44, roll);
_mav_put_float(buf, 48, pitch);
_mav_put_float(buf, 52, yaw);
_mav_put_float(buf, 56, local_z);
_mav_put_float(buf, 60, lat);
_mav_put_float(buf, 64, lon);
_mav_put_float(buf, 68, alt);
_mav_put_float(buf, 72, ground_x);
_mav_put_float(buf, 76, ground_y);
_mav_put_float(buf, 80, ground_z);
_mav_put_uint16_t(buf, 84, width);
_mav_put_uint16_t(buf, 86, height);
_mav_put_uint16_t(buf, 88, depth);
_mav_put_uint8_t(buf, 90, cam_no);
_mav_put_uint8_t(buf, 91, channels);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, buf, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN, MAVLINK_MSG_ID_IMAGE_AVAILABLE_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, buf, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
#else
mavlink_image_available_t packet;
packet.cam_id = cam_id;
packet.timestamp = timestamp;
packet.valid_until = valid_until;
packet.img_seq = img_seq;
packet.img_buf_index = img_buf_index;
packet.key = key;
packet.exposure = exposure;
packet.gain = gain;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
packet.width = width;
packet.height = height;
packet.depth = depth;
packet.cam_no = cam_no;
packet.channels = channels;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, (const char *)&packet, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN, MAVLINK_MSG_ID_IMAGE_AVAILABLE_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, (const char *)&packet, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_image_available_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t cam_id, uint8_t cam_no, uint64_t timestamp, uint64_t valid_until, uint32_t img_seq, uint32_t img_buf_index, uint16_t width, uint16_t height, uint16_t depth, uint8_t channels, uint32_t key, uint32_t exposure, float gain, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, cam_id);
_mav_put_uint64_t(buf, 8, timestamp);
_mav_put_uint64_t(buf, 16, valid_until);
_mav_put_uint32_t(buf, 24, img_seq);
_mav_put_uint32_t(buf, 28, img_buf_index);
_mav_put_uint32_t(buf, 32, key);
_mav_put_uint32_t(buf, 36, exposure);
_mav_put_float(buf, 40, gain);
_mav_put_float(buf, 44, roll);
_mav_put_float(buf, 48, pitch);
_mav_put_float(buf, 52, yaw);
_mav_put_float(buf, 56, local_z);
_mav_put_float(buf, 60, lat);
_mav_put_float(buf, 64, lon);
_mav_put_float(buf, 68, alt);
_mav_put_float(buf, 72, ground_x);
_mav_put_float(buf, 76, ground_y);
_mav_put_float(buf, 80, ground_z);
_mav_put_uint16_t(buf, 84, width);
_mav_put_uint16_t(buf, 86, height);
_mav_put_uint16_t(buf, 88, depth);
_mav_put_uint8_t(buf, 90, cam_no);
_mav_put_uint8_t(buf, 91, channels);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, buf, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN, MAVLINK_MSG_ID_IMAGE_AVAILABLE_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, buf, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
#else
mavlink_image_available_t *packet = (mavlink_image_available_t *)msgbuf;
packet->cam_id = cam_id;
packet->timestamp = timestamp;
packet->valid_until = valid_until;
packet->img_seq = img_seq;
packet->img_buf_index = img_buf_index;
packet->key = key;
packet->exposure = exposure;
packet->gain = gain;
packet->roll = roll;
packet->pitch = pitch;
packet->yaw = yaw;
packet->local_z = local_z;
packet->lat = lat;
packet->lon = lon;
packet->alt = alt;
packet->ground_x = ground_x;
packet->ground_y = ground_y;
packet->ground_z = ground_z;
packet->width = width;
packet->height = height;
packet->depth = depth;
packet->cam_no = cam_no;
packet->channels = channels;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, (const char *)packet, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN, MAVLINK_MSG_ID_IMAGE_AVAILABLE_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE, (const char *)packet, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE IMAGE_AVAILABLE UNPACKING
/**
* @brief Get field cam_id from image_available message
*
* @return Camera id
*/
static inline uint64_t mavlink_msg_image_available_get_cam_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field cam_no from image_available message
*
* @return Camera # (starts with 0)
*/
static inline uint8_t mavlink_msg_image_available_get_cam_no(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 90);
}
/**
* @brief Get field timestamp from image_available message
*
* @return Timestamp
*/
static inline uint64_t mavlink_msg_image_available_get_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 8);
}
/**
* @brief Get field valid_until from image_available message
*
* @return Until which timestamp this buffer will stay valid
*/
static inline uint64_t mavlink_msg_image_available_get_valid_until(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 16);
}
/**
* @brief Get field img_seq from image_available message
*
* @return The image sequence number
*/
static inline uint32_t mavlink_msg_image_available_get_img_seq(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 24);
}
/**
* @brief Get field img_buf_index from image_available message
*
* @return Position of the image in the buffer, starts with 0
*/
static inline uint32_t mavlink_msg_image_available_get_img_buf_index(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 28);
}
/**
* @brief Get field width from image_available message
*
* @return Image width
*/
static inline uint16_t mavlink_msg_image_available_get_width(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 84);
}
/**
* @brief Get field height from image_available message
*
* @return Image height
*/
static inline uint16_t mavlink_msg_image_available_get_height(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 86);
}
/**
* @brief Get field depth from image_available message
*
* @return Image depth
*/
static inline uint16_t mavlink_msg_image_available_get_depth(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 88);
}
/**
* @brief Get field channels from image_available message
*
* @return Image channels
*/
static inline uint8_t mavlink_msg_image_available_get_channels(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 91);
}
/**
* @brief Get field key from image_available message
*
* @return Shared memory area key
*/
static inline uint32_t mavlink_msg_image_available_get_key(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 32);
}
/**
* @brief Get field exposure from image_available message
*
* @return Exposure time, in microseconds
*/
static inline uint32_t mavlink_msg_image_available_get_exposure(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 36);
}
/**
* @brief Get field gain from image_available message
*
* @return Camera gain
*/
static inline float mavlink_msg_image_available_get_gain(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 40);
}
/**
* @brief Get field roll from image_available message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_image_available_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 44);
}
/**
* @brief Get field pitch from image_available message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_image_available_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 48);
}
/**
* @brief Get field yaw from image_available message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_image_available_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 52);
}
/**
* @brief Get field local_z from image_available message
*
* @return Local frame Z coordinate (height over ground)
*/
static inline float mavlink_msg_image_available_get_local_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 56);
}
/**
* @brief Get field lat from image_available message
*
* @return GPS X coordinate
*/
static inline float mavlink_msg_image_available_get_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 60);
}
/**
* @brief Get field lon from image_available message
*
* @return GPS Y coordinate
*/
static inline float mavlink_msg_image_available_get_lon(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 64);
}
/**
* @brief Get field alt from image_available message
*
* @return Global frame altitude
*/
static inline float mavlink_msg_image_available_get_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 68);
}
/**
* @brief Get field ground_x from image_available message
*
* @return Ground truth X
*/
static inline float mavlink_msg_image_available_get_ground_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 72);
}
/**
* @brief Get field ground_y from image_available message
*
* @return Ground truth Y
*/
static inline float mavlink_msg_image_available_get_ground_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 76);
}
/**
* @brief Get field ground_z from image_available message
*
* @return Ground truth Z
*/
static inline float mavlink_msg_image_available_get_ground_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 80);
}
/**
* @brief Decode a image_available message into a struct
*
* @param msg The message to decode
* @param image_available C-struct to decode the message contents into
*/
static inline void mavlink_msg_image_available_decode(const mavlink_message_t* msg, mavlink_image_available_t* image_available)
{
#if MAVLINK_NEED_BYTE_SWAP
image_available->cam_id = mavlink_msg_image_available_get_cam_id(msg);
image_available->timestamp = mavlink_msg_image_available_get_timestamp(msg);
image_available->valid_until = mavlink_msg_image_available_get_valid_until(msg);
image_available->img_seq = mavlink_msg_image_available_get_img_seq(msg);
image_available->img_buf_index = mavlink_msg_image_available_get_img_buf_index(msg);
image_available->key = mavlink_msg_image_available_get_key(msg);
image_available->exposure = mavlink_msg_image_available_get_exposure(msg);
image_available->gain = mavlink_msg_image_available_get_gain(msg);
image_available->roll = mavlink_msg_image_available_get_roll(msg);
image_available->pitch = mavlink_msg_image_available_get_pitch(msg);
image_available->yaw = mavlink_msg_image_available_get_yaw(msg);
image_available->local_z = mavlink_msg_image_available_get_local_z(msg);
image_available->lat = mavlink_msg_image_available_get_lat(msg);
image_available->lon = mavlink_msg_image_available_get_lon(msg);
image_available->alt = mavlink_msg_image_available_get_alt(msg);
image_available->ground_x = mavlink_msg_image_available_get_ground_x(msg);
image_available->ground_y = mavlink_msg_image_available_get_ground_y(msg);
image_available->ground_z = mavlink_msg_image_available_get_ground_z(msg);
image_available->width = mavlink_msg_image_available_get_width(msg);
image_available->height = mavlink_msg_image_available_get_height(msg);
image_available->depth = mavlink_msg_image_available_get_depth(msg);
image_available->cam_no = mavlink_msg_image_available_get_cam_no(msg);
image_available->channels = mavlink_msg_image_available_get_channels(msg);
#else
memcpy(image_available, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN);
#endif
}
// MESSAGE IMAGE_TRIGGER_CONTROL PACKING
#define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL 153
typedef struct __mavlink_image_trigger_control_t
{
uint8_t enable; /*< 0 to disable, 1 to enable*/
} mavlink_image_trigger_control_t;
#define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN 1
#define MAVLINK_MSG_ID_153_LEN 1
#define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_CRC 95
#define MAVLINK_MSG_ID_153_CRC 95
#define MAVLINK_MESSAGE_INFO_IMAGE_TRIGGER_CONTROL { \
"IMAGE_TRIGGER_CONTROL", \
1, \
{ { "enable", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_image_trigger_control_t, enable) }, \
} \
}
/**
* @brief Pack a image_trigger_control 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 enable 0 to disable, 1 to enable
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_trigger_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t enable)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN];
_mav_put_uint8_t(buf, 0, enable);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#else
mavlink_image_trigger_control_t packet;
packet.enable = enable;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
}
/**
* @brief Pack a image_trigger_control 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 enable 0 to disable, 1 to enable
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_trigger_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t enable)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN];
_mav_put_uint8_t(buf, 0, enable);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#else
mavlink_image_trigger_control_t packet;
packet.enable = enable;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
}
/**
* @brief Encode a image_trigger_control 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 image_trigger_control C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_trigger_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_trigger_control_t* image_trigger_control)
{
return mavlink_msg_image_trigger_control_pack(system_id, component_id, msg, image_trigger_control->enable);
}
/**
* @brief Encode a image_trigger_control 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 image_trigger_control C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_trigger_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_image_trigger_control_t* image_trigger_control)
{
return mavlink_msg_image_trigger_control_pack_chan(system_id, component_id, chan, msg, image_trigger_control->enable);
}
/**
* @brief Send a image_trigger_control message
* @param chan MAVLink channel to send the message
*
* @param enable 0 to disable, 1 to enable
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_trigger_control_send(mavlink_channel_t chan, uint8_t enable)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN];
_mav_put_uint8_t(buf, 0, enable);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, buf, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, buf, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
#else
mavlink_image_trigger_control_t packet;
packet.enable = enable;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_image_trigger_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t enable)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint8_t(buf, 0, enable);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, buf, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, buf, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
#else
mavlink_image_trigger_control_t *packet = (mavlink_image_trigger_control_t *)msgbuf;
packet->enable = enable;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, (const char *)packet, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL, (const char *)packet, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE IMAGE_TRIGGER_CONTROL UNPACKING
/**
* @brief Get field enable from image_trigger_control message
*
* @return 0 to disable, 1 to enable
*/
static inline uint8_t mavlink_msg_image_trigger_control_get_enable(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
* @brief Decode a image_trigger_control message into a struct
*
* @param msg The message to decode
* @param image_trigger_control C-struct to decode the message contents into
*/
static inline void mavlink_msg_image_trigger_control_decode(const mavlink_message_t* msg, mavlink_image_trigger_control_t* image_trigger_control)
{
#if MAVLINK_NEED_BYTE_SWAP
image_trigger_control->enable = mavlink_msg_image_trigger_control_get_enable(msg);
#else
memcpy(image_trigger_control, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
#endif
}
// MESSAGE IMAGE_TRIGGERED PACKING
#define MAVLINK_MSG_ID_IMAGE_TRIGGERED 152
typedef struct __mavlink_image_triggered_t
{
uint64_t timestamp; /*< Timestamp*/
uint32_t seq; /*< IMU seq*/
float roll; /*< Roll angle in rad*/
float pitch; /*< Pitch angle in rad*/
float yaw; /*< Yaw angle in rad*/
float local_z; /*< Local frame Z coordinate (height over ground)*/
float lat; /*< GPS X coordinate*/
float lon; /*< GPS Y coordinate*/
float alt; /*< Global frame altitude*/
float ground_x; /*< Ground truth X*/
float ground_y; /*< Ground truth Y*/
float ground_z; /*< Ground truth Z*/
} mavlink_image_triggered_t;
#define MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN 52
#define MAVLINK_MSG_ID_152_LEN 52
#define MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC 86
#define MAVLINK_MSG_ID_152_CRC 86
#define MAVLINK_MESSAGE_INFO_IMAGE_TRIGGERED { \
"IMAGE_TRIGGERED", \
12, \
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_image_triggered_t, timestamp) }, \
{ "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_image_triggered_t, seq) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_image_triggered_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_image_triggered_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_image_triggered_t, yaw) }, \
{ "local_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_image_triggered_t, local_z) }, \
{ "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_image_triggered_t, lat) }, \
{ "lon", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_image_triggered_t, lon) }, \
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_image_triggered_t, alt) }, \
{ "ground_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_image_triggered_t, ground_x) }, \
{ "ground_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_image_triggered_t, ground_y) }, \
{ "ground_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_image_triggered_t, ground_z) }, \
} \
}
/**
* @brief Pack a image_triggered 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 Timestamp
* @param seq IMU seq
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_triggered_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint32_t(buf, 8, seq);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_float(buf, 24, local_z);
_mav_put_float(buf, 28, lat);
_mav_put_float(buf, 32, lon);
_mav_put_float(buf, 36, alt);
_mav_put_float(buf, 40, ground_x);
_mav_put_float(buf, 44, ground_y);
_mav_put_float(buf, 48, ground_z);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#else
mavlink_image_triggered_t packet;
packet.timestamp = timestamp;
packet.seq = seq;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGERED;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
}
/**
* @brief Pack a image_triggered 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 Timestamp
* @param seq IMU seq
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_image_triggered_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t timestamp,uint32_t seq,float roll,float pitch,float yaw,float local_z,float lat,float lon,float alt,float ground_x,float ground_y,float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint32_t(buf, 8, seq);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_float(buf, 24, local_z);
_mav_put_float(buf, 28, lat);
_mav_put_float(buf, 32, lon);
_mav_put_float(buf, 36, alt);
_mav_put_float(buf, 40, ground_x);
_mav_put_float(buf, 44, ground_y);
_mav_put_float(buf, 48, ground_z);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#else
mavlink_image_triggered_t packet;
packet.timestamp = timestamp;
packet.seq = seq;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGERED;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
}
/**
* @brief Encode a image_triggered 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 image_triggered C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_triggered_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_image_triggered_t* image_triggered)
{
return mavlink_msg_image_triggered_pack(system_id, component_id, msg, image_triggered->timestamp, image_triggered->seq, image_triggered->roll, image_triggered->pitch, image_triggered->yaw, image_triggered->local_z, image_triggered->lat, image_triggered->lon, image_triggered->alt, image_triggered->ground_x, image_triggered->ground_y, image_triggered->ground_z);
}
/**
* @brief Encode a image_triggered 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 image_triggered C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_image_triggered_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_image_triggered_t* image_triggered)
{
return mavlink_msg_image_triggered_pack_chan(system_id, component_id, chan, msg, image_triggered->timestamp, image_triggered->seq, image_triggered->roll, image_triggered->pitch, image_triggered->yaw, image_triggered->local_z, image_triggered->lat, image_triggered->lon, image_triggered->alt, image_triggered->ground_x, image_triggered->ground_y, image_triggered->ground_z);
}
/**
* @brief Send a image_triggered message
* @param chan MAVLink channel to send the message
*
* @param timestamp Timestamp
* @param seq IMU seq
* @param roll Roll angle in rad
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
* @param local_z Local frame Z coordinate (height over ground)
* @param lat GPS X coordinate
* @param lon GPS Y coordinate
* @param alt Global frame altitude
* @param ground_x Ground truth X
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_triggered_send(mavlink_channel_t chan, uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN];
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint32_t(buf, 8, seq);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_float(buf, 24, local_z);
_mav_put_float(buf, 28, lat);
_mav_put_float(buf, 32, lon);
_mav_put_float(buf, 36, alt);
_mav_put_float(buf, 40, ground_x);
_mav_put_float(buf, 44, ground_y);
_mav_put_float(buf, 48, ground_z);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, buf, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, buf, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
#else
mavlink_image_triggered_t packet;
packet.timestamp = timestamp;
packet.seq = seq;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.local_z = local_z;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.ground_x = ground_x;
packet.ground_y = ground_y;
packet.ground_z = ground_z;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)&packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)&packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_image_triggered_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint64_t(buf, 0, timestamp);
_mav_put_uint32_t(buf, 8, seq);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_float(buf, 24, local_z);
_mav_put_float(buf, 28, lat);
_mav_put_float(buf, 32, lon);
_mav_put_float(buf, 36, alt);
_mav_put_float(buf, 40, ground_x);
_mav_put_float(buf, 44, ground_y);
_mav_put_float(buf, 48, ground_z);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, buf, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, buf, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
#else
mavlink_image_triggered_t *packet = (mavlink_image_triggered_t *)msgbuf;
packet->timestamp = timestamp;
packet->seq = seq;
packet->roll = roll;
packet->pitch = pitch;
packet->yaw = yaw;
packet->local_z = local_z;
packet->lat = lat;
packet->lon = lon;
packet->alt = alt;
packet->ground_x = ground_x;
packet->ground_y = ground_y;
packet->ground_z = ground_z;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN, MAVLINK_MSG_ID_IMAGE_TRIGGERED_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED, (const char *)packet, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE IMAGE_TRIGGERED UNPACKING
/**
* @brief Get field timestamp from image_triggered message
*
* @return Timestamp
*/
static inline uint64_t mavlink_msg_image_triggered_get_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field seq from image_triggered message
*
* @return IMU seq
*/
static inline uint32_t mavlink_msg_image_triggered_get_seq(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 8);
}
/**
* @brief Get field roll from image_triggered message
*
* @return Roll angle in rad
*/
static inline float mavlink_msg_image_triggered_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field pitch from image_triggered message
*
* @return Pitch angle in rad
*/
static inline float mavlink_msg_image_triggered_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field yaw from image_triggered message
*
* @return Yaw angle in rad
*/
static inline float mavlink_msg_image_triggered_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field local_z from image_triggered message
*
* @return Local frame Z coordinate (height over ground)
*/
static inline float mavlink_msg_image_triggered_get_local_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field lat from image_triggered message
*
* @return GPS X coordinate
*/
static inline float mavlink_msg_image_triggered_get_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Get field lon from image_triggered message
*
* @return GPS Y coordinate
*/
static inline float mavlink_msg_image_triggered_get_lon(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 32);
}
/**
* @brief Get field alt from image_triggered message
*
* @return Global frame altitude
*/
static inline float mavlink_msg_image_triggered_get_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 36);
}
/**
* @brief Get field ground_x from image_triggered message
*
* @return Ground truth X
*/
static inline float mavlink_msg_image_triggered_get_ground_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 40);
}
/**
* @brief Get field ground_y from image_triggered message
*
* @return Ground truth Y
*/
static inline float mavlink_msg_image_triggered_get_ground_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 44);
}
/**
* @brief Get field ground_z from image_triggered message
*
* @return Ground truth Z
*/
static inline float mavlink_msg_image_triggered_get_ground_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 48);
}
/**
* @brief Decode a image_triggered message into a struct
*
* @param msg The message to decode
* @param image_triggered C-struct to decode the message contents into
*/
static inline void mavlink_msg_image_triggered_decode(const mavlink_message_t* msg, mavlink_image_triggered_t* image_triggered)
{
#if MAVLINK_NEED_BYTE_SWAP
image_triggered->timestamp = mavlink_msg_image_triggered_get_timestamp(msg);
image_triggered->seq = mavlink_msg_image_triggered_get_seq(msg);
image_triggered->roll = mavlink_msg_image_triggered_get_roll(msg);
image_triggered->pitch = mavlink_msg_image_triggered_get_pitch(msg);
image_triggered->yaw = mavlink_msg_image_triggered_get_yaw(msg);
image_triggered->local_z = mavlink_msg_image_triggered_get_local_z(msg);
image_triggered->lat = mavlink_msg_image_triggered_get_lat(msg);
image_triggered->lon = mavlink_msg_image_triggered_get_lon(msg);
image_triggered->alt = mavlink_msg_image_triggered_get_alt(msg);
image_triggered->ground_x = mavlink_msg_image_triggered_get_ground_x(msg);
image_triggered->ground_y = mavlink_msg_image_triggered_get_ground_y(msg);
image_triggered->ground_z = mavlink_msg_image_triggered_get_ground_z(msg);
#else
memcpy(image_triggered, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
#endif
}
// MESSAGE MARKER PACKING
#define MAVLINK_MSG_ID_MARKER 171
typedef struct __mavlink_marker_t
{
float x; /*< x position*/
float y; /*< y position*/
float z; /*< z position*/
float roll; /*< roll orientation*/
float pitch; /*< pitch orientation*/
float yaw; /*< yaw orientation*/
uint16_t id; /*< ID*/
} mavlink_marker_t;
#define MAVLINK_MSG_ID_MARKER_LEN 26
#define MAVLINK_MSG_ID_171_LEN 26
#define MAVLINK_MSG_ID_MARKER_CRC 249
#define MAVLINK_MSG_ID_171_CRC 249
#define MAVLINK_MESSAGE_INFO_MARKER { \
"MARKER", \
7, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_marker_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_marker_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_marker_t, z) }, \
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_marker_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_marker_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_marker_t, yaw) }, \
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_marker_t, id) }, \
} \
}
/**
* @brief Pack a marker 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 id ID
* @param x x position
* @param y y position
* @param z z position
* @param roll roll orientation
* @param pitch pitch orientation
* @param yaw yaw orientation
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_marker_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t id, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_MARKER_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_uint16_t(buf, 24, id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MARKER_LEN);
#else
mavlink_marker_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.id = id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MARKER_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_MARKER;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MARKER_LEN, MAVLINK_MSG_ID_MARKER_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MARKER_LEN);
#endif
}
/**
* @brief Pack a marker 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 id ID
* @param x x position
* @param y y position
* @param z z position
* @param roll roll orientation
* @param pitch pitch orientation
* @param yaw yaw orientation
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_marker_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t id,float x,float y,float z,float roll,float pitch,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_MARKER_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_uint16_t(buf, 24, id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MARKER_LEN);
#else
mavlink_marker_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.id = id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MARKER_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_MARKER;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MARKER_LEN, MAVLINK_MSG_ID_MARKER_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MARKER_LEN);
#endif
}
/**
* @brief Encode a marker 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 marker C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_marker_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_marker_t* marker)
{
return mavlink_msg_marker_pack(system_id, component_id, msg, marker->id, marker->x, marker->y, marker->z, marker->roll, marker->pitch, marker->yaw);
}
/**
* @brief Encode a marker 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 marker C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_marker_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_marker_t* marker)
{
return mavlink_msg_marker_pack_chan(system_id, component_id, chan, msg, marker->id, marker->x, marker->y, marker->z, marker->roll, marker->pitch, marker->yaw);
}
/**
* @brief Send a marker message
* @param chan MAVLink channel to send the message
*
* @param id ID
* @param x x position
* @param y y position
* @param z z position
* @param roll roll orientation
* @param pitch pitch orientation
* @param yaw yaw orientation
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_marker_send(mavlink_channel_t chan, uint16_t id, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_MARKER_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_uint16_t(buf, 24, id);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, buf, MAVLINK_MSG_ID_MARKER_LEN, MAVLINK_MSG_ID_MARKER_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, buf, MAVLINK_MSG_ID_MARKER_LEN);
#endif
#else
mavlink_marker_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.id = id;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, (const char *)&packet, MAVLINK_MSG_ID_MARKER_LEN, MAVLINK_MSG_ID_MARKER_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, (const char *)&packet, MAVLINK_MSG_ID_MARKER_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_MARKER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_marker_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t id, float x, float y, float z, float roll, float pitch, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, roll);
_mav_put_float(buf, 16, pitch);
_mav_put_float(buf, 20, yaw);
_mav_put_uint16_t(buf, 24, id);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, buf, MAVLINK_MSG_ID_MARKER_LEN, MAVLINK_MSG_ID_MARKER_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, buf, MAVLINK_MSG_ID_MARKER_LEN);
#endif
#else
mavlink_marker_t *packet = (mavlink_marker_t *)msgbuf;
packet->x = x;
packet->y = y;
packet->z = z;
packet->roll = roll;
packet->pitch = pitch;
packet->yaw = yaw;
packet->id = id;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, (const char *)packet, MAVLINK_MSG_ID_MARKER_LEN, MAVLINK_MSG_ID_MARKER_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MARKER, (const char *)packet, MAVLINK_MSG_ID_MARKER_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE MARKER UNPACKING
/**
* @brief Get field id from marker message
*
* @return ID
*/
static inline uint16_t mavlink_msg_marker_get_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 24);
}
/**
* @brief Get field x from marker message
*
* @return x position
*/
static inline float mavlink_msg_marker_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from marker message
*
* @return y position
*/
static inline float mavlink_msg_marker_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from marker message
*
* @return z position
*/
static inline float mavlink_msg_marker_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field roll from marker message
*
* @return roll orientation
*/
static inline float mavlink_msg_marker_get_roll(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field pitch from marker message
*
* @return pitch orientation
*/
static inline float mavlink_msg_marker_get_pitch(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field yaw from marker message
*
* @return yaw orientation
*/
static inline float mavlink_msg_marker_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Decode a marker message into a struct
*
* @param msg The message to decode
* @param marker C-struct to decode the message contents into
*/
static inline void mavlink_msg_marker_decode(const mavlink_message_t* msg, mavlink_marker_t* marker)
{
#if MAVLINK_NEED_BYTE_SWAP
marker->x = mavlink_msg_marker_get_x(msg);
marker->y = mavlink_msg_marker_get_y(msg);
marker->z = mavlink_msg_marker_get_z(msg);
marker->roll = mavlink_msg_marker_get_roll(msg);
marker->pitch = mavlink_msg_marker_get_pitch(msg);
marker->yaw = mavlink_msg_marker_get_yaw(msg);
marker->id = mavlink_msg_marker_get_id(msg);
#else
memcpy(marker, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MARKER_LEN);
#endif
}
// MESSAGE ONBOARD_HEALTH PACKING
#define MAVLINK_MSG_ID_ONBOARD_HEALTH 206
typedef struct __mavlink_onboard_health_t
{
uint32_t uptime; /*< Uptime of system*/
float ram_total; /*< RAM size in GiB*/
float swap_total; /*< Swap size in GiB*/
float disk_total; /*< Disk total in GiB*/
float temp; /*< Temperature*/
float voltage; /*< Supply voltage V*/
float network_load_in; /*< Network load inbound KiB/s*/
float network_load_out; /*< Network load outbound in KiB/s */
uint16_t cpu_freq; /*< CPU frequency*/
uint8_t cpu_load; /*< CPU load in percent*/
uint8_t ram_usage; /*< RAM usage in percent*/
uint8_t swap_usage; /*< Swap usage in percent*/
int8_t disk_health; /*< Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)*/
uint8_t disk_usage; /*< Disk usage in percent*/
} mavlink_onboard_health_t;
#define MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN 39
#define MAVLINK_MSG_ID_206_LEN 39
#define MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC 19
#define MAVLINK_MSG_ID_206_CRC 19
#define MAVLINK_MESSAGE_INFO_ONBOARD_HEALTH { \
"ONBOARD_HEALTH", \
14, \
{ { "uptime", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_onboard_health_t, uptime) }, \
{ "ram_total", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_onboard_health_t, ram_total) }, \
{ "swap_total", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_onboard_health_t, swap_total) }, \
{ "disk_total", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_onboard_health_t, disk_total) }, \
{ "temp", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_onboard_health_t, temp) }, \
{ "voltage", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_onboard_health_t, voltage) }, \
{ "network_load_in", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_onboard_health_t, network_load_in) }, \
{ "network_load_out", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_onboard_health_t, network_load_out) }, \
{ "cpu_freq", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_onboard_health_t, cpu_freq) }, \
{ "cpu_load", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_onboard_health_t, cpu_load) }, \
{ "ram_usage", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_onboard_health_t, ram_usage) }, \
{ "swap_usage", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_onboard_health_t, swap_usage) }, \
{ "disk_health", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_onboard_health_t, disk_health) }, \
{ "disk_usage", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_onboard_health_t, disk_usage) }, \
} \
}
/**
* @brief Pack a onboard_health 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 uptime Uptime of system
* @param cpu_freq CPU frequency
* @param cpu_load CPU load in percent
* @param ram_usage RAM usage in percent
* @param ram_total RAM size in GiB
* @param swap_usage Swap usage in percent
* @param swap_total Swap size in GiB
* @param disk_health Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)
* @param disk_usage Disk usage in percent
* @param disk_total Disk total in GiB
* @param temp Temperature
* @param voltage Supply voltage V
* @param network_load_in Network load inbound KiB/s
* @param network_load_out Network load outbound in KiB/s
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_onboard_health_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t uptime, uint16_t cpu_freq, uint8_t cpu_load, uint8_t ram_usage, float ram_total, uint8_t swap_usage, float swap_total, int8_t disk_health, uint8_t disk_usage, float disk_total, float temp, float voltage, float network_load_in, float network_load_out)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN];
_mav_put_uint32_t(buf, 0, uptime);
_mav_put_float(buf, 4, ram_total);
_mav_put_float(buf, 8, swap_total);
_mav_put_float(buf, 12, disk_total);
_mav_put_float(buf, 16, temp);
_mav_put_float(buf, 20, voltage);
_mav_put_float(buf, 24, network_load_in);
_mav_put_float(buf, 28, network_load_out);
_mav_put_uint16_t(buf, 32, cpu_freq);
_mav_put_uint8_t(buf, 34, cpu_load);
_mav_put_uint8_t(buf, 35, ram_usage);
_mav_put_uint8_t(buf, 36, swap_usage);
_mav_put_int8_t(buf, 37, disk_health);
_mav_put_uint8_t(buf, 38, disk_usage);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#else
mavlink_onboard_health_t packet;
packet.uptime = uptime;
packet.ram_total = ram_total;
packet.swap_total = swap_total;
packet.disk_total = disk_total;
packet.temp = temp;
packet.voltage = voltage;
packet.network_load_in = network_load_in;
packet.network_load_out = network_load_out;
packet.cpu_freq = cpu_freq;
packet.cpu_load = cpu_load;
packet.ram_usage = ram_usage;
packet.swap_usage = swap_usage;
packet.disk_health = disk_health;
packet.disk_usage = disk_usage;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ONBOARD_HEALTH;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
}
/**
* @brief Pack a onboard_health 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 uptime Uptime of system
* @param cpu_freq CPU frequency
* @param cpu_load CPU load in percent
* @param ram_usage RAM usage in percent
* @param ram_total RAM size in GiB
* @param swap_usage Swap usage in percent
* @param swap_total Swap size in GiB
* @param disk_health Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)
* @param disk_usage Disk usage in percent
* @param disk_total Disk total in GiB
* @param temp Temperature
* @param voltage Supply voltage V
* @param network_load_in Network load inbound KiB/s
* @param network_load_out Network load outbound in KiB/s
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_onboard_health_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t uptime,uint16_t cpu_freq,uint8_t cpu_load,uint8_t ram_usage,float ram_total,uint8_t swap_usage,float swap_total,int8_t disk_health,uint8_t disk_usage,float disk_total,float temp,float voltage,float network_load_in,float network_load_out)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN];
_mav_put_uint32_t(buf, 0, uptime);
_mav_put_float(buf, 4, ram_total);
_mav_put_float(buf, 8, swap_total);
_mav_put_float(buf, 12, disk_total);
_mav_put_float(buf, 16, temp);
_mav_put_float(buf, 20, voltage);
_mav_put_float(buf, 24, network_load_in);
_mav_put_float(buf, 28, network_load_out);
_mav_put_uint16_t(buf, 32, cpu_freq);
_mav_put_uint8_t(buf, 34, cpu_load);
_mav_put_uint8_t(buf, 35, ram_usage);
_mav_put_uint8_t(buf, 36, swap_usage);
_mav_put_int8_t(buf, 37, disk_health);
_mav_put_uint8_t(buf, 38, disk_usage);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#else
mavlink_onboard_health_t packet;
packet.uptime = uptime;
packet.ram_total = ram_total;
packet.swap_total = swap_total;
packet.disk_total = disk_total;
packet.temp = temp;
packet.voltage = voltage;
packet.network_load_in = network_load_in;
packet.network_load_out = network_load_out;
packet.cpu_freq = cpu_freq;
packet.cpu_load = cpu_load;
packet.ram_usage = ram_usage;
packet.swap_usage = swap_usage;
packet.disk_health = disk_health;
packet.disk_usage = disk_usage;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_ONBOARD_HEALTH;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
}
/**
* @brief Encode a onboard_health 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 onboard_health C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_onboard_health_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_onboard_health_t* onboard_health)
{
return mavlink_msg_onboard_health_pack(system_id, component_id, msg, onboard_health->uptime, onboard_health->cpu_freq, onboard_health->cpu_load, onboard_health->ram_usage, onboard_health->ram_total, onboard_health->swap_usage, onboard_health->swap_total, onboard_health->disk_health, onboard_health->disk_usage, onboard_health->disk_total, onboard_health->temp, onboard_health->voltage, onboard_health->network_load_in, onboard_health->network_load_out);
}
/**
* @brief Encode a onboard_health 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 onboard_health C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_onboard_health_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_onboard_health_t* onboard_health)
{
return mavlink_msg_onboard_health_pack_chan(system_id, component_id, chan, msg, onboard_health->uptime, onboard_health->cpu_freq, onboard_health->cpu_load, onboard_health->ram_usage, onboard_health->ram_total, onboard_health->swap_usage, onboard_health->swap_total, onboard_health->disk_health, onboard_health->disk_usage, onboard_health->disk_total, onboard_health->temp, onboard_health->voltage, onboard_health->network_load_in, onboard_health->network_load_out);
}
/**
* @brief Send a onboard_health message
* @param chan MAVLink channel to send the message
*
* @param uptime Uptime of system
* @param cpu_freq CPU frequency
* @param cpu_load CPU load in percent
* @param ram_usage RAM usage in percent
* @param ram_total RAM size in GiB
* @param swap_usage Swap usage in percent
* @param swap_total Swap size in GiB
* @param disk_health Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)
* @param disk_usage Disk usage in percent
* @param disk_total Disk total in GiB
* @param temp Temperature
* @param voltage Supply voltage V
* @param network_load_in Network load inbound KiB/s
* @param network_load_out Network load outbound in KiB/s
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_onboard_health_send(mavlink_channel_t chan, uint32_t uptime, uint16_t cpu_freq, uint8_t cpu_load, uint8_t ram_usage, float ram_total, uint8_t swap_usage, float swap_total, int8_t disk_health, uint8_t disk_usage, float disk_total, float temp, float voltage, float network_load_in, float network_load_out)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN];
_mav_put_uint32_t(buf, 0, uptime);
_mav_put_float(buf, 4, ram_total);
_mav_put_float(buf, 8, swap_total);
_mav_put_float(buf, 12, disk_total);
_mav_put_float(buf, 16, temp);
_mav_put_float(buf, 20, voltage);
_mav_put_float(buf, 24, network_load_in);
_mav_put_float(buf, 28, network_load_out);
_mav_put_uint16_t(buf, 32, cpu_freq);
_mav_put_uint8_t(buf, 34, cpu_load);
_mav_put_uint8_t(buf, 35, ram_usage);
_mav_put_uint8_t(buf, 36, swap_usage);
_mav_put_int8_t(buf, 37, disk_health);
_mav_put_uint8_t(buf, 38, disk_usage);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
#else
mavlink_onboard_health_t packet;
packet.uptime = uptime;
packet.ram_total = ram_total;
packet.swap_total = swap_total;
packet.disk_total = disk_total;
packet.temp = temp;
packet.voltage = voltage;
packet.network_load_in = network_load_in;
packet.network_load_out = network_load_out;
packet.cpu_freq = cpu_freq;
packet.cpu_load = cpu_load;
packet.ram_usage = ram_usage;
packet.swap_usage = swap_usage;
packet.disk_health = disk_health;
packet.disk_usage = disk_usage;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, (const char *)&packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, (const char *)&packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_onboard_health_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t uptime, uint16_t cpu_freq, uint8_t cpu_load, uint8_t ram_usage, float ram_total, uint8_t swap_usage, float swap_total, int8_t disk_health, uint8_t disk_usage, float disk_total, float temp, float voltage, float network_load_in, float network_load_out)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, uptime);
_mav_put_float(buf, 4, ram_total);
_mav_put_float(buf, 8, swap_total);
_mav_put_float(buf, 12, disk_total);
_mav_put_float(buf, 16, temp);
_mav_put_float(buf, 20, voltage);
_mav_put_float(buf, 24, network_load_in);
_mav_put_float(buf, 28, network_load_out);
_mav_put_uint16_t(buf, 32, cpu_freq);
_mav_put_uint8_t(buf, 34, cpu_load);
_mav_put_uint8_t(buf, 35, ram_usage);
_mav_put_uint8_t(buf, 36, swap_usage);
_mav_put_int8_t(buf, 37, disk_health);
_mav_put_uint8_t(buf, 38, disk_usage);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
#else
mavlink_onboard_health_t *packet = (mavlink_onboard_health_t *)msgbuf;
packet->uptime = uptime;
packet->ram_total = ram_total;
packet->swap_total = swap_total;
packet->disk_total = disk_total;
packet->temp = temp;
packet->voltage = voltage;
packet->network_load_in = network_load_in;
packet->network_load_out = network_load_out;
packet->cpu_freq = cpu_freq;
packet->cpu_load = cpu_load;
packet->ram_usage = ram_usage;
packet->swap_usage = swap_usage;
packet->disk_health = disk_health;
packet->disk_usage = disk_usage;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, (const char *)packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, (const char *)packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE ONBOARD_HEALTH UNPACKING
/**
* @brief Get field uptime from onboard_health message
*
* @return Uptime of system
*/
static inline uint32_t mavlink_msg_onboard_health_get_uptime(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field cpu_freq from onboard_health message
*
* @return CPU frequency
*/
static inline uint16_t mavlink_msg_onboard_health_get_cpu_freq(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 32);
}
/**
* @brief Get field cpu_load from onboard_health message
*
* @return CPU load in percent
*/
static inline uint8_t mavlink_msg_onboard_health_get_cpu_load(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 34);
}
/**
* @brief Get field ram_usage from onboard_health message
*
* @return RAM usage in percent
*/
static inline uint8_t mavlink_msg_onboard_health_get_ram_usage(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 35);
}
/**
* @brief Get field ram_total from onboard_health message
*
* @return RAM size in GiB
*/
static inline float mavlink_msg_onboard_health_get_ram_total(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field swap_usage from onboard_health message
*
* @return Swap usage in percent
*/
static inline uint8_t mavlink_msg_onboard_health_get_swap_usage(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 36);
}
/**
* @brief Get field swap_total from onboard_health message
*
* @return Swap size in GiB
*/
static inline float mavlink_msg_onboard_health_get_swap_total(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field disk_health from onboard_health message
*
* @return Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)
*/
static inline int8_t mavlink_msg_onboard_health_get_disk_health(const mavlink_message_t* msg)
{
return _MAV_RETURN_int8_t(msg, 37);
}
/**
* @brief Get field disk_usage from onboard_health message
*
* @return Disk usage in percent
*/
static inline uint8_t mavlink_msg_onboard_health_get_disk_usage(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 38);
}
/**
* @brief Get field disk_total from onboard_health message
*
* @return Disk total in GiB
*/
static inline float mavlink_msg_onboard_health_get_disk_total(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field temp from onboard_health message
*
* @return Temperature
*/
static inline float mavlink_msg_onboard_health_get_temp(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field voltage from onboard_health message
*
* @return Supply voltage V
*/
static inline float mavlink_msg_onboard_health_get_voltage(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field network_load_in from onboard_health message
*
* @return Network load inbound KiB/s
*/
static inline float mavlink_msg_onboard_health_get_network_load_in(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field network_load_out from onboard_health message
*
* @return Network load outbound in KiB/s
*/
static inline float mavlink_msg_onboard_health_get_network_load_out(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a onboard_health message into a struct
*
* @param msg The message to decode
* @param onboard_health C-struct to decode the message contents into
*/
static inline void mavlink_msg_onboard_health_decode(const mavlink_message_t* msg, mavlink_onboard_health_t* onboard_health)
{
#if MAVLINK_NEED_BYTE_SWAP
onboard_health->uptime = mavlink_msg_onboard_health_get_uptime(msg);
onboard_health->ram_total = mavlink_msg_onboard_health_get_ram_total(msg);
onboard_health->swap_total = mavlink_msg_onboard_health_get_swap_total(msg);
onboard_health->disk_total = mavlink_msg_onboard_health_get_disk_total(msg);
onboard_health->temp = mavlink_msg_onboard_health_get_temp(msg);
onboard_health->voltage = mavlink_msg_onboard_health_get_voltage(msg);
onboard_health->network_load_in = mavlink_msg_onboard_health_get_network_load_in(msg);
onboard_health->network_load_out = mavlink_msg_onboard_health_get_network_load_out(msg);
onboard_health->cpu_freq = mavlink_msg_onboard_health_get_cpu_freq(msg);
onboard_health->cpu_load = mavlink_msg_onboard_health_get_cpu_load(msg);
onboard_health->ram_usage = mavlink_msg_onboard_health_get_ram_usage(msg);
onboard_health->swap_usage = mavlink_msg_onboard_health_get_swap_usage(msg);
onboard_health->disk_health = mavlink_msg_onboard_health_get_disk_health(msg);
onboard_health->disk_usage = mavlink_msg_onboard_health_get_disk_usage(msg);
#else
memcpy(onboard_health, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
}
// MESSAGE PATTERN_DETECTED PACKING
#define MAVLINK_MSG_ID_PATTERN_DETECTED 190
typedef struct __mavlink_pattern_detected_t
{
float confidence; /*< Confidence of detection*/
uint8_t type; /*< 0: Pattern, 1: Letter*/
char file[100]; /*< Pattern file name*/
uint8_t detected; /*< Accepted as true detection, 0 no, 1 yes*/
} mavlink_pattern_detected_t;
#define MAVLINK_MSG_ID_PATTERN_DETECTED_LEN 106
#define MAVLINK_MSG_ID_190_LEN 106
#define MAVLINK_MSG_ID_PATTERN_DETECTED_CRC 90
#define MAVLINK_MSG_ID_190_CRC 90
#define MAVLINK_MSG_PATTERN_DETECTED_FIELD_FILE_LEN 100
#define MAVLINK_MESSAGE_INFO_PATTERN_DETECTED { \
"PATTERN_DETECTED", \
4, \
{ { "confidence", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_pattern_detected_t, confidence) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_pattern_detected_t, type) }, \
{ "file", NULL, MAVLINK_TYPE_CHAR, 100, 5, offsetof(mavlink_pattern_detected_t, file) }, \
{ "detected", NULL, MAVLINK_TYPE_UINT8_T, 0, 105, offsetof(mavlink_pattern_detected_t, detected) }, \
} \
}
/**
* @brief Pack a pattern_detected 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 0: Pattern, 1: Letter
* @param confidence Confidence of detection
* @param file Pattern file name
* @param detected Accepted as true detection, 0 no, 1 yes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_pattern_detected_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t type, float confidence, const char *file, uint8_t detected)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_PATTERN_DETECTED_LEN];
_mav_put_float(buf, 0, confidence);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 105, detected);
_mav_put_char_array(buf, 5, file, 100);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#else
mavlink_pattern_detected_t packet;
packet.confidence = confidence;
packet.type = type;
packet.detected = detected;
mav_array_memcpy(packet.file, file, sizeof(char)*100);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_PATTERN_DETECTED;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN, MAVLINK_MSG_ID_PATTERN_DETECTED_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
}
/**
* @brief Pack a pattern_detected 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 type 0: Pattern, 1: Letter
* @param confidence Confidence of detection
* @param file Pattern file name
* @param detected Accepted as true detection, 0 no, 1 yes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_pattern_detected_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t type,float confidence,const char *file,uint8_t detected)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_PATTERN_DETECTED_LEN];
_mav_put_float(buf, 0, confidence);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 105, detected);
_mav_put_char_array(buf, 5, file, 100);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#else
mavlink_pattern_detected_t packet;
packet.confidence = confidence;
packet.type = type;
packet.detected = detected;
mav_array_memcpy(packet.file, file, sizeof(char)*100);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_PATTERN_DETECTED;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN, MAVLINK_MSG_ID_PATTERN_DETECTED_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
}
/**
* @brief Encode a pattern_detected 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 pattern_detected C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_pattern_detected_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_pattern_detected_t* pattern_detected)
{
return mavlink_msg_pattern_detected_pack(system_id, component_id, msg, pattern_detected->type, pattern_detected->confidence, pattern_detected->file, pattern_detected->detected);
}
/**
* @brief Encode a pattern_detected 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 pattern_detected C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_pattern_detected_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_pattern_detected_t* pattern_detected)
{
return mavlink_msg_pattern_detected_pack_chan(system_id, component_id, chan, msg, pattern_detected->type, pattern_detected->confidence, pattern_detected->file, pattern_detected->detected);
}
/**
* @brief Send a pattern_detected message
* @param chan MAVLink channel to send the message
*
* @param type 0: Pattern, 1: Letter
* @param confidence Confidence of detection
* @param file Pattern file name
* @param detected Accepted as true detection, 0 no, 1 yes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_pattern_detected_send(mavlink_channel_t chan, uint8_t type, float confidence, const char *file, uint8_t detected)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_PATTERN_DETECTED_LEN];
_mav_put_float(buf, 0, confidence);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 105, detected);
_mav_put_char_array(buf, 5, file, 100);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, buf, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN, MAVLINK_MSG_ID_PATTERN_DETECTED_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, buf, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
#else
mavlink_pattern_detected_t packet;
packet.confidence = confidence;
packet.type = type;
packet.detected = detected;
mav_array_memcpy(packet.file, file, sizeof(char)*100);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, (const char *)&packet, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN, MAVLINK_MSG_ID_PATTERN_DETECTED_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, (const char *)&packet, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_PATTERN_DETECTED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_pattern_detected_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, float confidence, const char *file, uint8_t detected)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, confidence);
_mav_put_uint8_t(buf, 4, type);
_mav_put_uint8_t(buf, 105, detected);
_mav_put_char_array(buf, 5, file, 100);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, buf, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN, MAVLINK_MSG_ID_PATTERN_DETECTED_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, buf, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
#else
mavlink_pattern_detected_t *packet = (mavlink_pattern_detected_t *)msgbuf;
packet->confidence = confidence;
packet->type = type;
packet->detected = detected;
mav_array_memcpy(packet->file, file, sizeof(char)*100);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, (const char *)packet, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN, MAVLINK_MSG_ID_PATTERN_DETECTED_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PATTERN_DETECTED, (const char *)packet, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE PATTERN_DETECTED UNPACKING
/**
* @brief Get field type from pattern_detected message
*
* @return 0: Pattern, 1: Letter
*/
static inline uint8_t mavlink_msg_pattern_detected_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field confidence from pattern_detected message
*
* @return Confidence of detection
*/
static inline float mavlink_msg_pattern_detected_get_confidence(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field file from pattern_detected message
*
* @return Pattern file name
*/
static inline uint16_t mavlink_msg_pattern_detected_get_file(const mavlink_message_t* msg, char *file)
{
return _MAV_RETURN_char_array(msg, file, 100, 5);
}
/**
* @brief Get field detected from pattern_detected message
*
* @return Accepted as true detection, 0 no, 1 yes
*/
static inline uint8_t mavlink_msg_pattern_detected_get_detected(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 105);
}
/**
* @brief Decode a pattern_detected message into a struct
*
* @param msg The message to decode
* @param pattern_detected C-struct to decode the message contents into
*/
static inline void mavlink_msg_pattern_detected_decode(const mavlink_message_t* msg, mavlink_pattern_detected_t* pattern_detected)
{
#if MAVLINK_NEED_BYTE_SWAP
pattern_detected->confidence = mavlink_msg_pattern_detected_get_confidence(msg);
pattern_detected->type = mavlink_msg_pattern_detected_get_type(msg);
mavlink_msg_pattern_detected_get_file(msg, pattern_detected->file);
pattern_detected->detected = mavlink_msg_pattern_detected_get_detected(msg);
#else
memcpy(pattern_detected, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
#endif
}
// MESSAGE POINT_OF_INTEREST PACKING
#define MAVLINK_MSG_ID_POINT_OF_INTEREST 191
typedef struct __mavlink_point_of_interest_t
{
float x; /*< X Position*/
float y; /*< Y Position*/
float z; /*< Z Position*/
uint16_t timeout; /*< 0: no timeout, >1: timeout in seconds*/
uint8_t type; /*< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug*/
uint8_t color; /*< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta*/
uint8_t coordinate_system; /*< 0: global, 1:local*/
char name[26]; /*< POI name*/
} mavlink_point_of_interest_t;
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN 43
#define MAVLINK_MSG_ID_191_LEN 43
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC 95
#define MAVLINK_MSG_ID_191_CRC 95
#define MAVLINK_MSG_POINT_OF_INTEREST_FIELD_NAME_LEN 26
#define MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST { \
"POINT_OF_INTEREST", \
8, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_point_of_interest_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_point_of_interest_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_point_of_interest_t, z) }, \
{ "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_point_of_interest_t, timeout) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_point_of_interest_t, type) }, \
{ "color", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_point_of_interest_t, color) }, \
{ "coordinate_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_point_of_interest_t, coordinate_system) }, \
{ "name", NULL, MAVLINK_TYPE_CHAR, 26, 17, offsetof(mavlink_point_of_interest_t, name) }, \
} \
}
/**
* @brief Pack a point_of_interest 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 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param x X Position
* @param y Y Position
* @param z Z Position
* @param name POI name
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_point_of_interest_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_uint16_t(buf, 12, timeout);
_mav_put_uint8_t(buf, 14, type);
_mav_put_uint8_t(buf, 15, color);
_mav_put_uint8_t(buf, 16, coordinate_system);
_mav_put_char_array(buf, 17, name, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#else
mavlink_point_of_interest_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
mav_array_memcpy(packet.name, name, sizeof(char)*26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
}
/**
* @brief Pack a point_of_interest 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 type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param x X Position
* @param y Y Position
* @param z Z Position
* @param name POI name
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_point_of_interest_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t type,uint8_t color,uint8_t coordinate_system,uint16_t timeout,float x,float y,float z,const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_uint16_t(buf, 12, timeout);
_mav_put_uint8_t(buf, 14, type);
_mav_put_uint8_t(buf, 15, color);
_mav_put_uint8_t(buf, 16, coordinate_system);
_mav_put_char_array(buf, 17, name, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#else
mavlink_point_of_interest_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
mav_array_memcpy(packet.name, name, sizeof(char)*26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
}
/**
* @brief Encode a point_of_interest 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 point_of_interest C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_point_of_interest_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_point_of_interest_t* point_of_interest)
{
return mavlink_msg_point_of_interest_pack(system_id, component_id, msg, point_of_interest->type, point_of_interest->color, point_of_interest->coordinate_system, point_of_interest->timeout, point_of_interest->x, point_of_interest->y, point_of_interest->z, point_of_interest->name);
}
/**
* @brief Encode a point_of_interest 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 point_of_interest C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_point_of_interest_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_point_of_interest_t* point_of_interest)
{
return mavlink_msg_point_of_interest_pack_chan(system_id, component_id, chan, msg, point_of_interest->type, point_of_interest->color, point_of_interest->coordinate_system, point_of_interest->timeout, point_of_interest->x, point_of_interest->y, point_of_interest->z, point_of_interest->name);
}
/**
* @brief Send a point_of_interest message
* @param chan MAVLink channel to send the message
*
* @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param x X Position
* @param y Y Position
* @param z Z Position
* @param name POI name
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_point_of_interest_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_uint16_t(buf, 12, timeout);
_mav_put_uint8_t(buf, 14, type);
_mav_put_uint8_t(buf, 15, color);
_mav_put_uint8_t(buf, 16, coordinate_system);
_mav_put_char_array(buf, 17, name, 26);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
#else
mavlink_point_of_interest_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
mav_array_memcpy(packet.name, name, sizeof(char)*26);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)&packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)&packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_point_of_interest_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_uint16_t(buf, 12, timeout);
_mav_put_uint8_t(buf, 14, type);
_mav_put_uint8_t(buf, 15, color);
_mav_put_uint8_t(buf, 16, coordinate_system);
_mav_put_char_array(buf, 17, name, 26);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
#else
mavlink_point_of_interest_t *packet = (mavlink_point_of_interest_t *)msgbuf;
packet->x = x;
packet->y = y;
packet->z = z;
packet->timeout = timeout;
packet->type = type;
packet->color = color;
packet->coordinate_system = coordinate_system;
mav_array_memcpy(packet->name, name, sizeof(char)*26);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE POINT_OF_INTEREST UNPACKING
/**
* @brief Get field type from point_of_interest message
*
* @return 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
*/
static inline uint8_t mavlink_msg_point_of_interest_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 14);
}
/**
* @brief Get field color from point_of_interest message
*
* @return 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
*/
static inline uint8_t mavlink_msg_point_of_interest_get_color(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 15);
}
/**
* @brief Get field coordinate_system from point_of_interest message
*
* @return 0: global, 1:local
*/
static inline uint8_t mavlink_msg_point_of_interest_get_coordinate_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
* @brief Get field timeout from point_of_interest message
*
* @return 0: no timeout, >1: timeout in seconds
*/
static inline uint16_t mavlink_msg_point_of_interest_get_timeout(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 12);
}
/**
* @brief Get field x from point_of_interest message
*
* @return X Position
*/
static inline float mavlink_msg_point_of_interest_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from point_of_interest message
*
* @return Y Position
*/
static inline float mavlink_msg_point_of_interest_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from point_of_interest message
*
* @return Z Position
*/
static inline float mavlink_msg_point_of_interest_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field name from point_of_interest message
*
* @return POI name
*/
static inline uint16_t mavlink_msg_point_of_interest_get_name(const mavlink_message_t* msg, char *name)
{
return _MAV_RETURN_char_array(msg, name, 26, 17);
}
/**
* @brief Decode a point_of_interest message into a struct
*
* @param msg The message to decode
* @param point_of_interest C-struct to decode the message contents into
*/
static inline void mavlink_msg_point_of_interest_decode(const mavlink_message_t* msg, mavlink_point_of_interest_t* point_of_interest)
{
#if MAVLINK_NEED_BYTE_SWAP
point_of_interest->x = mavlink_msg_point_of_interest_get_x(msg);
point_of_interest->y = mavlink_msg_point_of_interest_get_y(msg);
point_of_interest->z = mavlink_msg_point_of_interest_get_z(msg);
point_of_interest->timeout = mavlink_msg_point_of_interest_get_timeout(msg);
point_of_interest->type = mavlink_msg_point_of_interest_get_type(msg);
point_of_interest->color = mavlink_msg_point_of_interest_get_color(msg);
point_of_interest->coordinate_system = mavlink_msg_point_of_interest_get_coordinate_system(msg);
mavlink_msg_point_of_interest_get_name(msg, point_of_interest->name);
#else
memcpy(point_of_interest, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
#endif
}
// MESSAGE POINT_OF_INTEREST_CONNECTION PACKING
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION 192
typedef struct __mavlink_point_of_interest_connection_t
{
float xp1; /*< X1 Position*/
float yp1; /*< Y1 Position*/
float zp1; /*< Z1 Position*/
float xp2; /*< X2 Position*/
float yp2; /*< Y2 Position*/
float zp2; /*< Z2 Position*/
uint16_t timeout; /*< 0: no timeout, >1: timeout in seconds*/
uint8_t type; /*< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug*/
uint8_t color; /*< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta*/
uint8_t coordinate_system; /*< 0: global, 1:local*/
char name[26]; /*< POI connection name*/
} mavlink_point_of_interest_connection_t;
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN 55
#define MAVLINK_MSG_ID_192_LEN 55
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_CRC 36
#define MAVLINK_MSG_ID_192_CRC 36
#define MAVLINK_MSG_POINT_OF_INTEREST_CONNECTION_FIELD_NAME_LEN 26
#define MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST_CONNECTION { \
"POINT_OF_INTEREST_CONNECTION", \
11, \
{ { "xp1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_point_of_interest_connection_t, xp1) }, \
{ "yp1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_point_of_interest_connection_t, yp1) }, \
{ "zp1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_point_of_interest_connection_t, zp1) }, \
{ "xp2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_point_of_interest_connection_t, xp2) }, \
{ "yp2", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_point_of_interest_connection_t, yp2) }, \
{ "zp2", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_point_of_interest_connection_t, zp2) }, \
{ "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_point_of_interest_connection_t, timeout) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_point_of_interest_connection_t, type) }, \
{ "color", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_point_of_interest_connection_t, color) }, \
{ "coordinate_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_point_of_interest_connection_t, coordinate_system) }, \
{ "name", NULL, MAVLINK_TYPE_CHAR, 26, 29, offsetof(mavlink_point_of_interest_connection_t, name) }, \
} \
}
/**
* @brief Pack a point_of_interest_connection 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 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param xp1 X1 Position
* @param yp1 Y1 Position
* @param zp1 Z1 Position
* @param xp2 X2 Position
* @param yp2 Y2 Position
* @param zp2 Z2 Position
* @param name POI connection name
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN];
_mav_put_float(buf, 0, xp1);
_mav_put_float(buf, 4, yp1);
_mav_put_float(buf, 8, zp1);
_mav_put_float(buf, 12, xp2);
_mav_put_float(buf, 16, yp2);
_mav_put_float(buf, 20, zp2);
_mav_put_uint16_t(buf, 24, timeout);
_mav_put_uint8_t(buf, 26, type);
_mav_put_uint8_t(buf, 27, color);
_mav_put_uint8_t(buf, 28, coordinate_system);
_mav_put_char_array(buf, 29, name, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#else
mavlink_point_of_interest_connection_t packet;
packet.xp1 = xp1;
packet.yp1 = yp1;
packet.zp1 = zp1;
packet.xp2 = xp2;
packet.yp2 = yp2;
packet.zp2 = zp2;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
mav_array_memcpy(packet.name, name, sizeof(char)*26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
}
/**
* @brief Pack a point_of_interest_connection 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 type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param xp1 X1 Position
* @param yp1 Y1 Position
* @param zp1 Z1 Position
* @param xp2 X2 Position
* @param yp2 Y2 Position
* @param zp2 Z2 Position
* @param name POI connection name
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t type,uint8_t color,uint8_t coordinate_system,uint16_t timeout,float xp1,float yp1,float zp1,float xp2,float yp2,float zp2,const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN];
_mav_put_float(buf, 0, xp1);
_mav_put_float(buf, 4, yp1);
_mav_put_float(buf, 8, zp1);
_mav_put_float(buf, 12, xp2);
_mav_put_float(buf, 16, yp2);
_mav_put_float(buf, 20, zp2);
_mav_put_uint16_t(buf, 24, timeout);
_mav_put_uint8_t(buf, 26, type);
_mav_put_uint8_t(buf, 27, color);
_mav_put_uint8_t(buf, 28, coordinate_system);
_mav_put_char_array(buf, 29, name, 26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#else
mavlink_point_of_interest_connection_t packet;
packet.xp1 = xp1;
packet.yp1 = yp1;
packet.zp1 = zp1;
packet.xp2 = xp2;
packet.yp2 = yp2;
packet.zp2 = zp2;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
mav_array_memcpy(packet.name, name, sizeof(char)*26);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
}
/**
* @brief Encode a point_of_interest_connection 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 point_of_interest_connection C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_point_of_interest_connection_t* point_of_interest_connection)
{
return mavlink_msg_point_of_interest_connection_pack(system_id, component_id, msg, point_of_interest_connection->type, point_of_interest_connection->color, point_of_interest_connection->coordinate_system, point_of_interest_connection->timeout, point_of_interest_connection->xp1, point_of_interest_connection->yp1, point_of_interest_connection->zp1, point_of_interest_connection->xp2, point_of_interest_connection->yp2, point_of_interest_connection->zp2, point_of_interest_connection->name);
}
/**
* @brief Encode a point_of_interest_connection 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 point_of_interest_connection C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_point_of_interest_connection_t* point_of_interest_connection)
{
return mavlink_msg_point_of_interest_connection_pack_chan(system_id, component_id, chan, msg, point_of_interest_connection->type, point_of_interest_connection->color, point_of_interest_connection->coordinate_system, point_of_interest_connection->timeout, point_of_interest_connection->xp1, point_of_interest_connection->yp1, point_of_interest_connection->zp1, point_of_interest_connection->xp2, point_of_interest_connection->yp2, point_of_interest_connection->zp2, point_of_interest_connection->name);
}
/**
* @brief Send a point_of_interest_connection message
* @param chan MAVLink channel to send the message
*
* @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
* @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
* @param coordinate_system 0: global, 1:local
* @param timeout 0: no timeout, >1: timeout in seconds
* @param xp1 X1 Position
* @param yp1 Y1 Position
* @param zp1 Z1 Position
* @param xp2 X2 Position
* @param yp2 Y2 Position
* @param zp2 Z2 Position
* @param name POI connection name
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_point_of_interest_connection_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN];
_mav_put_float(buf, 0, xp1);
_mav_put_float(buf, 4, yp1);
_mav_put_float(buf, 8, zp1);
_mav_put_float(buf, 12, xp2);
_mav_put_float(buf, 16, yp2);
_mav_put_float(buf, 20, zp2);
_mav_put_uint16_t(buf, 24, timeout);
_mav_put_uint8_t(buf, 26, type);
_mav_put_uint8_t(buf, 27, color);
_mav_put_uint8_t(buf, 28, coordinate_system);
_mav_put_char_array(buf, 29, name, 26);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
#else
mavlink_point_of_interest_connection_t packet;
packet.xp1 = xp1;
packet.yp1 = yp1;
packet.zp1 = zp1;
packet.xp2 = xp2;
packet.yp2 = yp2;
packet.zp2 = zp2;
packet.timeout = timeout;
packet.type = type;
packet.color = color;
packet.coordinate_system = coordinate_system;
mav_array_memcpy(packet.name, name, sizeof(char)*26);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, (const char *)&packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, (const char *)&packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_point_of_interest_connection_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char *name)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, xp1);
_mav_put_float(buf, 4, yp1);
_mav_put_float(buf, 8, zp1);
_mav_put_float(buf, 12, xp2);
_mav_put_float(buf, 16, yp2);
_mav_put_float(buf, 20, zp2);
_mav_put_uint16_t(buf, 24, timeout);
_mav_put_uint8_t(buf, 26, type);
_mav_put_uint8_t(buf, 27, color);
_mav_put_uint8_t(buf, 28, coordinate_system);
_mav_put_char_array(buf, 29, name, 26);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
#else
mavlink_point_of_interest_connection_t *packet = (mavlink_point_of_interest_connection_t *)msgbuf;
packet->xp1 = xp1;
packet->yp1 = yp1;
packet->zp1 = zp1;
packet->xp2 = xp2;
packet->yp2 = yp2;
packet->zp2 = zp2;
packet->timeout = timeout;
packet->type = type;
packet->color = color;
packet->coordinate_system = coordinate_system;
mav_array_memcpy(packet->name, name, sizeof(char)*26);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, (const char *)packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, (const char *)packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE POINT_OF_INTEREST_CONNECTION UNPACKING
/**
* @brief Get field type from point_of_interest_connection message
*
* @return 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
*/
static inline uint8_t mavlink_msg_point_of_interest_connection_get_type(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 26);
}
/**
* @brief Get field color from point_of_interest_connection message
*
* @return 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
*/
static inline uint8_t mavlink_msg_point_of_interest_connection_get_color(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 27);
}
/**
* @brief Get field coordinate_system from point_of_interest_connection message
*
* @return 0: global, 1:local
*/
static inline uint8_t mavlink_msg_point_of_interest_connection_get_coordinate_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 28);
}
/**
* @brief Get field timeout from point_of_interest_connection message
*
* @return 0: no timeout, >1: timeout in seconds
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_get_timeout(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 24);
}
/**
* @brief Get field xp1 from point_of_interest_connection message
*
* @return X1 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_xp1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field yp1 from point_of_interest_connection message
*
* @return Y1 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_yp1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field zp1 from point_of_interest_connection message
*
* @return Z1 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_zp1(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field xp2 from point_of_interest_connection message
*
* @return X2 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_xp2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field yp2 from point_of_interest_connection message
*
* @return Y2 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_yp2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field zp2 from point_of_interest_connection message
*
* @return Z2 Position
*/
static inline float mavlink_msg_point_of_interest_connection_get_zp2(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field name from point_of_interest_connection message
*
* @return POI connection name
*/
static inline uint16_t mavlink_msg_point_of_interest_connection_get_name(const mavlink_message_t* msg, char *name)
{
return _MAV_RETURN_char_array(msg, name, 26, 29);
}
/**
* @brief Decode a point_of_interest_connection message into a struct
*
* @param msg The message to decode
* @param point_of_interest_connection C-struct to decode the message contents into
*/
static inline void mavlink_msg_point_of_interest_connection_decode(const mavlink_message_t* msg, mavlink_point_of_interest_connection_t* point_of_interest_connection)
{
#if MAVLINK_NEED_BYTE_SWAP
point_of_interest_connection->xp1 = mavlink_msg_point_of_interest_connection_get_xp1(msg);
point_of_interest_connection->yp1 = mavlink_msg_point_of_interest_connection_get_yp1(msg);
point_of_interest_connection->zp1 = mavlink_msg_point_of_interest_connection_get_zp1(msg);
point_of_interest_connection->xp2 = mavlink_msg_point_of_interest_connection_get_xp2(msg);
point_of_interest_connection->yp2 = mavlink_msg_point_of_interest_connection_get_yp2(msg);
point_of_interest_connection->zp2 = mavlink_msg_point_of_interest_connection_get_zp2(msg);
point_of_interest_connection->timeout = mavlink_msg_point_of_interest_connection_get_timeout(msg);
point_of_interest_connection->type = mavlink_msg_point_of_interest_connection_get_type(msg);
point_of_interest_connection->color = mavlink_msg_point_of_interest_connection_get_color(msg);
point_of_interest_connection->coordinate_system = mavlink_msg_point_of_interest_connection_get_coordinate_system(msg);
mavlink_msg_point_of_interest_connection_get_name(msg, point_of_interest_connection->name);
#else
memcpy(point_of_interest_connection, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
#endif
}
// MESSAGE POSITION_CONTROL_SETPOINT PACKING
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT 170
typedef struct __mavlink_position_control_setpoint_t
{
float x; /*< x position*/
float y; /*< y position*/
float z; /*< z position*/
float yaw; /*< yaw orientation in radians, 0 = NORTH*/
uint16_t id; /*< ID of waypoint, 0 for plain position*/
} mavlink_position_control_setpoint_t;
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN 18
#define MAVLINK_MSG_ID_170_LEN 18
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_CRC 28
#define MAVLINK_MSG_ID_170_CRC 28
#define MAVLINK_MESSAGE_INFO_POSITION_CONTROL_SETPOINT { \
"POSITION_CONTROL_SETPOINT", \
5, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_position_control_setpoint_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_control_setpoint_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_control_setpoint_t, z) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_control_setpoint_t, yaw) }, \
{ "id", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_position_control_setpoint_t, id) }, \
} \
}
/**
* @brief Pack a position_control_setpoint message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_control_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t id, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#else
mavlink_position_control_setpoint_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
}
/**
* @brief Pack a position_control_setpoint message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_position_control_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t id,float x,float y,float z,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#else
mavlink_position_control_setpoint_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
}
/**
* @brief Encode a position_control_setpoint 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 position_control_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_position_control_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_control_setpoint_t* position_control_setpoint)
{
return mavlink_msg_position_control_setpoint_pack(system_id, component_id, msg, position_control_setpoint->id, position_control_setpoint->x, position_control_setpoint->y, position_control_setpoint->z, position_control_setpoint->yaw);
}
/**
* @brief Encode a position_control_setpoint 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 position_control_setpoint C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_position_control_setpoint_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_position_control_setpoint_t* position_control_setpoint)
{
return mavlink_msg_position_control_setpoint_pack_chan(system_id, component_id, chan, msg, position_control_setpoint->id, position_control_setpoint->x, position_control_setpoint->y, position_control_setpoint->z, position_control_setpoint->yaw);
}
/**
* @brief Send a position_control_setpoint message
* @param chan MAVLink channel to send the message
*
* @param id ID of waypoint, 0 for plain position
* @param x x position
* @param y y position
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_position_control_setpoint_send(mavlink_channel_t chan, uint16_t id, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, buf, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, buf, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
#else
mavlink_position_control_setpoint_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.id = id;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_position_control_setpoint_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t id, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint16_t(buf, 16, id);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, buf, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, buf, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
#else
mavlink_position_control_setpoint_t *packet = (mavlink_position_control_setpoint_t *)msgbuf;
packet->x = x;
packet->y = y;
packet->z = z;
packet->yaw = yaw;
packet->id = id;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT, (const char *)packet, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE POSITION_CONTROL_SETPOINT UNPACKING
/**
* @brief Get field id from position_control_setpoint message
*
* @return ID of waypoint, 0 for plain position
*/
static inline uint16_t mavlink_msg_position_control_setpoint_get_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 16);
}
/**
* @brief Get field x from position_control_setpoint message
*
* @return x position
*/
static inline float mavlink_msg_position_control_setpoint_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from position_control_setpoint message
*
* @return y position
*/
static inline float mavlink_msg_position_control_setpoint_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from position_control_setpoint message
*
* @return z position
*/
static inline float mavlink_msg_position_control_setpoint_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field yaw from position_control_setpoint message
*
* @return yaw orientation in radians, 0 = NORTH
*/
static inline float mavlink_msg_position_control_setpoint_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Decode a position_control_setpoint message into a struct
*
* @param msg The message to decode
* @param position_control_setpoint C-struct to decode the message contents into
*/
static inline void mavlink_msg_position_control_setpoint_decode(const mavlink_message_t* msg, mavlink_position_control_setpoint_t* position_control_setpoint)
{
#if MAVLINK_NEED_BYTE_SWAP
position_control_setpoint->x = mavlink_msg_position_control_setpoint_get_x(msg);
position_control_setpoint->y = mavlink_msg_position_control_setpoint_get_y(msg);
position_control_setpoint->z = mavlink_msg_position_control_setpoint_get_z(msg);
position_control_setpoint->yaw = mavlink_msg_position_control_setpoint_get_yaw(msg);
position_control_setpoint->id = mavlink_msg_position_control_setpoint_get_id(msg);
#else
memcpy(position_control_setpoint, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
#endif
}
// MESSAGE RAW_AUX PACKING
#define MAVLINK_MSG_ID_RAW_AUX 172
typedef struct __mavlink_raw_aux_t
{
int32_t baro; /*< Barometric pressure (hecto Pascal)*/
uint16_t adc1; /*< ADC1 (J405 ADC3, LPC2148 AD0.6)*/
uint16_t adc2; /*< ADC2 (J405 ADC5, LPC2148 AD0.2)*/
uint16_t adc3; /*< ADC3 (J405 ADC6, LPC2148 AD0.1)*/
uint16_t adc4; /*< ADC4 (J405 ADC7, LPC2148 AD1.3)*/
uint16_t vbat; /*< Battery voltage*/
int16_t temp; /*< Temperature (degrees celcius)*/
} mavlink_raw_aux_t;
#define MAVLINK_MSG_ID_RAW_AUX_LEN 16
#define MAVLINK_MSG_ID_172_LEN 16
#define MAVLINK_MSG_ID_RAW_AUX_CRC 182
#define MAVLINK_MSG_ID_172_CRC 182
#define MAVLINK_MESSAGE_INFO_RAW_AUX { \
"RAW_AUX", \
7, \
{ { "baro", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_raw_aux_t, baro) }, \
{ "adc1", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_raw_aux_t, adc1) }, \
{ "adc2", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_raw_aux_t, adc2) }, \
{ "adc3", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_raw_aux_t, adc3) }, \
{ "adc4", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_raw_aux_t, adc4) }, \
{ "vbat", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_raw_aux_t, vbat) }, \
{ "temp", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_raw_aux_t, temp) }, \
} \
}
/**
* @brief Pack a raw_aux 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 adc1 ADC1 (J405 ADC3, LPC2148 AD0.6)
* @param adc2 ADC2 (J405 ADC5, LPC2148 AD0.2)
* @param adc3 ADC3 (J405 ADC6, LPC2148 AD0.1)
* @param adc4 ADC4 (J405 ADC7, LPC2148 AD1.3)
* @param vbat Battery voltage
* @param temp Temperature (degrees celcius)
* @param baro Barometric pressure (hecto Pascal)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_raw_aux_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t vbat, int16_t temp, int32_t baro)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_RAW_AUX_LEN];
_mav_put_int32_t(buf, 0, baro);
_mav_put_uint16_t(buf, 4, adc1);
_mav_put_uint16_t(buf, 6, adc2);
_mav_put_uint16_t(buf, 8, adc3);
_mav_put_uint16_t(buf, 10, adc4);
_mav_put_uint16_t(buf, 12, vbat);
_mav_put_int16_t(buf, 14, temp);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_AUX_LEN);
#else
mavlink_raw_aux_t packet;
packet.baro = baro;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.vbat = vbat;
packet.temp = temp;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_RAW_AUX;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_AUX_LEN, MAVLINK_MSG_ID_RAW_AUX_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
}
/**
* @brief Pack a raw_aux 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 adc1 ADC1 (J405 ADC3, LPC2148 AD0.6)
* @param adc2 ADC2 (J405 ADC5, LPC2148 AD0.2)
* @param adc3 ADC3 (J405 ADC6, LPC2148 AD0.1)
* @param adc4 ADC4 (J405 ADC7, LPC2148 AD1.3)
* @param vbat Battery voltage
* @param temp Temperature (degrees celcius)
* @param baro Barometric pressure (hecto Pascal)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_raw_aux_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t adc1,uint16_t adc2,uint16_t adc3,uint16_t adc4,uint16_t vbat,int16_t temp,int32_t baro)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_RAW_AUX_LEN];
_mav_put_int32_t(buf, 0, baro);
_mav_put_uint16_t(buf, 4, adc1);
_mav_put_uint16_t(buf, 6, adc2);
_mav_put_uint16_t(buf, 8, adc3);
_mav_put_uint16_t(buf, 10, adc4);
_mav_put_uint16_t(buf, 12, vbat);
_mav_put_int16_t(buf, 14, temp);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RAW_AUX_LEN);
#else
mavlink_raw_aux_t packet;
packet.baro = baro;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.vbat = vbat;
packet.temp = temp;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_RAW_AUX;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_AUX_LEN, MAVLINK_MSG_ID_RAW_AUX_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
}
/**
* @brief Encode a raw_aux 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 raw_aux C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_raw_aux_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_raw_aux_t* raw_aux)
{
return mavlink_msg_raw_aux_pack(system_id, component_id, msg, raw_aux->adc1, raw_aux->adc2, raw_aux->adc3, raw_aux->adc4, raw_aux->vbat, raw_aux->temp, raw_aux->baro);
}
/**
* @brief Encode a raw_aux 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 raw_aux C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_raw_aux_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_raw_aux_t* raw_aux)
{
return mavlink_msg_raw_aux_pack_chan(system_id, component_id, chan, msg, raw_aux->adc1, raw_aux->adc2, raw_aux->adc3, raw_aux->adc4, raw_aux->vbat, raw_aux->temp, raw_aux->baro);
}
/**
* @brief Send a raw_aux message
* @param chan MAVLink channel to send the message
*
* @param adc1 ADC1 (J405 ADC3, LPC2148 AD0.6)
* @param adc2 ADC2 (J405 ADC5, LPC2148 AD0.2)
* @param adc3 ADC3 (J405 ADC6, LPC2148 AD0.1)
* @param adc4 ADC4 (J405 ADC7, LPC2148 AD1.3)
* @param vbat Battery voltage
* @param temp Temperature (degrees celcius)
* @param baro Barometric pressure (hecto Pascal)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_raw_aux_send(mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t vbat, int16_t temp, int32_t baro)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_RAW_AUX_LEN];
_mav_put_int32_t(buf, 0, baro);
_mav_put_uint16_t(buf, 4, adc1);
_mav_put_uint16_t(buf, 6, adc2);
_mav_put_uint16_t(buf, 8, adc3);
_mav_put_uint16_t(buf, 10, adc4);
_mav_put_uint16_t(buf, 12, vbat);
_mav_put_int16_t(buf, 14, temp);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, buf, MAVLINK_MSG_ID_RAW_AUX_LEN, MAVLINK_MSG_ID_RAW_AUX_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, buf, MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
#else
mavlink_raw_aux_t packet;
packet.baro = baro;
packet.adc1 = adc1;
packet.adc2 = adc2;
packet.adc3 = adc3;
packet.adc4 = adc4;
packet.vbat = vbat;
packet.temp = temp;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, (const char *)&packet, MAVLINK_MSG_ID_RAW_AUX_LEN, MAVLINK_MSG_ID_RAW_AUX_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, (const char *)&packet, MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_RAW_AUX_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_raw_aux_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t vbat, int16_t temp, int32_t baro)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_int32_t(buf, 0, baro);
_mav_put_uint16_t(buf, 4, adc1);
_mav_put_uint16_t(buf, 6, adc2);
_mav_put_uint16_t(buf, 8, adc3);
_mav_put_uint16_t(buf, 10, adc4);
_mav_put_uint16_t(buf, 12, vbat);
_mav_put_int16_t(buf, 14, temp);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, buf, MAVLINK_MSG_ID_RAW_AUX_LEN, MAVLINK_MSG_ID_RAW_AUX_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, buf, MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
#else
mavlink_raw_aux_t *packet = (mavlink_raw_aux_t *)msgbuf;
packet->baro = baro;
packet->adc1 = adc1;
packet->adc2 = adc2;
packet->adc3 = adc3;
packet->adc4 = adc4;
packet->vbat = vbat;
packet->temp = temp;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, (const char *)packet, MAVLINK_MSG_ID_RAW_AUX_LEN, MAVLINK_MSG_ID_RAW_AUX_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RAW_AUX, (const char *)packet, MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE RAW_AUX UNPACKING
/**
* @brief Get field adc1 from raw_aux message
*
* @return ADC1 (J405 ADC3, LPC2148 AD0.6)
*/
static inline uint16_t mavlink_msg_raw_aux_get_adc1(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field adc2 from raw_aux message
*
* @return ADC2 (J405 ADC5, LPC2148 AD0.2)
*/
static inline uint16_t mavlink_msg_raw_aux_get_adc2(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field adc3 from raw_aux message
*
* @return ADC3 (J405 ADC6, LPC2148 AD0.1)
*/
static inline uint16_t mavlink_msg_raw_aux_get_adc3(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Get field adc4 from raw_aux message
*
* @return ADC4 (J405 ADC7, LPC2148 AD1.3)
*/
static inline uint16_t mavlink_msg_raw_aux_get_adc4(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 10);
}
/**
* @brief Get field vbat from raw_aux message
*
* @return Battery voltage
*/
static inline uint16_t mavlink_msg_raw_aux_get_vbat(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 12);
}
/**
* @brief Get field temp from raw_aux message
*
* @return Temperature (degrees celcius)
*/
static inline int16_t mavlink_msg_raw_aux_get_temp(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 14);
}
/**
* @brief Get field baro from raw_aux message
*
* @return Barometric pressure (hecto Pascal)
*/
static inline int32_t mavlink_msg_raw_aux_get_baro(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 0);
}
/**
* @brief Decode a raw_aux message into a struct
*
* @param msg The message to decode
* @param raw_aux C-struct to decode the message contents into
*/
static inline void mavlink_msg_raw_aux_decode(const mavlink_message_t* msg, mavlink_raw_aux_t* raw_aux)
{
#if MAVLINK_NEED_BYTE_SWAP
raw_aux->baro = mavlink_msg_raw_aux_get_baro(msg);
raw_aux->adc1 = mavlink_msg_raw_aux_get_adc1(msg);
raw_aux->adc2 = mavlink_msg_raw_aux_get_adc2(msg);
raw_aux->adc3 = mavlink_msg_raw_aux_get_adc3(msg);
raw_aux->adc4 = mavlink_msg_raw_aux_get_adc4(msg);
raw_aux->vbat = mavlink_msg_raw_aux_get_vbat(msg);
raw_aux->temp = mavlink_msg_raw_aux_get_temp(msg);
#else
memcpy(raw_aux, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RAW_AUX_LEN);
#endif
}
// MESSAGE SET_CAM_SHUTTER PACKING
#define MAVLINK_MSG_ID_SET_CAM_SHUTTER 151
typedef struct __mavlink_set_cam_shutter_t
{
float gain; /*< Camera gain*/
uint16_t interval; /*< Shutter interval, in microseconds*/
uint16_t exposure; /*< Exposure time, in microseconds*/
uint8_t cam_no; /*< Camera id*/
uint8_t cam_mode; /*< Camera mode: 0 = auto, 1 = manual*/
uint8_t trigger_pin; /*< Trigger pin, 0-3 for PtGrey FireFly*/
} mavlink_set_cam_shutter_t;
#define MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN 11
#define MAVLINK_MSG_ID_151_LEN 11
#define MAVLINK_MSG_ID_SET_CAM_SHUTTER_CRC 108
#define MAVLINK_MSG_ID_151_CRC 108
#define MAVLINK_MESSAGE_INFO_SET_CAM_SHUTTER { \
"SET_CAM_SHUTTER", \
6, \
{ { "gain", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_set_cam_shutter_t, gain) }, \
{ "interval", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_set_cam_shutter_t, interval) }, \
{ "exposure", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_set_cam_shutter_t, exposure) }, \
{ "cam_no", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_set_cam_shutter_t, cam_no) }, \
{ "cam_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_set_cam_shutter_t, cam_mode) }, \
{ "trigger_pin", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_set_cam_shutter_t, trigger_pin) }, \
} \
}
/**
* @brief Pack a set_cam_shutter 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 cam_no Camera id
* @param cam_mode Camera mode: 0 = auto, 1 = manual
* @param trigger_pin Trigger pin, 0-3 for PtGrey FireFly
* @param interval Shutter interval, in microseconds
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_cam_shutter_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t cam_no, uint8_t cam_mode, uint8_t trigger_pin, uint16_t interval, uint16_t exposure, float gain)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN];
_mav_put_float(buf, 0, gain);
_mav_put_uint16_t(buf, 4, interval);
_mav_put_uint16_t(buf, 6, exposure);
_mav_put_uint8_t(buf, 8, cam_no);
_mav_put_uint8_t(buf, 9, cam_mode);
_mav_put_uint8_t(buf, 10, trigger_pin);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#else
mavlink_set_cam_shutter_t packet;
packet.gain = gain;
packet.interval = interval;
packet.exposure = exposure;
packet.cam_no = cam_no;
packet.cam_mode = cam_mode;
packet.trigger_pin = trigger_pin;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_CAM_SHUTTER;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN, MAVLINK_MSG_ID_SET_CAM_SHUTTER_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
}
/**
* @brief Pack a set_cam_shutter 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 cam_no Camera id
* @param cam_mode Camera mode: 0 = auto, 1 = manual
* @param trigger_pin Trigger pin, 0-3 for PtGrey FireFly
* @param interval Shutter interval, in microseconds
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_cam_shutter_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t cam_no,uint8_t cam_mode,uint8_t trigger_pin,uint16_t interval,uint16_t exposure,float gain)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN];
_mav_put_float(buf, 0, gain);
_mav_put_uint16_t(buf, 4, interval);
_mav_put_uint16_t(buf, 6, exposure);
_mav_put_uint8_t(buf, 8, cam_no);
_mav_put_uint8_t(buf, 9, cam_mode);
_mav_put_uint8_t(buf, 10, trigger_pin);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#else
mavlink_set_cam_shutter_t packet;
packet.gain = gain;
packet.interval = interval;
packet.exposure = exposure;
packet.cam_no = cam_no;
packet.cam_mode = cam_mode;
packet.trigger_pin = trigger_pin;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_CAM_SHUTTER;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN, MAVLINK_MSG_ID_SET_CAM_SHUTTER_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
}
/**
* @brief Encode a set_cam_shutter 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 set_cam_shutter C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_cam_shutter_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_cam_shutter_t* set_cam_shutter)
{
return mavlink_msg_set_cam_shutter_pack(system_id, component_id, msg, set_cam_shutter->cam_no, set_cam_shutter->cam_mode, set_cam_shutter->trigger_pin, set_cam_shutter->interval, set_cam_shutter->exposure, set_cam_shutter->gain);
}
/**
* @brief Encode a set_cam_shutter 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 set_cam_shutter C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_cam_shutter_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_cam_shutter_t* set_cam_shutter)
{
return mavlink_msg_set_cam_shutter_pack_chan(system_id, component_id, chan, msg, set_cam_shutter->cam_no, set_cam_shutter->cam_mode, set_cam_shutter->trigger_pin, set_cam_shutter->interval, set_cam_shutter->exposure, set_cam_shutter->gain);
}
/**
* @brief Send a set_cam_shutter message
* @param chan MAVLink channel to send the message
*
* @param cam_no Camera id
* @param cam_mode Camera mode: 0 = auto, 1 = manual
* @param trigger_pin Trigger pin, 0-3 for PtGrey FireFly
* @param interval Shutter interval, in microseconds
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_cam_shutter_send(mavlink_channel_t chan, uint8_t cam_no, uint8_t cam_mode, uint8_t trigger_pin, uint16_t interval, uint16_t exposure, float gain)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN];
_mav_put_float(buf, 0, gain);
_mav_put_uint16_t(buf, 4, interval);
_mav_put_uint16_t(buf, 6, exposure);
_mav_put_uint8_t(buf, 8, cam_no);
_mav_put_uint8_t(buf, 9, cam_mode);
_mav_put_uint8_t(buf, 10, trigger_pin);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, buf, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN, MAVLINK_MSG_ID_SET_CAM_SHUTTER_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, buf, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
#else
mavlink_set_cam_shutter_t packet;
packet.gain = gain;
packet.interval = interval;
packet.exposure = exposure;
packet.cam_no = cam_no;
packet.cam_mode = cam_mode;
packet.trigger_pin = trigger_pin;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, (const char *)&packet, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN, MAVLINK_MSG_ID_SET_CAM_SHUTTER_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, (const char *)&packet, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_set_cam_shutter_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t cam_no, uint8_t cam_mode, uint8_t trigger_pin, uint16_t interval, uint16_t exposure, float gain)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, gain);
_mav_put_uint16_t(buf, 4, interval);
_mav_put_uint16_t(buf, 6, exposure);
_mav_put_uint8_t(buf, 8, cam_no);
_mav_put_uint8_t(buf, 9, cam_mode);
_mav_put_uint8_t(buf, 10, trigger_pin);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, buf, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN, MAVLINK_MSG_ID_SET_CAM_SHUTTER_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, buf, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
#else
mavlink_set_cam_shutter_t *packet = (mavlink_set_cam_shutter_t *)msgbuf;
packet->gain = gain;
packet->interval = interval;
packet->exposure = exposure;
packet->cam_no = cam_no;
packet->cam_mode = cam_mode;
packet->trigger_pin = trigger_pin;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, (const char *)packet, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN, MAVLINK_MSG_ID_SET_CAM_SHUTTER_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER, (const char *)packet, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE SET_CAM_SHUTTER UNPACKING
/**
* @brief Get field cam_no from set_cam_shutter message
*
* @return Camera id
*/
static inline uint8_t mavlink_msg_set_cam_shutter_get_cam_no(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
* @brief Get field cam_mode from set_cam_shutter message
*
* @return Camera mode: 0 = auto, 1 = manual
*/
static inline uint8_t mavlink_msg_set_cam_shutter_get_cam_mode(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 9);
}
/**
* @brief Get field trigger_pin from set_cam_shutter message
*
* @return Trigger pin, 0-3 for PtGrey FireFly
*/
static inline uint8_t mavlink_msg_set_cam_shutter_get_trigger_pin(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 10);
}
/**
* @brief Get field interval from set_cam_shutter message
*
* @return Shutter interval, in microseconds
*/
static inline uint16_t mavlink_msg_set_cam_shutter_get_interval(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field exposure from set_cam_shutter message
*
* @return Exposure time, in microseconds
*/
static inline uint16_t mavlink_msg_set_cam_shutter_get_exposure(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field gain from set_cam_shutter message
*
* @return Camera gain
*/
static inline float mavlink_msg_set_cam_shutter_get_gain(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Decode a set_cam_shutter message into a struct
*
* @param msg The message to decode
* @param set_cam_shutter C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_cam_shutter_decode(const mavlink_message_t* msg, mavlink_set_cam_shutter_t* set_cam_shutter)
{
#if MAVLINK_NEED_BYTE_SWAP
set_cam_shutter->gain = mavlink_msg_set_cam_shutter_get_gain(msg);
set_cam_shutter->interval = mavlink_msg_set_cam_shutter_get_interval(msg);
set_cam_shutter->exposure = mavlink_msg_set_cam_shutter_get_exposure(msg);
set_cam_shutter->cam_no = mavlink_msg_set_cam_shutter_get_cam_no(msg);
set_cam_shutter->cam_mode = mavlink_msg_set_cam_shutter_get_cam_mode(msg);
set_cam_shutter->trigger_pin = mavlink_msg_set_cam_shutter_get_trigger_pin(msg);
#else
memcpy(set_cam_shutter, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
#endif
}
// MESSAGE SET_POSITION_CONTROL_OFFSET PACKING
#define MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET 160
typedef struct __mavlink_set_position_control_offset_t
{
float x; /*< x position offset*/
float y; /*< y position offset*/
float z; /*< z position offset*/
float yaw; /*< yaw orientation offset in radians, 0 = NORTH*/
uint8_t target_system; /*< System ID*/
uint8_t target_component; /*< Component ID*/
} mavlink_set_position_control_offset_t;
#define MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN 18
#define MAVLINK_MSG_ID_160_LEN 18
#define MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_CRC 22
#define MAVLINK_MSG_ID_160_CRC 22
#define MAVLINK_MESSAGE_INFO_SET_POSITION_CONTROL_OFFSET { \
"SET_POSITION_CONTROL_OFFSET", \
6, \
{ { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_set_position_control_offset_t, x) }, \
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_control_offset_t, y) }, \
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_control_offset_t, z) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_control_offset_t, yaw) }, \
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_set_position_control_offset_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_set_position_control_offset_t, target_component) }, \
} \
}
/**
* @brief Pack a set_position_control_offset message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target_system System ID
* @param target_component Component ID
* @param x x position offset
* @param y y position offset
* @param z z position offset
* @param yaw yaw orientation offset in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_position_control_offset_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#else
mavlink_set_position_control_offset_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
}
/**
* @brief Pack a set_position_control_offset message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param x x position offset
* @param y y position offset
* @param z z position offset
* @param yaw yaw orientation offset in radians, 0 = NORTH
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_position_control_offset_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,float x,float y,float z,float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#else
mavlink_set_position_control_offset_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
}
/**
* @brief Encode a set_position_control_offset 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 set_position_control_offset C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_position_control_offset_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_position_control_offset_t* set_position_control_offset)
{
return mavlink_msg_set_position_control_offset_pack(system_id, component_id, msg, set_position_control_offset->target_system, set_position_control_offset->target_component, set_position_control_offset->x, set_position_control_offset->y, set_position_control_offset->z, set_position_control_offset->yaw);
}
/**
* @brief Encode a set_position_control_offset 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 set_position_control_offset C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_position_control_offset_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_position_control_offset_t* set_position_control_offset)
{
return mavlink_msg_set_position_control_offset_pack_chan(system_id, component_id, chan, msg, set_position_control_offset->target_system, set_position_control_offset->target_component, set_position_control_offset->x, set_position_control_offset->y, set_position_control_offset->z, set_position_control_offset->yaw);
}
/**
* @brief Send a set_position_control_offset message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param x x position offset
* @param y y position offset
* @param z z position offset
* @param yaw yaw orientation offset in radians, 0 = NORTH
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_position_control_offset_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN];
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET, buf, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET, buf, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
#else
mavlink_set_position_control_offset_t packet;
packet.x = x;
packet.y = y;
packet.z = z;
packet.yaw = yaw;
packet.target_system = target_system;
packet.target_component = target_component;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_set_position_control_offset_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, x);
_mav_put_float(buf, 4, y);
_mav_put_float(buf, 8, z);
_mav_put_float(buf, 12, yaw);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET, buf, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET, buf, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
#else
mavlink_set_position_control_offset_t *packet = (mavlink_set_position_control_offset_t *)msgbuf;
packet->x = x;
packet->y = y;
packet->z = z;
packet->yaw = yaw;
packet->target_system = target_system;
packet->target_component = target_component;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE SET_POSITION_CONTROL_OFFSET UNPACKING
/**
* @brief Get field target_system from set_position_control_offset message
*
* @return System ID
*/
static inline uint8_t mavlink_msg_set_position_control_offset_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
* @brief Get field target_component from set_position_control_offset message
*
* @return Component ID
*/
static inline uint8_t mavlink_msg_set_position_control_offset_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 17);
}
/**
* @brief Get field x from set_position_control_offset message
*
* @return x position offset
*/
static inline float mavlink_msg_set_position_control_offset_get_x(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field y from set_position_control_offset message
*
* @return y position offset
*/
static inline float mavlink_msg_set_position_control_offset_get_y(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field z from set_position_control_offset message
*
* @return z position offset
*/
static inline float mavlink_msg_set_position_control_offset_get_z(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field yaw from set_position_control_offset message
*
* @return yaw orientation offset in radians, 0 = NORTH
*/
static inline float mavlink_msg_set_position_control_offset_get_yaw(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Decode a set_position_control_offset message into a struct
*
* @param msg The message to decode
* @param set_position_control_offset C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_position_control_offset_decode(const mavlink_message_t* msg, mavlink_set_position_control_offset_t* set_position_control_offset)
{
#if MAVLINK_NEED_BYTE_SWAP
set_position_control_offset->x = mavlink_msg_set_position_control_offset_get_x(msg);
set_position_control_offset->y = mavlink_msg_set_position_control_offset_get_y(msg);
set_position_control_offset->z = mavlink_msg_set_position_control_offset_get_z(msg);
set_position_control_offset->yaw = mavlink_msg_set_position_control_offset_get_yaw(msg);
set_position_control_offset->target_system = mavlink_msg_set_position_control_offset_get_target_system(msg);
set_position_control_offset->target_component = mavlink_msg_set_position_control_offset_get_target_component(msg);
#else
memcpy(set_position_control_offset, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_POSITION_CONTROL_OFFSET_LEN);
#endif
}
// MESSAGE WATCHDOG_COMMAND PACKING
#define MAVLINK_MSG_ID_WATCHDOG_COMMAND 183
typedef struct __mavlink_watchdog_command_t
{
uint16_t watchdog_id; /*< Watchdog ID*/
uint16_t process_id; /*< Process ID*/
uint8_t target_system_id; /*< Target system ID*/
uint8_t command_id; /*< Command ID*/
} mavlink_watchdog_command_t;
#define MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN 6
#define MAVLINK_MSG_ID_183_LEN 6
#define MAVLINK_MSG_ID_WATCHDOG_COMMAND_CRC 162
#define MAVLINK_MSG_ID_183_CRC 162
#define MAVLINK_MESSAGE_INFO_WATCHDOG_COMMAND { \
"WATCHDOG_COMMAND", \
4, \
{ { "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_watchdog_command_t, watchdog_id) }, \
{ "process_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_watchdog_command_t, process_id) }, \
{ "target_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_watchdog_command_t, target_system_id) }, \
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_watchdog_command_t, command_id) }, \
} \
}
/**
* @brief Pack a watchdog_command message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param target_system_id Target system ID
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param command_id Command ID
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_command_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system_id, uint16_t watchdog_id, uint16_t process_id, uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_id);
_mav_put_uint8_t(buf, 4, target_system_id);
_mav_put_uint8_t(buf, 5, command_id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#else
mavlink_watchdog_command_t packet;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.target_system_id = target_system_id;
packet.command_id = command_id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_COMMAND;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN, MAVLINK_MSG_ID_WATCHDOG_COMMAND_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
}
/**
* @brief Pack a watchdog_command 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 target_system_id Target system ID
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param command_id Command ID
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_command_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system_id,uint16_t watchdog_id,uint16_t process_id,uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_id);
_mav_put_uint8_t(buf, 4, target_system_id);
_mav_put_uint8_t(buf, 5, command_id);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#else
mavlink_watchdog_command_t packet;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.target_system_id = target_system_id;
packet.command_id = command_id;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_COMMAND;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN, MAVLINK_MSG_ID_WATCHDOG_COMMAND_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
}
/**
* @brief Encode a watchdog_command 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 watchdog_command C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_command_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_command_t* watchdog_command)
{
return mavlink_msg_watchdog_command_pack(system_id, component_id, msg, watchdog_command->target_system_id, watchdog_command->watchdog_id, watchdog_command->process_id, watchdog_command->command_id);
}
/**
* @brief Encode a watchdog_command 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 watchdog_command C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_command_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_watchdog_command_t* watchdog_command)
{
return mavlink_msg_watchdog_command_pack_chan(system_id, component_id, chan, msg, watchdog_command->target_system_id, watchdog_command->watchdog_id, watchdog_command->process_id, watchdog_command->command_id);
}
/**
* @brief Send a watchdog_command message
* @param chan MAVLink channel to send the message
*
* @param target_system_id Target system ID
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param command_id Command ID
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_command_send(mavlink_channel_t chan, uint8_t target_system_id, uint16_t watchdog_id, uint16_t process_id, uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_id);
_mav_put_uint8_t(buf, 4, target_system_id);
_mav_put_uint8_t(buf, 5, command_id);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, buf, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN, MAVLINK_MSG_ID_WATCHDOG_COMMAND_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, buf, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
#else
mavlink_watchdog_command_t packet;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.target_system_id = target_system_id;
packet.command_id = command_id;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN, MAVLINK_MSG_ID_WATCHDOG_COMMAND_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_watchdog_command_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system_id, uint16_t watchdog_id, uint16_t process_id, uint8_t command_id)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_id);
_mav_put_uint8_t(buf, 4, target_system_id);
_mav_put_uint8_t(buf, 5, command_id);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, buf, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN, MAVLINK_MSG_ID_WATCHDOG_COMMAND_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, buf, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
#else
mavlink_watchdog_command_t *packet = (mavlink_watchdog_command_t *)msgbuf;
packet->watchdog_id = watchdog_id;
packet->process_id = process_id;
packet->target_system_id = target_system_id;
packet->command_id = command_id;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN, MAVLINK_MSG_ID_WATCHDOG_COMMAND_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE WATCHDOG_COMMAND UNPACKING
/**
* @brief Get field target_system_id from watchdog_command message
*
* @return Target system ID
*/
static inline uint8_t mavlink_msg_watchdog_command_get_target_system_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 4);
}
/**
* @brief Get field watchdog_id from watchdog_command message
*
* @return Watchdog ID
*/
static inline uint16_t mavlink_msg_watchdog_command_get_watchdog_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field process_id from watchdog_command message
*
* @return Process ID
*/
static inline uint16_t mavlink_msg_watchdog_command_get_process_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Get field command_id from watchdog_command message
*
* @return Command ID
*/
static inline uint8_t mavlink_msg_watchdog_command_get_command_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 5);
}
/**
* @brief Decode a watchdog_command message into a struct
*
* @param msg The message to decode
* @param watchdog_command C-struct to decode the message contents into
*/
static inline void mavlink_msg_watchdog_command_decode(const mavlink_message_t* msg, mavlink_watchdog_command_t* watchdog_command)
{
#if MAVLINK_NEED_BYTE_SWAP
watchdog_command->watchdog_id = mavlink_msg_watchdog_command_get_watchdog_id(msg);
watchdog_command->process_id = mavlink_msg_watchdog_command_get_process_id(msg);
watchdog_command->target_system_id = mavlink_msg_watchdog_command_get_target_system_id(msg);
watchdog_command->command_id = mavlink_msg_watchdog_command_get_command_id(msg);
#else
memcpy(watchdog_command, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
#endif
}
// MESSAGE WATCHDOG_HEARTBEAT PACKING
#define MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT 180
typedef struct __mavlink_watchdog_heartbeat_t
{
uint16_t watchdog_id; /*< Watchdog ID*/
uint16_t process_count; /*< Number of processes*/
} mavlink_watchdog_heartbeat_t;
#define MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN 4
#define MAVLINK_MSG_ID_180_LEN 4
#define MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_CRC 153
#define MAVLINK_MSG_ID_180_CRC 153
#define MAVLINK_MESSAGE_INFO_WATCHDOG_HEARTBEAT { \
"WATCHDOG_HEARTBEAT", \
2, \
{ { "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_watchdog_heartbeat_t, watchdog_id) }, \
{ "process_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_watchdog_heartbeat_t, process_count) }, \
} \
}
/**
* @brief Pack a watchdog_heartbeat 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 watchdog_id Watchdog ID
* @param process_count Number of processes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t watchdog_id, uint16_t process_count)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_count);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#else
mavlink_watchdog_heartbeat_t packet;
packet.watchdog_id = watchdog_id;
packet.process_count = process_count;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
}
/**
* @brief Pack a watchdog_heartbeat 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 watchdog_id Watchdog ID
* @param process_count Number of processes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t watchdog_id,uint16_t process_count)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_count);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#else
mavlink_watchdog_heartbeat_t packet;
packet.watchdog_id = watchdog_id;
packet.process_count = process_count;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
}
/**
* @brief Encode a watchdog_heartbeat 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 watchdog_heartbeat C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_heartbeat_t* watchdog_heartbeat)
{
return mavlink_msg_watchdog_heartbeat_pack(system_id, component_id, msg, watchdog_heartbeat->watchdog_id, watchdog_heartbeat->process_count);
}
/**
* @brief Encode a watchdog_heartbeat 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 watchdog_heartbeat C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_watchdog_heartbeat_t* watchdog_heartbeat)
{
return mavlink_msg_watchdog_heartbeat_pack_chan(system_id, component_id, chan, msg, watchdog_heartbeat->watchdog_id, watchdog_heartbeat->process_count);
}
/**
* @brief Send a watchdog_heartbeat message
* @param chan MAVLink channel to send the message
*
* @param watchdog_id Watchdog ID
* @param process_count Number of processes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_heartbeat_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_count)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN];
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_count);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, buf, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, buf, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
#else
mavlink_watchdog_heartbeat_t packet;
packet.watchdog_id = watchdog_id;
packet.process_count = process_count;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_watchdog_heartbeat_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_count)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint16_t(buf, 0, watchdog_id);
_mav_put_uint16_t(buf, 2, process_count);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, buf, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, buf, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
#else
mavlink_watchdog_heartbeat_t *packet = (mavlink_watchdog_heartbeat_t *)msgbuf;
packet->watchdog_id = watchdog_id;
packet->process_count = process_count;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE WATCHDOG_HEARTBEAT UNPACKING
/**
* @brief Get field watchdog_id from watchdog_heartbeat message
*
* @return Watchdog ID
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_get_watchdog_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
* @brief Get field process_count from watchdog_heartbeat message
*
* @return Number of processes
*/
static inline uint16_t mavlink_msg_watchdog_heartbeat_get_process_count(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 2);
}
/**
* @brief Decode a watchdog_heartbeat message into a struct
*
* @param msg The message to decode
* @param watchdog_heartbeat C-struct to decode the message contents into
*/
static inline void mavlink_msg_watchdog_heartbeat_decode(const mavlink_message_t* msg, mavlink_watchdog_heartbeat_t* watchdog_heartbeat)
{
#if MAVLINK_NEED_BYTE_SWAP
watchdog_heartbeat->watchdog_id = mavlink_msg_watchdog_heartbeat_get_watchdog_id(msg);
watchdog_heartbeat->process_count = mavlink_msg_watchdog_heartbeat_get_process_count(msg);
#else
memcpy(watchdog_heartbeat, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
#endif
}
// MESSAGE WATCHDOG_PROCESS_INFO PACKING
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO 181
typedef struct __mavlink_watchdog_process_info_t
{
int32_t timeout; /*< Timeout (seconds)*/
uint16_t watchdog_id; /*< Watchdog ID*/
uint16_t process_id; /*< Process ID*/
char name[100]; /*< Process name*/
char arguments[147]; /*< Process arguments*/
} mavlink_watchdog_process_info_t;
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN 255
#define MAVLINK_MSG_ID_181_LEN 255
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_CRC 16
#define MAVLINK_MSG_ID_181_CRC 16
#define MAVLINK_MSG_WATCHDOG_PROCESS_INFO_FIELD_NAME_LEN 100
#define MAVLINK_MSG_WATCHDOG_PROCESS_INFO_FIELD_ARGUMENTS_LEN 147
#define MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_INFO { \
"WATCHDOG_PROCESS_INFO", \
5, \
{ { "timeout", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_watchdog_process_info_t, timeout) }, \
{ "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_watchdog_process_info_t, watchdog_id) }, \
{ "process_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_watchdog_process_info_t, process_id) }, \
{ "name", NULL, MAVLINK_TYPE_CHAR, 100, 8, offsetof(mavlink_watchdog_process_info_t, name) }, \
{ "arguments", NULL, MAVLINK_TYPE_CHAR, 147, 108, offsetof(mavlink_watchdog_process_info_t, arguments) }, \
} \
}
/**
* @brief Pack a watchdog_process_info 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 watchdog_id Watchdog ID
* @param process_id Process ID
* @param name Process name
* @param arguments Process arguments
* @param timeout Timeout (seconds)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_process_info_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t watchdog_id, uint16_t process_id, const char *name, const char *arguments, int32_t timeout)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN];
_mav_put_int32_t(buf, 0, timeout);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_char_array(buf, 8, name, 100);
_mav_put_char_array(buf, 108, arguments, 147);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#else
mavlink_watchdog_process_info_t packet;
packet.timeout = timeout;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
mav_array_memcpy(packet.name, name, sizeof(char)*100);
mav_array_memcpy(packet.arguments, arguments, sizeof(char)*147);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
}
/**
* @brief Pack a watchdog_process_info 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 watchdog_id Watchdog ID
* @param process_id Process ID
* @param name Process name
* @param arguments Process arguments
* @param timeout Timeout (seconds)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_process_info_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t watchdog_id,uint16_t process_id,const char *name,const char *arguments,int32_t timeout)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN];
_mav_put_int32_t(buf, 0, timeout);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_char_array(buf, 8, name, 100);
_mav_put_char_array(buf, 108, arguments, 147);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#else
mavlink_watchdog_process_info_t packet;
packet.timeout = timeout;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
mav_array_memcpy(packet.name, name, sizeof(char)*100);
mav_array_memcpy(packet.arguments, arguments, sizeof(char)*147);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
}
/**
* @brief Encode a watchdog_process_info 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 watchdog_process_info C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_process_info_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_process_info_t* watchdog_process_info)
{
return mavlink_msg_watchdog_process_info_pack(system_id, component_id, msg, watchdog_process_info->watchdog_id, watchdog_process_info->process_id, watchdog_process_info->name, watchdog_process_info->arguments, watchdog_process_info->timeout);
}
/**
* @brief Encode a watchdog_process_info 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 watchdog_process_info C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_process_info_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_watchdog_process_info_t* watchdog_process_info)
{
return mavlink_msg_watchdog_process_info_pack_chan(system_id, component_id, chan, msg, watchdog_process_info->watchdog_id, watchdog_process_info->process_id, watchdog_process_info->name, watchdog_process_info->arguments, watchdog_process_info->timeout);
}
/**
* @brief Send a watchdog_process_info message
* @param chan MAVLink channel to send the message
*
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param name Process name
* @param arguments Process arguments
* @param timeout Timeout (seconds)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_process_info_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, const char *name, const char *arguments, int32_t timeout)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN];
_mav_put_int32_t(buf, 0, timeout);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_char_array(buf, 8, name, 100);
_mav_put_char_array(buf, 108, arguments, 147);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
#else
mavlink_watchdog_process_info_t packet;
packet.timeout = timeout;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
mav_array_memcpy(packet.name, name, sizeof(char)*100);
mav_array_memcpy(packet.arguments, arguments, sizeof(char)*147);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_watchdog_process_info_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, const char *name, const char *arguments, int32_t timeout)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_int32_t(buf, 0, timeout);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_char_array(buf, 8, name, 100);
_mav_put_char_array(buf, 108, arguments, 147);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
#else
mavlink_watchdog_process_info_t *packet = (mavlink_watchdog_process_info_t *)msgbuf;
packet->timeout = timeout;
packet->watchdog_id = watchdog_id;
packet->process_id = process_id;
mav_array_memcpy(packet->name, name, sizeof(char)*100);
mav_array_memcpy(packet->arguments, arguments, sizeof(char)*147);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE WATCHDOG_PROCESS_INFO UNPACKING
/**
* @brief Get field watchdog_id from watchdog_process_info message
*
* @return Watchdog ID
*/
static inline uint16_t mavlink_msg_watchdog_process_info_get_watchdog_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field process_id from watchdog_process_info message
*
* @return Process ID
*/
static inline uint16_t mavlink_msg_watchdog_process_info_get_process_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field name from watchdog_process_info message
*
* @return Process name
*/
static inline uint16_t mavlink_msg_watchdog_process_info_get_name(const mavlink_message_t* msg, char *name)
{
return _MAV_RETURN_char_array(msg, name, 100, 8);
}
/**
* @brief Get field arguments from watchdog_process_info message
*
* @return Process arguments
*/
static inline uint16_t mavlink_msg_watchdog_process_info_get_arguments(const mavlink_message_t* msg, char *arguments)
{
return _MAV_RETURN_char_array(msg, arguments, 147, 108);
}
/**
* @brief Get field timeout from watchdog_process_info message
*
* @return Timeout (seconds)
*/
static inline int32_t mavlink_msg_watchdog_process_info_get_timeout(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 0);
}
/**
* @brief Decode a watchdog_process_info message into a struct
*
* @param msg The message to decode
* @param watchdog_process_info C-struct to decode the message contents into
*/
static inline void mavlink_msg_watchdog_process_info_decode(const mavlink_message_t* msg, mavlink_watchdog_process_info_t* watchdog_process_info)
{
#if MAVLINK_NEED_BYTE_SWAP
watchdog_process_info->timeout = mavlink_msg_watchdog_process_info_get_timeout(msg);
watchdog_process_info->watchdog_id = mavlink_msg_watchdog_process_info_get_watchdog_id(msg);
watchdog_process_info->process_id = mavlink_msg_watchdog_process_info_get_process_id(msg);
mavlink_msg_watchdog_process_info_get_name(msg, watchdog_process_info->name);
mavlink_msg_watchdog_process_info_get_arguments(msg, watchdog_process_info->arguments);
#else
memcpy(watchdog_process_info, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
#endif
}
// MESSAGE WATCHDOG_PROCESS_STATUS PACKING
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS 182
typedef struct __mavlink_watchdog_process_status_t
{
int32_t pid; /*< PID*/
uint16_t watchdog_id; /*< Watchdog ID*/
uint16_t process_id; /*< Process ID*/
uint16_t crashes; /*< Number of crashes*/
uint8_t state; /*< Is running / finished / suspended / crashed*/
uint8_t muted; /*< Is muted*/
} mavlink_watchdog_process_status_t;
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN 12
#define MAVLINK_MSG_ID_182_LEN 12
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_CRC 29
#define MAVLINK_MSG_ID_182_CRC 29
#define MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_STATUS { \
"WATCHDOG_PROCESS_STATUS", \
6, \
{ { "pid", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_watchdog_process_status_t, pid) }, \
{ "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_watchdog_process_status_t, watchdog_id) }, \
{ "process_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_watchdog_process_status_t, process_id) }, \
{ "crashes", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_watchdog_process_status_t, crashes) }, \
{ "state", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_watchdog_process_status_t, state) }, \
{ "muted", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_watchdog_process_status_t, muted) }, \
} \
}
/**
* @brief Pack a watchdog_process_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 watchdog_id Watchdog ID
* @param process_id Process ID
* @param state Is running / finished / suspended / crashed
* @param muted Is muted
* @param pid PID
* @param crashes Number of crashes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_process_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN];
_mav_put_int32_t(buf, 0, pid);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_uint16_t(buf, 8, crashes);
_mav_put_uint8_t(buf, 10, state);
_mav_put_uint8_t(buf, 11, muted);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#else
mavlink_watchdog_process_status_t packet;
packet.pid = pid;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.crashes = crashes;
packet.state = state;
packet.muted = muted;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_CRC);
#else
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
}
/**
* @brief Pack a watchdog_process_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 will be sent over
* @param msg The MAVLink message to compress the data into
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param state Is running / finished / suspended / crashed
* @param muted Is muted
* @param pid PID
* @param crashes Number of crashes
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_watchdog_process_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t watchdog_id,uint16_t process_id,uint8_t state,uint8_t muted,int32_t pid,uint16_t crashes)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN];
_mav_put_int32_t(buf, 0, pid);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_uint16_t(buf, 8, crashes);
_mav_put_uint8_t(buf, 10, state);
_mav_put_uint8_t(buf, 11, muted);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#else
mavlink_watchdog_process_status_t packet;
packet.pid = pid;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.crashes = crashes;
packet.state = state;
packet.muted = muted;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS;
#if MAVLINK_CRC_EXTRA
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_CRC);
#else
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
}
/**
* @brief Encode a watchdog_process_status 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 watchdog_process_status C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_process_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_process_status_t* watchdog_process_status)
{
return mavlink_msg_watchdog_process_status_pack(system_id, component_id, msg, watchdog_process_status->watchdog_id, watchdog_process_status->process_id, watchdog_process_status->state, watchdog_process_status->muted, watchdog_process_status->pid, watchdog_process_status->crashes);
}
/**
* @brief Encode a watchdog_process_status 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 watchdog_process_status C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_watchdog_process_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_watchdog_process_status_t* watchdog_process_status)
{
return mavlink_msg_watchdog_process_status_pack_chan(system_id, component_id, chan, msg, watchdog_process_status->watchdog_id, watchdog_process_status->process_id, watchdog_process_status->state, watchdog_process_status->muted, watchdog_process_status->pid, watchdog_process_status->crashes);
}
/**
* @brief Send a watchdog_process_status message
* @param chan MAVLink channel to send the message
*
* @param watchdog_id Watchdog ID
* @param process_id Process ID
* @param state Is running / finished / suspended / crashed
* @param muted Is muted
* @param pid PID
* @param crashes Number of crashes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_process_status_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN];
_mav_put_int32_t(buf, 0, pid);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_uint16_t(buf, 8, crashes);
_mav_put_uint8_t(buf, 10, state);
_mav_put_uint8_t(buf, 11, muted);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
#else
mavlink_watchdog_process_status_t packet;
packet.pid = pid;
packet.watchdog_id = watchdog_id;
packet.process_id = process_id;
packet.crashes = crashes;
packet.state = state;
packet.muted = muted;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
#endif
}
#if MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient 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_watchdog_process_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_int32_t(buf, 0, pid);
_mav_put_uint16_t(buf, 4, watchdog_id);
_mav_put_uint16_t(buf, 6, process_id);
_mav_put_uint16_t(buf, 8, crashes);
_mav_put_uint8_t(buf, 10, state);
_mav_put_uint8_t(buf, 11, muted);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
#else
mavlink_watchdog_process_status_t *packet = (mavlink_watchdog_process_status_t *)msgbuf;
packet->pid = pid;
packet->watchdog_id = watchdog_id;
packet->process_id = process_id;
packet->crashes = crashes;
packet->state = state;
packet->muted = muted;
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_CRC);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
#endif
}
#endif
#endif
// MESSAGE WATCHDOG_PROCESS_STATUS UNPACKING
/**
* @brief Get field watchdog_id from watchdog_process_status message
*
* @return Watchdog ID
*/
static inline uint16_t mavlink_msg_watchdog_process_status_get_watchdog_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field process_id from watchdog_process_status message
*
* @return Process ID
*/
static inline uint16_t mavlink_msg_watchdog_process_status_get_process_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field state from watchdog_process_status message
*
* @return Is running / finished / suspended / crashed
*/
static inline uint8_t mavlink_msg_watchdog_process_status_get_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 10);
}
/**
* @brief Get field muted from watchdog_process_status message
*
* @return Is muted
*/
static inline uint8_t mavlink_msg_watchdog_process_status_get_muted(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 11);
}
/**
* @brief Get field pid from watchdog_process_status message
*
* @return PID
*/
static inline int32_t mavlink_msg_watchdog_process_status_get_pid(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 0);
}
/**
* @brief Get field crashes from watchdog_process_status message
*
* @return Number of crashes
*/
static inline uint16_t mavlink_msg_watchdog_process_status_get_crashes(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Decode a watchdog_process_status message into a struct
*
* @param msg The message to decode
* @param watchdog_process_status C-struct to decode the message contents into
*/
static inline void mavlink_msg_watchdog_process_status_decode(const mavlink_message_t* msg, mavlink_watchdog_process_status_t* watchdog_process_status)
{
#if MAVLINK_NEED_BYTE_SWAP
watchdog_process_status->pid = mavlink_msg_watchdog_process_status_get_pid(msg);
watchdog_process_status->watchdog_id = mavlink_msg_watchdog_process_status_get_watchdog_id(msg);
watchdog_process_status->process_id = mavlink_msg_watchdog_process_status_get_process_id(msg);
watchdog_process_status->crashes = mavlink_msg_watchdog_process_status_get_crashes(msg);
watchdog_process_status->state = mavlink_msg_watchdog_process_status_get_state(msg);
watchdog_process_status->muted = mavlink_msg_watchdog_process_status_get_muted(msg);
#else
memcpy(watchdog_process_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
#endif
}
/** @file
* @brief MAVLink comm protocol generated from pixhawk.xml
* @see http://mavlink.org
*/
#ifndef MAVLINK_PIXHAWK_H
#define MAVLINK_PIXHAWK_H
#ifndef MAVLINK_H
#error Wrong include order: MAVLINK_PIXHAWK.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
#endif
#ifdef __cplusplus
extern "C" {
#endif
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 229, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 12, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 32, 243, 14, 0, 0, 100, 36, 60, 30, 0, 11, 52, 1, 92, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 26, 16, 0, 0, 0, 0, 0, 0, 0, 4, 255, 12, 6, 0, 0, 0, 0, 0, 0, 106, 43, 55, 0, 0, 53, 0, 0, 0, 0, 21, 0, 0, 0, 0, 48, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 6, 2, 38, 0, 254, 36, 30, 18, 18, 51, 9, 0}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 59, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 0, 0, 103, 154, 178, 200, 0, 108, 86, 95, 224, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 249, 182, 0, 0, 0, 0, 0, 0, 0, 153, 16, 29, 162, 0, 0, 0, 0, 0, 0, 90, 95, 36, 0, 0, 88, 0, 0, 0, 0, 254, 0, 0, 0, 0, 87, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 158, 0, 8, 204, 49, 170, 44, 83, 46, 0}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE3, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_CAM_SHUTTER, MAVLINK_MESSAGE_INFO_IMAGE_TRIGGERED, MAVLINK_MESSAGE_INFO_IMAGE_TRIGGER_CONTROL, MAVLINK_MESSAGE_INFO_IMAGE_AVAILABLE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_POSITION_CONTROL_OFFSET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_POSITION_CONTROL_SETPOINT, MAVLINK_MESSAGE_INFO_MARKER, MAVLINK_MESSAGE_INFO_RAW_AUX, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_WATCHDOG_HEARTBEAT, MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_INFO, MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_STATUS, MAVLINK_MESSAGE_INFO_WATCHDOG_COMMAND, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PATTERN_DETECTED, MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST, MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST_CONNECTION, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_BRIEF_FEATURE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_CONTROL, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_DETECTION_STATS, MAVLINK_MESSAGE_INFO_ONBOARD_HEALTH, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE, MAVLINK_MESSAGE_INFO_ADSB_VEHICLE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}}
#endif
#include "../protocol.h"
#define MAVLINK_ENABLED_PIXHAWK
// ENUM DEFINITIONS
/** @brief Content Types for data transmission handshake */
#ifndef HAVE_ENUM_DATA_TYPES
#define HAVE_ENUM_DATA_TYPES
typedef enum DATA_TYPES
{
DATA_TYPE_JPEG_IMAGE=1, /* | */
DATA_TYPE_RAW_IMAGE=2, /* | */
DATA_TYPE_KINECT=3, /* | */
DATA_TYPES_ENUM_END=4, /* | */
} DATA_TYPES;
#endif
/** @brief Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. */
#ifndef HAVE_ENUM_MAV_CMD
#define HAVE_ENUM_MAV_CMD
typedef enum MAV_CMD
{
MAV_CMD_NAV_WAYPOINT=16, /* Navigate to MISSION. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_RETURN_TO_LAUNCH=20, /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_NAV_LAND=21, /* Land at location |Abort Alt| Empty| Empty| Desired yaw angle| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_TAKEOFF=22, /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_LAND_LOCAL=23, /* Land at local position (local frame only) |Landing target number (if available)| Maximum accepted offset from desired landing position [m] - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| Landing descend rate [ms^-1]| Desired yaw angle [rad]| Y-axis position [m]| X-axis position [m]| Z-axis / ground level position [m]| */
MAV_CMD_NAV_TAKEOFF_LOCAL=24, /* Takeoff from local position (local frame only) |Minimum pitch (if airspeed sensor present), desired pitch without sensor [rad]| Empty| Takeoff ascend rate [ms^-1]| Yaw angle [rad] (if magnetometer or another yaw estimation source present), ignored without one of these| Y-axis position [m]| X-axis position [m]| Z-axis position [m]| */
MAV_CMD_NAV_FOLLOW=25, /* Vehicle following, i.e. this waypoint represents the position of a moving vehicle |Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Ground speed of vehicle to be followed| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT=30, /* Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. |Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude. | Empty| Empty| Empty| Empty| Empty| Desired altitude in meters| */
MAV_CMD_NAV_LOITER_TO_ALT=31, /* Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. |Heading Required (0 = False)| Radius in meters. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| Empty| Empty| Latitude| Longitude| Altitude| */
MAV_CMD_NAV_ROI=80, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */
MAV_CMD_NAV_PATHPLANNING=81, /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */
MAV_CMD_NAV_SPLINE_WAYPOINT=82, /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */
MAV_CMD_NAV_GUIDED_ENABLE=92, /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_NAV_LAST=95, /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_CONDITION_DELAY=112, /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_CONDITION_CHANGE_ALT=113, /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */
MAV_CMD_CONDITION_DISTANCE=114, /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_CONDITION_YAW=115, /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */
MAV_CMD_CONDITION_LAST=159, /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_SET_MODE=176, /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_JUMP=177, /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_CHANGE_SPEED=178, /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_SET_HOME=179, /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */
MAV_CMD_DO_SET_PARAMETER=180, /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_SET_RELAY=181, /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_REPEAT_RELAY=182, /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_SET_SERVO=183, /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_REPEAT_SERVO=184, /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */
MAV_CMD_DO_FLIGHTTERMINATION=185, /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_LAND_START=189, /* Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0/0 if not needed. If specified then it will be used to help find the closest landing sequence. |Empty| Empty| Empty| Empty| Latitude| Longitude| Empty| */
MAV_CMD_DO_RALLY_LAND=190, /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_GO_AROUND=191, /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_CONTROL_VIDEO=200, /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */
MAV_CMD_DO_SET_ROI=201, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */
MAV_CMD_DO_DIGICAM_CONFIGURE=202, /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */
MAV_CMD_DO_DIGICAM_CONTROL=203, /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */
MAV_CMD_DO_MOUNT_CONFIGURE=204, /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */
MAV_CMD_DO_MOUNT_CONTROL=205, /* Mission command to control a camera or antenna mount |pitch or lat in degrees, depending on mount mode.| roll or lon in degrees depending on mount mode| yaw or alt (in meters) depending on mount mode| reserved| reserved| reserved| MAV_MOUNT_MODE enum value| */
MAV_CMD_DO_SET_CAM_TRIGG_DIST=206, /* Mission command to set CAM_TRIGG_DIST for this flight |Camera trigger distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_FENCE_ENABLE=207, /* Mission command to enable the geofence |enable? (0=disable, 1=enable, 2=disable_floor_only)| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_PARACHUTE=208, /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_INVERTED_FLIGHT=210, /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_MOUNT_CONTROL_QUAT=220, /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty| */
MAV_CMD_DO_GUIDED_MASTER=221, /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_DO_GUIDED_LIMITS=222, /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit| horizontal move limit (in meters, AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty| */
MAV_CMD_DO_LAST=240, /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */
MAV_CMD_PREFLIGHT_CALIBRATION=241, /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Accelerometer calibration: 0: no, 1: yes| Compass/Motor interference calibration: 0: no, 1: yes| Empty| */
MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS=242, /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */
MAV_CMD_PREFLIGHT_UAVCAN=243, /* Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. |1: Trigger actuator ID assignment and direction mapping.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */
MAV_CMD_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: start logging with rate of param 3 in Hz (e.g. set to 1000 for 1000 Hz logging)| Reserved| Empty| Empty| Empty| */
MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN=246, /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.| Reserved| Reserved| Empty| Empty| Empty| */
MAV_CMD_OVERRIDE_GOTO=252, /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position| */
MAV_CMD_MISSION_START=300, /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| */
MAV_CMD_COMPONENT_ARM_DISARM=400, /* Arms / Disarms a component |1 to arm, 0 to disarm| */
MAV_CMD_GET_HOME_POSITION=410, /* Request the home position from the vehicle. |Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */
MAV_CMD_START_RX_PAIR=500, /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX| */
MAV_CMD_GET_MESSAGE_INTERVAL=510, /* Request the interval between messages for a particular MAVLink message ID |The MAVLink message ID| */
MAV_CMD_SET_MESSAGE_INTERVAL=511, /* Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM |The MAVLink message ID| The interval between two messages, in microseconds. Set to -1 to disable and 0 to request default rate.| */
MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES=520, /* Request autopilot capabilities |1: Request autopilot version| Reserved (all remaining params)| */
MAV_CMD_IMAGE_START_CAPTURE=2000, /* Start image capture sequence |Duration between two consecutive pictures (in seconds)| Number of images to capture total - 0 for unlimited capture| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */
MAV_CMD_IMAGE_STOP_CAPTURE=2001, /* Stop image capture sequence |Reserved| Reserved| */
MAV_CMD_DO_TRIGGER_CONTROL=2003, /* Enable or disable on-board camera triggering system. |Trigger enable/disable (0 for disable, 1 for start)| Shutter integration time (in ms)| Reserved| */
MAV_CMD_VIDEO_START_CAPTURE=2500, /* Starts video capture |Camera ID (0 for all cameras), 1 for first, 2 for second, etc.| Frames per second| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */
MAV_CMD_VIDEO_STOP_CAPTURE=2501, /* Stop the current video capture |Reserved| Reserved| */
MAV_CMD_PANORAMA_CREATE=2800, /* Create a panorama at the current position |Viewing angle horizontal of the panorama (in degrees, +- 0.5 the total angle)| Viewing angle vertical of panorama (in degrees)| Speed of the horizontal rotation (in degrees per second)| Speed of the vertical rotation (in degrees per second)| */
MAV_CMD_DO_VTOL_TRANSITION=3000, /* Request VTOL transition |The target VTOL state, as defined by ENUM MAV_VTOL_STATE. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.| */
MAV_CMD_DO_START_SEARCH=10001, /* Starts a search |1 to arm, 0 to disarm| */
MAV_CMD_DO_FINISH_SEARCH=10002, /* Starts a search |1 to arm, 0 to disarm| */
MAV_CMD_NAV_SWEEP=10003, /* Starts a search |1 to arm, 0 to disarm| */
MAV_CMD_PAYLOAD_PREPARE_DEPLOY=30001, /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude, in meters AMSL| */
MAV_CMD_PAYLOAD_CONTROL_DEPLOY=30002, /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */
MAV_CMD_ENUM_END=30003, /* | */
} MAV_CMD;
#endif
#include "../common/common.h"
// MAVLINK VERSION
#ifndef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
#if (MAVLINK_VERSION == 0)
#undef MAVLINK_VERSION
#define MAVLINK_VERSION 2
#endif
// MESSAGE DEFINITIONS
#include "./mavlink_msg_set_cam_shutter.h"
#include "./mavlink_msg_image_triggered.h"
#include "./mavlink_msg_image_trigger_control.h"
#include "./mavlink_msg_image_available.h"
#include "./mavlink_msg_set_position_control_offset.h"
#include "./mavlink_msg_position_control_setpoint.h"
#include "./mavlink_msg_marker.h"
#include "./mavlink_msg_raw_aux.h"
#include "./mavlink_msg_watchdog_heartbeat.h"
#include "./mavlink_msg_watchdog_process_info.h"
#include "./mavlink_msg_watchdog_process_status.h"
#include "./mavlink_msg_watchdog_command.h"
#include "./mavlink_msg_pattern_detected.h"
#include "./mavlink_msg_point_of_interest.h"
#include "./mavlink_msg_point_of_interest_connection.h"
#include "./mavlink_msg_brief_feature.h"
#include "./mavlink_msg_attitude_control.h"
#include "./mavlink_msg_detection_stats.h"
#include "./mavlink_msg_onboard_health.h"
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // MAVLINK_PIXHAWK_H
/** @file
* @brief MAVLink comm protocol testsuite generated from pixhawk.xml
* @see http://qgroundcontrol.org/mavlink/
*/
#ifndef PIXHAWK_TESTSUITE_H
#define PIXHAWK_TESTSUITE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MAVLINK_TEST_ALL
#define MAVLINK_TEST_ALL
static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_pixhawk(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_common(system_id, component_id, last_msg);
mavlink_test_pixhawk(system_id, component_id, last_msg);
}
#endif
#include "../common/testsuite.h"
static void mavlink_test_set_cam_shutter(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_set_cam_shutter_t packet_in = {
17.0,17443,17547,29,96,163
};
mavlink_set_cam_shutter_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.gain = packet_in.gain;
packet1.interval = packet_in.interval;
packet1.exposure = packet_in.exposure;
packet1.cam_no = packet_in.cam_no;
packet1.cam_mode = packet_in.cam_mode;
packet1.trigger_pin = packet_in.trigger_pin;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_cam_shutter_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_set_cam_shutter_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_cam_shutter_pack(system_id, component_id, &msg , packet1.cam_no , packet1.cam_mode , packet1.trigger_pin , packet1.interval , packet1.exposure , packet1.gain );
mavlink_msg_set_cam_shutter_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_cam_shutter_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.cam_no , packet1.cam_mode , packet1.trigger_pin , packet1.interval , packet1.exposure , packet1.gain );
mavlink_msg_set_cam_shutter_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_set_cam_shutter_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_cam_shutter_send(MAVLINK_COMM_1 , packet1.cam_no , packet1.cam_mode , packet1.trigger_pin , packet1.interval , packet1.exposure , packet1.gain );
mavlink_msg_set_cam_shutter_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_image_triggered(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_image_triggered_t packet_in = {
93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0
};
mavlink_image_triggered_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.timestamp = packet_in.timestamp;
packet1.seq = packet_in.seq;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
packet1.local_z = packet_in.local_z;
packet1.lat = packet_in.lat;
packet1.lon = packet_in.lon;
packet1.alt = packet_in.alt;
packet1.ground_x = packet_in.ground_x;
packet1.ground_y = packet_in.ground_y;
packet1.ground_z = packet_in.ground_z;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_triggered_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_image_triggered_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_triggered_pack(system_id, component_id, &msg , packet1.timestamp , packet1.seq , packet1.roll , packet1.pitch , packet1.yaw , packet1.local_z , packet1.lat , packet1.lon , packet1.alt , packet1.ground_x , packet1.ground_y , packet1.ground_z );
mavlink_msg_image_triggered_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_triggered_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.seq , packet1.roll , packet1.pitch , packet1.yaw , packet1.local_z , packet1.lat , packet1.lon , packet1.alt , packet1.ground_x , packet1.ground_y , packet1.ground_z );
mavlink_msg_image_triggered_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_image_triggered_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_triggered_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.seq , packet1.roll , packet1.pitch , packet1.yaw , packet1.local_z , packet1.lat , packet1.lon , packet1.alt , packet1.ground_x , packet1.ground_y , packet1.ground_z );
mavlink_msg_image_triggered_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_image_trigger_control(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_image_trigger_control_t packet_in = {
5
};
mavlink_image_trigger_control_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.enable = packet_in.enable;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_trigger_control_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_image_trigger_control_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_trigger_control_pack(system_id, component_id, &msg , packet1.enable );
mavlink_msg_image_trigger_control_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_trigger_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.enable );
mavlink_msg_image_trigger_control_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_image_trigger_control_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_trigger_control_send(MAVLINK_COMM_1 , packet1.enable );
mavlink_msg_image_trigger_control_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_image_available(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_image_available_t packet_in = {
93372036854775807ULL,93372036854776311ULL,93372036854776815ULL,963498712,963498920,963499128,963499336,297.0,325.0,353.0,381.0,409.0,437.0,465.0,493.0,521.0,549.0,577.0,21603,21707,21811,147,214
};
mavlink_image_available_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.cam_id = packet_in.cam_id;
packet1.timestamp = packet_in.timestamp;
packet1.valid_until = packet_in.valid_until;
packet1.img_seq = packet_in.img_seq;
packet1.img_buf_index = packet_in.img_buf_index;
packet1.key = packet_in.key;
packet1.exposure = packet_in.exposure;
packet1.gain = packet_in.gain;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
packet1.local_z = packet_in.local_z;
packet1.lat = packet_in.lat;
packet1.lon = packet_in.lon;
packet1.alt = packet_in.alt;
packet1.ground_x = packet_in.ground_x;
packet1.ground_y = packet_in.ground_y;
packet1.ground_z = packet_in.ground_z;
packet1.width = packet_in.width;
packet1.height = packet_in.height;
packet1.depth = packet_in.depth;
packet1.cam_no = packet_in.cam_no;
packet1.channels = packet_in.channels;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_available_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_image_available_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_available_pack(system_id, component_id, &msg , packet1.cam_id , packet1.cam_no , packet1.timestamp , packet1.valid_until , packet1.img_seq , packet1.img_buf_index , packet1.width , packet1.height , packet1.depth , packet1.channels , packet1.key , packet1.exposure , packet1.gain , packet1.roll , packet1.pitch , packet1.yaw , packet1.local_z , packet1.lat , packet1.lon , packet1.alt , packet1.ground_x , packet1.ground_y , packet1.ground_z );
mavlink_msg_image_available_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_available_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.cam_id , packet1.cam_no , packet1.timestamp , packet1.valid_until , packet1.img_seq , packet1.img_buf_index , packet1.width , packet1.height , packet1.depth , packet1.channels , packet1.key , packet1.exposure , packet1.gain , packet1.roll , packet1.pitch , packet1.yaw , packet1.local_z , packet1.lat , packet1.lon , packet1.alt , packet1.ground_x , packet1.ground_y , packet1.ground_z );
mavlink_msg_image_available_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_image_available_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_image_available_send(MAVLINK_COMM_1 , packet1.cam_id , packet1.cam_no , packet1.timestamp , packet1.valid_until , packet1.img_seq , packet1.img_buf_index , packet1.width , packet1.height , packet1.depth , packet1.channels , packet1.key , packet1.exposure , packet1.gain , packet1.roll , packet1.pitch , packet1.yaw , packet1.local_z , packet1.lat , packet1.lon , packet1.alt , packet1.ground_x , packet1.ground_y , packet1.ground_z );
mavlink_msg_image_available_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_set_position_control_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_set_position_control_offset_t packet_in = {
17.0,45.0,73.0,101.0,53,120
};
mavlink_set_position_control_offset_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.yaw = packet_in.yaw;
packet1.target_system = packet_in.target_system;
packet1.target_component = packet_in.target_component;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_position_control_offset_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_set_position_control_offset_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_position_control_offset_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.x , packet1.y , packet1.z , packet1.yaw );
mavlink_msg_set_position_control_offset_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_position_control_offset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.x , packet1.y , packet1.z , packet1.yaw );
mavlink_msg_set_position_control_offset_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_set_position_control_offset_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_position_control_offset_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.x , packet1.y , packet1.z , packet1.yaw );
mavlink_msg_set_position_control_offset_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_position_control_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_position_control_setpoint_t packet_in = {
17.0,45.0,73.0,101.0,18067
};
mavlink_position_control_setpoint_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.yaw = packet_in.yaw;
packet1.id = packet_in.id;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_position_control_setpoint_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_position_control_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_position_control_setpoint_pack(system_id, component_id, &msg , packet1.id , packet1.x , packet1.y , packet1.z , packet1.yaw );
mavlink_msg_position_control_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_position_control_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.x , packet1.y , packet1.z , packet1.yaw );
mavlink_msg_position_control_setpoint_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_position_control_setpoint_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_position_control_setpoint_send(MAVLINK_COMM_1 , packet1.id , packet1.x , packet1.y , packet1.z , packet1.yaw );
mavlink_msg_position_control_setpoint_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_marker(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_marker_t packet_in = {
17.0,45.0,73.0,101.0,129.0,157.0,18483
};
mavlink_marker_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
packet1.id = packet_in.id;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_marker_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_marker_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_marker_pack(system_id, component_id, &msg , packet1.id , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_marker_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_marker_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_marker_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_marker_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_marker_send(MAVLINK_COMM_1 , packet1.id , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
mavlink_msg_marker_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_raw_aux(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_raw_aux_t packet_in = {
963497464,17443,17547,17651,17755,17859,17963
};
mavlink_raw_aux_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.baro = packet_in.baro;
packet1.adc1 = packet_in.adc1;
packet1.adc2 = packet_in.adc2;
packet1.adc3 = packet_in.adc3;
packet1.adc4 = packet_in.adc4;
packet1.vbat = packet_in.vbat;
packet1.temp = packet_in.temp;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_raw_aux_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_raw_aux_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_raw_aux_pack(system_id, component_id, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.vbat , packet1.temp , packet1.baro );
mavlink_msg_raw_aux_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_raw_aux_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.vbat , packet1.temp , packet1.baro );
mavlink_msg_raw_aux_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_raw_aux_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_raw_aux_send(MAVLINK_COMM_1 , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.vbat , packet1.temp , packet1.baro );
mavlink_msg_raw_aux_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_watchdog_heartbeat(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_watchdog_heartbeat_t packet_in = {
17235,17339
};
mavlink_watchdog_heartbeat_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.watchdog_id = packet_in.watchdog_id;
packet1.process_count = packet_in.process_count;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_heartbeat_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_watchdog_heartbeat_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_heartbeat_pack(system_id, component_id, &msg , packet1.watchdog_id , packet1.process_count );
mavlink_msg_watchdog_heartbeat_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.watchdog_id , packet1.process_count );
mavlink_msg_watchdog_heartbeat_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_watchdog_heartbeat_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_heartbeat_send(MAVLINK_COMM_1 , packet1.watchdog_id , packet1.process_count );
mavlink_msg_watchdog_heartbeat_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_watchdog_process_info(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_watchdog_process_info_t packet_in = {
963497464,17443,17547,"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC","EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST"
};
mavlink_watchdog_process_info_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.timeout = packet_in.timeout;
packet1.watchdog_id = packet_in.watchdog_id;
packet1.process_id = packet_in.process_id;
mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*100);
mav_array_memcpy(packet1.arguments, packet_in.arguments, sizeof(char)*147);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_process_info_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_watchdog_process_info_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_process_info_pack(system_id, component_id, &msg , packet1.watchdog_id , packet1.process_id , packet1.name , packet1.arguments , packet1.timeout );
mavlink_msg_watchdog_process_info_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_process_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.watchdog_id , packet1.process_id , packet1.name , packet1.arguments , packet1.timeout );
mavlink_msg_watchdog_process_info_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_watchdog_process_info_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_process_info_send(MAVLINK_COMM_1 , packet1.watchdog_id , packet1.process_id , packet1.name , packet1.arguments , packet1.timeout );
mavlink_msg_watchdog_process_info_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_watchdog_process_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_watchdog_process_status_t packet_in = {
963497464,17443,17547,17651,163,230
};
mavlink_watchdog_process_status_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.pid = packet_in.pid;
packet1.watchdog_id = packet_in.watchdog_id;
packet1.process_id = packet_in.process_id;
packet1.crashes = packet_in.crashes;
packet1.state = packet_in.state;
packet1.muted = packet_in.muted;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_process_status_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_watchdog_process_status_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_process_status_pack(system_id, component_id, &msg , packet1.watchdog_id , packet1.process_id , packet1.state , packet1.muted , packet1.pid , packet1.crashes );
mavlink_msg_watchdog_process_status_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_process_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.watchdog_id , packet1.process_id , packet1.state , packet1.muted , packet1.pid , packet1.crashes );
mavlink_msg_watchdog_process_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_watchdog_process_status_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_process_status_send(MAVLINK_COMM_1 , packet1.watchdog_id , packet1.process_id , packet1.state , packet1.muted , packet1.pid , packet1.crashes );
mavlink_msg_watchdog_process_status_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_watchdog_command(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_watchdog_command_t packet_in = {
17235,17339,17,84
};
mavlink_watchdog_command_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.watchdog_id = packet_in.watchdog_id;
packet1.process_id = packet_in.process_id;
packet1.target_system_id = packet_in.target_system_id;
packet1.command_id = packet_in.command_id;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_command_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_watchdog_command_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_command_pack(system_id, component_id, &msg , packet1.target_system_id , packet1.watchdog_id , packet1.process_id , packet1.command_id );
mavlink_msg_watchdog_command_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_command_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system_id , packet1.watchdog_id , packet1.process_id , packet1.command_id );
mavlink_msg_watchdog_command_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_watchdog_command_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_watchdog_command_send(MAVLINK_COMM_1 , packet1.target_system_id , packet1.watchdog_id , packet1.process_id , packet1.command_id );
mavlink_msg_watchdog_command_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_pattern_detected(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_pattern_detected_t packet_in = {
17.0,17,"FGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ",128
};
mavlink_pattern_detected_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.confidence = packet_in.confidence;
packet1.type = packet_in.type;
packet1.detected = packet_in.detected;
mav_array_memcpy(packet1.file, packet_in.file, sizeof(char)*100);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_pattern_detected_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_pattern_detected_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_pattern_detected_pack(system_id, component_id, &msg , packet1.type , packet1.confidence , packet1.file , packet1.detected );
mavlink_msg_pattern_detected_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_pattern_detected_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.confidence , packet1.file , packet1.detected );
mavlink_msg_pattern_detected_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_pattern_detected_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_pattern_detected_send(MAVLINK_COMM_1 , packet1.type , packet1.confidence , packet1.file , packet1.detected );
mavlink_msg_pattern_detected_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_point_of_interest(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_point_of_interest_t packet_in = {
17.0,45.0,73.0,17859,175,242,53,"RSTUVWXYZABCDEFGHIJKLMNOP"
};
mavlink_point_of_interest_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.timeout = packet_in.timeout;
packet1.type = packet_in.type;
packet1.color = packet_in.color;
packet1.coordinate_system = packet_in.coordinate_system;
mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*26);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_point_of_interest_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_point_of_interest_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_point_of_interest_pack(system_id, component_id, &msg , packet1.type , packet1.color , packet1.coordinate_system , packet1.timeout , packet1.x , packet1.y , packet1.z , packet1.name );
mavlink_msg_point_of_interest_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_point_of_interest_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.color , packet1.coordinate_system , packet1.timeout , packet1.x , packet1.y , packet1.z , packet1.name );
mavlink_msg_point_of_interest_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_point_of_interest_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_point_of_interest_send(MAVLINK_COMM_1 , packet1.type , packet1.color , packet1.coordinate_system , packet1.timeout , packet1.x , packet1.y , packet1.z , packet1.name );
mavlink_msg_point_of_interest_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_point_of_interest_connection(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_point_of_interest_connection_t packet_in = {
17.0,45.0,73.0,101.0,129.0,157.0,18483,211,22,89,"DEFGHIJKLMNOPQRSTUVWXYZAB"
};
mavlink_point_of_interest_connection_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.xp1 = packet_in.xp1;
packet1.yp1 = packet_in.yp1;
packet1.zp1 = packet_in.zp1;
packet1.xp2 = packet_in.xp2;
packet1.yp2 = packet_in.yp2;
packet1.zp2 = packet_in.zp2;
packet1.timeout = packet_in.timeout;
packet1.type = packet_in.type;
packet1.color = packet_in.color;
packet1.coordinate_system = packet_in.coordinate_system;
mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*26);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_point_of_interest_connection_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_point_of_interest_connection_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_point_of_interest_connection_pack(system_id, component_id, &msg , packet1.type , packet1.color , packet1.coordinate_system , packet1.timeout , packet1.xp1 , packet1.yp1 , packet1.zp1 , packet1.xp2 , packet1.yp2 , packet1.zp2 , packet1.name );
mavlink_msg_point_of_interest_connection_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_point_of_interest_connection_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.color , packet1.coordinate_system , packet1.timeout , packet1.xp1 , packet1.yp1 , packet1.zp1 , packet1.xp2 , packet1.yp2 , packet1.zp2 , packet1.name );
mavlink_msg_point_of_interest_connection_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_point_of_interest_connection_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_point_of_interest_connection_send(MAVLINK_COMM_1 , packet1.type , packet1.color , packet1.coordinate_system , packet1.timeout , packet1.xp1 , packet1.yp1 , packet1.zp1 , packet1.xp2 , packet1.yp2 , packet1.zp2 , packet1.name );
mavlink_msg_point_of_interest_connection_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_brief_feature(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_brief_feature_t packet_in = {
17.0,45.0,73.0,101.0,18067,18171,65,{ 132, 133, 134, 135, 136, 137, 138, 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 }
};
mavlink_brief_feature_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.x = packet_in.x;
packet1.y = packet_in.y;
packet1.z = packet_in.z;
packet1.response = packet_in.response;
packet1.size = packet_in.size;
packet1.orientation = packet_in.orientation;
packet1.orientation_assignment = packet_in.orientation_assignment;
mav_array_memcpy(packet1.descriptor, packet_in.descriptor, sizeof(uint8_t)*32);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_brief_feature_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_brief_feature_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_brief_feature_pack(system_id, component_id, &msg , packet1.x , packet1.y , packet1.z , packet1.orientation_assignment , packet1.size , packet1.orientation , packet1.descriptor , packet1.response );
mavlink_msg_brief_feature_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_brief_feature_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.x , packet1.y , packet1.z , packet1.orientation_assignment , packet1.size , packet1.orientation , packet1.descriptor , packet1.response );
mavlink_msg_brief_feature_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_brief_feature_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_brief_feature_send(MAVLINK_COMM_1 , packet1.x , packet1.y , packet1.z , packet1.orientation_assignment , packet1.size , packet1.orientation , packet1.descriptor , packet1.response );
mavlink_msg_brief_feature_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_attitude_control(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_attitude_control_t packet_in = {
17.0,45.0,73.0,101.0,53,120,187,254,65
};
mavlink_attitude_control_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.roll = packet_in.roll;
packet1.pitch = packet_in.pitch;
packet1.yaw = packet_in.yaw;
packet1.thrust = packet_in.thrust;
packet1.target = packet_in.target;
packet1.roll_manual = packet_in.roll_manual;
packet1.pitch_manual = packet_in.pitch_manual;
packet1.yaw_manual = packet_in.yaw_manual;
packet1.thrust_manual = packet_in.thrust_manual;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_attitude_control_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_attitude_control_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_attitude_control_pack(system_id, component_id, &msg , packet1.target , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.roll_manual , packet1.pitch_manual , packet1.yaw_manual , packet1.thrust_manual );
mavlink_msg_attitude_control_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_attitude_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.roll_manual , packet1.pitch_manual , packet1.yaw_manual , packet1.thrust_manual );
mavlink_msg_attitude_control_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_attitude_control_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_attitude_control_send(MAVLINK_COMM_1 , packet1.target , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.roll_manual , packet1.pitch_manual , packet1.yaw_manual , packet1.thrust_manual );
mavlink_msg_attitude_control_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_detection_stats(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_detection_stats_t packet_in = {
963497464,963497672,73.0,963498088,963498296,963498504,963498712,963498920,963499128,963499336,963499544,325.0
};
mavlink_detection_stats_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.detections = packet_in.detections;
packet1.cluster_iters = packet_in.cluster_iters;
packet1.best_score = packet_in.best_score;
packet1.best_lat = packet_in.best_lat;
packet1.best_lon = packet_in.best_lon;
packet1.best_alt = packet_in.best_alt;
packet1.best_detection_id = packet_in.best_detection_id;
packet1.best_cluster_id = packet_in.best_cluster_id;
packet1.best_cluster_iter_id = packet_in.best_cluster_iter_id;
packet1.images_done = packet_in.images_done;
packet1.images_todo = packet_in.images_todo;
packet1.fps = packet_in.fps;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_detection_stats_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_detection_stats_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_detection_stats_pack(system_id, component_id, &msg , packet1.detections , packet1.cluster_iters , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_alt , packet1.best_detection_id , packet1.best_cluster_id , packet1.best_cluster_iter_id , packet1.images_done , packet1.images_todo , packet1.fps );
mavlink_msg_detection_stats_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_detection_stats_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.detections , packet1.cluster_iters , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_alt , packet1.best_detection_id , packet1.best_cluster_id , packet1.best_cluster_iter_id , packet1.images_done , packet1.images_todo , packet1.fps );
mavlink_msg_detection_stats_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_detection_stats_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_detection_stats_send(MAVLINK_COMM_1 , packet1.detections , packet1.cluster_iters , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_alt , packet1.best_detection_id , packet1.best_cluster_id , packet1.best_cluster_iter_id , packet1.images_done , packet1.images_todo , packet1.fps );
mavlink_msg_detection_stats_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_onboard_health(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_onboard_health_t packet_in = {
963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,18899,235,46,113,180,247
};
mavlink_onboard_health_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.uptime = packet_in.uptime;
packet1.ram_total = packet_in.ram_total;
packet1.swap_total = packet_in.swap_total;
packet1.disk_total = packet_in.disk_total;
packet1.temp = packet_in.temp;
packet1.voltage = packet_in.voltage;
packet1.network_load_in = packet_in.network_load_in;
packet1.network_load_out = packet_in.network_load_out;
packet1.cpu_freq = packet_in.cpu_freq;
packet1.cpu_load = packet_in.cpu_load;
packet1.ram_usage = packet_in.ram_usage;
packet1.swap_usage = packet_in.swap_usage;
packet1.disk_health = packet_in.disk_health;
packet1.disk_usage = packet_in.disk_usage;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_onboard_health_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_onboard_health_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_onboard_health_pack(system_id, component_id, &msg , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.ram_total , packet1.swap_usage , packet1.swap_total , packet1.disk_health , packet1.disk_usage , packet1.disk_total , packet1.temp , packet1.voltage , packet1.network_load_in , packet1.network_load_out );
mavlink_msg_onboard_health_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_onboard_health_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.ram_total , packet1.swap_usage , packet1.swap_total , packet1.disk_health , packet1.disk_usage , packet1.disk_total , packet1.temp , packet1.voltage , packet1.network_load_in , packet1.network_load_out );
mavlink_msg_onboard_health_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_onboard_health_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_onboard_health_send(MAVLINK_COMM_1 , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.ram_total , packet1.swap_usage , packet1.swap_total , packet1.disk_health , packet1.disk_usage , packet1.disk_total , packet1.temp , packet1.voltage , packet1.network_load_in , packet1.network_load_out );
mavlink_msg_onboard_health_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_pixhawk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_set_cam_shutter(system_id, component_id, last_msg);
mavlink_test_image_triggered(system_id, component_id, last_msg);
mavlink_test_image_trigger_control(system_id, component_id, last_msg);
mavlink_test_image_available(system_id, component_id, last_msg);
mavlink_test_set_position_control_offset(system_id, component_id, last_msg);
mavlink_test_position_control_setpoint(system_id, component_id, last_msg);
mavlink_test_marker(system_id, component_id, last_msg);
mavlink_test_raw_aux(system_id, component_id, last_msg);
mavlink_test_watchdog_heartbeat(system_id, component_id, last_msg);
mavlink_test_watchdog_process_info(system_id, component_id, last_msg);
mavlink_test_watchdog_process_status(system_id, component_id, last_msg);
mavlink_test_watchdog_command(system_id, component_id, last_msg);
mavlink_test_pattern_detected(system_id, component_id, last_msg);
mavlink_test_point_of_interest(system_id, component_id, last_msg);
mavlink_test_point_of_interest_connection(system_id, component_id, last_msg);
mavlink_test_brief_feature(system_id, component_id, last_msg);
mavlink_test_attitude_control(system_id, component_id, last_msg);
mavlink_test_detection_stats(system_id, component_id, last_msg);
mavlink_test_onboard_health(system_id, component_id, last_msg);
}
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // PIXHAWK_TESTSUITE_H
/** @file
* @brief MAVLink comm protocol built from pixhawk.xml
* @see http://mavlink.org
*/
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:20:06 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
#endif // MAVLINK_VERSION_H
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:20:14 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:24:49 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:20:21 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:24:57 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 179
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:20:22 2015"
#define MAVLINK_BUILD_DATE "Fri Dec 11 08:24:58 2015"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment