添加MAVLINK协议库
This commit is contained in:
34
app/drivers/sertrf/protocol/mavlinkv2/slugs/mavlink.h
Normal file
34
app/drivers/sertrf/protocol/mavlinkv2/slugs/mavlink.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/** @file
|
||||
* @brief MAVLink comm protocol built from slugs.xml
|
||||
* @see http://mavlink.org
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef MAVLINK_H
|
||||
#define MAVLINK_H
|
||||
|
||||
#define MAVLINK_PRIMARY_XML_IDX 0
|
||||
|
||||
#ifndef MAVLINK_STX
|
||||
#define MAVLINK_STX 253
|
||||
#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
|
||||
|
||||
#ifndef MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_COMMAND_24BIT 1
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "slugs.h"
|
||||
|
||||
#endif // MAVLINK_H
|
||||
213
app/drivers/sertrf/protocol/mavlinkv2/slugs/mavlink_msg_boot.h
Normal file
213
app/drivers/sertrf/protocol/mavlinkv2/slugs/mavlink_msg_boot.h
Normal file
@@ -0,0 +1,213 @@
|
||||
#pragma once
|
||||
// MESSAGE BOOT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_BOOT 197
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_boot_t {
|
||||
uint32_t version; /*< The onboard software version*/
|
||||
}) mavlink_boot_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_BOOT_LEN 4
|
||||
#define MAVLINK_MSG_ID_BOOT_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_197_LEN 4
|
||||
#define MAVLINK_MSG_ID_197_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_BOOT_CRC 39
|
||||
#define MAVLINK_MSG_ID_197_CRC 39
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_BOOT { \
|
||||
197, \
|
||||
"BOOT", \
|
||||
1, \
|
||||
{ { "version", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_boot_t, version) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_BOOT { \
|
||||
"BOOT", \
|
||||
1, \
|
||||
{ { "version", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_boot_t, version) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a boot 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 version The onboard software version
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_boot_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t version)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BOOT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, version);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BOOT_LEN);
|
||||
#else
|
||||
mavlink_boot_t packet;
|
||||
packet.version = version;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BOOT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BOOT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BOOT_MIN_LEN, MAVLINK_MSG_ID_BOOT_LEN, MAVLINK_MSG_ID_BOOT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a boot 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 version The onboard software version
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_boot_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t version)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BOOT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, version);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BOOT_LEN);
|
||||
#else
|
||||
mavlink_boot_t packet;
|
||||
packet.version = version;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BOOT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BOOT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BOOT_MIN_LEN, MAVLINK_MSG_ID_BOOT_LEN, MAVLINK_MSG_ID_BOOT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a boot 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 boot C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_boot_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_boot_t* boot)
|
||||
{
|
||||
return mavlink_msg_boot_pack(system_id, component_id, msg, boot->version);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a boot 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 boot C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_boot_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_boot_t* boot)
|
||||
{
|
||||
return mavlink_msg_boot_pack_chan(system_id, component_id, chan, msg, boot->version);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a boot message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param version The onboard software version
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_boot_send(mavlink_channel_t chan, uint32_t version)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BOOT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, version);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, buf, MAVLINK_MSG_ID_BOOT_MIN_LEN, MAVLINK_MSG_ID_BOOT_LEN, MAVLINK_MSG_ID_BOOT_CRC);
|
||||
#else
|
||||
mavlink_boot_t packet;
|
||||
packet.version = version;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, (const char *)&packet, MAVLINK_MSG_ID_BOOT_MIN_LEN, MAVLINK_MSG_ID_BOOT_LEN, MAVLINK_MSG_ID_BOOT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a boot message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_boot_send_struct(mavlink_channel_t chan, const mavlink_boot_t* boot)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_boot_send(chan, boot->version);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, (const char *)boot, MAVLINK_MSG_ID_BOOT_MIN_LEN, MAVLINK_MSG_ID_BOOT_LEN, MAVLINK_MSG_ID_BOOT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_BOOT_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_boot_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t version)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, version);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, buf, MAVLINK_MSG_ID_BOOT_MIN_LEN, MAVLINK_MSG_ID_BOOT_LEN, MAVLINK_MSG_ID_BOOT_CRC);
|
||||
#else
|
||||
mavlink_boot_t *packet = (mavlink_boot_t *)msgbuf;
|
||||
packet->version = version;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BOOT, (const char *)packet, MAVLINK_MSG_ID_BOOT_MIN_LEN, MAVLINK_MSG_ID_BOOT_LEN, MAVLINK_MSG_ID_BOOT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE BOOT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field version from boot message
|
||||
*
|
||||
* @return The onboard software version
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_boot_get_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a boot message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param boot C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_boot_decode(const mavlink_message_t* msg, mavlink_boot_t* boot)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
boot->version = mavlink_msg_boot_get_version(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_BOOT_LEN? msg->len : MAVLINK_MSG_ID_BOOT_LEN;
|
||||
memset(boot, 0, MAVLINK_MSG_ID_BOOT_LEN);
|
||||
memcpy(boot, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE CONTROL_SURFACE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SURFACE 185
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_control_surface_t {
|
||||
float mControl; /*< Pending*/
|
||||
float bControl; /*< Order to origin*/
|
||||
uint8_t target; /*< The system setting the commands*/
|
||||
uint8_t idSurface; /*< ID control surface send 0: throttle 1: aileron 2: elevator 3: rudder*/
|
||||
}) mavlink_control_surface_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SURFACE_LEN 10
|
||||
#define MAVLINK_MSG_ID_CONTROL_SURFACE_MIN_LEN 10
|
||||
#define MAVLINK_MSG_ID_185_LEN 10
|
||||
#define MAVLINK_MSG_ID_185_MIN_LEN 10
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SURFACE_CRC 113
|
||||
#define MAVLINK_MSG_ID_185_CRC 113
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CONTROL_SURFACE { \
|
||||
185, \
|
||||
"CONTROL_SURFACE", \
|
||||
4, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_control_surface_t, target) }, \
|
||||
{ "idSurface", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_control_surface_t, idSurface) }, \
|
||||
{ "mControl", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_control_surface_t, mControl) }, \
|
||||
{ "bControl", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_control_surface_t, bControl) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CONTROL_SURFACE { \
|
||||
"CONTROL_SURFACE", \
|
||||
4, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_control_surface_t, target) }, \
|
||||
{ "idSurface", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_control_surface_t, idSurface) }, \
|
||||
{ "mControl", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_control_surface_t, mControl) }, \
|
||||
{ "bControl", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_control_surface_t, bControl) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a control_surface 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 setting the commands
|
||||
* @param idSurface ID control surface send 0: throttle 1: aileron 2: elevator 3: rudder
|
||||
* @param mControl Pending
|
||||
* @param bControl Order to origin
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_surface_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, uint8_t idSurface, float mControl, float bControl)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SURFACE_LEN];
|
||||
_mav_put_float(buf, 0, mControl);
|
||||
_mav_put_float(buf, 4, bControl);
|
||||
_mav_put_uint8_t(buf, 8, target);
|
||||
_mav_put_uint8_t(buf, 9, idSurface);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN);
|
||||
#else
|
||||
mavlink_control_surface_t packet;
|
||||
packet.mControl = mControl;
|
||||
packet.bControl = bControl;
|
||||
packet.target = target;
|
||||
packet.idSurface = idSurface;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CONTROL_SURFACE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CONTROL_SURFACE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a control_surface 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 setting the commands
|
||||
* @param idSurface ID control surface send 0: throttle 1: aileron 2: elevator 3: rudder
|
||||
* @param mControl Pending
|
||||
* @param bControl Order to origin
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_surface_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,uint8_t idSurface,float mControl,float bControl)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SURFACE_LEN];
|
||||
_mav_put_float(buf, 0, mControl);
|
||||
_mav_put_float(buf, 4, bControl);
|
||||
_mav_put_uint8_t(buf, 8, target);
|
||||
_mav_put_uint8_t(buf, 9, idSurface);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN);
|
||||
#else
|
||||
mavlink_control_surface_t packet;
|
||||
packet.mControl = mControl;
|
||||
packet.bControl = bControl;
|
||||
packet.target = target;
|
||||
packet.idSurface = idSurface;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CONTROL_SURFACE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CONTROL_SURFACE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a control_surface 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 control_surface C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_surface_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_control_surface_t* control_surface)
|
||||
{
|
||||
return mavlink_msg_control_surface_pack(system_id, component_id, msg, control_surface->target, control_surface->idSurface, control_surface->mControl, control_surface->bControl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a control_surface 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 control_surface C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_surface_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_control_surface_t* control_surface)
|
||||
{
|
||||
return mavlink_msg_control_surface_pack_chan(system_id, component_id, chan, msg, control_surface->target, control_surface->idSurface, control_surface->mControl, control_surface->bControl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a control_surface message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system setting the commands
|
||||
* @param idSurface ID control surface send 0: throttle 1: aileron 2: elevator 3: rudder
|
||||
* @param mControl Pending
|
||||
* @param bControl Order to origin
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_control_surface_send(mavlink_channel_t chan, uint8_t target, uint8_t idSurface, float mControl, float bControl)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SURFACE_LEN];
|
||||
_mav_put_float(buf, 0, mControl);
|
||||
_mav_put_float(buf, 4, bControl);
|
||||
_mav_put_uint8_t(buf, 8, target);
|
||||
_mav_put_uint8_t(buf, 9, idSurface);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SURFACE, buf, MAVLINK_MSG_ID_CONTROL_SURFACE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_CRC);
|
||||
#else
|
||||
mavlink_control_surface_t packet;
|
||||
packet.mControl = mControl;
|
||||
packet.bControl = bControl;
|
||||
packet.target = target;
|
||||
packet.idSurface = idSurface;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SURFACE, (const char *)&packet, MAVLINK_MSG_ID_CONTROL_SURFACE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a control_surface message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_control_surface_send_struct(mavlink_channel_t chan, const mavlink_control_surface_t* control_surface)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_control_surface_send(chan, control_surface->target, control_surface->idSurface, control_surface->mControl, control_surface->bControl);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SURFACE, (const char *)control_surface, MAVLINK_MSG_ID_CONTROL_SURFACE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CONTROL_SURFACE_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_control_surface_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, uint8_t idSurface, float mControl, float bControl)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, mControl);
|
||||
_mav_put_float(buf, 4, bControl);
|
||||
_mav_put_uint8_t(buf, 8, target);
|
||||
_mav_put_uint8_t(buf, 9, idSurface);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SURFACE, buf, MAVLINK_MSG_ID_CONTROL_SURFACE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_CRC);
|
||||
#else
|
||||
mavlink_control_surface_t *packet = (mavlink_control_surface_t *)msgbuf;
|
||||
packet->mControl = mControl;
|
||||
packet->bControl = bControl;
|
||||
packet->target = target;
|
||||
packet->idSurface = idSurface;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SURFACE, (const char *)packet, MAVLINK_MSG_ID_CONTROL_SURFACE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN, MAVLINK_MSG_ID_CONTROL_SURFACE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CONTROL_SURFACE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from control_surface message
|
||||
*
|
||||
* @return The system setting the commands
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_control_surface_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field idSurface from control_surface message
|
||||
*
|
||||
* @return ID control surface send 0: throttle 1: aileron 2: elevator 3: rudder
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_control_surface_get_idSurface(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 9);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mControl from control_surface message
|
||||
*
|
||||
* @return Pending
|
||||
*/
|
||||
static inline float mavlink_msg_control_surface_get_mControl(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field bControl from control_surface message
|
||||
*
|
||||
* @return Order to origin
|
||||
*/
|
||||
static inline float mavlink_msg_control_surface_get_bControl(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a control_surface message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param control_surface C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_control_surface_decode(const mavlink_message_t* msg, mavlink_control_surface_t* control_surface)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
control_surface->mControl = mavlink_msg_control_surface_get_mControl(msg);
|
||||
control_surface->bControl = mavlink_msg_control_surface_get_bControl(msg);
|
||||
control_surface->target = mavlink_msg_control_surface_get_target(msg);
|
||||
control_surface->idSurface = mavlink_msg_control_surface_get_idSurface(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CONTROL_SURFACE_LEN? msg->len : MAVLINK_MSG_ID_CONTROL_SURFACE_LEN;
|
||||
memset(control_surface, 0, MAVLINK_MSG_ID_CONTROL_SURFACE_LEN);
|
||||
memcpy(control_surface, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE CPU_LOAD PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CPU_LOAD 170
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_cpu_load_t {
|
||||
uint16_t batVolt; /*< [mV] Battery Voltage*/
|
||||
uint8_t sensLoad; /*< Sensor DSC Load*/
|
||||
uint8_t ctrlLoad; /*< Control DSC Load*/
|
||||
}) mavlink_cpu_load_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CPU_LOAD_LEN 4
|
||||
#define MAVLINK_MSG_ID_CPU_LOAD_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_170_LEN 4
|
||||
#define MAVLINK_MSG_ID_170_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_CPU_LOAD_CRC 75
|
||||
#define MAVLINK_MSG_ID_170_CRC 75
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CPU_LOAD { \
|
||||
170, \
|
||||
"CPU_LOAD", \
|
||||
3, \
|
||||
{ { "sensLoad", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_cpu_load_t, sensLoad) }, \
|
||||
{ "ctrlLoad", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_cpu_load_t, ctrlLoad) }, \
|
||||
{ "batVolt", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_cpu_load_t, batVolt) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CPU_LOAD { \
|
||||
"CPU_LOAD", \
|
||||
3, \
|
||||
{ { "sensLoad", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_cpu_load_t, sensLoad) }, \
|
||||
{ "ctrlLoad", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_cpu_load_t, ctrlLoad) }, \
|
||||
{ "batVolt", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_cpu_load_t, batVolt) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a cpu_load 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 sensLoad Sensor DSC Load
|
||||
* @param ctrlLoad Control DSC Load
|
||||
* @param batVolt [mV] Battery Voltage
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_cpu_load_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t sensLoad, uint8_t ctrlLoad, uint16_t batVolt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CPU_LOAD_LEN];
|
||||
_mav_put_uint16_t(buf, 0, batVolt);
|
||||
_mav_put_uint8_t(buf, 2, sensLoad);
|
||||
_mav_put_uint8_t(buf, 3, ctrlLoad);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CPU_LOAD_LEN);
|
||||
#else
|
||||
mavlink_cpu_load_t packet;
|
||||
packet.batVolt = batVolt;
|
||||
packet.sensLoad = sensLoad;
|
||||
packet.ctrlLoad = ctrlLoad;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CPU_LOAD_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CPU_LOAD;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CPU_LOAD_MIN_LEN, MAVLINK_MSG_ID_CPU_LOAD_LEN, MAVLINK_MSG_ID_CPU_LOAD_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a cpu_load 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 sensLoad Sensor DSC Load
|
||||
* @param ctrlLoad Control DSC Load
|
||||
* @param batVolt [mV] Battery Voltage
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_cpu_load_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t sensLoad,uint8_t ctrlLoad,uint16_t batVolt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CPU_LOAD_LEN];
|
||||
_mav_put_uint16_t(buf, 0, batVolt);
|
||||
_mav_put_uint8_t(buf, 2, sensLoad);
|
||||
_mav_put_uint8_t(buf, 3, ctrlLoad);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CPU_LOAD_LEN);
|
||||
#else
|
||||
mavlink_cpu_load_t packet;
|
||||
packet.batVolt = batVolt;
|
||||
packet.sensLoad = sensLoad;
|
||||
packet.ctrlLoad = ctrlLoad;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CPU_LOAD_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CPU_LOAD;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CPU_LOAD_MIN_LEN, MAVLINK_MSG_ID_CPU_LOAD_LEN, MAVLINK_MSG_ID_CPU_LOAD_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a cpu_load 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 cpu_load C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_cpu_load_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_cpu_load_t* cpu_load)
|
||||
{
|
||||
return mavlink_msg_cpu_load_pack(system_id, component_id, msg, cpu_load->sensLoad, cpu_load->ctrlLoad, cpu_load->batVolt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a cpu_load 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 cpu_load C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_cpu_load_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_cpu_load_t* cpu_load)
|
||||
{
|
||||
return mavlink_msg_cpu_load_pack_chan(system_id, component_id, chan, msg, cpu_load->sensLoad, cpu_load->ctrlLoad, cpu_load->batVolt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a cpu_load message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param sensLoad Sensor DSC Load
|
||||
* @param ctrlLoad Control DSC Load
|
||||
* @param batVolt [mV] Battery Voltage
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_cpu_load_send(mavlink_channel_t chan, uint8_t sensLoad, uint8_t ctrlLoad, uint16_t batVolt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CPU_LOAD_LEN];
|
||||
_mav_put_uint16_t(buf, 0, batVolt);
|
||||
_mav_put_uint8_t(buf, 2, sensLoad);
|
||||
_mav_put_uint8_t(buf, 3, ctrlLoad);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CPU_LOAD, buf, MAVLINK_MSG_ID_CPU_LOAD_MIN_LEN, MAVLINK_MSG_ID_CPU_LOAD_LEN, MAVLINK_MSG_ID_CPU_LOAD_CRC);
|
||||
#else
|
||||
mavlink_cpu_load_t packet;
|
||||
packet.batVolt = batVolt;
|
||||
packet.sensLoad = sensLoad;
|
||||
packet.ctrlLoad = ctrlLoad;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CPU_LOAD, (const char *)&packet, MAVLINK_MSG_ID_CPU_LOAD_MIN_LEN, MAVLINK_MSG_ID_CPU_LOAD_LEN, MAVLINK_MSG_ID_CPU_LOAD_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a cpu_load message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_cpu_load_send_struct(mavlink_channel_t chan, const mavlink_cpu_load_t* cpu_load)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_cpu_load_send(chan, cpu_load->sensLoad, cpu_load->ctrlLoad, cpu_load->batVolt);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CPU_LOAD, (const char *)cpu_load, MAVLINK_MSG_ID_CPU_LOAD_MIN_LEN, MAVLINK_MSG_ID_CPU_LOAD_LEN, MAVLINK_MSG_ID_CPU_LOAD_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CPU_LOAD_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_cpu_load_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t sensLoad, uint8_t ctrlLoad, uint16_t batVolt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, batVolt);
|
||||
_mav_put_uint8_t(buf, 2, sensLoad);
|
||||
_mav_put_uint8_t(buf, 3, ctrlLoad);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CPU_LOAD, buf, MAVLINK_MSG_ID_CPU_LOAD_MIN_LEN, MAVLINK_MSG_ID_CPU_LOAD_LEN, MAVLINK_MSG_ID_CPU_LOAD_CRC);
|
||||
#else
|
||||
mavlink_cpu_load_t *packet = (mavlink_cpu_load_t *)msgbuf;
|
||||
packet->batVolt = batVolt;
|
||||
packet->sensLoad = sensLoad;
|
||||
packet->ctrlLoad = ctrlLoad;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CPU_LOAD, (const char *)packet, MAVLINK_MSG_ID_CPU_LOAD_MIN_LEN, MAVLINK_MSG_ID_CPU_LOAD_LEN, MAVLINK_MSG_ID_CPU_LOAD_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CPU_LOAD UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field sensLoad from cpu_load message
|
||||
*
|
||||
* @return Sensor DSC Load
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_cpu_load_get_sensLoad(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ctrlLoad from cpu_load message
|
||||
*
|
||||
* @return Control DSC Load
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_cpu_load_get_ctrlLoad(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field batVolt from cpu_load message
|
||||
*
|
||||
* @return [mV] Battery Voltage
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_cpu_load_get_batVolt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a cpu_load message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param cpu_load C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_cpu_load_decode(const mavlink_message_t* msg, mavlink_cpu_load_t* cpu_load)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
cpu_load->batVolt = mavlink_msg_cpu_load_get_batVolt(msg);
|
||||
cpu_load->sensLoad = mavlink_msg_cpu_load_get_sensLoad(msg);
|
||||
cpu_load->ctrlLoad = mavlink_msg_cpu_load_get_ctrlLoad(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CPU_LOAD_LEN? msg->len : MAVLINK_MSG_ID_CPU_LOAD_LEN;
|
||||
memset(cpu_load, 0, MAVLINK_MSG_ID_CPU_LOAD_LEN);
|
||||
memcpy(cpu_load, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
#pragma once
|
||||
// MESSAGE CTRL_SRFC_PT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CTRL_SRFC_PT 181
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_ctrl_srfc_pt_t {
|
||||
uint16_t bitfieldPt; /*< Bitfield containing the passthrough configuration, see CONTROL_SURFACE_FLAG ENUM.*/
|
||||
uint8_t target; /*< The system setting the commands*/
|
||||
}) mavlink_ctrl_srfc_pt_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN 3
|
||||
#define MAVLINK_MSG_ID_CTRL_SRFC_PT_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_181_LEN 3
|
||||
#define MAVLINK_MSG_ID_181_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_CTRL_SRFC_PT_CRC 104
|
||||
#define MAVLINK_MSG_ID_181_CRC 104
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CTRL_SRFC_PT { \
|
||||
181, \
|
||||
"CTRL_SRFC_PT", \
|
||||
2, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_ctrl_srfc_pt_t, target) }, \
|
||||
{ "bitfieldPt", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ctrl_srfc_pt_t, bitfieldPt) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CTRL_SRFC_PT { \
|
||||
"CTRL_SRFC_PT", \
|
||||
2, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_ctrl_srfc_pt_t, target) }, \
|
||||
{ "bitfieldPt", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ctrl_srfc_pt_t, bitfieldPt) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a ctrl_srfc_pt 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 setting the commands
|
||||
* @param bitfieldPt Bitfield containing the passthrough configuration, see CONTROL_SURFACE_FLAG ENUM.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ctrl_srfc_pt_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, uint16_t bitfieldPt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, bitfieldPt);
|
||||
_mav_put_uint8_t(buf, 2, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN);
|
||||
#else
|
||||
mavlink_ctrl_srfc_pt_t packet;
|
||||
packet.bitfieldPt = bitfieldPt;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CTRL_SRFC_PT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CTRL_SRFC_PT_MIN_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a ctrl_srfc_pt 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 setting the commands
|
||||
* @param bitfieldPt Bitfield containing the passthrough configuration, see CONTROL_SURFACE_FLAG ENUM.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ctrl_srfc_pt_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,uint16_t bitfieldPt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, bitfieldPt);
|
||||
_mav_put_uint8_t(buf, 2, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN);
|
||||
#else
|
||||
mavlink_ctrl_srfc_pt_t packet;
|
||||
packet.bitfieldPt = bitfieldPt;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CTRL_SRFC_PT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CTRL_SRFC_PT_MIN_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ctrl_srfc_pt 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 ctrl_srfc_pt C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ctrl_srfc_pt_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ctrl_srfc_pt_t* ctrl_srfc_pt)
|
||||
{
|
||||
return mavlink_msg_ctrl_srfc_pt_pack(system_id, component_id, msg, ctrl_srfc_pt->target, ctrl_srfc_pt->bitfieldPt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ctrl_srfc_pt 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 ctrl_srfc_pt C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ctrl_srfc_pt_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ctrl_srfc_pt_t* ctrl_srfc_pt)
|
||||
{
|
||||
return mavlink_msg_ctrl_srfc_pt_pack_chan(system_id, component_id, chan, msg, ctrl_srfc_pt->target, ctrl_srfc_pt->bitfieldPt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ctrl_srfc_pt message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system setting the commands
|
||||
* @param bitfieldPt Bitfield containing the passthrough configuration, see CONTROL_SURFACE_FLAG ENUM.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_ctrl_srfc_pt_send(mavlink_channel_t chan, uint8_t target, uint16_t bitfieldPt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN];
|
||||
_mav_put_uint16_t(buf, 0, bitfieldPt);
|
||||
_mav_put_uint8_t(buf, 2, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CTRL_SRFC_PT, buf, MAVLINK_MSG_ID_CTRL_SRFC_PT_MIN_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_CRC);
|
||||
#else
|
||||
mavlink_ctrl_srfc_pt_t packet;
|
||||
packet.bitfieldPt = bitfieldPt;
|
||||
packet.target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CTRL_SRFC_PT, (const char *)&packet, MAVLINK_MSG_ID_CTRL_SRFC_PT_MIN_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ctrl_srfc_pt message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_ctrl_srfc_pt_send_struct(mavlink_channel_t chan, const mavlink_ctrl_srfc_pt_t* ctrl_srfc_pt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_ctrl_srfc_pt_send(chan, ctrl_srfc_pt->target, ctrl_srfc_pt->bitfieldPt);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CTRL_SRFC_PT, (const char *)ctrl_srfc_pt, MAVLINK_MSG_ID_CTRL_SRFC_PT_MIN_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CTRL_SRFC_PT_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_ctrl_srfc_pt_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, uint16_t bitfieldPt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, bitfieldPt);
|
||||
_mav_put_uint8_t(buf, 2, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CTRL_SRFC_PT, buf, MAVLINK_MSG_ID_CTRL_SRFC_PT_MIN_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_CRC);
|
||||
#else
|
||||
mavlink_ctrl_srfc_pt_t *packet = (mavlink_ctrl_srfc_pt_t *)msgbuf;
|
||||
packet->bitfieldPt = bitfieldPt;
|
||||
packet->target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CTRL_SRFC_PT, (const char *)packet, MAVLINK_MSG_ID_CTRL_SRFC_PT_MIN_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN, MAVLINK_MSG_ID_CTRL_SRFC_PT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CTRL_SRFC_PT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from ctrl_srfc_pt message
|
||||
*
|
||||
* @return The system setting the commands
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_ctrl_srfc_pt_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field bitfieldPt from ctrl_srfc_pt message
|
||||
*
|
||||
* @return Bitfield containing the passthrough configuration, see CONTROL_SURFACE_FLAG ENUM.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ctrl_srfc_pt_get_bitfieldPt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a ctrl_srfc_pt message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param ctrl_srfc_pt C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_ctrl_srfc_pt_decode(const mavlink_message_t* msg, mavlink_ctrl_srfc_pt_t* ctrl_srfc_pt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
ctrl_srfc_pt->bitfieldPt = mavlink_msg_ctrl_srfc_pt_get_bitfieldPt(msg);
|
||||
ctrl_srfc_pt->target = mavlink_msg_ctrl_srfc_pt_get_target(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN? msg->len : MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN;
|
||||
memset(ctrl_srfc_pt, 0, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN);
|
||||
memcpy(ctrl_srfc_pt, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA_LOG PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_LOG 177
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_data_log_t {
|
||||
float fl_1; /*< Log value 1 */
|
||||
float fl_2; /*< Log value 2 */
|
||||
float fl_3; /*< Log value 3 */
|
||||
float fl_4; /*< Log value 4 */
|
||||
float fl_5; /*< Log value 5 */
|
||||
float fl_6; /*< Log value 6 */
|
||||
}) mavlink_data_log_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_LOG_LEN 24
|
||||
#define MAVLINK_MSG_ID_DATA_LOG_MIN_LEN 24
|
||||
#define MAVLINK_MSG_ID_177_LEN 24
|
||||
#define MAVLINK_MSG_ID_177_MIN_LEN 24
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_LOG_CRC 167
|
||||
#define MAVLINK_MSG_ID_177_CRC 167
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_LOG { \
|
||||
177, \
|
||||
"DATA_LOG", \
|
||||
6, \
|
||||
{ { "fl_1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_data_log_t, fl_1) }, \
|
||||
{ "fl_2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_data_log_t, fl_2) }, \
|
||||
{ "fl_3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_data_log_t, fl_3) }, \
|
||||
{ "fl_4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_data_log_t, fl_4) }, \
|
||||
{ "fl_5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_data_log_t, fl_5) }, \
|
||||
{ "fl_6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_data_log_t, fl_6) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_LOG { \
|
||||
"DATA_LOG", \
|
||||
6, \
|
||||
{ { "fl_1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_data_log_t, fl_1) }, \
|
||||
{ "fl_2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_data_log_t, fl_2) }, \
|
||||
{ "fl_3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_data_log_t, fl_3) }, \
|
||||
{ "fl_4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_data_log_t, fl_4) }, \
|
||||
{ "fl_5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_data_log_t, fl_5) }, \
|
||||
{ "fl_6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_data_log_t, fl_6) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a data_log 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 fl_1 Log value 1
|
||||
* @param fl_2 Log value 2
|
||||
* @param fl_3 Log value 3
|
||||
* @param fl_4 Log value 4
|
||||
* @param fl_5 Log value 5
|
||||
* @param fl_6 Log value 6
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_log_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float fl_1, float fl_2, float fl_3, float fl_4, float fl_5, float fl_6)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_LOG_LEN];
|
||||
_mav_put_float(buf, 0, fl_1);
|
||||
_mav_put_float(buf, 4, fl_2);
|
||||
_mav_put_float(buf, 8, fl_3);
|
||||
_mav_put_float(buf, 12, fl_4);
|
||||
_mav_put_float(buf, 16, fl_5);
|
||||
_mav_put_float(buf, 20, fl_6);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_LOG_LEN);
|
||||
#else
|
||||
mavlink_data_log_t packet;
|
||||
packet.fl_1 = fl_1;
|
||||
packet.fl_2 = fl_2;
|
||||
packet.fl_3 = fl_3;
|
||||
packet.fl_4 = fl_4;
|
||||
packet.fl_5 = fl_5;
|
||||
packet.fl_6 = fl_6;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_LOG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_LOG;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_LOG_MIN_LEN, MAVLINK_MSG_ID_DATA_LOG_LEN, MAVLINK_MSG_ID_DATA_LOG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data_log 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 fl_1 Log value 1
|
||||
* @param fl_2 Log value 2
|
||||
* @param fl_3 Log value 3
|
||||
* @param fl_4 Log value 4
|
||||
* @param fl_5 Log value 5
|
||||
* @param fl_6 Log value 6
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_log_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float fl_1,float fl_2,float fl_3,float fl_4,float fl_5,float fl_6)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_LOG_LEN];
|
||||
_mav_put_float(buf, 0, fl_1);
|
||||
_mav_put_float(buf, 4, fl_2);
|
||||
_mav_put_float(buf, 8, fl_3);
|
||||
_mav_put_float(buf, 12, fl_4);
|
||||
_mav_put_float(buf, 16, fl_5);
|
||||
_mav_put_float(buf, 20, fl_6);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_LOG_LEN);
|
||||
#else
|
||||
mavlink_data_log_t packet;
|
||||
packet.fl_1 = fl_1;
|
||||
packet.fl_2 = fl_2;
|
||||
packet.fl_3 = fl_3;
|
||||
packet.fl_4 = fl_4;
|
||||
packet.fl_5 = fl_5;
|
||||
packet.fl_6 = fl_6;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_LOG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_LOG;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_LOG_MIN_LEN, MAVLINK_MSG_ID_DATA_LOG_LEN, MAVLINK_MSG_ID_DATA_LOG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_log 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 data_log C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_log_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_log_t* data_log)
|
||||
{
|
||||
return mavlink_msg_data_log_pack(system_id, component_id, msg, data_log->fl_1, data_log->fl_2, data_log->fl_3, data_log->fl_4, data_log->fl_5, data_log->fl_6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_log 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 data_log C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_log_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_log_t* data_log)
|
||||
{
|
||||
return mavlink_msg_data_log_pack_chan(system_id, component_id, chan, msg, data_log->fl_1, data_log->fl_2, data_log->fl_3, data_log->fl_4, data_log->fl_5, data_log->fl_6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_log message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param fl_1 Log value 1
|
||||
* @param fl_2 Log value 2
|
||||
* @param fl_3 Log value 3
|
||||
* @param fl_4 Log value 4
|
||||
* @param fl_5 Log value 5
|
||||
* @param fl_6 Log value 6
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data_log_send(mavlink_channel_t chan, float fl_1, float fl_2, float fl_3, float fl_4, float fl_5, float fl_6)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_LOG_LEN];
|
||||
_mav_put_float(buf, 0, fl_1);
|
||||
_mav_put_float(buf, 4, fl_2);
|
||||
_mav_put_float(buf, 8, fl_3);
|
||||
_mav_put_float(buf, 12, fl_4);
|
||||
_mav_put_float(buf, 16, fl_5);
|
||||
_mav_put_float(buf, 20, fl_6);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_LOG, buf, MAVLINK_MSG_ID_DATA_LOG_MIN_LEN, MAVLINK_MSG_ID_DATA_LOG_LEN, MAVLINK_MSG_ID_DATA_LOG_CRC);
|
||||
#else
|
||||
mavlink_data_log_t packet;
|
||||
packet.fl_1 = fl_1;
|
||||
packet.fl_2 = fl_2;
|
||||
packet.fl_3 = fl_3;
|
||||
packet.fl_4 = fl_4;
|
||||
packet.fl_5 = fl_5;
|
||||
packet.fl_6 = fl_6;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_LOG, (const char *)&packet, MAVLINK_MSG_ID_DATA_LOG_MIN_LEN, MAVLINK_MSG_ID_DATA_LOG_LEN, MAVLINK_MSG_ID_DATA_LOG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_log message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data_log_send_struct(mavlink_channel_t chan, const mavlink_data_log_t* data_log)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data_log_send(chan, data_log->fl_1, data_log->fl_2, data_log->fl_3, data_log->fl_4, data_log->fl_5, data_log->fl_6);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_LOG, (const char *)data_log, MAVLINK_MSG_ID_DATA_LOG_MIN_LEN, MAVLINK_MSG_ID_DATA_LOG_LEN, MAVLINK_MSG_ID_DATA_LOG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA_LOG_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_data_log_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float fl_1, float fl_2, float fl_3, float fl_4, float fl_5, float fl_6)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, fl_1);
|
||||
_mav_put_float(buf, 4, fl_2);
|
||||
_mav_put_float(buf, 8, fl_3);
|
||||
_mav_put_float(buf, 12, fl_4);
|
||||
_mav_put_float(buf, 16, fl_5);
|
||||
_mav_put_float(buf, 20, fl_6);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_LOG, buf, MAVLINK_MSG_ID_DATA_LOG_MIN_LEN, MAVLINK_MSG_ID_DATA_LOG_LEN, MAVLINK_MSG_ID_DATA_LOG_CRC);
|
||||
#else
|
||||
mavlink_data_log_t *packet = (mavlink_data_log_t *)msgbuf;
|
||||
packet->fl_1 = fl_1;
|
||||
packet->fl_2 = fl_2;
|
||||
packet->fl_3 = fl_3;
|
||||
packet->fl_4 = fl_4;
|
||||
packet->fl_5 = fl_5;
|
||||
packet->fl_6 = fl_6;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_LOG, (const char *)packet, MAVLINK_MSG_ID_DATA_LOG_MIN_LEN, MAVLINK_MSG_ID_DATA_LOG_LEN, MAVLINK_MSG_ID_DATA_LOG_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA_LOG UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field fl_1 from data_log message
|
||||
*
|
||||
* @return Log value 1
|
||||
*/
|
||||
static inline float mavlink_msg_data_log_get_fl_1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fl_2 from data_log message
|
||||
*
|
||||
* @return Log value 2
|
||||
*/
|
||||
static inline float mavlink_msg_data_log_get_fl_2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fl_3 from data_log message
|
||||
*
|
||||
* @return Log value 3
|
||||
*/
|
||||
static inline float mavlink_msg_data_log_get_fl_3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fl_4 from data_log message
|
||||
*
|
||||
* @return Log value 4
|
||||
*/
|
||||
static inline float mavlink_msg_data_log_get_fl_4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fl_5 from data_log message
|
||||
*
|
||||
* @return Log value 5
|
||||
*/
|
||||
static inline float mavlink_msg_data_log_get_fl_5(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fl_6 from data_log message
|
||||
*
|
||||
* @return Log value 6
|
||||
*/
|
||||
static inline float mavlink_msg_data_log_get_fl_6(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data_log message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data_log C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data_log_decode(const mavlink_message_t* msg, mavlink_data_log_t* data_log)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
data_log->fl_1 = mavlink_msg_data_log_get_fl_1(msg);
|
||||
data_log->fl_2 = mavlink_msg_data_log_get_fl_2(msg);
|
||||
data_log->fl_3 = mavlink_msg_data_log_get_fl_3(msg);
|
||||
data_log->fl_4 = mavlink_msg_data_log_get_fl_4(msg);
|
||||
data_log->fl_5 = mavlink_msg_data_log_get_fl_5(msg);
|
||||
data_log->fl_6 = mavlink_msg_data_log_get_fl_6(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_LOG_LEN? msg->len : MAVLINK_MSG_ID_DATA_LOG_LEN;
|
||||
memset(data_log, 0, MAVLINK_MSG_ID_DATA_LOG_LEN);
|
||||
memcpy(data_log, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
#pragma once
|
||||
// MESSAGE DIAGNOSTIC PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DIAGNOSTIC 173
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_diagnostic_t {
|
||||
float diagFl1; /*< Diagnostic float 1*/
|
||||
float diagFl2; /*< Diagnostic float 2*/
|
||||
float diagFl3; /*< Diagnostic float 3*/
|
||||
int16_t diagSh1; /*< Diagnostic short 1*/
|
||||
int16_t diagSh2; /*< Diagnostic short 2*/
|
||||
int16_t diagSh3; /*< Diagnostic short 3*/
|
||||
}) mavlink_diagnostic_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DIAGNOSTIC_LEN 18
|
||||
#define MAVLINK_MSG_ID_DIAGNOSTIC_MIN_LEN 18
|
||||
#define MAVLINK_MSG_ID_173_LEN 18
|
||||
#define MAVLINK_MSG_ID_173_MIN_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_ID_DIAGNOSTIC_CRC 2
|
||||
#define MAVLINK_MSG_ID_173_CRC 2
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DIAGNOSTIC { \
|
||||
173, \
|
||||
"DIAGNOSTIC", \
|
||||
6, \
|
||||
{ { "diagFl1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_diagnostic_t, diagFl1) }, \
|
||||
{ "diagFl2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_diagnostic_t, diagFl2) }, \
|
||||
{ "diagFl3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_diagnostic_t, diagFl3) }, \
|
||||
{ "diagSh1", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_diagnostic_t, diagSh1) }, \
|
||||
{ "diagSh2", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_diagnostic_t, diagSh2) }, \
|
||||
{ "diagSh3", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_diagnostic_t, diagSh3) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DIAGNOSTIC { \
|
||||
"DIAGNOSTIC", \
|
||||
6, \
|
||||
{ { "diagFl1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_diagnostic_t, diagFl1) }, \
|
||||
{ "diagFl2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_diagnostic_t, diagFl2) }, \
|
||||
{ "diagFl3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_diagnostic_t, diagFl3) }, \
|
||||
{ "diagSh1", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_diagnostic_t, diagSh1) }, \
|
||||
{ "diagSh2", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_diagnostic_t, diagSh2) }, \
|
||||
{ "diagSh3", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_diagnostic_t, diagSh3) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a diagnostic 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 diagFl1 Diagnostic float 1
|
||||
* @param diagFl2 Diagnostic float 2
|
||||
* @param diagFl3 Diagnostic float 3
|
||||
* @param diagSh1 Diagnostic short 1
|
||||
* @param diagSh2 Diagnostic short 2
|
||||
* @param diagSh3 Diagnostic short 3
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_diagnostic_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float diagFl1, float diagFl2, float diagFl3, int16_t diagSh1, int16_t diagSh2, int16_t diagSh3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIAGNOSTIC_LEN];
|
||||
_mav_put_float(buf, 0, diagFl1);
|
||||
_mav_put_float(buf, 4, diagFl2);
|
||||
_mav_put_float(buf, 8, diagFl3);
|
||||
_mav_put_int16_t(buf, 12, diagSh1);
|
||||
_mav_put_int16_t(buf, 14, diagSh2);
|
||||
_mav_put_int16_t(buf, 16, diagSh3);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIAGNOSTIC_LEN);
|
||||
#else
|
||||
mavlink_diagnostic_t packet;
|
||||
packet.diagFl1 = diagFl1;
|
||||
packet.diagFl2 = diagFl2;
|
||||
packet.diagFl3 = diagFl3;
|
||||
packet.diagSh1 = diagSh1;
|
||||
packet.diagSh2 = diagSh2;
|
||||
packet.diagSh3 = diagSh3;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIAGNOSTIC_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIAGNOSTIC;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIAGNOSTIC_MIN_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a diagnostic 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 diagFl1 Diagnostic float 1
|
||||
* @param diagFl2 Diagnostic float 2
|
||||
* @param diagFl3 Diagnostic float 3
|
||||
* @param diagSh1 Diagnostic short 1
|
||||
* @param diagSh2 Diagnostic short 2
|
||||
* @param diagSh3 Diagnostic short 3
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_diagnostic_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float diagFl1,float diagFl2,float diagFl3,int16_t diagSh1,int16_t diagSh2,int16_t diagSh3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIAGNOSTIC_LEN];
|
||||
_mav_put_float(buf, 0, diagFl1);
|
||||
_mav_put_float(buf, 4, diagFl2);
|
||||
_mav_put_float(buf, 8, diagFl3);
|
||||
_mav_put_int16_t(buf, 12, diagSh1);
|
||||
_mav_put_int16_t(buf, 14, diagSh2);
|
||||
_mav_put_int16_t(buf, 16, diagSh3);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIAGNOSTIC_LEN);
|
||||
#else
|
||||
mavlink_diagnostic_t packet;
|
||||
packet.diagFl1 = diagFl1;
|
||||
packet.diagFl2 = diagFl2;
|
||||
packet.diagFl3 = diagFl3;
|
||||
packet.diagSh1 = diagSh1;
|
||||
packet.diagSh2 = diagSh2;
|
||||
packet.diagSh3 = diagSh3;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIAGNOSTIC_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIAGNOSTIC;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIAGNOSTIC_MIN_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a diagnostic 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 diagnostic C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_diagnostic_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_diagnostic_t* diagnostic)
|
||||
{
|
||||
return mavlink_msg_diagnostic_pack(system_id, component_id, msg, diagnostic->diagFl1, diagnostic->diagFl2, diagnostic->diagFl3, diagnostic->diagSh1, diagnostic->diagSh2, diagnostic->diagSh3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a diagnostic 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 diagnostic C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_diagnostic_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_diagnostic_t* diagnostic)
|
||||
{
|
||||
return mavlink_msg_diagnostic_pack_chan(system_id, component_id, chan, msg, diagnostic->diagFl1, diagnostic->diagFl2, diagnostic->diagFl3, diagnostic->diagSh1, diagnostic->diagSh2, diagnostic->diagSh3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a diagnostic message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param diagFl1 Diagnostic float 1
|
||||
* @param diagFl2 Diagnostic float 2
|
||||
* @param diagFl3 Diagnostic float 3
|
||||
* @param diagSh1 Diagnostic short 1
|
||||
* @param diagSh2 Diagnostic short 2
|
||||
* @param diagSh3 Diagnostic short 3
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_diagnostic_send(mavlink_channel_t chan, float diagFl1, float diagFl2, float diagFl3, int16_t diagSh1, int16_t diagSh2, int16_t diagSh3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIAGNOSTIC_LEN];
|
||||
_mav_put_float(buf, 0, diagFl1);
|
||||
_mav_put_float(buf, 4, diagFl2);
|
||||
_mav_put_float(buf, 8, diagFl3);
|
||||
_mav_put_int16_t(buf, 12, diagSh1);
|
||||
_mav_put_int16_t(buf, 14, diagSh2);
|
||||
_mav_put_int16_t(buf, 16, diagSh3);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIAGNOSTIC, buf, MAVLINK_MSG_ID_DIAGNOSTIC_MIN_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_CRC);
|
||||
#else
|
||||
mavlink_diagnostic_t packet;
|
||||
packet.diagFl1 = diagFl1;
|
||||
packet.diagFl2 = diagFl2;
|
||||
packet.diagFl3 = diagFl3;
|
||||
packet.diagSh1 = diagSh1;
|
||||
packet.diagSh2 = diagSh2;
|
||||
packet.diagSh3 = diagSh3;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIAGNOSTIC, (const char *)&packet, MAVLINK_MSG_ID_DIAGNOSTIC_MIN_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a diagnostic message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_diagnostic_send_struct(mavlink_channel_t chan, const mavlink_diagnostic_t* diagnostic)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_diagnostic_send(chan, diagnostic->diagFl1, diagnostic->diagFl2, diagnostic->diagFl3, diagnostic->diagSh1, diagnostic->diagSh2, diagnostic->diagSh3);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIAGNOSTIC, (const char *)diagnostic, MAVLINK_MSG_ID_DIAGNOSTIC_MIN_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DIAGNOSTIC_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_diagnostic_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float diagFl1, float diagFl2, float diagFl3, int16_t diagSh1, int16_t diagSh2, int16_t diagSh3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, diagFl1);
|
||||
_mav_put_float(buf, 4, diagFl2);
|
||||
_mav_put_float(buf, 8, diagFl3);
|
||||
_mav_put_int16_t(buf, 12, diagSh1);
|
||||
_mav_put_int16_t(buf, 14, diagSh2);
|
||||
_mav_put_int16_t(buf, 16, diagSh3);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIAGNOSTIC, buf, MAVLINK_MSG_ID_DIAGNOSTIC_MIN_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_CRC);
|
||||
#else
|
||||
mavlink_diagnostic_t *packet = (mavlink_diagnostic_t *)msgbuf;
|
||||
packet->diagFl1 = diagFl1;
|
||||
packet->diagFl2 = diagFl2;
|
||||
packet->diagFl3 = diagFl3;
|
||||
packet->diagSh1 = diagSh1;
|
||||
packet->diagSh2 = diagSh2;
|
||||
packet->diagSh3 = diagSh3;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIAGNOSTIC, (const char *)packet, MAVLINK_MSG_ID_DIAGNOSTIC_MIN_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_LEN, MAVLINK_MSG_ID_DIAGNOSTIC_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DIAGNOSTIC UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field diagFl1 from diagnostic message
|
||||
*
|
||||
* @return Diagnostic float 1
|
||||
*/
|
||||
static inline float mavlink_msg_diagnostic_get_diagFl1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diagFl2 from diagnostic message
|
||||
*
|
||||
* @return Diagnostic float 2
|
||||
*/
|
||||
static inline float mavlink_msg_diagnostic_get_diagFl2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diagFl3 from diagnostic message
|
||||
*
|
||||
* @return Diagnostic float 3
|
||||
*/
|
||||
static inline float mavlink_msg_diagnostic_get_diagFl3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diagSh1 from diagnostic message
|
||||
*
|
||||
* @return Diagnostic short 1
|
||||
*/
|
||||
static inline int16_t mavlink_msg_diagnostic_get_diagSh1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diagSh2 from diagnostic message
|
||||
*
|
||||
* @return Diagnostic short 2
|
||||
*/
|
||||
static inline int16_t mavlink_msg_diagnostic_get_diagSh2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diagSh3 from diagnostic message
|
||||
*
|
||||
* @return Diagnostic short 3
|
||||
*/
|
||||
static inline int16_t mavlink_msg_diagnostic_get_diagSh3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a diagnostic message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param diagnostic C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_diagnostic_decode(const mavlink_message_t* msg, mavlink_diagnostic_t* diagnostic)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
diagnostic->diagFl1 = mavlink_msg_diagnostic_get_diagFl1(msg);
|
||||
diagnostic->diagFl2 = mavlink_msg_diagnostic_get_diagFl2(msg);
|
||||
diagnostic->diagFl3 = mavlink_msg_diagnostic_get_diagFl3(msg);
|
||||
diagnostic->diagSh1 = mavlink_msg_diagnostic_get_diagSh1(msg);
|
||||
diagnostic->diagSh2 = mavlink_msg_diagnostic_get_diagSh2(msg);
|
||||
diagnostic->diagSh3 = mavlink_msg_diagnostic_get_diagSh3(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DIAGNOSTIC_LEN? msg->len : MAVLINK_MSG_ID_DIAGNOSTIC_LEN;
|
||||
memset(diagnostic, 0, MAVLINK_MSG_ID_DIAGNOSTIC_LEN);
|
||||
memcpy(diagnostic, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,488 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_DATE_TIME PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_DATE_TIME 179
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_date_time_t {
|
||||
uint8_t year; /*< Year reported by Gps */
|
||||
uint8_t month; /*< Month reported by Gps */
|
||||
uint8_t day; /*< Day reported by Gps */
|
||||
uint8_t hour; /*< Hour reported by Gps */
|
||||
uint8_t min; /*< Min reported by Gps */
|
||||
uint8_t sec; /*< Sec reported by Gps */
|
||||
uint8_t clockStat; /*< Clock Status. See table 47 page 211 OEMStar Manual */
|
||||
uint8_t visSat; /*< Visible satellites reported by Gps */
|
||||
uint8_t useSat; /*< Used satellites in Solution */
|
||||
uint8_t GppGl; /*< GPS+GLONASS satellites in Solution */
|
||||
uint8_t sigUsedMask; /*< GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)*/
|
||||
uint8_t percentUsed; /*< [%] Percent used GPS*/
|
||||
}) mavlink_gps_date_time_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_DATE_TIME_LEN 12
|
||||
#define MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_179_LEN 12
|
||||
#define MAVLINK_MSG_ID_179_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_DATE_TIME_CRC 132
|
||||
#define MAVLINK_MSG_ID_179_CRC 132
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_DATE_TIME { \
|
||||
179, \
|
||||
"GPS_DATE_TIME", \
|
||||
12, \
|
||||
{ { "year", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_date_time_t, year) }, \
|
||||
{ "month", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_date_time_t, month) }, \
|
||||
{ "day", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_date_time_t, day) }, \
|
||||
{ "hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_gps_date_time_t, hour) }, \
|
||||
{ "min", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_gps_date_time_t, min) }, \
|
||||
{ "sec", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_gps_date_time_t, sec) }, \
|
||||
{ "clockStat", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_gps_date_time_t, clockStat) }, \
|
||||
{ "visSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_gps_date_time_t, visSat) }, \
|
||||
{ "useSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_gps_date_time_t, useSat) }, \
|
||||
{ "GppGl", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_gps_date_time_t, GppGl) }, \
|
||||
{ "sigUsedMask", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_gps_date_time_t, sigUsedMask) }, \
|
||||
{ "percentUsed", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_gps_date_time_t, percentUsed) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_DATE_TIME { \
|
||||
"GPS_DATE_TIME", \
|
||||
12, \
|
||||
{ { "year", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_date_time_t, year) }, \
|
||||
{ "month", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_date_time_t, month) }, \
|
||||
{ "day", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_date_time_t, day) }, \
|
||||
{ "hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_gps_date_time_t, hour) }, \
|
||||
{ "min", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_gps_date_time_t, min) }, \
|
||||
{ "sec", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_gps_date_time_t, sec) }, \
|
||||
{ "clockStat", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_gps_date_time_t, clockStat) }, \
|
||||
{ "visSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_gps_date_time_t, visSat) }, \
|
||||
{ "useSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_gps_date_time_t, useSat) }, \
|
||||
{ "GppGl", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_gps_date_time_t, GppGl) }, \
|
||||
{ "sigUsedMask", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_gps_date_time_t, sigUsedMask) }, \
|
||||
{ "percentUsed", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_gps_date_time_t, percentUsed) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_date_time 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 year Year reported by Gps
|
||||
* @param month Month reported by Gps
|
||||
* @param day Day reported by Gps
|
||||
* @param hour Hour reported by Gps
|
||||
* @param min Min reported by Gps
|
||||
* @param sec Sec reported by Gps
|
||||
* @param clockStat Clock Status. See table 47 page 211 OEMStar Manual
|
||||
* @param visSat Visible satellites reported by Gps
|
||||
* @param useSat Used satellites in Solution
|
||||
* @param GppGl GPS+GLONASS satellites in Solution
|
||||
* @param sigUsedMask GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
|
||||
* @param percentUsed [%] Percent used GPS
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_date_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t clockStat, uint8_t visSat, uint8_t useSat, uint8_t GppGl, uint8_t sigUsedMask, uint8_t percentUsed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_DATE_TIME_LEN];
|
||||
_mav_put_uint8_t(buf, 0, year);
|
||||
_mav_put_uint8_t(buf, 1, month);
|
||||
_mav_put_uint8_t(buf, 2, day);
|
||||
_mav_put_uint8_t(buf, 3, hour);
|
||||
_mav_put_uint8_t(buf, 4, min);
|
||||
_mav_put_uint8_t(buf, 5, sec);
|
||||
_mav_put_uint8_t(buf, 6, clockStat);
|
||||
_mav_put_uint8_t(buf, 7, visSat);
|
||||
_mav_put_uint8_t(buf, 8, useSat);
|
||||
_mav_put_uint8_t(buf, 9, GppGl);
|
||||
_mav_put_uint8_t(buf, 10, sigUsedMask);
|
||||
_mav_put_uint8_t(buf, 11, percentUsed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
|
||||
#else
|
||||
mavlink_gps_date_time_t packet;
|
||||
packet.year = year;
|
||||
packet.month = month;
|
||||
packet.day = day;
|
||||
packet.hour = hour;
|
||||
packet.min = min;
|
||||
packet.sec = sec;
|
||||
packet.clockStat = clockStat;
|
||||
packet.visSat = visSat;
|
||||
packet.useSat = useSat;
|
||||
packet.GppGl = GppGl;
|
||||
packet.sigUsedMask = sigUsedMask;
|
||||
packet.percentUsed = percentUsed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_date_time 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 year Year reported by Gps
|
||||
* @param month Month reported by Gps
|
||||
* @param day Day reported by Gps
|
||||
* @param hour Hour reported by Gps
|
||||
* @param min Min reported by Gps
|
||||
* @param sec Sec reported by Gps
|
||||
* @param clockStat Clock Status. See table 47 page 211 OEMStar Manual
|
||||
* @param visSat Visible satellites reported by Gps
|
||||
* @param useSat Used satellites in Solution
|
||||
* @param GppGl GPS+GLONASS satellites in Solution
|
||||
* @param sigUsedMask GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
|
||||
* @param percentUsed [%] Percent used GPS
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_date_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t year,uint8_t month,uint8_t day,uint8_t hour,uint8_t min,uint8_t sec,uint8_t clockStat,uint8_t visSat,uint8_t useSat,uint8_t GppGl,uint8_t sigUsedMask,uint8_t percentUsed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_DATE_TIME_LEN];
|
||||
_mav_put_uint8_t(buf, 0, year);
|
||||
_mav_put_uint8_t(buf, 1, month);
|
||||
_mav_put_uint8_t(buf, 2, day);
|
||||
_mav_put_uint8_t(buf, 3, hour);
|
||||
_mav_put_uint8_t(buf, 4, min);
|
||||
_mav_put_uint8_t(buf, 5, sec);
|
||||
_mav_put_uint8_t(buf, 6, clockStat);
|
||||
_mav_put_uint8_t(buf, 7, visSat);
|
||||
_mav_put_uint8_t(buf, 8, useSat);
|
||||
_mav_put_uint8_t(buf, 9, GppGl);
|
||||
_mav_put_uint8_t(buf, 10, sigUsedMask);
|
||||
_mav_put_uint8_t(buf, 11, percentUsed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
|
||||
#else
|
||||
mavlink_gps_date_time_t packet;
|
||||
packet.year = year;
|
||||
packet.month = month;
|
||||
packet.day = day;
|
||||
packet.hour = hour;
|
||||
packet.min = min;
|
||||
packet.sec = sec;
|
||||
packet.clockStat = clockStat;
|
||||
packet.visSat = visSat;
|
||||
packet.useSat = useSat;
|
||||
packet.GppGl = GppGl;
|
||||
packet.sigUsedMask = sigUsedMask;
|
||||
packet.percentUsed = percentUsed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_date_time 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 gps_date_time C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_date_time_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_date_time_t* gps_date_time)
|
||||
{
|
||||
return mavlink_msg_gps_date_time_pack(system_id, component_id, msg, gps_date_time->year, gps_date_time->month, gps_date_time->day, gps_date_time->hour, gps_date_time->min, gps_date_time->sec, gps_date_time->clockStat, gps_date_time->visSat, gps_date_time->useSat, gps_date_time->GppGl, gps_date_time->sigUsedMask, gps_date_time->percentUsed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_date_time 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 gps_date_time C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_date_time_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_date_time_t* gps_date_time)
|
||||
{
|
||||
return mavlink_msg_gps_date_time_pack_chan(system_id, component_id, chan, msg, gps_date_time->year, gps_date_time->month, gps_date_time->day, gps_date_time->hour, gps_date_time->min, gps_date_time->sec, gps_date_time->clockStat, gps_date_time->visSat, gps_date_time->useSat, gps_date_time->GppGl, gps_date_time->sigUsedMask, gps_date_time->percentUsed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_date_time message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param year Year reported by Gps
|
||||
* @param month Month reported by Gps
|
||||
* @param day Day reported by Gps
|
||||
* @param hour Hour reported by Gps
|
||||
* @param min Min reported by Gps
|
||||
* @param sec Sec reported by Gps
|
||||
* @param clockStat Clock Status. See table 47 page 211 OEMStar Manual
|
||||
* @param visSat Visible satellites reported by Gps
|
||||
* @param useSat Used satellites in Solution
|
||||
* @param GppGl GPS+GLONASS satellites in Solution
|
||||
* @param sigUsedMask GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
|
||||
* @param percentUsed [%] Percent used GPS
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_date_time_send(mavlink_channel_t chan, uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t clockStat, uint8_t visSat, uint8_t useSat, uint8_t GppGl, uint8_t sigUsedMask, uint8_t percentUsed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_DATE_TIME_LEN];
|
||||
_mav_put_uint8_t(buf, 0, year);
|
||||
_mav_put_uint8_t(buf, 1, month);
|
||||
_mav_put_uint8_t(buf, 2, day);
|
||||
_mav_put_uint8_t(buf, 3, hour);
|
||||
_mav_put_uint8_t(buf, 4, min);
|
||||
_mav_put_uint8_t(buf, 5, sec);
|
||||
_mav_put_uint8_t(buf, 6, clockStat);
|
||||
_mav_put_uint8_t(buf, 7, visSat);
|
||||
_mav_put_uint8_t(buf, 8, useSat);
|
||||
_mav_put_uint8_t(buf, 9, GppGl);
|
||||
_mav_put_uint8_t(buf, 10, sigUsedMask);
|
||||
_mav_put_uint8_t(buf, 11, percentUsed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, buf, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
|
||||
#else
|
||||
mavlink_gps_date_time_t packet;
|
||||
packet.year = year;
|
||||
packet.month = month;
|
||||
packet.day = day;
|
||||
packet.hour = hour;
|
||||
packet.min = min;
|
||||
packet.sec = sec;
|
||||
packet.clockStat = clockStat;
|
||||
packet.visSat = visSat;
|
||||
packet.useSat = useSat;
|
||||
packet.GppGl = GppGl;
|
||||
packet.sigUsedMask = sigUsedMask;
|
||||
packet.percentUsed = percentUsed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)&packet, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_date_time message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_date_time_send_struct(mavlink_channel_t chan, const mavlink_gps_date_time_t* gps_date_time)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_date_time_send(chan, gps_date_time->year, gps_date_time->month, gps_date_time->day, gps_date_time->hour, gps_date_time->min, gps_date_time->sec, gps_date_time->clockStat, gps_date_time->visSat, gps_date_time->useSat, gps_date_time->GppGl, gps_date_time->sigUsedMask, gps_date_time->percentUsed);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)gps_date_time, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_DATE_TIME_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_gps_date_time_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t clockStat, uint8_t visSat, uint8_t useSat, uint8_t GppGl, uint8_t sigUsedMask, uint8_t percentUsed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, year);
|
||||
_mav_put_uint8_t(buf, 1, month);
|
||||
_mav_put_uint8_t(buf, 2, day);
|
||||
_mav_put_uint8_t(buf, 3, hour);
|
||||
_mav_put_uint8_t(buf, 4, min);
|
||||
_mav_put_uint8_t(buf, 5, sec);
|
||||
_mav_put_uint8_t(buf, 6, clockStat);
|
||||
_mav_put_uint8_t(buf, 7, visSat);
|
||||
_mav_put_uint8_t(buf, 8, useSat);
|
||||
_mav_put_uint8_t(buf, 9, GppGl);
|
||||
_mav_put_uint8_t(buf, 10, sigUsedMask);
|
||||
_mav_put_uint8_t(buf, 11, percentUsed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, buf, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
|
||||
#else
|
||||
mavlink_gps_date_time_t *packet = (mavlink_gps_date_time_t *)msgbuf;
|
||||
packet->year = year;
|
||||
packet->month = month;
|
||||
packet->day = day;
|
||||
packet->hour = hour;
|
||||
packet->min = min;
|
||||
packet->sec = sec;
|
||||
packet->clockStat = clockStat;
|
||||
packet->visSat = visSat;
|
||||
packet->useSat = useSat;
|
||||
packet->GppGl = GppGl;
|
||||
packet->sigUsedMask = sigUsedMask;
|
||||
packet->percentUsed = percentUsed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)packet, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_DATE_TIME UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field year from gps_date_time message
|
||||
*
|
||||
* @return Year reported by Gps
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_year(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field month from gps_date_time message
|
||||
*
|
||||
* @return Month reported by Gps
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_month(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field day from gps_date_time message
|
||||
*
|
||||
* @return Day reported by Gps
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_day(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hour from gps_date_time message
|
||||
*
|
||||
* @return Hour reported by Gps
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_hour(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field min from gps_date_time message
|
||||
*
|
||||
* @return Min reported by Gps
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_min(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sec from gps_date_time message
|
||||
*
|
||||
* @return Sec reported by Gps
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_sec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field clockStat from gps_date_time message
|
||||
*
|
||||
* @return Clock Status. See table 47 page 211 OEMStar Manual
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_clockStat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field visSat from gps_date_time message
|
||||
*
|
||||
* @return Visible satellites reported by Gps
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_visSat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field useSat from gps_date_time message
|
||||
*
|
||||
* @return Used satellites in Solution
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_useSat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field GppGl from gps_date_time message
|
||||
*
|
||||
* @return GPS+GLONASS satellites in Solution
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_GppGl(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 9);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sigUsedMask from gps_date_time message
|
||||
*
|
||||
* @return GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_sigUsedMask(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field percentUsed from gps_date_time message
|
||||
*
|
||||
* @return [%] Percent used GPS
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_date_time_get_percentUsed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_date_time message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_date_time C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_date_time_decode(const mavlink_message_t* msg, mavlink_gps_date_time_t* gps_date_time)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_date_time->year = mavlink_msg_gps_date_time_get_year(msg);
|
||||
gps_date_time->month = mavlink_msg_gps_date_time_get_month(msg);
|
||||
gps_date_time->day = mavlink_msg_gps_date_time_get_day(msg);
|
||||
gps_date_time->hour = mavlink_msg_gps_date_time_get_hour(msg);
|
||||
gps_date_time->min = mavlink_msg_gps_date_time_get_min(msg);
|
||||
gps_date_time->sec = mavlink_msg_gps_date_time_get_sec(msg);
|
||||
gps_date_time->clockStat = mavlink_msg_gps_date_time_get_clockStat(msg);
|
||||
gps_date_time->visSat = mavlink_msg_gps_date_time_get_visSat(msg);
|
||||
gps_date_time->useSat = mavlink_msg_gps_date_time_get_useSat(msg);
|
||||
gps_date_time->GppGl = mavlink_msg_gps_date_time_get_GppGl(msg);
|
||||
gps_date_time->sigUsedMask = mavlink_msg_gps_date_time_get_sigUsedMask(msg);
|
||||
gps_date_time->percentUsed = mavlink_msg_gps_date_time_get_percentUsed(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_DATE_TIME_LEN? msg->len : MAVLINK_MSG_ID_GPS_DATE_TIME_LEN;
|
||||
memset(gps_date_time, 0, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
|
||||
memcpy(gps_date_time, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE ISR_LOCATION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ISR_LOCATION 189
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_isr_location_t {
|
||||
float latitude; /*< [deg] ISR Latitude*/
|
||||
float longitude; /*< [deg] ISR Longitude*/
|
||||
float height; /*< ISR Height*/
|
||||
uint8_t target; /*< The system reporting the action*/
|
||||
uint8_t option1; /*< Option 1*/
|
||||
uint8_t option2; /*< Option 2*/
|
||||
uint8_t option3; /*< Option 3*/
|
||||
}) mavlink_isr_location_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ISR_LOCATION_LEN 16
|
||||
#define MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN 16
|
||||
#define MAVLINK_MSG_ID_189_LEN 16
|
||||
#define MAVLINK_MSG_ID_189_MIN_LEN 16
|
||||
|
||||
#define MAVLINK_MSG_ID_ISR_LOCATION_CRC 246
|
||||
#define MAVLINK_MSG_ID_189_CRC 246
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ISR_LOCATION { \
|
||||
189, \
|
||||
"ISR_LOCATION", \
|
||||
7, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_isr_location_t, target) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_isr_location_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_isr_location_t, longitude) }, \
|
||||
{ "height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_isr_location_t, height) }, \
|
||||
{ "option1", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_isr_location_t, option1) }, \
|
||||
{ "option2", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_isr_location_t, option2) }, \
|
||||
{ "option3", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_isr_location_t, option3) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ISR_LOCATION { \
|
||||
"ISR_LOCATION", \
|
||||
7, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_isr_location_t, target) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_isr_location_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_isr_location_t, longitude) }, \
|
||||
{ "height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_isr_location_t, height) }, \
|
||||
{ "option1", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_isr_location_t, option1) }, \
|
||||
{ "option2", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_isr_location_t, option2) }, \
|
||||
{ "option3", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_isr_location_t, option3) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a isr_location 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 reporting the action
|
||||
* @param latitude [deg] ISR Latitude
|
||||
* @param longitude [deg] ISR Longitude
|
||||
* @param height ISR Height
|
||||
* @param option1 Option 1
|
||||
* @param option2 Option 2
|
||||
* @param option3 Option 3
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_isr_location_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, float latitude, float longitude, float height, uint8_t option1, uint8_t option2, uint8_t option3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ISR_LOCATION_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_float(buf, 8, height);
|
||||
_mav_put_uint8_t(buf, 12, target);
|
||||
_mav_put_uint8_t(buf, 13, option1);
|
||||
_mav_put_uint8_t(buf, 14, option2);
|
||||
_mav_put_uint8_t(buf, 15, option3);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
|
||||
#else
|
||||
mavlink_isr_location_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.height = height;
|
||||
packet.target = target;
|
||||
packet.option1 = option1;
|
||||
packet.option2 = option2;
|
||||
packet.option3 = option3;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ISR_LOCATION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a isr_location 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 reporting the action
|
||||
* @param latitude [deg] ISR Latitude
|
||||
* @param longitude [deg] ISR Longitude
|
||||
* @param height ISR Height
|
||||
* @param option1 Option 1
|
||||
* @param option2 Option 2
|
||||
* @param option3 Option 3
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_isr_location_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,float latitude,float longitude,float height,uint8_t option1,uint8_t option2,uint8_t option3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ISR_LOCATION_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_float(buf, 8, height);
|
||||
_mav_put_uint8_t(buf, 12, target);
|
||||
_mav_put_uint8_t(buf, 13, option1);
|
||||
_mav_put_uint8_t(buf, 14, option2);
|
||||
_mav_put_uint8_t(buf, 15, option3);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
|
||||
#else
|
||||
mavlink_isr_location_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.height = height;
|
||||
packet.target = target;
|
||||
packet.option1 = option1;
|
||||
packet.option2 = option2;
|
||||
packet.option3 = option3;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ISR_LOCATION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a isr_location 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 isr_location C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_isr_location_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_isr_location_t* isr_location)
|
||||
{
|
||||
return mavlink_msg_isr_location_pack(system_id, component_id, msg, isr_location->target, isr_location->latitude, isr_location->longitude, isr_location->height, isr_location->option1, isr_location->option2, isr_location->option3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a isr_location 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 isr_location C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_isr_location_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_isr_location_t* isr_location)
|
||||
{
|
||||
return mavlink_msg_isr_location_pack_chan(system_id, component_id, chan, msg, isr_location->target, isr_location->latitude, isr_location->longitude, isr_location->height, isr_location->option1, isr_location->option2, isr_location->option3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a isr_location message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system reporting the action
|
||||
* @param latitude [deg] ISR Latitude
|
||||
* @param longitude [deg] ISR Longitude
|
||||
* @param height ISR Height
|
||||
* @param option1 Option 1
|
||||
* @param option2 Option 2
|
||||
* @param option3 Option 3
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_isr_location_send(mavlink_channel_t chan, uint8_t target, float latitude, float longitude, float height, uint8_t option1, uint8_t option2, uint8_t option3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ISR_LOCATION_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_float(buf, 8, height);
|
||||
_mav_put_uint8_t(buf, 12, target);
|
||||
_mav_put_uint8_t(buf, 13, option1);
|
||||
_mav_put_uint8_t(buf, 14, option2);
|
||||
_mav_put_uint8_t(buf, 15, option3);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, buf, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
|
||||
#else
|
||||
mavlink_isr_location_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.height = height;
|
||||
packet.target = target;
|
||||
packet.option1 = option1;
|
||||
packet.option2 = option2;
|
||||
packet.option3 = option3;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, (const char *)&packet, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a isr_location message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_isr_location_send_struct(mavlink_channel_t chan, const mavlink_isr_location_t* isr_location)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_isr_location_send(chan, isr_location->target, isr_location->latitude, isr_location->longitude, isr_location->height, isr_location->option1, isr_location->option2, isr_location->option3);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, (const char *)isr_location, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ISR_LOCATION_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_isr_location_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, float latitude, float longitude, float height, uint8_t option1, uint8_t option2, uint8_t option3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_float(buf, 8, height);
|
||||
_mav_put_uint8_t(buf, 12, target);
|
||||
_mav_put_uint8_t(buf, 13, option1);
|
||||
_mav_put_uint8_t(buf, 14, option2);
|
||||
_mav_put_uint8_t(buf, 15, option3);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, buf, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
|
||||
#else
|
||||
mavlink_isr_location_t *packet = (mavlink_isr_location_t *)msgbuf;
|
||||
packet->latitude = latitude;
|
||||
packet->longitude = longitude;
|
||||
packet->height = height;
|
||||
packet->target = target;
|
||||
packet->option1 = option1;
|
||||
packet->option2 = option2;
|
||||
packet->option3 = option3;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, (const char *)packet, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ISR_LOCATION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from isr_location message
|
||||
*
|
||||
* @return The system reporting the action
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_isr_location_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field latitude from isr_location message
|
||||
*
|
||||
* @return [deg] ISR Latitude
|
||||
*/
|
||||
static inline float mavlink_msg_isr_location_get_latitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field longitude from isr_location message
|
||||
*
|
||||
* @return [deg] ISR Longitude
|
||||
*/
|
||||
static inline float mavlink_msg_isr_location_get_longitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field height from isr_location message
|
||||
*
|
||||
* @return ISR Height
|
||||
*/
|
||||
static inline float mavlink_msg_isr_location_get_height(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field option1 from isr_location message
|
||||
*
|
||||
* @return Option 1
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_isr_location_get_option1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field option2 from isr_location message
|
||||
*
|
||||
* @return Option 2
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_isr_location_get_option2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field option3 from isr_location message
|
||||
*
|
||||
* @return Option 3
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_isr_location_get_option3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 15);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a isr_location message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param isr_location C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_isr_location_decode(const mavlink_message_t* msg, mavlink_isr_location_t* isr_location)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
isr_location->latitude = mavlink_msg_isr_location_get_latitude(msg);
|
||||
isr_location->longitude = mavlink_msg_isr_location_get_longitude(msg);
|
||||
isr_location->height = mavlink_msg_isr_location_get_height(msg);
|
||||
isr_location->target = mavlink_msg_isr_location_get_target(msg);
|
||||
isr_location->option1 = mavlink_msg_isr_location_get_option1(msg);
|
||||
isr_location->option2 = mavlink_msg_isr_location_get_option2(msg);
|
||||
isr_location->option3 = mavlink_msg_isr_location_get_option3(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ISR_LOCATION_LEN? msg->len : MAVLINK_MSG_ID_ISR_LOCATION_LEN;
|
||||
memset(isr_location, 0, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
|
||||
memcpy(isr_location, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE MID_LVL_CMDS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MID_LVL_CMDS 180
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mid_lvl_cmds_t {
|
||||
float hCommand; /*< [m] Commanded Altitude*/
|
||||
float uCommand; /*< [m/s] Commanded Airspeed*/
|
||||
float rCommand; /*< [rad/s] Commanded Turnrate*/
|
||||
uint8_t target; /*< The system setting the commands*/
|
||||
}) mavlink_mid_lvl_cmds_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MID_LVL_CMDS_LEN 13
|
||||
#define MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN 13
|
||||
#define MAVLINK_MSG_ID_180_LEN 13
|
||||
#define MAVLINK_MSG_ID_180_MIN_LEN 13
|
||||
|
||||
#define MAVLINK_MSG_ID_MID_LVL_CMDS_CRC 146
|
||||
#define MAVLINK_MSG_ID_180_CRC 146
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MID_LVL_CMDS { \
|
||||
180, \
|
||||
"MID_LVL_CMDS", \
|
||||
4, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mid_lvl_cmds_t, target) }, \
|
||||
{ "hCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mid_lvl_cmds_t, hCommand) }, \
|
||||
{ "uCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mid_lvl_cmds_t, uCommand) }, \
|
||||
{ "rCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mid_lvl_cmds_t, rCommand) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MID_LVL_CMDS { \
|
||||
"MID_LVL_CMDS", \
|
||||
4, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mid_lvl_cmds_t, target) }, \
|
||||
{ "hCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mid_lvl_cmds_t, hCommand) }, \
|
||||
{ "uCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mid_lvl_cmds_t, uCommand) }, \
|
||||
{ "rCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mid_lvl_cmds_t, rCommand) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mid_lvl_cmds 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 setting the commands
|
||||
* @param hCommand [m] Commanded Altitude
|
||||
* @param uCommand [m/s] Commanded Airspeed
|
||||
* @param rCommand [rad/s] Commanded Turnrate
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mid_lvl_cmds_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, float hCommand, float uCommand, float rCommand)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MID_LVL_CMDS_LEN];
|
||||
_mav_put_float(buf, 0, hCommand);
|
||||
_mav_put_float(buf, 4, uCommand);
|
||||
_mav_put_float(buf, 8, rCommand);
|
||||
_mav_put_uint8_t(buf, 12, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
|
||||
#else
|
||||
mavlink_mid_lvl_cmds_t packet;
|
||||
packet.hCommand = hCommand;
|
||||
packet.uCommand = uCommand;
|
||||
packet.rCommand = rCommand;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MID_LVL_CMDS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mid_lvl_cmds 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 setting the commands
|
||||
* @param hCommand [m] Commanded Altitude
|
||||
* @param uCommand [m/s] Commanded Airspeed
|
||||
* @param rCommand [rad/s] Commanded Turnrate
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mid_lvl_cmds_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,float hCommand,float uCommand,float rCommand)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MID_LVL_CMDS_LEN];
|
||||
_mav_put_float(buf, 0, hCommand);
|
||||
_mav_put_float(buf, 4, uCommand);
|
||||
_mav_put_float(buf, 8, rCommand);
|
||||
_mav_put_uint8_t(buf, 12, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
|
||||
#else
|
||||
mavlink_mid_lvl_cmds_t packet;
|
||||
packet.hCommand = hCommand;
|
||||
packet.uCommand = uCommand;
|
||||
packet.rCommand = rCommand;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MID_LVL_CMDS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mid_lvl_cmds 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 mid_lvl_cmds C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mid_lvl_cmds_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
|
||||
{
|
||||
return mavlink_msg_mid_lvl_cmds_pack(system_id, component_id, msg, mid_lvl_cmds->target, mid_lvl_cmds->hCommand, mid_lvl_cmds->uCommand, mid_lvl_cmds->rCommand);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mid_lvl_cmds 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 mid_lvl_cmds C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mid_lvl_cmds_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
|
||||
{
|
||||
return mavlink_msg_mid_lvl_cmds_pack_chan(system_id, component_id, chan, msg, mid_lvl_cmds->target, mid_lvl_cmds->hCommand, mid_lvl_cmds->uCommand, mid_lvl_cmds->rCommand);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mid_lvl_cmds message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system setting the commands
|
||||
* @param hCommand [m] Commanded Altitude
|
||||
* @param uCommand [m/s] Commanded Airspeed
|
||||
* @param rCommand [rad/s] Commanded Turnrate
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mid_lvl_cmds_send(mavlink_channel_t chan, uint8_t target, float hCommand, float uCommand, float rCommand)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MID_LVL_CMDS_LEN];
|
||||
_mav_put_float(buf, 0, hCommand);
|
||||
_mav_put_float(buf, 4, uCommand);
|
||||
_mav_put_float(buf, 8, rCommand);
|
||||
_mav_put_uint8_t(buf, 12, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, buf, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
|
||||
#else
|
||||
mavlink_mid_lvl_cmds_t packet;
|
||||
packet.hCommand = hCommand;
|
||||
packet.uCommand = uCommand;
|
||||
packet.rCommand = rCommand;
|
||||
packet.target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, (const char *)&packet, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mid_lvl_cmds message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mid_lvl_cmds_send_struct(mavlink_channel_t chan, const mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mid_lvl_cmds_send(chan, mid_lvl_cmds->target, mid_lvl_cmds->hCommand, mid_lvl_cmds->uCommand, mid_lvl_cmds->rCommand);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, (const char *)mid_lvl_cmds, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MID_LVL_CMDS_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_mid_lvl_cmds_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, float hCommand, float uCommand, float rCommand)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, hCommand);
|
||||
_mav_put_float(buf, 4, uCommand);
|
||||
_mav_put_float(buf, 8, rCommand);
|
||||
_mav_put_uint8_t(buf, 12, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, buf, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
|
||||
#else
|
||||
mavlink_mid_lvl_cmds_t *packet = (mavlink_mid_lvl_cmds_t *)msgbuf;
|
||||
packet->hCommand = hCommand;
|
||||
packet->uCommand = uCommand;
|
||||
packet->rCommand = rCommand;
|
||||
packet->target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, (const char *)packet, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MID_LVL_CMDS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from mid_lvl_cmds message
|
||||
*
|
||||
* @return The system setting the commands
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mid_lvl_cmds_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hCommand from mid_lvl_cmds message
|
||||
*
|
||||
* @return [m] Commanded Altitude
|
||||
*/
|
||||
static inline float mavlink_msg_mid_lvl_cmds_get_hCommand(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field uCommand from mid_lvl_cmds message
|
||||
*
|
||||
* @return [m/s] Commanded Airspeed
|
||||
*/
|
||||
static inline float mavlink_msg_mid_lvl_cmds_get_uCommand(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rCommand from mid_lvl_cmds message
|
||||
*
|
||||
* @return [rad/s] Commanded Turnrate
|
||||
*/
|
||||
static inline float mavlink_msg_mid_lvl_cmds_get_rCommand(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mid_lvl_cmds message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mid_lvl_cmds C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mid_lvl_cmds_decode(const mavlink_message_t* msg, mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mid_lvl_cmds->hCommand = mavlink_msg_mid_lvl_cmds_get_hCommand(msg);
|
||||
mid_lvl_cmds->uCommand = mavlink_msg_mid_lvl_cmds_get_uCommand(msg);
|
||||
mid_lvl_cmds->rCommand = mavlink_msg_mid_lvl_cmds_get_rCommand(msg);
|
||||
mid_lvl_cmds->target = mavlink_msg_mid_lvl_cmds_get_target(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MID_LVL_CMDS_LEN? msg->len : MAVLINK_MSG_ID_MID_LVL_CMDS_LEN;
|
||||
memset(mid_lvl_cmds, 0, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
|
||||
memcpy(mid_lvl_cmds, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE NOVATEL_DIAG PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_NOVATEL_DIAG 195
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_novatel_diag_t {
|
||||
uint32_t receiverStatus; /*< Status Bitfield. See table 69 page 350 Novatel OEMstar Manual*/
|
||||
float posSolAge; /*< [s] Age of the position solution*/
|
||||
uint16_t csFails; /*< Times the CRC has failed since boot*/
|
||||
uint8_t timeStatus; /*< The Time Status. See Table 8 page 27 Novatel OEMStar Manual*/
|
||||
uint8_t solStatus; /*< solution Status. See table 44 page 197*/
|
||||
uint8_t posType; /*< position type. See table 43 page 196*/
|
||||
uint8_t velType; /*< velocity type. See table 43 page 196*/
|
||||
}) mavlink_novatel_diag_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_NOVATEL_DIAG_LEN 14
|
||||
#define MAVLINK_MSG_ID_NOVATEL_DIAG_MIN_LEN 14
|
||||
#define MAVLINK_MSG_ID_195_LEN 14
|
||||
#define MAVLINK_MSG_ID_195_MIN_LEN 14
|
||||
|
||||
#define MAVLINK_MSG_ID_NOVATEL_DIAG_CRC 59
|
||||
#define MAVLINK_MSG_ID_195_CRC 59
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_NOVATEL_DIAG { \
|
||||
195, \
|
||||
"NOVATEL_DIAG", \
|
||||
7, \
|
||||
{ { "timeStatus", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_novatel_diag_t, timeStatus) }, \
|
||||
{ "receiverStatus", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_novatel_diag_t, receiverStatus) }, \
|
||||
{ "solStatus", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_novatel_diag_t, solStatus) }, \
|
||||
{ "posType", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_novatel_diag_t, posType) }, \
|
||||
{ "velType", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_novatel_diag_t, velType) }, \
|
||||
{ "posSolAge", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_novatel_diag_t, posSolAge) }, \
|
||||
{ "csFails", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_novatel_diag_t, csFails) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_NOVATEL_DIAG { \
|
||||
"NOVATEL_DIAG", \
|
||||
7, \
|
||||
{ { "timeStatus", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_novatel_diag_t, timeStatus) }, \
|
||||
{ "receiverStatus", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_novatel_diag_t, receiverStatus) }, \
|
||||
{ "solStatus", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_novatel_diag_t, solStatus) }, \
|
||||
{ "posType", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_novatel_diag_t, posType) }, \
|
||||
{ "velType", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_novatel_diag_t, velType) }, \
|
||||
{ "posSolAge", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_novatel_diag_t, posSolAge) }, \
|
||||
{ "csFails", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_novatel_diag_t, csFails) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a novatel_diag 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 timeStatus The Time Status. See Table 8 page 27 Novatel OEMStar Manual
|
||||
* @param receiverStatus Status Bitfield. See table 69 page 350 Novatel OEMstar Manual
|
||||
* @param solStatus solution Status. See table 44 page 197
|
||||
* @param posType position type. See table 43 page 196
|
||||
* @param velType velocity type. See table 43 page 196
|
||||
* @param posSolAge [s] Age of the position solution
|
||||
* @param csFails Times the CRC has failed since boot
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_novatel_diag_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t timeStatus, uint32_t receiverStatus, uint8_t solStatus, uint8_t posType, uint8_t velType, float posSolAge, uint16_t csFails)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NOVATEL_DIAG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, receiverStatus);
|
||||
_mav_put_float(buf, 4, posSolAge);
|
||||
_mav_put_uint16_t(buf, 8, csFails);
|
||||
_mav_put_uint8_t(buf, 10, timeStatus);
|
||||
_mav_put_uint8_t(buf, 11, solStatus);
|
||||
_mav_put_uint8_t(buf, 12, posType);
|
||||
_mav_put_uint8_t(buf, 13, velType);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN);
|
||||
#else
|
||||
mavlink_novatel_diag_t packet;
|
||||
packet.receiverStatus = receiverStatus;
|
||||
packet.posSolAge = posSolAge;
|
||||
packet.csFails = csFails;
|
||||
packet.timeStatus = timeStatus;
|
||||
packet.solStatus = solStatus;
|
||||
packet.posType = posType;
|
||||
packet.velType = velType;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NOVATEL_DIAG;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NOVATEL_DIAG_MIN_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a novatel_diag 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 timeStatus The Time Status. See Table 8 page 27 Novatel OEMStar Manual
|
||||
* @param receiverStatus Status Bitfield. See table 69 page 350 Novatel OEMstar Manual
|
||||
* @param solStatus solution Status. See table 44 page 197
|
||||
* @param posType position type. See table 43 page 196
|
||||
* @param velType velocity type. See table 43 page 196
|
||||
* @param posSolAge [s] Age of the position solution
|
||||
* @param csFails Times the CRC has failed since boot
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_novatel_diag_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t timeStatus,uint32_t receiverStatus,uint8_t solStatus,uint8_t posType,uint8_t velType,float posSolAge,uint16_t csFails)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NOVATEL_DIAG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, receiverStatus);
|
||||
_mav_put_float(buf, 4, posSolAge);
|
||||
_mav_put_uint16_t(buf, 8, csFails);
|
||||
_mav_put_uint8_t(buf, 10, timeStatus);
|
||||
_mav_put_uint8_t(buf, 11, solStatus);
|
||||
_mav_put_uint8_t(buf, 12, posType);
|
||||
_mav_put_uint8_t(buf, 13, velType);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN);
|
||||
#else
|
||||
mavlink_novatel_diag_t packet;
|
||||
packet.receiverStatus = receiverStatus;
|
||||
packet.posSolAge = posSolAge;
|
||||
packet.csFails = csFails;
|
||||
packet.timeStatus = timeStatus;
|
||||
packet.solStatus = solStatus;
|
||||
packet.posType = posType;
|
||||
packet.velType = velType;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NOVATEL_DIAG;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NOVATEL_DIAG_MIN_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a novatel_diag 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 novatel_diag C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_novatel_diag_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_novatel_diag_t* novatel_diag)
|
||||
{
|
||||
return mavlink_msg_novatel_diag_pack(system_id, component_id, msg, novatel_diag->timeStatus, novatel_diag->receiverStatus, novatel_diag->solStatus, novatel_diag->posType, novatel_diag->velType, novatel_diag->posSolAge, novatel_diag->csFails);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a novatel_diag 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 novatel_diag C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_novatel_diag_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_novatel_diag_t* novatel_diag)
|
||||
{
|
||||
return mavlink_msg_novatel_diag_pack_chan(system_id, component_id, chan, msg, novatel_diag->timeStatus, novatel_diag->receiverStatus, novatel_diag->solStatus, novatel_diag->posType, novatel_diag->velType, novatel_diag->posSolAge, novatel_diag->csFails);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a novatel_diag message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param timeStatus The Time Status. See Table 8 page 27 Novatel OEMStar Manual
|
||||
* @param receiverStatus Status Bitfield. See table 69 page 350 Novatel OEMstar Manual
|
||||
* @param solStatus solution Status. See table 44 page 197
|
||||
* @param posType position type. See table 43 page 196
|
||||
* @param velType velocity type. See table 43 page 196
|
||||
* @param posSolAge [s] Age of the position solution
|
||||
* @param csFails Times the CRC has failed since boot
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_novatel_diag_send(mavlink_channel_t chan, uint8_t timeStatus, uint32_t receiverStatus, uint8_t solStatus, uint8_t posType, uint8_t velType, float posSolAge, uint16_t csFails)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_NOVATEL_DIAG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, receiverStatus);
|
||||
_mav_put_float(buf, 4, posSolAge);
|
||||
_mav_put_uint16_t(buf, 8, csFails);
|
||||
_mav_put_uint8_t(buf, 10, timeStatus);
|
||||
_mav_put_uint8_t(buf, 11, solStatus);
|
||||
_mav_put_uint8_t(buf, 12, posType);
|
||||
_mav_put_uint8_t(buf, 13, velType);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NOVATEL_DIAG, buf, MAVLINK_MSG_ID_NOVATEL_DIAG_MIN_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_CRC);
|
||||
#else
|
||||
mavlink_novatel_diag_t packet;
|
||||
packet.receiverStatus = receiverStatus;
|
||||
packet.posSolAge = posSolAge;
|
||||
packet.csFails = csFails;
|
||||
packet.timeStatus = timeStatus;
|
||||
packet.solStatus = solStatus;
|
||||
packet.posType = posType;
|
||||
packet.velType = velType;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NOVATEL_DIAG, (const char *)&packet, MAVLINK_MSG_ID_NOVATEL_DIAG_MIN_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a novatel_diag message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_novatel_diag_send_struct(mavlink_channel_t chan, const mavlink_novatel_diag_t* novatel_diag)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_novatel_diag_send(chan, novatel_diag->timeStatus, novatel_diag->receiverStatus, novatel_diag->solStatus, novatel_diag->posType, novatel_diag->velType, novatel_diag->posSolAge, novatel_diag->csFails);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NOVATEL_DIAG, (const char *)novatel_diag, MAVLINK_MSG_ID_NOVATEL_DIAG_MIN_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_NOVATEL_DIAG_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_novatel_diag_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t timeStatus, uint32_t receiverStatus, uint8_t solStatus, uint8_t posType, uint8_t velType, float posSolAge, uint16_t csFails)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, receiverStatus);
|
||||
_mav_put_float(buf, 4, posSolAge);
|
||||
_mav_put_uint16_t(buf, 8, csFails);
|
||||
_mav_put_uint8_t(buf, 10, timeStatus);
|
||||
_mav_put_uint8_t(buf, 11, solStatus);
|
||||
_mav_put_uint8_t(buf, 12, posType);
|
||||
_mav_put_uint8_t(buf, 13, velType);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NOVATEL_DIAG, buf, MAVLINK_MSG_ID_NOVATEL_DIAG_MIN_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_CRC);
|
||||
#else
|
||||
mavlink_novatel_diag_t *packet = (mavlink_novatel_diag_t *)msgbuf;
|
||||
packet->receiverStatus = receiverStatus;
|
||||
packet->posSolAge = posSolAge;
|
||||
packet->csFails = csFails;
|
||||
packet->timeStatus = timeStatus;
|
||||
packet->solStatus = solStatus;
|
||||
packet->posType = posType;
|
||||
packet->velType = velType;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NOVATEL_DIAG, (const char *)packet, MAVLINK_MSG_ID_NOVATEL_DIAG_MIN_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN, MAVLINK_MSG_ID_NOVATEL_DIAG_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE NOVATEL_DIAG UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field timeStatus from novatel_diag message
|
||||
*
|
||||
* @return The Time Status. See Table 8 page 27 Novatel OEMStar Manual
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_novatel_diag_get_timeStatus(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field receiverStatus from novatel_diag message
|
||||
*
|
||||
* @return Status Bitfield. See table 69 page 350 Novatel OEMstar Manual
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_novatel_diag_get_receiverStatus(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field solStatus from novatel_diag message
|
||||
*
|
||||
* @return solution Status. See table 44 page 197
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_novatel_diag_get_solStatus(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field posType from novatel_diag message
|
||||
*
|
||||
* @return position type. See table 43 page 196
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_novatel_diag_get_posType(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field velType from novatel_diag message
|
||||
*
|
||||
* @return velocity type. See table 43 page 196
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_novatel_diag_get_velType(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field posSolAge from novatel_diag message
|
||||
*
|
||||
* @return [s] Age of the position solution
|
||||
*/
|
||||
static inline float mavlink_msg_novatel_diag_get_posSolAge(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field csFails from novatel_diag message
|
||||
*
|
||||
* @return Times the CRC has failed since boot
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_novatel_diag_get_csFails(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a novatel_diag message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param novatel_diag C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_novatel_diag_decode(const mavlink_message_t* msg, mavlink_novatel_diag_t* novatel_diag)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
novatel_diag->receiverStatus = mavlink_msg_novatel_diag_get_receiverStatus(msg);
|
||||
novatel_diag->posSolAge = mavlink_msg_novatel_diag_get_posSolAge(msg);
|
||||
novatel_diag->csFails = mavlink_msg_novatel_diag_get_csFails(msg);
|
||||
novatel_diag->timeStatus = mavlink_msg_novatel_diag_get_timeStatus(msg);
|
||||
novatel_diag->solStatus = mavlink_msg_novatel_diag_get_solStatus(msg);
|
||||
novatel_diag->posType = mavlink_msg_novatel_diag_get_posType(msg);
|
||||
novatel_diag->velType = mavlink_msg_novatel_diag_get_velType(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_NOVATEL_DIAG_LEN? msg->len : MAVLINK_MSG_ID_NOVATEL_DIAG_LEN;
|
||||
memset(novatel_diag, 0, MAVLINK_MSG_ID_NOVATEL_DIAG_LEN);
|
||||
memcpy(novatel_diag, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE PTZ_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_PTZ_STATUS 192
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_ptz_status_t {
|
||||
int16_t pan; /*< The Pan value in 10ths of degree*/
|
||||
int16_t tilt; /*< The Tilt value in 10ths of degree*/
|
||||
uint8_t zoom; /*< The actual Zoom Value*/
|
||||
}) mavlink_ptz_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_PTZ_STATUS_LEN 5
|
||||
#define MAVLINK_MSG_ID_PTZ_STATUS_MIN_LEN 5
|
||||
#define MAVLINK_MSG_ID_192_LEN 5
|
||||
#define MAVLINK_MSG_ID_192_MIN_LEN 5
|
||||
|
||||
#define MAVLINK_MSG_ID_PTZ_STATUS_CRC 187
|
||||
#define MAVLINK_MSG_ID_192_CRC 187
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_PTZ_STATUS { \
|
||||
192, \
|
||||
"PTZ_STATUS", \
|
||||
3, \
|
||||
{ { "zoom", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_ptz_status_t, zoom) }, \
|
||||
{ "pan", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_ptz_status_t, pan) }, \
|
||||
{ "tilt", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_ptz_status_t, tilt) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_PTZ_STATUS { \
|
||||
"PTZ_STATUS", \
|
||||
3, \
|
||||
{ { "zoom", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_ptz_status_t, zoom) }, \
|
||||
{ "pan", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_ptz_status_t, pan) }, \
|
||||
{ "tilt", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_ptz_status_t, tilt) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a ptz_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 zoom The actual Zoom Value
|
||||
* @param pan The Pan value in 10ths of degree
|
||||
* @param tilt The Tilt value in 10ths of degree
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ptz_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t zoom, int16_t pan, int16_t tilt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_PTZ_STATUS_LEN];
|
||||
_mav_put_int16_t(buf, 0, pan);
|
||||
_mav_put_int16_t(buf, 2, tilt);
|
||||
_mav_put_uint8_t(buf, 4, zoom);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PTZ_STATUS_LEN);
|
||||
#else
|
||||
mavlink_ptz_status_t packet;
|
||||
packet.pan = pan;
|
||||
packet.tilt = tilt;
|
||||
packet.zoom = zoom;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PTZ_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PTZ_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PTZ_STATUS_MIN_LEN, MAVLINK_MSG_ID_PTZ_STATUS_LEN, MAVLINK_MSG_ID_PTZ_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a ptz_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 zoom The actual Zoom Value
|
||||
* @param pan The Pan value in 10ths of degree
|
||||
* @param tilt The Tilt value in 10ths of degree
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ptz_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t zoom,int16_t pan,int16_t tilt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_PTZ_STATUS_LEN];
|
||||
_mav_put_int16_t(buf, 0, pan);
|
||||
_mav_put_int16_t(buf, 2, tilt);
|
||||
_mav_put_uint8_t(buf, 4, zoom);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PTZ_STATUS_LEN);
|
||||
#else
|
||||
mavlink_ptz_status_t packet;
|
||||
packet.pan = pan;
|
||||
packet.tilt = tilt;
|
||||
packet.zoom = zoom;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PTZ_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PTZ_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PTZ_STATUS_MIN_LEN, MAVLINK_MSG_ID_PTZ_STATUS_LEN, MAVLINK_MSG_ID_PTZ_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ptz_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 ptz_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ptz_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ptz_status_t* ptz_status)
|
||||
{
|
||||
return mavlink_msg_ptz_status_pack(system_id, component_id, msg, ptz_status->zoom, ptz_status->pan, ptz_status->tilt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ptz_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 ptz_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ptz_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ptz_status_t* ptz_status)
|
||||
{
|
||||
return mavlink_msg_ptz_status_pack_chan(system_id, component_id, chan, msg, ptz_status->zoom, ptz_status->pan, ptz_status->tilt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ptz_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param zoom The actual Zoom Value
|
||||
* @param pan The Pan value in 10ths of degree
|
||||
* @param tilt The Tilt value in 10ths of degree
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_ptz_status_send(mavlink_channel_t chan, uint8_t zoom, int16_t pan, int16_t tilt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_PTZ_STATUS_LEN];
|
||||
_mav_put_int16_t(buf, 0, pan);
|
||||
_mav_put_int16_t(buf, 2, tilt);
|
||||
_mav_put_uint8_t(buf, 4, zoom);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PTZ_STATUS, buf, MAVLINK_MSG_ID_PTZ_STATUS_MIN_LEN, MAVLINK_MSG_ID_PTZ_STATUS_LEN, MAVLINK_MSG_ID_PTZ_STATUS_CRC);
|
||||
#else
|
||||
mavlink_ptz_status_t packet;
|
||||
packet.pan = pan;
|
||||
packet.tilt = tilt;
|
||||
packet.zoom = zoom;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PTZ_STATUS, (const char *)&packet, MAVLINK_MSG_ID_PTZ_STATUS_MIN_LEN, MAVLINK_MSG_ID_PTZ_STATUS_LEN, MAVLINK_MSG_ID_PTZ_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ptz_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_ptz_status_send_struct(mavlink_channel_t chan, const mavlink_ptz_status_t* ptz_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_ptz_status_send(chan, ptz_status->zoom, ptz_status->pan, ptz_status->tilt);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PTZ_STATUS, (const char *)ptz_status, MAVLINK_MSG_ID_PTZ_STATUS_MIN_LEN, MAVLINK_MSG_ID_PTZ_STATUS_LEN, MAVLINK_MSG_ID_PTZ_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_PTZ_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_ptz_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t zoom, int16_t pan, int16_t tilt)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int16_t(buf, 0, pan);
|
||||
_mav_put_int16_t(buf, 2, tilt);
|
||||
_mav_put_uint8_t(buf, 4, zoom);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PTZ_STATUS, buf, MAVLINK_MSG_ID_PTZ_STATUS_MIN_LEN, MAVLINK_MSG_ID_PTZ_STATUS_LEN, MAVLINK_MSG_ID_PTZ_STATUS_CRC);
|
||||
#else
|
||||
mavlink_ptz_status_t *packet = (mavlink_ptz_status_t *)msgbuf;
|
||||
packet->pan = pan;
|
||||
packet->tilt = tilt;
|
||||
packet->zoom = zoom;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PTZ_STATUS, (const char *)packet, MAVLINK_MSG_ID_PTZ_STATUS_MIN_LEN, MAVLINK_MSG_ID_PTZ_STATUS_LEN, MAVLINK_MSG_ID_PTZ_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE PTZ_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field zoom from ptz_status message
|
||||
*
|
||||
* @return The actual Zoom Value
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_ptz_status_get_zoom(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pan from ptz_status message
|
||||
*
|
||||
* @return The Pan value in 10ths of degree
|
||||
*/
|
||||
static inline int16_t mavlink_msg_ptz_status_get_pan(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tilt from ptz_status message
|
||||
*
|
||||
* @return The Tilt value in 10ths of degree
|
||||
*/
|
||||
static inline int16_t mavlink_msg_ptz_status_get_tilt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a ptz_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param ptz_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_ptz_status_decode(const mavlink_message_t* msg, mavlink_ptz_status_t* ptz_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
ptz_status->pan = mavlink_msg_ptz_status_get_pan(msg);
|
||||
ptz_status->tilt = mavlink_msg_ptz_status_get_tilt(msg);
|
||||
ptz_status->zoom = mavlink_msg_ptz_status_get_zoom(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_PTZ_STATUS_LEN? msg->len : MAVLINK_MSG_ID_PTZ_STATUS_LEN;
|
||||
memset(ptz_status, 0, MAVLINK_MSG_ID_PTZ_STATUS_LEN);
|
||||
memcpy(ptz_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
#pragma once
|
||||
// MESSAGE SENSOR_BIAS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_BIAS 172
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_sensor_bias_t {
|
||||
float axBias; /*< [m/s] Accelerometer X bias*/
|
||||
float ayBias; /*< [m/s] Accelerometer Y bias*/
|
||||
float azBias; /*< [m/s] Accelerometer Z bias*/
|
||||
float gxBias; /*< [rad/s] Gyro X bias*/
|
||||
float gyBias; /*< [rad/s] Gyro Y bias*/
|
||||
float gzBias; /*< [rad/s] Gyro Z bias*/
|
||||
}) mavlink_sensor_bias_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_BIAS_LEN 24
|
||||
#define MAVLINK_MSG_ID_SENSOR_BIAS_MIN_LEN 24
|
||||
#define MAVLINK_MSG_ID_172_LEN 24
|
||||
#define MAVLINK_MSG_ID_172_MIN_LEN 24
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_BIAS_CRC 168
|
||||
#define MAVLINK_MSG_ID_172_CRC 168
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SENSOR_BIAS { \
|
||||
172, \
|
||||
"SENSOR_BIAS", \
|
||||
6, \
|
||||
{ { "axBias", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_bias_t, axBias) }, \
|
||||
{ "ayBias", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sensor_bias_t, ayBias) }, \
|
||||
{ "azBias", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sensor_bias_t, azBias) }, \
|
||||
{ "gxBias", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_bias_t, gxBias) }, \
|
||||
{ "gyBias", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_bias_t, gyBias) }, \
|
||||
{ "gzBias", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_bias_t, gzBias) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_SENSOR_BIAS { \
|
||||
"SENSOR_BIAS", \
|
||||
6, \
|
||||
{ { "axBias", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_bias_t, axBias) }, \
|
||||
{ "ayBias", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sensor_bias_t, ayBias) }, \
|
||||
{ "azBias", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sensor_bias_t, azBias) }, \
|
||||
{ "gxBias", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_bias_t, gxBias) }, \
|
||||
{ "gyBias", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_bias_t, gyBias) }, \
|
||||
{ "gzBias", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_bias_t, gzBias) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a sensor_bias 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 axBias [m/s] Accelerometer X bias
|
||||
* @param ayBias [m/s] Accelerometer Y bias
|
||||
* @param azBias [m/s] Accelerometer Z bias
|
||||
* @param gxBias [rad/s] Gyro X bias
|
||||
* @param gyBias [rad/s] Gyro Y bias
|
||||
* @param gzBias [rad/s] Gyro Z bias
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_bias_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float axBias, float ayBias, float azBias, float gxBias, float gyBias, float gzBias)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_BIAS_LEN];
|
||||
_mav_put_float(buf, 0, axBias);
|
||||
_mav_put_float(buf, 4, ayBias);
|
||||
_mav_put_float(buf, 8, azBias);
|
||||
_mav_put_float(buf, 12, gxBias);
|
||||
_mav_put_float(buf, 16, gyBias);
|
||||
_mav_put_float(buf, 20, gzBias);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_BIAS_LEN);
|
||||
#else
|
||||
mavlink_sensor_bias_t packet;
|
||||
packet.axBias = axBias;
|
||||
packet.ayBias = ayBias;
|
||||
packet.azBias = azBias;
|
||||
packet.gxBias = gxBias;
|
||||
packet.gyBias = gyBias;
|
||||
packet.gzBias = gzBias;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_BIAS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_BIAS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENSOR_BIAS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a sensor_bias 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 axBias [m/s] Accelerometer X bias
|
||||
* @param ayBias [m/s] Accelerometer Y bias
|
||||
* @param azBias [m/s] Accelerometer Z bias
|
||||
* @param gxBias [rad/s] Gyro X bias
|
||||
* @param gyBias [rad/s] Gyro Y bias
|
||||
* @param gzBias [rad/s] Gyro Z bias
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_bias_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float axBias,float ayBias,float azBias,float gxBias,float gyBias,float gzBias)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_BIAS_LEN];
|
||||
_mav_put_float(buf, 0, axBias);
|
||||
_mav_put_float(buf, 4, ayBias);
|
||||
_mav_put_float(buf, 8, azBias);
|
||||
_mav_put_float(buf, 12, gxBias);
|
||||
_mav_put_float(buf, 16, gyBias);
|
||||
_mav_put_float(buf, 20, gzBias);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_BIAS_LEN);
|
||||
#else
|
||||
mavlink_sensor_bias_t packet;
|
||||
packet.axBias = axBias;
|
||||
packet.ayBias = ayBias;
|
||||
packet.azBias = azBias;
|
||||
packet.gxBias = gxBias;
|
||||
packet.gyBias = gyBias;
|
||||
packet.gzBias = gzBias;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_BIAS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_BIAS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENSOR_BIAS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a sensor_bias 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 sensor_bias C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_bias_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sensor_bias_t* sensor_bias)
|
||||
{
|
||||
return mavlink_msg_sensor_bias_pack(system_id, component_id, msg, sensor_bias->axBias, sensor_bias->ayBias, sensor_bias->azBias, sensor_bias->gxBias, sensor_bias->gyBias, sensor_bias->gzBias);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a sensor_bias 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 sensor_bias C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_bias_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sensor_bias_t* sensor_bias)
|
||||
{
|
||||
return mavlink_msg_sensor_bias_pack_chan(system_id, component_id, chan, msg, sensor_bias->axBias, sensor_bias->ayBias, sensor_bias->azBias, sensor_bias->gxBias, sensor_bias->gyBias, sensor_bias->gzBias);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a sensor_bias message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param axBias [m/s] Accelerometer X bias
|
||||
* @param ayBias [m/s] Accelerometer Y bias
|
||||
* @param azBias [m/s] Accelerometer Z bias
|
||||
* @param gxBias [rad/s] Gyro X bias
|
||||
* @param gyBias [rad/s] Gyro Y bias
|
||||
* @param gzBias [rad/s] Gyro Z bias
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_sensor_bias_send(mavlink_channel_t chan, float axBias, float ayBias, float azBias, float gxBias, float gyBias, float gzBias)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_BIAS_LEN];
|
||||
_mav_put_float(buf, 0, axBias);
|
||||
_mav_put_float(buf, 4, ayBias);
|
||||
_mav_put_float(buf, 8, azBias);
|
||||
_mav_put_float(buf, 12, gxBias);
|
||||
_mav_put_float(buf, 16, gyBias);
|
||||
_mav_put_float(buf, 20, gzBias);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_BIAS, buf, MAVLINK_MSG_ID_SENSOR_BIAS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_CRC);
|
||||
#else
|
||||
mavlink_sensor_bias_t packet;
|
||||
packet.axBias = axBias;
|
||||
packet.ayBias = ayBias;
|
||||
packet.azBias = azBias;
|
||||
packet.gxBias = gxBias;
|
||||
packet.gyBias = gyBias;
|
||||
packet.gzBias = gzBias;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_BIAS, (const char *)&packet, MAVLINK_MSG_ID_SENSOR_BIAS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a sensor_bias message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_sensor_bias_send_struct(mavlink_channel_t chan, const mavlink_sensor_bias_t* sensor_bias)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_sensor_bias_send(chan, sensor_bias->axBias, sensor_bias->ayBias, sensor_bias->azBias, sensor_bias->gxBias, sensor_bias->gyBias, sensor_bias->gzBias);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_BIAS, (const char *)sensor_bias, MAVLINK_MSG_ID_SENSOR_BIAS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SENSOR_BIAS_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_sensor_bias_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float axBias, float ayBias, float azBias, float gxBias, float gyBias, float gzBias)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, axBias);
|
||||
_mav_put_float(buf, 4, ayBias);
|
||||
_mav_put_float(buf, 8, azBias);
|
||||
_mav_put_float(buf, 12, gxBias);
|
||||
_mav_put_float(buf, 16, gyBias);
|
||||
_mav_put_float(buf, 20, gzBias);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_BIAS, buf, MAVLINK_MSG_ID_SENSOR_BIAS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_CRC);
|
||||
#else
|
||||
mavlink_sensor_bias_t *packet = (mavlink_sensor_bias_t *)msgbuf;
|
||||
packet->axBias = axBias;
|
||||
packet->ayBias = ayBias;
|
||||
packet->azBias = azBias;
|
||||
packet->gxBias = gxBias;
|
||||
packet->gyBias = gyBias;
|
||||
packet->gzBias = gzBias;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_BIAS, (const char *)packet, MAVLINK_MSG_ID_SENSOR_BIAS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_LEN, MAVLINK_MSG_ID_SENSOR_BIAS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SENSOR_BIAS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field axBias from sensor_bias message
|
||||
*
|
||||
* @return [m/s] Accelerometer X bias
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_bias_get_axBias(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ayBias from sensor_bias message
|
||||
*
|
||||
* @return [m/s] Accelerometer Y bias
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_bias_get_ayBias(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field azBias from sensor_bias message
|
||||
*
|
||||
* @return [m/s] Accelerometer Z bias
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_bias_get_azBias(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gxBias from sensor_bias message
|
||||
*
|
||||
* @return [rad/s] Gyro X bias
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_bias_get_gxBias(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gyBias from sensor_bias message
|
||||
*
|
||||
* @return [rad/s] Gyro Y bias
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_bias_get_gyBias(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gzBias from sensor_bias message
|
||||
*
|
||||
* @return [rad/s] Gyro Z bias
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_bias_get_gzBias(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a sensor_bias message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param sensor_bias C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_sensor_bias_decode(const mavlink_message_t* msg, mavlink_sensor_bias_t* sensor_bias)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
sensor_bias->axBias = mavlink_msg_sensor_bias_get_axBias(msg);
|
||||
sensor_bias->ayBias = mavlink_msg_sensor_bias_get_ayBias(msg);
|
||||
sensor_bias->azBias = mavlink_msg_sensor_bias_get_azBias(msg);
|
||||
sensor_bias->gxBias = mavlink_msg_sensor_bias_get_gxBias(msg);
|
||||
sensor_bias->gyBias = mavlink_msg_sensor_bias_get_gyBias(msg);
|
||||
sensor_bias->gzBias = mavlink_msg_sensor_bias_get_gzBias(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SENSOR_BIAS_LEN? msg->len : MAVLINK_MSG_ID_SENSOR_BIAS_LEN;
|
||||
memset(sensor_bias, 0, MAVLINK_MSG_ID_SENSOR_BIAS_LEN);
|
||||
memcpy(sensor_bias, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
#pragma once
|
||||
// MESSAGE SENSOR_DIAG PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_DIAG 196
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_sensor_diag_t {
|
||||
float float1; /*< Float field 1*/
|
||||
float float2; /*< Float field 2*/
|
||||
int16_t int1; /*< Int 16 field 1*/
|
||||
int8_t char1; /*< Int 8 field 1*/
|
||||
}) mavlink_sensor_diag_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_DIAG_LEN 11
|
||||
#define MAVLINK_MSG_ID_SENSOR_DIAG_MIN_LEN 11
|
||||
#define MAVLINK_MSG_ID_196_LEN 11
|
||||
#define MAVLINK_MSG_ID_196_MIN_LEN 11
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_DIAG_CRC 129
|
||||
#define MAVLINK_MSG_ID_196_CRC 129
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SENSOR_DIAG { \
|
||||
196, \
|
||||
"SENSOR_DIAG", \
|
||||
4, \
|
||||
{ { "float1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_diag_t, float1) }, \
|
||||
{ "float2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sensor_diag_t, float2) }, \
|
||||
{ "int1", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_sensor_diag_t, int1) }, \
|
||||
{ "char1", NULL, MAVLINK_TYPE_INT8_T, 0, 10, offsetof(mavlink_sensor_diag_t, char1) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_SENSOR_DIAG { \
|
||||
"SENSOR_DIAG", \
|
||||
4, \
|
||||
{ { "float1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_diag_t, float1) }, \
|
||||
{ "float2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_sensor_diag_t, float2) }, \
|
||||
{ "int1", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_sensor_diag_t, int1) }, \
|
||||
{ "char1", NULL, MAVLINK_TYPE_INT8_T, 0, 10, offsetof(mavlink_sensor_diag_t, char1) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a sensor_diag 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 float1 Float field 1
|
||||
* @param float2 Float field 2
|
||||
* @param int1 Int 16 field 1
|
||||
* @param char1 Int 8 field 1
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_diag_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float float1, float float2, int16_t int1, int8_t char1)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_DIAG_LEN];
|
||||
_mav_put_float(buf, 0, float1);
|
||||
_mav_put_float(buf, 4, float2);
|
||||
_mav_put_int16_t(buf, 8, int1);
|
||||
_mav_put_int8_t(buf, 10, char1);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_DIAG_LEN);
|
||||
#else
|
||||
mavlink_sensor_diag_t packet;
|
||||
packet.float1 = float1;
|
||||
packet.float2 = float2;
|
||||
packet.int1 = int1;
|
||||
packet.char1 = char1;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_DIAG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_DIAG;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENSOR_DIAG_MIN_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a sensor_diag 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 float1 Float field 1
|
||||
* @param float2 Float field 2
|
||||
* @param int1 Int 16 field 1
|
||||
* @param char1 Int 8 field 1
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_diag_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float float1,float float2,int16_t int1,int8_t char1)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_DIAG_LEN];
|
||||
_mav_put_float(buf, 0, float1);
|
||||
_mav_put_float(buf, 4, float2);
|
||||
_mav_put_int16_t(buf, 8, int1);
|
||||
_mav_put_int8_t(buf, 10, char1);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_DIAG_LEN);
|
||||
#else
|
||||
mavlink_sensor_diag_t packet;
|
||||
packet.float1 = float1;
|
||||
packet.float2 = float2;
|
||||
packet.int1 = int1;
|
||||
packet.char1 = char1;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_DIAG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_DIAG;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENSOR_DIAG_MIN_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a sensor_diag 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 sensor_diag C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_diag_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sensor_diag_t* sensor_diag)
|
||||
{
|
||||
return mavlink_msg_sensor_diag_pack(system_id, component_id, msg, sensor_diag->float1, sensor_diag->float2, sensor_diag->int1, sensor_diag->char1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a sensor_diag 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 sensor_diag C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_diag_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sensor_diag_t* sensor_diag)
|
||||
{
|
||||
return mavlink_msg_sensor_diag_pack_chan(system_id, component_id, chan, msg, sensor_diag->float1, sensor_diag->float2, sensor_diag->int1, sensor_diag->char1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a sensor_diag message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param float1 Float field 1
|
||||
* @param float2 Float field 2
|
||||
* @param int1 Int 16 field 1
|
||||
* @param char1 Int 8 field 1
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_sensor_diag_send(mavlink_channel_t chan, float float1, float float2, int16_t int1, int8_t char1)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_DIAG_LEN];
|
||||
_mav_put_float(buf, 0, float1);
|
||||
_mav_put_float(buf, 4, float2);
|
||||
_mav_put_int16_t(buf, 8, int1);
|
||||
_mav_put_int8_t(buf, 10, char1);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_DIAG, buf, MAVLINK_MSG_ID_SENSOR_DIAG_MIN_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_CRC);
|
||||
#else
|
||||
mavlink_sensor_diag_t packet;
|
||||
packet.float1 = float1;
|
||||
packet.float2 = float2;
|
||||
packet.int1 = int1;
|
||||
packet.char1 = char1;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_DIAG, (const char *)&packet, MAVLINK_MSG_ID_SENSOR_DIAG_MIN_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a sensor_diag message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_sensor_diag_send_struct(mavlink_channel_t chan, const mavlink_sensor_diag_t* sensor_diag)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_sensor_diag_send(chan, sensor_diag->float1, sensor_diag->float2, sensor_diag->int1, sensor_diag->char1);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_DIAG, (const char *)sensor_diag, MAVLINK_MSG_ID_SENSOR_DIAG_MIN_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SENSOR_DIAG_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_sensor_diag_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float float1, float float2, int16_t int1, int8_t char1)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, float1);
|
||||
_mav_put_float(buf, 4, float2);
|
||||
_mav_put_int16_t(buf, 8, int1);
|
||||
_mav_put_int8_t(buf, 10, char1);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_DIAG, buf, MAVLINK_MSG_ID_SENSOR_DIAG_MIN_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_CRC);
|
||||
#else
|
||||
mavlink_sensor_diag_t *packet = (mavlink_sensor_diag_t *)msgbuf;
|
||||
packet->float1 = float1;
|
||||
packet->float2 = float2;
|
||||
packet->int1 = int1;
|
||||
packet->char1 = char1;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_DIAG, (const char *)packet, MAVLINK_MSG_ID_SENSOR_DIAG_MIN_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_LEN, MAVLINK_MSG_ID_SENSOR_DIAG_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SENSOR_DIAG UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field float1 from sensor_diag message
|
||||
*
|
||||
* @return Float field 1
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_diag_get_float1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field float2 from sensor_diag message
|
||||
*
|
||||
* @return Float field 2
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_diag_get_float2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field int1 from sensor_diag message
|
||||
*
|
||||
* @return Int 16 field 1
|
||||
*/
|
||||
static inline int16_t mavlink_msg_sensor_diag_get_int1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field char1 from sensor_diag message
|
||||
*
|
||||
* @return Int 8 field 1
|
||||
*/
|
||||
static inline int8_t mavlink_msg_sensor_diag_get_char1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a sensor_diag message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param sensor_diag C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_sensor_diag_decode(const mavlink_message_t* msg, mavlink_sensor_diag_t* sensor_diag)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
sensor_diag->float1 = mavlink_msg_sensor_diag_get_float1(msg);
|
||||
sensor_diag->float2 = mavlink_msg_sensor_diag_get_float2(msg);
|
||||
sensor_diag->int1 = mavlink_msg_sensor_diag_get_int1(msg);
|
||||
sensor_diag->char1 = mavlink_msg_sensor_diag_get_char1(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SENSOR_DIAG_LEN? msg->len : MAVLINK_MSG_ID_SENSOR_DIAG_LEN;
|
||||
memset(sensor_diag, 0, MAVLINK_MSG_ID_SENSOR_DIAG_LEN);
|
||||
memcpy(sensor_diag, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
#pragma once
|
||||
// MESSAGE SLUGS_CAMERA_ORDER PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER 184
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_slugs_camera_order_t {
|
||||
uint8_t target; /*< The system reporting the action*/
|
||||
int8_t pan; /*< Order the mount to pan: -1 left, 0 No pan motion, +1 right*/
|
||||
int8_t tilt; /*< Order the mount to tilt: -1 down, 0 No tilt motion, +1 up*/
|
||||
int8_t zoom; /*< Order the zoom values 0 to 10*/
|
||||
int8_t moveHome; /*< Orders the camera mount to move home. The other fields are ignored when this field is set. 1: move home, 0 ignored*/
|
||||
}) mavlink_slugs_camera_order_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN 5
|
||||
#define MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_MIN_LEN 5
|
||||
#define MAVLINK_MSG_ID_184_LEN 5
|
||||
#define MAVLINK_MSG_ID_184_MIN_LEN 5
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_CRC 45
|
||||
#define MAVLINK_MSG_ID_184_CRC 45
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SLUGS_CAMERA_ORDER { \
|
||||
184, \
|
||||
"SLUGS_CAMERA_ORDER", \
|
||||
5, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_slugs_camera_order_t, target) }, \
|
||||
{ "pan", NULL, MAVLINK_TYPE_INT8_T, 0, 1, offsetof(mavlink_slugs_camera_order_t, pan) }, \
|
||||
{ "tilt", NULL, MAVLINK_TYPE_INT8_T, 0, 2, offsetof(mavlink_slugs_camera_order_t, tilt) }, \
|
||||
{ "zoom", NULL, MAVLINK_TYPE_INT8_T, 0, 3, offsetof(mavlink_slugs_camera_order_t, zoom) }, \
|
||||
{ "moveHome", NULL, MAVLINK_TYPE_INT8_T, 0, 4, offsetof(mavlink_slugs_camera_order_t, moveHome) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_SLUGS_CAMERA_ORDER { \
|
||||
"SLUGS_CAMERA_ORDER", \
|
||||
5, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_slugs_camera_order_t, target) }, \
|
||||
{ "pan", NULL, MAVLINK_TYPE_INT8_T, 0, 1, offsetof(mavlink_slugs_camera_order_t, pan) }, \
|
||||
{ "tilt", NULL, MAVLINK_TYPE_INT8_T, 0, 2, offsetof(mavlink_slugs_camera_order_t, tilt) }, \
|
||||
{ "zoom", NULL, MAVLINK_TYPE_INT8_T, 0, 3, offsetof(mavlink_slugs_camera_order_t, zoom) }, \
|
||||
{ "moveHome", NULL, MAVLINK_TYPE_INT8_T, 0, 4, offsetof(mavlink_slugs_camera_order_t, moveHome) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a slugs_camera_order 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 reporting the action
|
||||
* @param pan Order the mount to pan: -1 left, 0 No pan motion, +1 right
|
||||
* @param tilt Order the mount to tilt: -1 down, 0 No tilt motion, +1 up
|
||||
* @param zoom Order the zoom values 0 to 10
|
||||
* @param moveHome Orders the camera mount to move home. The other fields are ignored when this field is set. 1: move home, 0 ignored
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_camera_order_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, int8_t pan, int8_t tilt, int8_t zoom, int8_t moveHome)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target);
|
||||
_mav_put_int8_t(buf, 1, pan);
|
||||
_mav_put_int8_t(buf, 2, tilt);
|
||||
_mav_put_int8_t(buf, 3, zoom);
|
||||
_mav_put_int8_t(buf, 4, moveHome);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN);
|
||||
#else
|
||||
mavlink_slugs_camera_order_t packet;
|
||||
packet.target = target;
|
||||
packet.pan = pan;
|
||||
packet.tilt = tilt;
|
||||
packet.zoom = zoom;
|
||||
packet.moveHome = moveHome;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a slugs_camera_order 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 reporting the action
|
||||
* @param pan Order the mount to pan: -1 left, 0 No pan motion, +1 right
|
||||
* @param tilt Order the mount to tilt: -1 down, 0 No tilt motion, +1 up
|
||||
* @param zoom Order the zoom values 0 to 10
|
||||
* @param moveHome Orders the camera mount to move home. The other fields are ignored when this field is set. 1: move home, 0 ignored
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_camera_order_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,int8_t pan,int8_t tilt,int8_t zoom,int8_t moveHome)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target);
|
||||
_mav_put_int8_t(buf, 1, pan);
|
||||
_mav_put_int8_t(buf, 2, tilt);
|
||||
_mav_put_int8_t(buf, 3, zoom);
|
||||
_mav_put_int8_t(buf, 4, moveHome);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN);
|
||||
#else
|
||||
mavlink_slugs_camera_order_t packet;
|
||||
packet.target = target;
|
||||
packet.pan = pan;
|
||||
packet.tilt = tilt;
|
||||
packet.zoom = zoom;
|
||||
packet.moveHome = moveHome;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a slugs_camera_order 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 slugs_camera_order C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_camera_order_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_slugs_camera_order_t* slugs_camera_order)
|
||||
{
|
||||
return mavlink_msg_slugs_camera_order_pack(system_id, component_id, msg, slugs_camera_order->target, slugs_camera_order->pan, slugs_camera_order->tilt, slugs_camera_order->zoom, slugs_camera_order->moveHome);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a slugs_camera_order 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 slugs_camera_order C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_camera_order_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_slugs_camera_order_t* slugs_camera_order)
|
||||
{
|
||||
return mavlink_msg_slugs_camera_order_pack_chan(system_id, component_id, chan, msg, slugs_camera_order->target, slugs_camera_order->pan, slugs_camera_order->tilt, slugs_camera_order->zoom, slugs_camera_order->moveHome);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a slugs_camera_order message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system reporting the action
|
||||
* @param pan Order the mount to pan: -1 left, 0 No pan motion, +1 right
|
||||
* @param tilt Order the mount to tilt: -1 down, 0 No tilt motion, +1 up
|
||||
* @param zoom Order the zoom values 0 to 10
|
||||
* @param moveHome Orders the camera mount to move home. The other fields are ignored when this field is set. 1: move home, 0 ignored
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_slugs_camera_order_send(mavlink_channel_t chan, uint8_t target, int8_t pan, int8_t tilt, int8_t zoom, int8_t moveHome)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target);
|
||||
_mav_put_int8_t(buf, 1, pan);
|
||||
_mav_put_int8_t(buf, 2, tilt);
|
||||
_mav_put_int8_t(buf, 3, zoom);
|
||||
_mav_put_int8_t(buf, 4, moveHome);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER, buf, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_CRC);
|
||||
#else
|
||||
mavlink_slugs_camera_order_t packet;
|
||||
packet.target = target;
|
||||
packet.pan = pan;
|
||||
packet.tilt = tilt;
|
||||
packet.zoom = zoom;
|
||||
packet.moveHome = moveHome;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER, (const char *)&packet, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a slugs_camera_order message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_slugs_camera_order_send_struct(mavlink_channel_t chan, const mavlink_slugs_camera_order_t* slugs_camera_order)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_slugs_camera_order_send(chan, slugs_camera_order->target, slugs_camera_order->pan, slugs_camera_order->tilt, slugs_camera_order->zoom, slugs_camera_order->moveHome);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER, (const char *)slugs_camera_order, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_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_slugs_camera_order_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, int8_t pan, int8_t tilt, int8_t zoom, int8_t moveHome)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target);
|
||||
_mav_put_int8_t(buf, 1, pan);
|
||||
_mav_put_int8_t(buf, 2, tilt);
|
||||
_mav_put_int8_t(buf, 3, zoom);
|
||||
_mav_put_int8_t(buf, 4, moveHome);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER, buf, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_CRC);
|
||||
#else
|
||||
mavlink_slugs_camera_order_t *packet = (mavlink_slugs_camera_order_t *)msgbuf;
|
||||
packet->target = target;
|
||||
packet->pan = pan;
|
||||
packet->tilt = tilt;
|
||||
packet->zoom = zoom;
|
||||
packet->moveHome = moveHome;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER, (const char *)packet, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SLUGS_CAMERA_ORDER UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from slugs_camera_order message
|
||||
*
|
||||
* @return The system reporting the action
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_slugs_camera_order_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pan from slugs_camera_order message
|
||||
*
|
||||
* @return Order the mount to pan: -1 left, 0 No pan motion, +1 right
|
||||
*/
|
||||
static inline int8_t mavlink_msg_slugs_camera_order_get_pan(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tilt from slugs_camera_order message
|
||||
*
|
||||
* @return Order the mount to tilt: -1 down, 0 No tilt motion, +1 up
|
||||
*/
|
||||
static inline int8_t mavlink_msg_slugs_camera_order_get_tilt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zoom from slugs_camera_order message
|
||||
*
|
||||
* @return Order the zoom values 0 to 10
|
||||
*/
|
||||
static inline int8_t mavlink_msg_slugs_camera_order_get_zoom(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field moveHome from slugs_camera_order message
|
||||
*
|
||||
* @return Orders the camera mount to move home. The other fields are ignored when this field is set. 1: move home, 0 ignored
|
||||
*/
|
||||
static inline int8_t mavlink_msg_slugs_camera_order_get_moveHome(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a slugs_camera_order message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param slugs_camera_order C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_slugs_camera_order_decode(const mavlink_message_t* msg, mavlink_slugs_camera_order_t* slugs_camera_order)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
slugs_camera_order->target = mavlink_msg_slugs_camera_order_get_target(msg);
|
||||
slugs_camera_order->pan = mavlink_msg_slugs_camera_order_get_pan(msg);
|
||||
slugs_camera_order->tilt = mavlink_msg_slugs_camera_order_get_tilt(msg);
|
||||
slugs_camera_order->zoom = mavlink_msg_slugs_camera_order_get_zoom(msg);
|
||||
slugs_camera_order->moveHome = mavlink_msg_slugs_camera_order_get_moveHome(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN? msg->len : MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN;
|
||||
memset(slugs_camera_order, 0, MAVLINK_MSG_ID_SLUGS_CAMERA_ORDER_LEN);
|
||||
memcpy(slugs_camera_order, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE SLUGS_CONFIGURATION_CAMERA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA 188
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_slugs_configuration_camera_t {
|
||||
uint8_t target; /*< The system setting the commands*/
|
||||
uint8_t idOrder; /*< ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight*/
|
||||
uint8_t order; /*< 1: up/on 2: down/off 3: auto/reset/no action*/
|
||||
}) mavlink_slugs_configuration_camera_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN 3
|
||||
#define MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_188_LEN 3
|
||||
#define MAVLINK_MSG_ID_188_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC 5
|
||||
#define MAVLINK_MSG_ID_188_CRC 5
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SLUGS_CONFIGURATION_CAMERA { \
|
||||
188, \
|
||||
"SLUGS_CONFIGURATION_CAMERA", \
|
||||
3, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_slugs_configuration_camera_t, target) }, \
|
||||
{ "idOrder", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_slugs_configuration_camera_t, idOrder) }, \
|
||||
{ "order", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_slugs_configuration_camera_t, order) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_SLUGS_CONFIGURATION_CAMERA { \
|
||||
"SLUGS_CONFIGURATION_CAMERA", \
|
||||
3, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_slugs_configuration_camera_t, target) }, \
|
||||
{ "idOrder", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_slugs_configuration_camera_t, idOrder) }, \
|
||||
{ "order", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_slugs_configuration_camera_t, order) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a slugs_configuration_camera 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 setting the commands
|
||||
* @param idOrder ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight
|
||||
* @param order 1: up/on 2: down/off 3: auto/reset/no action
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_configuration_camera_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, uint8_t idOrder, uint8_t order)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target);
|
||||
_mav_put_uint8_t(buf, 1, idOrder);
|
||||
_mav_put_uint8_t(buf, 2, order);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
|
||||
#else
|
||||
mavlink_slugs_configuration_camera_t packet;
|
||||
packet.target = target;
|
||||
packet.idOrder = idOrder;
|
||||
packet.order = order;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a slugs_configuration_camera 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 setting the commands
|
||||
* @param idOrder ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight
|
||||
* @param order 1: up/on 2: down/off 3: auto/reset/no action
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_configuration_camera_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,uint8_t idOrder,uint8_t order)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target);
|
||||
_mav_put_uint8_t(buf, 1, idOrder);
|
||||
_mav_put_uint8_t(buf, 2, order);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
|
||||
#else
|
||||
mavlink_slugs_configuration_camera_t packet;
|
||||
packet.target = target;
|
||||
packet.idOrder = idOrder;
|
||||
packet.order = order;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a slugs_configuration_camera 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 slugs_configuration_camera C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_configuration_camera_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_slugs_configuration_camera_t* slugs_configuration_camera)
|
||||
{
|
||||
return mavlink_msg_slugs_configuration_camera_pack(system_id, component_id, msg, slugs_configuration_camera->target, slugs_configuration_camera->idOrder, slugs_configuration_camera->order);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a slugs_configuration_camera 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 slugs_configuration_camera C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_configuration_camera_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_slugs_configuration_camera_t* slugs_configuration_camera)
|
||||
{
|
||||
return mavlink_msg_slugs_configuration_camera_pack_chan(system_id, component_id, chan, msg, slugs_configuration_camera->target, slugs_configuration_camera->idOrder, slugs_configuration_camera->order);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a slugs_configuration_camera message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system setting the commands
|
||||
* @param idOrder ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight
|
||||
* @param order 1: up/on 2: down/off 3: auto/reset/no action
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_slugs_configuration_camera_send(mavlink_channel_t chan, uint8_t target, uint8_t idOrder, uint8_t order)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target);
|
||||
_mav_put_uint8_t(buf, 1, idOrder);
|
||||
_mav_put_uint8_t(buf, 2, order);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, buf, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
|
||||
#else
|
||||
mavlink_slugs_configuration_camera_t packet;
|
||||
packet.target = target;
|
||||
packet.idOrder = idOrder;
|
||||
packet.order = order;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, (const char *)&packet, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a slugs_configuration_camera message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_slugs_configuration_camera_send_struct(mavlink_channel_t chan, const mavlink_slugs_configuration_camera_t* slugs_configuration_camera)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_slugs_configuration_camera_send(chan, slugs_configuration_camera->target, slugs_configuration_camera->idOrder, slugs_configuration_camera->order);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, (const char *)slugs_configuration_camera, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_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_slugs_configuration_camera_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, uint8_t idOrder, uint8_t order)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target);
|
||||
_mav_put_uint8_t(buf, 1, idOrder);
|
||||
_mav_put_uint8_t(buf, 2, order);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, buf, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
|
||||
#else
|
||||
mavlink_slugs_configuration_camera_t *packet = (mavlink_slugs_configuration_camera_t *)msgbuf;
|
||||
packet->target = target;
|
||||
packet->idOrder = idOrder;
|
||||
packet->order = order;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, (const char *)packet, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SLUGS_CONFIGURATION_CAMERA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from slugs_configuration_camera message
|
||||
*
|
||||
* @return The system setting the commands
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_slugs_configuration_camera_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field idOrder from slugs_configuration_camera message
|
||||
*
|
||||
* @return ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_slugs_configuration_camera_get_idOrder(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field order from slugs_configuration_camera message
|
||||
*
|
||||
* @return 1: up/on 2: down/off 3: auto/reset/no action
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_slugs_configuration_camera_get_order(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a slugs_configuration_camera message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param slugs_configuration_camera C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_slugs_configuration_camera_decode(const mavlink_message_t* msg, mavlink_slugs_configuration_camera_t* slugs_configuration_camera)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
slugs_configuration_camera->target = mavlink_msg_slugs_configuration_camera_get_target(msg);
|
||||
slugs_configuration_camera->idOrder = mavlink_msg_slugs_configuration_camera_get_idOrder(msg);
|
||||
slugs_configuration_camera->order = mavlink_msg_slugs_configuration_camera_get_order(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN? msg->len : MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN;
|
||||
memset(slugs_configuration_camera, 0, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
|
||||
memcpy(slugs_configuration_camera, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE SLUGS_MOBILE_LOCATION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION 186
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_slugs_mobile_location_t {
|
||||
float latitude; /*< [deg] Mobile Latitude*/
|
||||
float longitude; /*< [deg] Mobile Longitude*/
|
||||
uint8_t target; /*< The system reporting the action*/
|
||||
}) mavlink_slugs_mobile_location_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN 9
|
||||
#define MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_MIN_LEN 9
|
||||
#define MAVLINK_MSG_ID_186_LEN 9
|
||||
#define MAVLINK_MSG_ID_186_MIN_LEN 9
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_CRC 101
|
||||
#define MAVLINK_MSG_ID_186_CRC 101
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SLUGS_MOBILE_LOCATION { \
|
||||
186, \
|
||||
"SLUGS_MOBILE_LOCATION", \
|
||||
3, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_slugs_mobile_location_t, target) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_slugs_mobile_location_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_slugs_mobile_location_t, longitude) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_SLUGS_MOBILE_LOCATION { \
|
||||
"SLUGS_MOBILE_LOCATION", \
|
||||
3, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_slugs_mobile_location_t, target) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_slugs_mobile_location_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_slugs_mobile_location_t, longitude) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a slugs_mobile_location 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 reporting the action
|
||||
* @param latitude [deg] Mobile Latitude
|
||||
* @param longitude [deg] Mobile Longitude
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_mobile_location_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, float latitude, float longitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_uint8_t(buf, 8, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN);
|
||||
#else
|
||||
mavlink_slugs_mobile_location_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a slugs_mobile_location 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 reporting the action
|
||||
* @param latitude [deg] Mobile Latitude
|
||||
* @param longitude [deg] Mobile Longitude
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_mobile_location_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,float latitude,float longitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_uint8_t(buf, 8, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN);
|
||||
#else
|
||||
mavlink_slugs_mobile_location_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a slugs_mobile_location 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 slugs_mobile_location C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_mobile_location_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_slugs_mobile_location_t* slugs_mobile_location)
|
||||
{
|
||||
return mavlink_msg_slugs_mobile_location_pack(system_id, component_id, msg, slugs_mobile_location->target, slugs_mobile_location->latitude, slugs_mobile_location->longitude);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a slugs_mobile_location 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 slugs_mobile_location C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_mobile_location_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_slugs_mobile_location_t* slugs_mobile_location)
|
||||
{
|
||||
return mavlink_msg_slugs_mobile_location_pack_chan(system_id, component_id, chan, msg, slugs_mobile_location->target, slugs_mobile_location->latitude, slugs_mobile_location->longitude);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a slugs_mobile_location message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system reporting the action
|
||||
* @param latitude [deg] Mobile Latitude
|
||||
* @param longitude [deg] Mobile Longitude
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_slugs_mobile_location_send(mavlink_channel_t chan, uint8_t target, float latitude, float longitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_uint8_t(buf, 8, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION, buf, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_CRC);
|
||||
#else
|
||||
mavlink_slugs_mobile_location_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION, (const char *)&packet, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a slugs_mobile_location message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_slugs_mobile_location_send_struct(mavlink_channel_t chan, const mavlink_slugs_mobile_location_t* slugs_mobile_location)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_slugs_mobile_location_send(chan, slugs_mobile_location->target, slugs_mobile_location->latitude, slugs_mobile_location->longitude);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION, (const char *)slugs_mobile_location, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_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_slugs_mobile_location_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, float latitude, float longitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_uint8_t(buf, 8, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION, buf, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_CRC);
|
||||
#else
|
||||
mavlink_slugs_mobile_location_t *packet = (mavlink_slugs_mobile_location_t *)msgbuf;
|
||||
packet->latitude = latitude;
|
||||
packet->longitude = longitude;
|
||||
packet->target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION, (const char *)packet, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SLUGS_MOBILE_LOCATION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from slugs_mobile_location message
|
||||
*
|
||||
* @return The system reporting the action
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_slugs_mobile_location_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field latitude from slugs_mobile_location message
|
||||
*
|
||||
* @return [deg] Mobile Latitude
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_mobile_location_get_latitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field longitude from slugs_mobile_location message
|
||||
*
|
||||
* @return [deg] Mobile Longitude
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_mobile_location_get_longitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a slugs_mobile_location message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param slugs_mobile_location C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_slugs_mobile_location_decode(const mavlink_message_t* msg, mavlink_slugs_mobile_location_t* slugs_mobile_location)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
slugs_mobile_location->latitude = mavlink_msg_slugs_mobile_location_get_latitude(msg);
|
||||
slugs_mobile_location->longitude = mavlink_msg_slugs_mobile_location_get_longitude(msg);
|
||||
slugs_mobile_location->target = mavlink_msg_slugs_mobile_location_get_target(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN? msg->len : MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN;
|
||||
memset(slugs_mobile_location, 0, MAVLINK_MSG_ID_SLUGS_MOBILE_LOCATION_LEN);
|
||||
memcpy(slugs_mobile_location, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,438 @@
|
||||
#pragma once
|
||||
// MESSAGE SLUGS_NAVIGATION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION 176
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_slugs_navigation_t {
|
||||
float u_m; /*< [m/s] Measured Airspeed prior to the nav filter*/
|
||||
float phi_c; /*< Commanded Roll*/
|
||||
float theta_c; /*< Commanded Pitch*/
|
||||
float psiDot_c; /*< Commanded Turn rate*/
|
||||
float ay_body; /*< Y component of the body acceleration*/
|
||||
float totalDist; /*< Total Distance to Run on this leg of Navigation*/
|
||||
float dist2Go; /*< Remaining distance to Run on this leg of Navigation*/
|
||||
uint16_t h_c; /*< [dm] Commanded altitude*/
|
||||
uint8_t fromWP; /*< Origin WP*/
|
||||
uint8_t toWP; /*< Destination WP*/
|
||||
}) mavlink_slugs_navigation_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN 32
|
||||
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_176_LEN 32
|
||||
#define MAVLINK_MSG_ID_176_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC 228
|
||||
#define MAVLINK_MSG_ID_176_CRC 228
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SLUGS_NAVIGATION { \
|
||||
176, \
|
||||
"SLUGS_NAVIGATION", \
|
||||
10, \
|
||||
{ { "u_m", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_slugs_navigation_t, u_m) }, \
|
||||
{ "phi_c", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_slugs_navigation_t, phi_c) }, \
|
||||
{ "theta_c", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_slugs_navigation_t, theta_c) }, \
|
||||
{ "psiDot_c", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_slugs_navigation_t, psiDot_c) }, \
|
||||
{ "ay_body", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_slugs_navigation_t, ay_body) }, \
|
||||
{ "totalDist", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_slugs_navigation_t, totalDist) }, \
|
||||
{ "dist2Go", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_slugs_navigation_t, dist2Go) }, \
|
||||
{ "fromWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_slugs_navigation_t, fromWP) }, \
|
||||
{ "toWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_slugs_navigation_t, toWP) }, \
|
||||
{ "h_c", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_slugs_navigation_t, h_c) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_SLUGS_NAVIGATION { \
|
||||
"SLUGS_NAVIGATION", \
|
||||
10, \
|
||||
{ { "u_m", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_slugs_navigation_t, u_m) }, \
|
||||
{ "phi_c", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_slugs_navigation_t, phi_c) }, \
|
||||
{ "theta_c", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_slugs_navigation_t, theta_c) }, \
|
||||
{ "psiDot_c", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_slugs_navigation_t, psiDot_c) }, \
|
||||
{ "ay_body", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_slugs_navigation_t, ay_body) }, \
|
||||
{ "totalDist", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_slugs_navigation_t, totalDist) }, \
|
||||
{ "dist2Go", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_slugs_navigation_t, dist2Go) }, \
|
||||
{ "fromWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_slugs_navigation_t, fromWP) }, \
|
||||
{ "toWP", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_slugs_navigation_t, toWP) }, \
|
||||
{ "h_c", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_slugs_navigation_t, h_c) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a slugs_navigation 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 u_m [m/s] Measured Airspeed prior to the nav filter
|
||||
* @param phi_c Commanded Roll
|
||||
* @param theta_c Commanded Pitch
|
||||
* @param psiDot_c Commanded Turn rate
|
||||
* @param ay_body Y component of the body acceleration
|
||||
* @param totalDist Total Distance to Run on this leg of Navigation
|
||||
* @param dist2Go Remaining distance to Run on this leg of Navigation
|
||||
* @param fromWP Origin WP
|
||||
* @param toWP Destination WP
|
||||
* @param h_c [dm] Commanded altitude
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_navigation_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP, uint16_t h_c)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN];
|
||||
_mav_put_float(buf, 0, u_m);
|
||||
_mav_put_float(buf, 4, phi_c);
|
||||
_mav_put_float(buf, 8, theta_c);
|
||||
_mav_put_float(buf, 12, psiDot_c);
|
||||
_mav_put_float(buf, 16, ay_body);
|
||||
_mav_put_float(buf, 20, totalDist);
|
||||
_mav_put_float(buf, 24, dist2Go);
|
||||
_mav_put_uint16_t(buf, 28, h_c);
|
||||
_mav_put_uint8_t(buf, 30, fromWP);
|
||||
_mav_put_uint8_t(buf, 31, toWP);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
|
||||
#else
|
||||
mavlink_slugs_navigation_t packet;
|
||||
packet.u_m = u_m;
|
||||
packet.phi_c = phi_c;
|
||||
packet.theta_c = theta_c;
|
||||
packet.psiDot_c = psiDot_c;
|
||||
packet.ay_body = ay_body;
|
||||
packet.totalDist = totalDist;
|
||||
packet.dist2Go = dist2Go;
|
||||
packet.h_c = h_c;
|
||||
packet.fromWP = fromWP;
|
||||
packet.toWP = toWP;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SLUGS_NAVIGATION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a slugs_navigation 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 u_m [m/s] Measured Airspeed prior to the nav filter
|
||||
* @param phi_c Commanded Roll
|
||||
* @param theta_c Commanded Pitch
|
||||
* @param psiDot_c Commanded Turn rate
|
||||
* @param ay_body Y component of the body acceleration
|
||||
* @param totalDist Total Distance to Run on this leg of Navigation
|
||||
* @param dist2Go Remaining distance to Run on this leg of Navigation
|
||||
* @param fromWP Origin WP
|
||||
* @param toWP Destination WP
|
||||
* @param h_c [dm] Commanded altitude
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_navigation_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float u_m,float phi_c,float theta_c,float psiDot_c,float ay_body,float totalDist,float dist2Go,uint8_t fromWP,uint8_t toWP,uint16_t h_c)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN];
|
||||
_mav_put_float(buf, 0, u_m);
|
||||
_mav_put_float(buf, 4, phi_c);
|
||||
_mav_put_float(buf, 8, theta_c);
|
||||
_mav_put_float(buf, 12, psiDot_c);
|
||||
_mav_put_float(buf, 16, ay_body);
|
||||
_mav_put_float(buf, 20, totalDist);
|
||||
_mav_put_float(buf, 24, dist2Go);
|
||||
_mav_put_uint16_t(buf, 28, h_c);
|
||||
_mav_put_uint8_t(buf, 30, fromWP);
|
||||
_mav_put_uint8_t(buf, 31, toWP);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
|
||||
#else
|
||||
mavlink_slugs_navigation_t packet;
|
||||
packet.u_m = u_m;
|
||||
packet.phi_c = phi_c;
|
||||
packet.theta_c = theta_c;
|
||||
packet.psiDot_c = psiDot_c;
|
||||
packet.ay_body = ay_body;
|
||||
packet.totalDist = totalDist;
|
||||
packet.dist2Go = dist2Go;
|
||||
packet.h_c = h_c;
|
||||
packet.fromWP = fromWP;
|
||||
packet.toWP = toWP;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SLUGS_NAVIGATION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a slugs_navigation 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 slugs_navigation C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_navigation_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_slugs_navigation_t* slugs_navigation)
|
||||
{
|
||||
return mavlink_msg_slugs_navigation_pack(system_id, component_id, msg, slugs_navigation->u_m, slugs_navigation->phi_c, slugs_navigation->theta_c, slugs_navigation->psiDot_c, slugs_navigation->ay_body, slugs_navigation->totalDist, slugs_navigation->dist2Go, slugs_navigation->fromWP, slugs_navigation->toWP, slugs_navigation->h_c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a slugs_navigation 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 slugs_navigation C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_navigation_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_slugs_navigation_t* slugs_navigation)
|
||||
{
|
||||
return mavlink_msg_slugs_navigation_pack_chan(system_id, component_id, chan, msg, slugs_navigation->u_m, slugs_navigation->phi_c, slugs_navigation->theta_c, slugs_navigation->psiDot_c, slugs_navigation->ay_body, slugs_navigation->totalDist, slugs_navigation->dist2Go, slugs_navigation->fromWP, slugs_navigation->toWP, slugs_navigation->h_c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a slugs_navigation message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param u_m [m/s] Measured Airspeed prior to the nav filter
|
||||
* @param phi_c Commanded Roll
|
||||
* @param theta_c Commanded Pitch
|
||||
* @param psiDot_c Commanded Turn rate
|
||||
* @param ay_body Y component of the body acceleration
|
||||
* @param totalDist Total Distance to Run on this leg of Navigation
|
||||
* @param dist2Go Remaining distance to Run on this leg of Navigation
|
||||
* @param fromWP Origin WP
|
||||
* @param toWP Destination WP
|
||||
* @param h_c [dm] Commanded altitude
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_slugs_navigation_send(mavlink_channel_t chan, float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP, uint16_t h_c)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN];
|
||||
_mav_put_float(buf, 0, u_m);
|
||||
_mav_put_float(buf, 4, phi_c);
|
||||
_mav_put_float(buf, 8, theta_c);
|
||||
_mav_put_float(buf, 12, psiDot_c);
|
||||
_mav_put_float(buf, 16, ay_body);
|
||||
_mav_put_float(buf, 20, totalDist);
|
||||
_mav_put_float(buf, 24, dist2Go);
|
||||
_mav_put_uint16_t(buf, 28, h_c);
|
||||
_mav_put_uint8_t(buf, 30, fromWP);
|
||||
_mav_put_uint8_t(buf, 31, toWP);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, buf, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
|
||||
#else
|
||||
mavlink_slugs_navigation_t packet;
|
||||
packet.u_m = u_m;
|
||||
packet.phi_c = phi_c;
|
||||
packet.theta_c = theta_c;
|
||||
packet.psiDot_c = psiDot_c;
|
||||
packet.ay_body = ay_body;
|
||||
packet.totalDist = totalDist;
|
||||
packet.dist2Go = dist2Go;
|
||||
packet.h_c = h_c;
|
||||
packet.fromWP = fromWP;
|
||||
packet.toWP = toWP;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, (const char *)&packet, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a slugs_navigation message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_slugs_navigation_send_struct(mavlink_channel_t chan, const mavlink_slugs_navigation_t* slugs_navigation)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_slugs_navigation_send(chan, slugs_navigation->u_m, slugs_navigation->phi_c, slugs_navigation->theta_c, slugs_navigation->psiDot_c, slugs_navigation->ay_body, slugs_navigation->totalDist, slugs_navigation->dist2Go, slugs_navigation->fromWP, slugs_navigation->toWP, slugs_navigation->h_c);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, (const char *)slugs_navigation, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SLUGS_NAVIGATION_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_slugs_navigation_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP, uint16_t h_c)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, u_m);
|
||||
_mav_put_float(buf, 4, phi_c);
|
||||
_mav_put_float(buf, 8, theta_c);
|
||||
_mav_put_float(buf, 12, psiDot_c);
|
||||
_mav_put_float(buf, 16, ay_body);
|
||||
_mav_put_float(buf, 20, totalDist);
|
||||
_mav_put_float(buf, 24, dist2Go);
|
||||
_mav_put_uint16_t(buf, 28, h_c);
|
||||
_mav_put_uint8_t(buf, 30, fromWP);
|
||||
_mav_put_uint8_t(buf, 31, toWP);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, buf, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
|
||||
#else
|
||||
mavlink_slugs_navigation_t *packet = (mavlink_slugs_navigation_t *)msgbuf;
|
||||
packet->u_m = u_m;
|
||||
packet->phi_c = phi_c;
|
||||
packet->theta_c = theta_c;
|
||||
packet->psiDot_c = psiDot_c;
|
||||
packet->ay_body = ay_body;
|
||||
packet->totalDist = totalDist;
|
||||
packet->dist2Go = dist2Go;
|
||||
packet->h_c = h_c;
|
||||
packet->fromWP = fromWP;
|
||||
packet->toWP = toWP;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION, (const char *)packet, MAVLINK_MSG_ID_SLUGS_NAVIGATION_MIN_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN, MAVLINK_MSG_ID_SLUGS_NAVIGATION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SLUGS_NAVIGATION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field u_m from slugs_navigation message
|
||||
*
|
||||
* @return [m/s] Measured Airspeed prior to the nav filter
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_navigation_get_u_m(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field phi_c from slugs_navigation message
|
||||
*
|
||||
* @return Commanded Roll
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_navigation_get_phi_c(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field theta_c from slugs_navigation message
|
||||
*
|
||||
* @return Commanded Pitch
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_navigation_get_theta_c(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field psiDot_c from slugs_navigation message
|
||||
*
|
||||
* @return Commanded Turn rate
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_navigation_get_psiDot_c(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ay_body from slugs_navigation message
|
||||
*
|
||||
* @return Y component of the body acceleration
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_navigation_get_ay_body(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field totalDist from slugs_navigation message
|
||||
*
|
||||
* @return Total Distance to Run on this leg of Navigation
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_navigation_get_totalDist(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field dist2Go from slugs_navigation message
|
||||
*
|
||||
* @return Remaining distance to Run on this leg of Navigation
|
||||
*/
|
||||
static inline float mavlink_msg_slugs_navigation_get_dist2Go(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fromWP from slugs_navigation message
|
||||
*
|
||||
* @return Origin WP
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_slugs_navigation_get_fromWP(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field toWP from slugs_navigation message
|
||||
*
|
||||
* @return Destination WP
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_slugs_navigation_get_toWP(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field h_c from slugs_navigation message
|
||||
*
|
||||
* @return [dm] Commanded altitude
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_slugs_navigation_get_h_c(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a slugs_navigation message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param slugs_navigation C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_slugs_navigation_decode(const mavlink_message_t* msg, mavlink_slugs_navigation_t* slugs_navigation)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
slugs_navigation->u_m = mavlink_msg_slugs_navigation_get_u_m(msg);
|
||||
slugs_navigation->phi_c = mavlink_msg_slugs_navigation_get_phi_c(msg);
|
||||
slugs_navigation->theta_c = mavlink_msg_slugs_navigation_get_theta_c(msg);
|
||||
slugs_navigation->psiDot_c = mavlink_msg_slugs_navigation_get_psiDot_c(msg);
|
||||
slugs_navigation->ay_body = mavlink_msg_slugs_navigation_get_ay_body(msg);
|
||||
slugs_navigation->totalDist = mavlink_msg_slugs_navigation_get_totalDist(msg);
|
||||
slugs_navigation->dist2Go = mavlink_msg_slugs_navigation_get_dist2Go(msg);
|
||||
slugs_navigation->h_c = mavlink_msg_slugs_navigation_get_h_c(msg);
|
||||
slugs_navigation->fromWP = mavlink_msg_slugs_navigation_get_fromWP(msg);
|
||||
slugs_navigation->toWP = mavlink_msg_slugs_navigation_get_toWP(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN? msg->len : MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN;
|
||||
memset(slugs_navigation, 0, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
|
||||
memcpy(slugs_navigation, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
#pragma once
|
||||
// MESSAGE STATUS_GPS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_STATUS_GPS 194
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_status_gps_t {
|
||||
float magVar; /*< [deg] Magnetic variation*/
|
||||
uint16_t csFails; /*< Number of times checksum has failed*/
|
||||
uint8_t gpsQuality; /*< The quality indicator, 0=fix not available or invalid, 1=GPS fix, 2=C/A differential GPS, 6=Dead reckoning mode, 7=Manual input mode (fixed position), 8=Simulator mode, 9= WAAS a*/
|
||||
uint8_t msgsType; /*< Indicates if GN, GL or GP messages are being received*/
|
||||
uint8_t posStatus; /*< A = data valid, V = data invalid*/
|
||||
int8_t magDir; /*< Magnetic variation direction E/W. Easterly variation (E) subtracts from True course and Westerly variation (W) adds to True course*/
|
||||
uint8_t modeInd; /*< Positioning system mode indicator. A - Autonomous;D-Differential; E-Estimated (dead reckoning) mode;M-Manual input; N-Data not valid*/
|
||||
}) mavlink_status_gps_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_STATUS_GPS_LEN 11
|
||||
#define MAVLINK_MSG_ID_STATUS_GPS_MIN_LEN 11
|
||||
#define MAVLINK_MSG_ID_194_LEN 11
|
||||
#define MAVLINK_MSG_ID_194_MIN_LEN 11
|
||||
|
||||
#define MAVLINK_MSG_ID_STATUS_GPS_CRC 51
|
||||
#define MAVLINK_MSG_ID_194_CRC 51
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_STATUS_GPS { \
|
||||
194, \
|
||||
"STATUS_GPS", \
|
||||
7, \
|
||||
{ { "csFails", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_status_gps_t, csFails) }, \
|
||||
{ "gpsQuality", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_status_gps_t, gpsQuality) }, \
|
||||
{ "msgsType", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_status_gps_t, msgsType) }, \
|
||||
{ "posStatus", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_status_gps_t, posStatus) }, \
|
||||
{ "magVar", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_status_gps_t, magVar) }, \
|
||||
{ "magDir", NULL, MAVLINK_TYPE_INT8_T, 0, 9, offsetof(mavlink_status_gps_t, magDir) }, \
|
||||
{ "modeInd", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_status_gps_t, modeInd) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_STATUS_GPS { \
|
||||
"STATUS_GPS", \
|
||||
7, \
|
||||
{ { "csFails", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_status_gps_t, csFails) }, \
|
||||
{ "gpsQuality", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_status_gps_t, gpsQuality) }, \
|
||||
{ "msgsType", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_status_gps_t, msgsType) }, \
|
||||
{ "posStatus", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_status_gps_t, posStatus) }, \
|
||||
{ "magVar", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_status_gps_t, magVar) }, \
|
||||
{ "magDir", NULL, MAVLINK_TYPE_INT8_T, 0, 9, offsetof(mavlink_status_gps_t, magDir) }, \
|
||||
{ "modeInd", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_status_gps_t, modeInd) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a status_gps 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 csFails Number of times checksum has failed
|
||||
* @param gpsQuality The quality indicator, 0=fix not available or invalid, 1=GPS fix, 2=C/A differential GPS, 6=Dead reckoning mode, 7=Manual input mode (fixed position), 8=Simulator mode, 9= WAAS a
|
||||
* @param msgsType Indicates if GN, GL or GP messages are being received
|
||||
* @param posStatus A = data valid, V = data invalid
|
||||
* @param magVar [deg] Magnetic variation
|
||||
* @param magDir Magnetic variation direction E/W. Easterly variation (E) subtracts from True course and Westerly variation (W) adds to True course
|
||||
* @param modeInd Positioning system mode indicator. A - Autonomous;D-Differential; E-Estimated (dead reckoning) mode;M-Manual input; N-Data not valid
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_status_gps_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t csFails, uint8_t gpsQuality, uint8_t msgsType, uint8_t posStatus, float magVar, int8_t magDir, uint8_t modeInd)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_STATUS_GPS_LEN];
|
||||
_mav_put_float(buf, 0, magVar);
|
||||
_mav_put_uint16_t(buf, 4, csFails);
|
||||
_mav_put_uint8_t(buf, 6, gpsQuality);
|
||||
_mav_put_uint8_t(buf, 7, msgsType);
|
||||
_mav_put_uint8_t(buf, 8, posStatus);
|
||||
_mav_put_int8_t(buf, 9, magDir);
|
||||
_mav_put_uint8_t(buf, 10, modeInd);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUS_GPS_LEN);
|
||||
#else
|
||||
mavlink_status_gps_t packet;
|
||||
packet.magVar = magVar;
|
||||
packet.csFails = csFails;
|
||||
packet.gpsQuality = gpsQuality;
|
||||
packet.msgsType = msgsType;
|
||||
packet.posStatus = posStatus;
|
||||
packet.magDir = magDir;
|
||||
packet.modeInd = modeInd;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUS_GPS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_STATUS_GPS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUS_GPS_MIN_LEN, MAVLINK_MSG_ID_STATUS_GPS_LEN, MAVLINK_MSG_ID_STATUS_GPS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a status_gps 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 csFails Number of times checksum has failed
|
||||
* @param gpsQuality The quality indicator, 0=fix not available or invalid, 1=GPS fix, 2=C/A differential GPS, 6=Dead reckoning mode, 7=Manual input mode (fixed position), 8=Simulator mode, 9= WAAS a
|
||||
* @param msgsType Indicates if GN, GL or GP messages are being received
|
||||
* @param posStatus A = data valid, V = data invalid
|
||||
* @param magVar [deg] Magnetic variation
|
||||
* @param magDir Magnetic variation direction E/W. Easterly variation (E) subtracts from True course and Westerly variation (W) adds to True course
|
||||
* @param modeInd Positioning system mode indicator. A - Autonomous;D-Differential; E-Estimated (dead reckoning) mode;M-Manual input; N-Data not valid
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_status_gps_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t csFails,uint8_t gpsQuality,uint8_t msgsType,uint8_t posStatus,float magVar,int8_t magDir,uint8_t modeInd)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_STATUS_GPS_LEN];
|
||||
_mav_put_float(buf, 0, magVar);
|
||||
_mav_put_uint16_t(buf, 4, csFails);
|
||||
_mav_put_uint8_t(buf, 6, gpsQuality);
|
||||
_mav_put_uint8_t(buf, 7, msgsType);
|
||||
_mav_put_uint8_t(buf, 8, posStatus);
|
||||
_mav_put_int8_t(buf, 9, magDir);
|
||||
_mav_put_uint8_t(buf, 10, modeInd);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUS_GPS_LEN);
|
||||
#else
|
||||
mavlink_status_gps_t packet;
|
||||
packet.magVar = magVar;
|
||||
packet.csFails = csFails;
|
||||
packet.gpsQuality = gpsQuality;
|
||||
packet.msgsType = msgsType;
|
||||
packet.posStatus = posStatus;
|
||||
packet.magDir = magDir;
|
||||
packet.modeInd = modeInd;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUS_GPS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_STATUS_GPS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUS_GPS_MIN_LEN, MAVLINK_MSG_ID_STATUS_GPS_LEN, MAVLINK_MSG_ID_STATUS_GPS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a status_gps 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 status_gps C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_status_gps_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_status_gps_t* status_gps)
|
||||
{
|
||||
return mavlink_msg_status_gps_pack(system_id, component_id, msg, status_gps->csFails, status_gps->gpsQuality, status_gps->msgsType, status_gps->posStatus, status_gps->magVar, status_gps->magDir, status_gps->modeInd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a status_gps 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 status_gps C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_status_gps_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_status_gps_t* status_gps)
|
||||
{
|
||||
return mavlink_msg_status_gps_pack_chan(system_id, component_id, chan, msg, status_gps->csFails, status_gps->gpsQuality, status_gps->msgsType, status_gps->posStatus, status_gps->magVar, status_gps->magDir, status_gps->modeInd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a status_gps message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param csFails Number of times checksum has failed
|
||||
* @param gpsQuality The quality indicator, 0=fix not available or invalid, 1=GPS fix, 2=C/A differential GPS, 6=Dead reckoning mode, 7=Manual input mode (fixed position), 8=Simulator mode, 9= WAAS a
|
||||
* @param msgsType Indicates if GN, GL or GP messages are being received
|
||||
* @param posStatus A = data valid, V = data invalid
|
||||
* @param magVar [deg] Magnetic variation
|
||||
* @param magDir Magnetic variation direction E/W. Easterly variation (E) subtracts from True course and Westerly variation (W) adds to True course
|
||||
* @param modeInd Positioning system mode indicator. A - Autonomous;D-Differential; E-Estimated (dead reckoning) mode;M-Manual input; N-Data not valid
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_status_gps_send(mavlink_channel_t chan, uint16_t csFails, uint8_t gpsQuality, uint8_t msgsType, uint8_t posStatus, float magVar, int8_t magDir, uint8_t modeInd)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_STATUS_GPS_LEN];
|
||||
_mav_put_float(buf, 0, magVar);
|
||||
_mav_put_uint16_t(buf, 4, csFails);
|
||||
_mav_put_uint8_t(buf, 6, gpsQuality);
|
||||
_mav_put_uint8_t(buf, 7, msgsType);
|
||||
_mav_put_uint8_t(buf, 8, posStatus);
|
||||
_mav_put_int8_t(buf, 9, magDir);
|
||||
_mav_put_uint8_t(buf, 10, modeInd);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUS_GPS, buf, MAVLINK_MSG_ID_STATUS_GPS_MIN_LEN, MAVLINK_MSG_ID_STATUS_GPS_LEN, MAVLINK_MSG_ID_STATUS_GPS_CRC);
|
||||
#else
|
||||
mavlink_status_gps_t packet;
|
||||
packet.magVar = magVar;
|
||||
packet.csFails = csFails;
|
||||
packet.gpsQuality = gpsQuality;
|
||||
packet.msgsType = msgsType;
|
||||
packet.posStatus = posStatus;
|
||||
packet.magDir = magDir;
|
||||
packet.modeInd = modeInd;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUS_GPS, (const char *)&packet, MAVLINK_MSG_ID_STATUS_GPS_MIN_LEN, MAVLINK_MSG_ID_STATUS_GPS_LEN, MAVLINK_MSG_ID_STATUS_GPS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a status_gps message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_status_gps_send_struct(mavlink_channel_t chan, const mavlink_status_gps_t* status_gps)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_status_gps_send(chan, status_gps->csFails, status_gps->gpsQuality, status_gps->msgsType, status_gps->posStatus, status_gps->magVar, status_gps->magDir, status_gps->modeInd);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUS_GPS, (const char *)status_gps, MAVLINK_MSG_ID_STATUS_GPS_MIN_LEN, MAVLINK_MSG_ID_STATUS_GPS_LEN, MAVLINK_MSG_ID_STATUS_GPS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_STATUS_GPS_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_status_gps_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t csFails, uint8_t gpsQuality, uint8_t msgsType, uint8_t posStatus, float magVar, int8_t magDir, uint8_t modeInd)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, magVar);
|
||||
_mav_put_uint16_t(buf, 4, csFails);
|
||||
_mav_put_uint8_t(buf, 6, gpsQuality);
|
||||
_mav_put_uint8_t(buf, 7, msgsType);
|
||||
_mav_put_uint8_t(buf, 8, posStatus);
|
||||
_mav_put_int8_t(buf, 9, magDir);
|
||||
_mav_put_uint8_t(buf, 10, modeInd);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUS_GPS, buf, MAVLINK_MSG_ID_STATUS_GPS_MIN_LEN, MAVLINK_MSG_ID_STATUS_GPS_LEN, MAVLINK_MSG_ID_STATUS_GPS_CRC);
|
||||
#else
|
||||
mavlink_status_gps_t *packet = (mavlink_status_gps_t *)msgbuf;
|
||||
packet->magVar = magVar;
|
||||
packet->csFails = csFails;
|
||||
packet->gpsQuality = gpsQuality;
|
||||
packet->msgsType = msgsType;
|
||||
packet->posStatus = posStatus;
|
||||
packet->magDir = magDir;
|
||||
packet->modeInd = modeInd;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUS_GPS, (const char *)packet, MAVLINK_MSG_ID_STATUS_GPS_MIN_LEN, MAVLINK_MSG_ID_STATUS_GPS_LEN, MAVLINK_MSG_ID_STATUS_GPS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE STATUS_GPS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field csFails from status_gps message
|
||||
*
|
||||
* @return Number of times checksum has failed
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_status_gps_get_csFails(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gpsQuality from status_gps message
|
||||
*
|
||||
* @return The quality indicator, 0=fix not available or invalid, 1=GPS fix, 2=C/A differential GPS, 6=Dead reckoning mode, 7=Manual input mode (fixed position), 8=Simulator mode, 9= WAAS a
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_status_gps_get_gpsQuality(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field msgsType from status_gps message
|
||||
*
|
||||
* @return Indicates if GN, GL or GP messages are being received
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_status_gps_get_msgsType(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field posStatus from status_gps message
|
||||
*
|
||||
* @return A = data valid, V = data invalid
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_status_gps_get_posStatus(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field magVar from status_gps message
|
||||
*
|
||||
* @return [deg] Magnetic variation
|
||||
*/
|
||||
static inline float mavlink_msg_status_gps_get_magVar(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field magDir from status_gps message
|
||||
*
|
||||
* @return Magnetic variation direction E/W. Easterly variation (E) subtracts from True course and Westerly variation (W) adds to True course
|
||||
*/
|
||||
static inline int8_t mavlink_msg_status_gps_get_magDir(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 9);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field modeInd from status_gps message
|
||||
*
|
||||
* @return Positioning system mode indicator. A - Autonomous;D-Differential; E-Estimated (dead reckoning) mode;M-Manual input; N-Data not valid
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_status_gps_get_modeInd(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a status_gps message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param status_gps C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_status_gps_decode(const mavlink_message_t* msg, mavlink_status_gps_t* status_gps)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
status_gps->magVar = mavlink_msg_status_gps_get_magVar(msg);
|
||||
status_gps->csFails = mavlink_msg_status_gps_get_csFails(msg);
|
||||
status_gps->gpsQuality = mavlink_msg_status_gps_get_gpsQuality(msg);
|
||||
status_gps->msgsType = mavlink_msg_status_gps_get_msgsType(msg);
|
||||
status_gps->posStatus = mavlink_msg_status_gps_get_posStatus(msg);
|
||||
status_gps->magDir = mavlink_msg_status_gps_get_magDir(msg);
|
||||
status_gps->modeInd = mavlink_msg_status_gps_get_modeInd(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_STATUS_GPS_LEN? msg->len : MAVLINK_MSG_ID_STATUS_GPS_LEN;
|
||||
memset(status_gps, 0, MAVLINK_MSG_ID_STATUS_GPS_LEN);
|
||||
memcpy(status_gps, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
#pragma once
|
||||
// MESSAGE UAV_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_UAV_STATUS 193
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_uav_status_t {
|
||||
float latitude; /*< [deg] Latitude UAV*/
|
||||
float longitude; /*< [deg] Longitude UAV*/
|
||||
float altitude; /*< [m] Altitude UAV*/
|
||||
float speed; /*< [m/s] Speed UAV*/
|
||||
float course; /*< Course UAV*/
|
||||
uint8_t target; /*< The ID system reporting the action*/
|
||||
}) mavlink_uav_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_UAV_STATUS_LEN 21
|
||||
#define MAVLINK_MSG_ID_UAV_STATUS_MIN_LEN 21
|
||||
#define MAVLINK_MSG_ID_193_LEN 21
|
||||
#define MAVLINK_MSG_ID_193_MIN_LEN 21
|
||||
|
||||
#define MAVLINK_MSG_ID_UAV_STATUS_CRC 160
|
||||
#define MAVLINK_MSG_ID_193_CRC 160
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_UAV_STATUS { \
|
||||
193, \
|
||||
"UAV_STATUS", \
|
||||
6, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_uav_status_t, target) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_uav_status_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_uav_status_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_uav_status_t, altitude) }, \
|
||||
{ "speed", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_uav_status_t, speed) }, \
|
||||
{ "course", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_uav_status_t, course) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_UAV_STATUS { \
|
||||
"UAV_STATUS", \
|
||||
6, \
|
||||
{ { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_uav_status_t, target) }, \
|
||||
{ "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_uav_status_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_uav_status_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_uav_status_t, altitude) }, \
|
||||
{ "speed", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_uav_status_t, speed) }, \
|
||||
{ "course", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_uav_status_t, course) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a uav_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 target The ID system reporting the action
|
||||
* @param latitude [deg] Latitude UAV
|
||||
* @param longitude [deg] Longitude UAV
|
||||
* @param altitude [m] Altitude UAV
|
||||
* @param speed [m/s] Speed UAV
|
||||
* @param course Course UAV
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_uav_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, float latitude, float longitude, float altitude, float speed, float course)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_UAV_STATUS_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_float(buf, 8, altitude);
|
||||
_mav_put_float(buf, 12, speed);
|
||||
_mav_put_float(buf, 16, course);
|
||||
_mav_put_uint8_t(buf, 20, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAV_STATUS_LEN);
|
||||
#else
|
||||
mavlink_uav_status_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.speed = speed;
|
||||
packet.course = course;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAV_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_UAV_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UAV_STATUS_MIN_LEN, MAVLINK_MSG_ID_UAV_STATUS_LEN, MAVLINK_MSG_ID_UAV_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a uav_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 target The ID system reporting the action
|
||||
* @param latitude [deg] Latitude UAV
|
||||
* @param longitude [deg] Longitude UAV
|
||||
* @param altitude [m] Altitude UAV
|
||||
* @param speed [m/s] Speed UAV
|
||||
* @param course Course UAV
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_uav_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,float latitude,float longitude,float altitude,float speed,float course)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_UAV_STATUS_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_float(buf, 8, altitude);
|
||||
_mav_put_float(buf, 12, speed);
|
||||
_mav_put_float(buf, 16, course);
|
||||
_mav_put_uint8_t(buf, 20, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAV_STATUS_LEN);
|
||||
#else
|
||||
mavlink_uav_status_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.speed = speed;
|
||||
packet.course = course;
|
||||
packet.target = target;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAV_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_UAV_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UAV_STATUS_MIN_LEN, MAVLINK_MSG_ID_UAV_STATUS_LEN, MAVLINK_MSG_ID_UAV_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a uav_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 uav_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_uav_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uav_status_t* uav_status)
|
||||
{
|
||||
return mavlink_msg_uav_status_pack(system_id, component_id, msg, uav_status->target, uav_status->latitude, uav_status->longitude, uav_status->altitude, uav_status->speed, uav_status->course);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a uav_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 uav_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_uav_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uav_status_t* uav_status)
|
||||
{
|
||||
return mavlink_msg_uav_status_pack_chan(system_id, component_id, chan, msg, uav_status->target, uav_status->latitude, uav_status->longitude, uav_status->altitude, uav_status->speed, uav_status->course);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a uav_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The ID system reporting the action
|
||||
* @param latitude [deg] Latitude UAV
|
||||
* @param longitude [deg] Longitude UAV
|
||||
* @param altitude [m] Altitude UAV
|
||||
* @param speed [m/s] Speed UAV
|
||||
* @param course Course UAV
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_uav_status_send(mavlink_channel_t chan, uint8_t target, float latitude, float longitude, float altitude, float speed, float course)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_UAV_STATUS_LEN];
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_float(buf, 8, altitude);
|
||||
_mav_put_float(buf, 12, speed);
|
||||
_mav_put_float(buf, 16, course);
|
||||
_mav_put_uint8_t(buf, 20, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_STATUS, buf, MAVLINK_MSG_ID_UAV_STATUS_MIN_LEN, MAVLINK_MSG_ID_UAV_STATUS_LEN, MAVLINK_MSG_ID_UAV_STATUS_CRC);
|
||||
#else
|
||||
mavlink_uav_status_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
packet.speed = speed;
|
||||
packet.course = course;
|
||||
packet.target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_STATUS, (const char *)&packet, MAVLINK_MSG_ID_UAV_STATUS_MIN_LEN, MAVLINK_MSG_ID_UAV_STATUS_LEN, MAVLINK_MSG_ID_UAV_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a uav_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_uav_status_send_struct(mavlink_channel_t chan, const mavlink_uav_status_t* uav_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_uav_status_send(chan, uav_status->target, uav_status->latitude, uav_status->longitude, uav_status->altitude, uav_status->speed, uav_status->course);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_STATUS, (const char *)uav_status, MAVLINK_MSG_ID_UAV_STATUS_MIN_LEN, MAVLINK_MSG_ID_UAV_STATUS_LEN, MAVLINK_MSG_ID_UAV_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_UAV_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_uav_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, float latitude, float longitude, float altitude, float speed, float course)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, latitude);
|
||||
_mav_put_float(buf, 4, longitude);
|
||||
_mav_put_float(buf, 8, altitude);
|
||||
_mav_put_float(buf, 12, speed);
|
||||
_mav_put_float(buf, 16, course);
|
||||
_mav_put_uint8_t(buf, 20, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_STATUS, buf, MAVLINK_MSG_ID_UAV_STATUS_MIN_LEN, MAVLINK_MSG_ID_UAV_STATUS_LEN, MAVLINK_MSG_ID_UAV_STATUS_CRC);
|
||||
#else
|
||||
mavlink_uav_status_t *packet = (mavlink_uav_status_t *)msgbuf;
|
||||
packet->latitude = latitude;
|
||||
packet->longitude = longitude;
|
||||
packet->altitude = altitude;
|
||||
packet->speed = speed;
|
||||
packet->course = course;
|
||||
packet->target = target;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAV_STATUS, (const char *)packet, MAVLINK_MSG_ID_UAV_STATUS_MIN_LEN, MAVLINK_MSG_ID_UAV_STATUS_LEN, MAVLINK_MSG_ID_UAV_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE UAV_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target from uav_status message
|
||||
*
|
||||
* @return The ID system reporting the action
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_uav_status_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field latitude from uav_status message
|
||||
*
|
||||
* @return [deg] Latitude UAV
|
||||
*/
|
||||
static inline float mavlink_msg_uav_status_get_latitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field longitude from uav_status message
|
||||
*
|
||||
* @return [deg] Longitude UAV
|
||||
*/
|
||||
static inline float mavlink_msg_uav_status_get_longitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from uav_status message
|
||||
*
|
||||
* @return [m] Altitude UAV
|
||||
*/
|
||||
static inline float mavlink_msg_uav_status_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field speed from uav_status message
|
||||
*
|
||||
* @return [m/s] Speed UAV
|
||||
*/
|
||||
static inline float mavlink_msg_uav_status_get_speed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field course from uav_status message
|
||||
*
|
||||
* @return Course UAV
|
||||
*/
|
||||
static inline float mavlink_msg_uav_status_get_course(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a uav_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param uav_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_uav_status_decode(const mavlink_message_t* msg, mavlink_uav_status_t* uav_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
uav_status->latitude = mavlink_msg_uav_status_get_latitude(msg);
|
||||
uav_status->longitude = mavlink_msg_uav_status_get_longitude(msg);
|
||||
uav_status->altitude = mavlink_msg_uav_status_get_altitude(msg);
|
||||
uav_status->speed = mavlink_msg_uav_status_get_speed(msg);
|
||||
uav_status->course = mavlink_msg_uav_status_get_course(msg);
|
||||
uav_status->target = mavlink_msg_uav_status_get_target(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_UAV_STATUS_LEN? msg->len : MAVLINK_MSG_ID_UAV_STATUS_LEN;
|
||||
memset(uav_status, 0, MAVLINK_MSG_ID_UAV_STATUS_LEN);
|
||||
memcpy(uav_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
#pragma once
|
||||
// MESSAGE VOLT_SENSOR PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_VOLT_SENSOR 191
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_volt_sensor_t {
|
||||
uint16_t voltage; /*< Voltage in uS of PWM. 0 uS = 0V, 20 uS = 21.5V */
|
||||
uint16_t reading2; /*< Depends on the value of r2Type (0) Current consumption in uS of PWM, 20 uS = 90Amp (1) Distance in cm (2) Distance in cm (3) Absolute value*/
|
||||
uint8_t r2Type; /*< It is the value of reading 2: 0 - Current, 1 - Foreward Sonar, 2 - Back Sonar, 3 - RPM*/
|
||||
}) mavlink_volt_sensor_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_VOLT_SENSOR_LEN 5
|
||||
#define MAVLINK_MSG_ID_VOLT_SENSOR_MIN_LEN 5
|
||||
#define MAVLINK_MSG_ID_191_LEN 5
|
||||
#define MAVLINK_MSG_ID_191_MIN_LEN 5
|
||||
|
||||
#define MAVLINK_MSG_ID_VOLT_SENSOR_CRC 17
|
||||
#define MAVLINK_MSG_ID_191_CRC 17
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_VOLT_SENSOR { \
|
||||
191, \
|
||||
"VOLT_SENSOR", \
|
||||
3, \
|
||||
{ { "r2Type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_volt_sensor_t, r2Type) }, \
|
||||
{ "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_volt_sensor_t, voltage) }, \
|
||||
{ "reading2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_volt_sensor_t, reading2) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_VOLT_SENSOR { \
|
||||
"VOLT_SENSOR", \
|
||||
3, \
|
||||
{ { "r2Type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_volt_sensor_t, r2Type) }, \
|
||||
{ "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_volt_sensor_t, voltage) }, \
|
||||
{ "reading2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_volt_sensor_t, reading2) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a volt_sensor 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 r2Type It is the value of reading 2: 0 - Current, 1 - Foreward Sonar, 2 - Back Sonar, 3 - RPM
|
||||
* @param voltage Voltage in uS of PWM. 0 uS = 0V, 20 uS = 21.5V
|
||||
* @param reading2 Depends on the value of r2Type (0) Current consumption in uS of PWM, 20 uS = 90Amp (1) Distance in cm (2) Distance in cm (3) Absolute value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_volt_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t r2Type, uint16_t voltage, uint16_t reading2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VOLT_SENSOR_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage);
|
||||
_mav_put_uint16_t(buf, 2, reading2);
|
||||
_mav_put_uint8_t(buf, 4, r2Type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VOLT_SENSOR_LEN);
|
||||
#else
|
||||
mavlink_volt_sensor_t packet;
|
||||
packet.voltage = voltage;
|
||||
packet.reading2 = reading2;
|
||||
packet.r2Type = r2Type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VOLT_SENSOR_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_VOLT_SENSOR;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VOLT_SENSOR_MIN_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a volt_sensor 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 r2Type It is the value of reading 2: 0 - Current, 1 - Foreward Sonar, 2 - Back Sonar, 3 - RPM
|
||||
* @param voltage Voltage in uS of PWM. 0 uS = 0V, 20 uS = 21.5V
|
||||
* @param reading2 Depends on the value of r2Type (0) Current consumption in uS of PWM, 20 uS = 90Amp (1) Distance in cm (2) Distance in cm (3) Absolute value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_volt_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t r2Type,uint16_t voltage,uint16_t reading2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VOLT_SENSOR_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage);
|
||||
_mav_put_uint16_t(buf, 2, reading2);
|
||||
_mav_put_uint8_t(buf, 4, r2Type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VOLT_SENSOR_LEN);
|
||||
#else
|
||||
mavlink_volt_sensor_t packet;
|
||||
packet.voltage = voltage;
|
||||
packet.reading2 = reading2;
|
||||
packet.r2Type = r2Type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VOLT_SENSOR_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_VOLT_SENSOR;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VOLT_SENSOR_MIN_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a volt_sensor 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 volt_sensor C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_volt_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_volt_sensor_t* volt_sensor)
|
||||
{
|
||||
return mavlink_msg_volt_sensor_pack(system_id, component_id, msg, volt_sensor->r2Type, volt_sensor->voltage, volt_sensor->reading2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a volt_sensor 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 volt_sensor C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_volt_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_volt_sensor_t* volt_sensor)
|
||||
{
|
||||
return mavlink_msg_volt_sensor_pack_chan(system_id, component_id, chan, msg, volt_sensor->r2Type, volt_sensor->voltage, volt_sensor->reading2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a volt_sensor message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param r2Type It is the value of reading 2: 0 - Current, 1 - Foreward Sonar, 2 - Back Sonar, 3 - RPM
|
||||
* @param voltage Voltage in uS of PWM. 0 uS = 0V, 20 uS = 21.5V
|
||||
* @param reading2 Depends on the value of r2Type (0) Current consumption in uS of PWM, 20 uS = 90Amp (1) Distance in cm (2) Distance in cm (3) Absolute value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_volt_sensor_send(mavlink_channel_t chan, uint8_t r2Type, uint16_t voltage, uint16_t reading2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_VOLT_SENSOR_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage);
|
||||
_mav_put_uint16_t(buf, 2, reading2);
|
||||
_mav_put_uint8_t(buf, 4, r2Type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VOLT_SENSOR, buf, MAVLINK_MSG_ID_VOLT_SENSOR_MIN_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_CRC);
|
||||
#else
|
||||
mavlink_volt_sensor_t packet;
|
||||
packet.voltage = voltage;
|
||||
packet.reading2 = reading2;
|
||||
packet.r2Type = r2Type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VOLT_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_VOLT_SENSOR_MIN_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a volt_sensor message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_volt_sensor_send_struct(mavlink_channel_t chan, const mavlink_volt_sensor_t* volt_sensor)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_volt_sensor_send(chan, volt_sensor->r2Type, volt_sensor->voltage, volt_sensor->reading2);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VOLT_SENSOR, (const char *)volt_sensor, MAVLINK_MSG_ID_VOLT_SENSOR_MIN_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_VOLT_SENSOR_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_volt_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t r2Type, uint16_t voltage, uint16_t reading2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, voltage);
|
||||
_mav_put_uint16_t(buf, 2, reading2);
|
||||
_mav_put_uint8_t(buf, 4, r2Type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VOLT_SENSOR, buf, MAVLINK_MSG_ID_VOLT_SENSOR_MIN_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_CRC);
|
||||
#else
|
||||
mavlink_volt_sensor_t *packet = (mavlink_volt_sensor_t *)msgbuf;
|
||||
packet->voltage = voltage;
|
||||
packet->reading2 = reading2;
|
||||
packet->r2Type = r2Type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VOLT_SENSOR, (const char *)packet, MAVLINK_MSG_ID_VOLT_SENSOR_MIN_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_LEN, MAVLINK_MSG_ID_VOLT_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE VOLT_SENSOR UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field r2Type from volt_sensor message
|
||||
*
|
||||
* @return It is the value of reading 2: 0 - Current, 1 - Foreward Sonar, 2 - Back Sonar, 3 - RPM
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_volt_sensor_get_r2Type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage from volt_sensor message
|
||||
*
|
||||
* @return Voltage in uS of PWM. 0 uS = 0V, 20 uS = 21.5V
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_volt_sensor_get_voltage(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field reading2 from volt_sensor message
|
||||
*
|
||||
* @return Depends on the value of r2Type (0) Current consumption in uS of PWM, 20 uS = 90Amp (1) Distance in cm (2) Distance in cm (3) Absolute value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_volt_sensor_get_reading2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a volt_sensor message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param volt_sensor C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_volt_sensor_decode(const mavlink_message_t* msg, mavlink_volt_sensor_t* volt_sensor)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
volt_sensor->voltage = mavlink_msg_volt_sensor_get_voltage(msg);
|
||||
volt_sensor->reading2 = mavlink_msg_volt_sensor_get_reading2(msg);
|
||||
volt_sensor->r2Type = mavlink_msg_volt_sensor_get_r2Type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_VOLT_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_VOLT_SENSOR_LEN;
|
||||
memset(volt_sensor, 0, MAVLINK_MSG_ID_VOLT_SENSOR_LEN);
|
||||
memcpy(volt_sensor, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
283
app/drivers/sertrf/protocol/mavlinkv2/slugs/slugs.h
Normal file
283
app/drivers/sertrf/protocol/mavlinkv2/slugs/slugs.h
Normal file
File diff suppressed because one or more lines are too long
1217
app/drivers/sertrf/protocol/mavlinkv2/slugs/testsuite.h
Normal file
1217
app/drivers/sertrf/protocol/mavlinkv2/slugs/testsuite.h
Normal file
File diff suppressed because it is too large
Load Diff
14
app/drivers/sertrf/protocol/mavlinkv2/slugs/version.h
Normal file
14
app/drivers/sertrf/protocol/mavlinkv2/slugs/version.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/** @file
|
||||
* @brief MAVLink comm protocol built from slugs.xml
|
||||
* @see http://mavlink.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Thu Aug 30 2018"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
#endif // MAVLINK_VERSION_H
|
||||
Reference in New Issue
Block a user