[mavlink] Updated mavlink code to work with the current Arducopter (and probably plane and rover). Mavlink library has been updated to V 1.0.
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
|
||||
|
||||
/// @file GCS_MAVLink.cpp
|
||||
/// @brief Supporting bits for MAVLink.
|
||||
|
||||
#include "GCS_MAVLink.h"
|
||||
|
||||
BetterStream *mavlink_comm_0_port;
|
||||
BetterStream *mavlink_comm_1_port;
|
||||
|
||||
// this might need to move to the flight software
|
||||
mavlink_system_t mavlink_system = {7,1,0,0};
|
||||
|
||||
#ifdef MAVLINK10
|
||||
# include "include_v1.0/mavlink_helpers.h"
|
||||
#else
|
||||
# include "include/mavlink_helpers.h"
|
||||
#endif
|
||||
|
||||
uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid)
|
||||
{
|
||||
if (sysid != mavlink_system.sysid)
|
||||
return 1;
|
||||
// Currently we are not checking for correct compid since APM is not passing mavlink info to any subsystem
|
||||
// If it is addressed to our system ID we assume it is for us
|
||||
return 0; // no error
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
|
||||
|
||||
/// @file GCS_MAVLink.h
|
||||
/// @brief One size fits all header for MAVLink integration.
|
||||
|
||||
#ifndef GCS_MAVLink_h
|
||||
#define GCS_MAVLink_h
|
||||
|
||||
#include <BetterStream.h>
|
||||
|
||||
#define MAVLINK_SEPARATE_HELPERS
|
||||
|
||||
#ifdef MAVLINK10
|
||||
# include "include_v1.0/ardupilotmega/version.h"
|
||||
#else
|
||||
# include "include/ardupilotmega/version.h"
|
||||
#endif
|
||||
|
||||
// this allows us to make mavlink_message_t much smaller
|
||||
#define MAVLINK_MAX_PAYLOAD_LEN MAVLINK_MAX_DIALECT_PAYLOAD_SIZE
|
||||
|
||||
#define MAVLINK_COMM_NUM_BUFFERS 2
|
||||
#ifdef MAVLINK10
|
||||
# include "include_v1.0/mavlink_types.h"
|
||||
#else
|
||||
# include "include/mavlink_types.h"
|
||||
#endif
|
||||
|
||||
/// MAVLink stream used for HIL interaction
|
||||
extern BetterStream *mavlink_comm_0_port;
|
||||
|
||||
/// MAVLink stream used for ground control communication
|
||||
extern BetterStream *mavlink_comm_1_port;
|
||||
|
||||
/// MAVLink system definition
|
||||
extern mavlink_system_t mavlink_system;
|
||||
|
||||
/// Send a byte to the nominated MAVLink channel
|
||||
///
|
||||
/// @param chan Channel to send to
|
||||
/// @param ch Byte to send
|
||||
///
|
||||
static inline void comm_send_ch(mavlink_channel_t chan, uint8_t ch)
|
||||
{
|
||||
switch(chan) {
|
||||
case MAVLINK_COMM_0:
|
||||
mavlink_comm_0_port->write(ch);
|
||||
break;
|
||||
case MAVLINK_COMM_1:
|
||||
mavlink_comm_1_port->write(ch);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// Read a byte from the nominated MAVLink channel
|
||||
///
|
||||
/// @param chan Channel to receive on
|
||||
/// @returns Byte read
|
||||
///
|
||||
static inline uint8_t comm_receive_ch(mavlink_channel_t chan)
|
||||
{
|
||||
uint8_t data = 0;
|
||||
|
||||
switch(chan) {
|
||||
case MAVLINK_COMM_0:
|
||||
data = mavlink_comm_0_port->read();
|
||||
break;
|
||||
case MAVLINK_COMM_1:
|
||||
data = mavlink_comm_1_port->read();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/// Check for available data on the nominated MAVLink channel
|
||||
///
|
||||
/// @param chan Channel to check
|
||||
/// @returns Number of bytes available
|
||||
static inline uint16_t comm_get_available(mavlink_channel_t chan)
|
||||
{
|
||||
uint16_t bytes = 0;
|
||||
switch(chan) {
|
||||
case MAVLINK_COMM_0:
|
||||
bytes = mavlink_comm_0_port->available();
|
||||
break;
|
||||
case MAVLINK_COMM_1:
|
||||
bytes = mavlink_comm_1_port->available();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
||||
/// Check for available transmit space on the nominated MAVLink channel
|
||||
///
|
||||
/// @param chan Channel to check
|
||||
/// @returns Number of bytes available, -1 for error
|
||||
static inline int comm_get_txspace(mavlink_channel_t chan)
|
||||
{
|
||||
switch(chan) {
|
||||
case MAVLINK_COMM_0:
|
||||
return mavlink_comm_0_port->txspace();
|
||||
break;
|
||||
case MAVLINK_COMM_1:
|
||||
return mavlink_comm_1_port->txspace();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
#ifdef MAVLINK10
|
||||
# include "include_v1.0/ardupilotmega/mavlink.h"
|
||||
#else
|
||||
# include "include/ardupilotmega/mavlink.h"
|
||||
#endif
|
||||
|
||||
uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid);
|
||||
|
||||
#endif // GCS_MAVLink_h
|
||||
@@ -1,172 +0,0 @@
|
||||
/*
|
||||
compatibility header during transition to MAVLink 1.0
|
||||
*/
|
||||
|
||||
#ifdef MAVLINK10
|
||||
// in MAVLink 1.0 'waypoint' becomes 'mission'. We can remove these
|
||||
// mappings once we are not trying to support both protocols
|
||||
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_CURRENT MAVLINK_MSG_ID_MISSION_CURRENT
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_CURRENT_LEN MAVLINK_MSG_ID_MISSION_CURRENT_LEN
|
||||
#define mavlink_msg_waypoint_current_send mavlink_msg_mission_current_send
|
||||
#define mavlink_msg_waypoint_current_decode mavlink_msg_mission_current_decode
|
||||
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_COUNT MAVLINK_MSG_ID_MISSION_COUNT
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_COUNT_LEN MAVLINK_MSG_ID_MISSION_COUNT_LEN
|
||||
#define mavlink_msg_waypoint_count_send mavlink_msg_mission_count_send
|
||||
#define mavlink_msg_waypoint_count_decode mavlink_msg_mission_count_decode
|
||||
#define mavlink_waypoint_count_t mavlink_mission_count_t
|
||||
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_REQUEST MAVLINK_MSG_ID_MISSION_REQUEST
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LEN MAVLINK_MSG_ID_MISSION_REQUEST_LEN
|
||||
#define mavlink_msg_waypoint_request_send mavlink_msg_mission_request_send
|
||||
#define mavlink_msg_waypoint_request_decode mavlink_msg_mission_request_decode
|
||||
#define mavlink_waypoint_request_t mavlink_mission_request_t
|
||||
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST MAVLINK_MSG_ID_MISSION_REQUEST_LIST
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_REQUEST_LIST_LEN MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN
|
||||
#define mavlink_msg_waypoint_request_list_send mavlink_msg_mission_request_list_send
|
||||
#define mavlink_msg_waypoint_request_list_decode mavlink_msg_mission_request_list_decode
|
||||
#define mavlink_waypoint_request_list_t mavlink_mission_request_list_t
|
||||
|
||||
#define MAVLINK_MSG_ID_WAYPOINT MAVLINK_MSG_ID_MISSION_ITEM
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_LEN MAVLINK_MSG_ID_MISSION_ITEM_LEN
|
||||
#define mavlink_msg_waypoint_send mavlink_msg_mission_item_send
|
||||
#define mavlink_msg_waypoint_decode mavlink_msg_mission_item_decode
|
||||
#define mavlink_waypoint_t mavlink_mission_item_t
|
||||
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_ACK MAVLINK_MSG_ID_MISSION_ACK
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_ACK_LEN MAVLINK_MSG_ID_MISSION_ACK_LEN
|
||||
#define mavlink_msg_waypoint_ack_send mavlink_msg_mission_ack_send
|
||||
#define mavlink_msg_waypoint_ack_decode mavlink_msg_mission_ack_decode
|
||||
#define mavlink_waypoint_ack_t mavlink_mission_ack_t
|
||||
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL MAVLINK_MSG_ID_MISSION_CLEAR_ALL
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL_LEN MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN
|
||||
#define mavlink_msg_waypoint_clear_all_send mavlink_msg_mission_clear_all_send
|
||||
#define mavlink_msg_waypoint_clear_all_decode mavlink_msg_mission_clear_all_decode
|
||||
#define mavlink_waypoint_clear_all_t mavlink_mission_clear_all_t
|
||||
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT MAVLINK_MSG_ID_MISSION_SET_CURRENT
|
||||
#define MAVLINK_MSG_ID_WAYPOINT_SET_CURRENT_LEN MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN
|
||||
#define mavlink_msg_waypoint_set_current_send mavlink_msg_mission_set_current_send
|
||||
#define mavlink_msg_waypoint_set_current_decode mavlink_msg_mission_set_current_decode
|
||||
#define mavlink_waypoint_set_current_t mavlink_mission_set_current_t
|
||||
|
||||
static uint8_t mav_var_type(enum ap_var_type t)
|
||||
{
|
||||
if (t == AP_PARAM_INT8) {
|
||||
return MAV_VAR_INT8;
|
||||
}
|
||||
if (t == AP_PARAM_INT16) {
|
||||
return MAV_VAR_INT16;
|
||||
}
|
||||
if (t == AP_PARAM_INT32) {
|
||||
return MAV_VAR_INT32;
|
||||
}
|
||||
// treat any others as float
|
||||
return MAV_VAR_FLOAT;
|
||||
}
|
||||
|
||||
#define MAV_FIXED_WING MAV_TYPE_FIXED_WING
|
||||
|
||||
#else // MAVLINK10
|
||||
|
||||
static uint8_t mav_var_type(enum ap_var_type t)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MAV_MISSION_ACCEPTED 0
|
||||
#define MAV_MISSION_UNSUPPORTED 1
|
||||
#define MAV_MISSION_UNSUPPORTED_FRAME 1
|
||||
#define MAV_MISSION_ERROR 1
|
||||
#define MAV_MISSION_INVALID_SEQUENCE 1
|
||||
|
||||
/*
|
||||
some functions have some extra params in MAVLink 1.0
|
||||
*/
|
||||
|
||||
static void mavlink_msg_global_position_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat, int32_t lon,
|
||||
int32_t alt, int32_t relative_alt, int16_t vx, int16_t vy,
|
||||
int16_t vz, uint16_t hdg)
|
||||
{
|
||||
mavlink_msg_global_position_int_send(
|
||||
chan,
|
||||
lat,
|
||||
lon,
|
||||
alt,
|
||||
vx, vy, vz);
|
||||
}
|
||||
|
||||
static void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port,
|
||||
int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled,
|
||||
int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled,
|
||||
int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi)
|
||||
{
|
||||
mavlink_msg_rc_channels_scaled_send(
|
||||
chan,
|
||||
chan1_scaled,
|
||||
chan2_scaled,
|
||||
chan3_scaled,
|
||||
chan4_scaled,
|
||||
chan5_scaled,
|
||||
chan6_scaled,
|
||||
chan7_scaled,
|
||||
chan8_scaled,
|
||||
rssi);
|
||||
}
|
||||
|
||||
static void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port,
|
||||
uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw,
|
||||
uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw,
|
||||
uint16_t chan7_raw, uint16_t chan8_raw, uint8_t rssi)
|
||||
{
|
||||
mavlink_msg_rc_channels_raw_send(
|
||||
chan,
|
||||
chan1_raw,
|
||||
chan2_raw,
|
||||
chan3_raw,
|
||||
chan4_raw,
|
||||
chan5_raw,
|
||||
chan6_raw,
|
||||
chan7_raw,
|
||||
chan8_raw,
|
||||
rssi);
|
||||
}
|
||||
|
||||
|
||||
static void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t port,
|
||||
uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw,
|
||||
uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw,
|
||||
uint16_t servo7_raw, uint16_t servo8_raw)
|
||||
{
|
||||
mavlink_msg_servo_output_raw_send(
|
||||
chan,
|
||||
servo1_raw,
|
||||
servo2_raw,
|
||||
servo3_raw,
|
||||
servo4_raw,
|
||||
servo5_raw,
|
||||
servo6_raw,
|
||||
servo7_raw,
|
||||
servo8_raw);
|
||||
}
|
||||
|
||||
static void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t severity, const char *text)
|
||||
{
|
||||
mavlink_msg_statustext_send(chan, severity, (const int8_t*) text);
|
||||
}
|
||||
|
||||
static void mavlink_msg_param_value_send(mavlink_channel_t chan, const char *param_id,
|
||||
float param_value, uint8_t param_type,
|
||||
uint16_t param_count, uint16_t param_index)
|
||||
{
|
||||
mavlink_msg_param_value_send(
|
||||
chan,
|
||||
(int8_t *)param_id,
|
||||
param_value,
|
||||
param_count,
|
||||
param_index);
|
||||
}
|
||||
#endif // MAVLINK10
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,276 @@
|
||||
// MESSAGE AHRS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS 163
|
||||
|
||||
typedef struct __mavlink_ahrs_t
|
||||
{
|
||||
float omegaIx; ///< X gyro drift estimate rad/s
|
||||
float omegaIy; ///< Y gyro drift estimate rad/s
|
||||
float omegaIz; ///< Z gyro drift estimate rad/s
|
||||
float accel_weight; ///< average accel_weight
|
||||
float renorm_val; ///< average renormalisation value
|
||||
float error_rp; ///< average error_roll_pitch value
|
||||
float error_yaw; ///< average error_yaw value
|
||||
} mavlink_ahrs_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS_LEN 28
|
||||
#define MAVLINK_MSG_ID_163_LEN 28
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_AHRS { \
|
||||
"AHRS", \
|
||||
7, \
|
||||
{ { "omegaIx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs_t, omegaIx) }, \
|
||||
{ "omegaIy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs_t, omegaIy) }, \
|
||||
{ "omegaIz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs_t, omegaIz) }, \
|
||||
{ "accel_weight", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs_t, accel_weight) }, \
|
||||
{ "renorm_val", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_ahrs_t, renorm_val) }, \
|
||||
{ "error_rp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_ahrs_t, error_rp) }, \
|
||||
{ "error_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_ahrs_t, error_yaw) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a ahrs 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 omegaIx X gyro drift estimate rad/s
|
||||
* @param omegaIy Y gyro drift estimate rad/s
|
||||
* @param omegaIz Z gyro drift estimate rad/s
|
||||
* @param accel_weight average accel_weight
|
||||
* @param renorm_val average renormalisation value
|
||||
* @param error_rp average error_roll_pitch value
|
||||
* @param error_yaw average error_yaw value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_float(buf, 0, omegaIx);
|
||||
_mav_put_float(buf, 4, omegaIy);
|
||||
_mav_put_float(buf, 8, omegaIz);
|
||||
_mav_put_float(buf, 12, accel_weight);
|
||||
_mav_put_float(buf, 16, renorm_val);
|
||||
_mav_put_float(buf, 20, error_rp);
|
||||
_mav_put_float(buf, 24, error_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_ahrs_t packet;
|
||||
packet.omegaIx = omegaIx;
|
||||
packet.omegaIy = omegaIy;
|
||||
packet.omegaIz = omegaIz;
|
||||
packet.accel_weight = accel_weight;
|
||||
packet.renorm_val = renorm_val;
|
||||
packet.error_rp = error_rp;
|
||||
packet.error_yaw = error_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 28, 127);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a ahrs 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param omegaIx X gyro drift estimate rad/s
|
||||
* @param omegaIy Y gyro drift estimate rad/s
|
||||
* @param omegaIz Z gyro drift estimate rad/s
|
||||
* @param accel_weight average accel_weight
|
||||
* @param renorm_val average renormalisation value
|
||||
* @param error_rp average error_roll_pitch value
|
||||
* @param error_yaw average error_yaw value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float omegaIx,float omegaIy,float omegaIz,float accel_weight,float renorm_val,float error_rp,float error_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_float(buf, 0, omegaIx);
|
||||
_mav_put_float(buf, 4, omegaIy);
|
||||
_mav_put_float(buf, 8, omegaIz);
|
||||
_mav_put_float(buf, 12, accel_weight);
|
||||
_mav_put_float(buf, 16, renorm_val);
|
||||
_mav_put_float(buf, 20, error_rp);
|
||||
_mav_put_float(buf, 24, error_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_ahrs_t packet;
|
||||
packet.omegaIx = omegaIx;
|
||||
packet.omegaIy = omegaIy;
|
||||
packet.omegaIz = omegaIz;
|
||||
packet.accel_weight = accel_weight;
|
||||
packet.renorm_val = renorm_val;
|
||||
packet.error_rp = error_rp;
|
||||
packet.error_yaw = error_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 127);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ahrs struct into a 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 ahrs C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ahrs_t* ahrs)
|
||||
{
|
||||
return mavlink_msg_ahrs_pack(system_id, component_id, msg, ahrs->omegaIx, ahrs->omegaIy, ahrs->omegaIz, ahrs->accel_weight, ahrs->renorm_val, ahrs->error_rp, ahrs->error_yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ahrs message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param omegaIx X gyro drift estimate rad/s
|
||||
* @param omegaIy Y gyro drift estimate rad/s
|
||||
* @param omegaIz Z gyro drift estimate rad/s
|
||||
* @param accel_weight average accel_weight
|
||||
* @param renorm_val average renormalisation value
|
||||
* @param error_rp average error_roll_pitch value
|
||||
* @param error_yaw average error_yaw value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_ahrs_send(mavlink_channel_t chan, float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_float(buf, 0, omegaIx);
|
||||
_mav_put_float(buf, 4, omegaIy);
|
||||
_mav_put_float(buf, 8, omegaIz);
|
||||
_mav_put_float(buf, 12, accel_weight);
|
||||
_mav_put_float(buf, 16, renorm_val);
|
||||
_mav_put_float(buf, 20, error_rp);
|
||||
_mav_put_float(buf, 24, error_yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, buf, 28, 127);
|
||||
#else
|
||||
mavlink_ahrs_t packet;
|
||||
packet.omegaIx = omegaIx;
|
||||
packet.omegaIy = omegaIy;
|
||||
packet.omegaIz = omegaIz;
|
||||
packet.accel_weight = accel_weight;
|
||||
packet.renorm_val = renorm_val;
|
||||
packet.error_rp = error_rp;
|
||||
packet.error_yaw = error_yaw;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, (const char *)&packet, 28, 127);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AHRS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field omegaIx from ahrs message
|
||||
*
|
||||
* @return X gyro drift estimate rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_omegaIx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field omegaIy from ahrs message
|
||||
*
|
||||
* @return Y gyro drift estimate rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_omegaIy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field omegaIz from ahrs message
|
||||
*
|
||||
* @return Z gyro drift estimate rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_omegaIz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accel_weight from ahrs message
|
||||
*
|
||||
* @return average accel_weight
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_accel_weight(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field renorm_val from ahrs message
|
||||
*
|
||||
* @return average renormalisation value
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_renorm_val(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field error_rp from ahrs message
|
||||
*
|
||||
* @return average error_roll_pitch value
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_error_rp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field error_yaw from ahrs message
|
||||
*
|
||||
* @return average error_yaw value
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs_get_error_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a ahrs message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param ahrs C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs_decode(const mavlink_message_t* msg, mavlink_ahrs_t* ahrs)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
ahrs->omegaIx = mavlink_msg_ahrs_get_omegaIx(msg);
|
||||
ahrs->omegaIy = mavlink_msg_ahrs_get_omegaIy(msg);
|
||||
ahrs->omegaIz = mavlink_msg_ahrs_get_omegaIz(msg);
|
||||
ahrs->accel_weight = mavlink_msg_ahrs_get_accel_weight(msg);
|
||||
ahrs->renorm_val = mavlink_msg_ahrs_get_renorm_val(msg);
|
||||
ahrs->error_rp = mavlink_msg_ahrs_get_error_rp(msg);
|
||||
ahrs->error_yaw = mavlink_msg_ahrs_get_error_yaw(msg);
|
||||
#else
|
||||
memcpy(ahrs, _MAV_PAYLOAD(msg), 28);
|
||||
#endif
|
||||
}
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon
|
||||
_mav_put_uint16_t(buf, 8, adc5);
|
||||
_mav_put_uint16_t(buf, 10, adc6);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_ap_adc_t packet;
|
||||
packet.adc1 = adc1;
|
||||
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t compon
|
||||
packet.adc5 = adc5;
|
||||
packet.adc6 = adc6;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AP_ADC;
|
||||
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint16_t(buf, 8, adc5);
|
||||
_mav_put_uint16_t(buf, 10, adc6);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_ap_adc_t packet;
|
||||
packet.adc1 = adc1;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t c
|
||||
packet.adc5 = adc5;
|
||||
packet.adc6 = adc6;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AP_ADC;
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE DATA16 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA16 169
|
||||
|
||||
typedef struct __mavlink_data16_t
|
||||
{
|
||||
uint8_t type; ///< data type
|
||||
uint8_t len; ///< data length
|
||||
uint8_t data[16]; ///< raw data
|
||||
} mavlink_data16_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA16_LEN 18
|
||||
#define MAVLINK_MSG_ID_169_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_DATA16_FIELD_DATA_LEN 16
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_DATA16 { \
|
||||
"DATA16", \
|
||||
3, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_data16_t, type) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_data16_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 16, 2, offsetof(mavlink_data16_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a data16 message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_data16_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA16;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 18, 234);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data16 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_data16_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA16;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 234);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data16 struct into a 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 data16 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data16_t* data16)
|
||||
{
|
||||
return mavlink_msg_data16_pack(system_id, component_id, msg, data16->type, data16->len, data16->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data16 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data16_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 16);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, buf, 18, 234);
|
||||
#else
|
||||
mavlink_data16_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*16);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, (const char *)&packet, 18, 234);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA16 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data16 message
|
||||
*
|
||||
* @return data type
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data16_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from data16 message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data16_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from data16 message
|
||||
*
|
||||
* @return raw data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 16, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data16 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data16 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data16_decode(const mavlink_message_t* msg, mavlink_data16_t* data16)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
data16->type = mavlink_msg_data16_get_type(msg);
|
||||
data16->len = mavlink_msg_data16_get_len(msg);
|
||||
mavlink_msg_data16_get_data(msg, data16->data);
|
||||
#else
|
||||
memcpy(data16, _MAV_PAYLOAD(msg), 18);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE DATA32 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA32 170
|
||||
|
||||
typedef struct __mavlink_data32_t
|
||||
{
|
||||
uint8_t type; ///< data type
|
||||
uint8_t len; ///< data length
|
||||
uint8_t data[32]; ///< raw data
|
||||
} mavlink_data32_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA32_LEN 34
|
||||
#define MAVLINK_MSG_ID_170_LEN 34
|
||||
|
||||
#define MAVLINK_MSG_DATA32_FIELD_DATA_LEN 32
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_DATA32 { \
|
||||
"DATA32", \
|
||||
3, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_data32_t, type) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_data32_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 32, 2, offsetof(mavlink_data32_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a data32 message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[34];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34);
|
||||
#else
|
||||
mavlink_data32_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA32;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 34, 73);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data32 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[34];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 34);
|
||||
#else
|
||||
mavlink_data32_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 34);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA32;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 34, 73);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data32 struct into a 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 data32 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data32_t* data32)
|
||||
{
|
||||
return mavlink_msg_data32_pack(system_id, component_id, msg, data32->type, data32->len, data32->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data32 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data32_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[34];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, buf, 34, 73);
|
||||
#else
|
||||
mavlink_data32_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, (const char *)&packet, 34, 73);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA32 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data32 message
|
||||
*
|
||||
* @return data type
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data32_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from data32 message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data32_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from data32 message
|
||||
*
|
||||
* @return raw data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 32, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data32 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data32 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data32_decode(const mavlink_message_t* msg, mavlink_data32_t* data32)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
data32->type = mavlink_msg_data32_get_type(msg);
|
||||
data32->len = mavlink_msg_data32_get_len(msg);
|
||||
mavlink_msg_data32_get_data(msg, data32->data);
|
||||
#else
|
||||
memcpy(data32, _MAV_PAYLOAD(msg), 34);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE DATA64 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA64 171
|
||||
|
||||
typedef struct __mavlink_data64_t
|
||||
{
|
||||
uint8_t type; ///< data type
|
||||
uint8_t len; ///< data length
|
||||
uint8_t data[64]; ///< raw data
|
||||
} mavlink_data64_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA64_LEN 66
|
||||
#define MAVLINK_MSG_ID_171_LEN 66
|
||||
|
||||
#define MAVLINK_MSG_DATA64_FIELD_DATA_LEN 64
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_DATA64 { \
|
||||
"DATA64", \
|
||||
3, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_data64_t, type) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_data64_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 64, 2, offsetof(mavlink_data64_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a data64 message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[66];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 64);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 66);
|
||||
#else
|
||||
mavlink_data64_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 66);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA64;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 66, 181);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data64 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[66];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 64);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 66);
|
||||
#else
|
||||
mavlink_data64_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 66);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA64;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 66, 181);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data64 struct into a 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 data64 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data64_t* data64)
|
||||
{
|
||||
return mavlink_msg_data64_pack(system_id, component_id, msg, data64->type, data64->len, data64->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data64 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data64_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[66];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 64);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, buf, 66, 181);
|
||||
#else
|
||||
mavlink_data64_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*64);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, (const char *)&packet, 66, 181);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA64 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data64 message
|
||||
*
|
||||
* @return data type
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data64_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from data64 message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data64_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from data64 message
|
||||
*
|
||||
* @return raw data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 64, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data64 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data64 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data64_decode(const mavlink_message_t* msg, mavlink_data64_t* data64)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
data64->type = mavlink_msg_data64_get_type(msg);
|
||||
data64->len = mavlink_msg_data64_get_len(msg);
|
||||
mavlink_msg_data64_get_data(msg, data64->data);
|
||||
#else
|
||||
memcpy(data64, _MAV_PAYLOAD(msg), 66);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE DATA96 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA96 172
|
||||
|
||||
typedef struct __mavlink_data96_t
|
||||
{
|
||||
uint8_t type; ///< data type
|
||||
uint8_t len; ///< data length
|
||||
uint8_t data[96]; ///< raw data
|
||||
} mavlink_data96_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA96_LEN 98
|
||||
#define MAVLINK_MSG_ID_172_LEN 98
|
||||
|
||||
#define MAVLINK_MSG_DATA96_FIELD_DATA_LEN 96
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_DATA96 { \
|
||||
"DATA96", \
|
||||
3, \
|
||||
{ { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_data96_t, type) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_data96_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 96, 2, offsetof(mavlink_data96_t, data) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a data96 message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[98];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 96);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 98);
|
||||
#else
|
||||
mavlink_data96_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 98);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA96;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 98, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data96 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[98];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 96);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 98);
|
||||
#else
|
||||
mavlink_data96_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 98);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA96;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 98, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data96 struct into a 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 data96 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data96_t* data96)
|
||||
{
|
||||
return mavlink_msg_data96_pack(system_id, component_id, msg, data96->type, data96->len, data96->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data96 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type data type
|
||||
* @param len data length
|
||||
* @param data raw data
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data96_send(mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[98];
|
||||
_mav_put_uint8_t(buf, 0, type);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 96);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, buf, 98, 22);
|
||||
#else
|
||||
mavlink_data96_t packet;
|
||||
packet.type = type;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*96);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, (const char *)&packet, 98, 22);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA96 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data96 message
|
||||
*
|
||||
* @return data type
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data96_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from data96 message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data96_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from data96 message
|
||||
*
|
||||
* @return raw data
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 96, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data96 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data96 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data96_decode(const mavlink_message_t* msg, mavlink_data96_t* data96)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
data96->type = mavlink_msg_data96_get_type(msg);
|
||||
data96->len = mavlink_msg_data96_get_len(msg);
|
||||
mavlink_msg_data96_get_data(msg, data96->data);
|
||||
#else
|
||||
memcpy(data96, _MAV_PAYLOAD(msg), 98);
|
||||
#endif
|
||||
}
|
||||
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 13, engine_cut_off);
|
||||
_mav_put_uint8_t(buf, 14, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_digicam_configure_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uin
|
||||
packet.engine_cut_off = engine_cut_off;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE;
|
||||
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id
|
||||
_mav_put_uint8_t(buf, 13, engine_cut_off);
|
||||
_mav_put_uint8_t(buf, 14, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_digicam_configure_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id
|
||||
packet.engine_cut_off = engine_cut_off;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE;
|
||||
|
||||
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t(buf, 11, command_id);
|
||||
_mav_put_uint8_t(buf, 12, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13);
|
||||
#else
|
||||
mavlink_digicam_control_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8
|
||||
packet.command_id = command_id;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL;
|
||||
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 11, command_id);
|
||||
_mav_put_uint8_t(buf, 12, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13);
|
||||
#else
|
||||
mavlink_digicam_control_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id,
|
||||
packet.command_id = command_id;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_fence_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_fence_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT;
|
||||
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint8_t(buf, 10, idx);
|
||||
_mav_put_uint8_t(buf, 11, count);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_fence_point_t packet;
|
||||
packet.lat = lat;
|
||||
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t c
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT;
|
||||
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint
|
||||
_mav_put_uint8_t(buf, 10, idx);
|
||||
_mav_put_uint8_t(buf, 11, count);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_fence_point_t packet;
|
||||
packet.lat = lat;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT;
|
||||
|
||||
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 6, breach_status);
|
||||
_mav_put_uint8_t(buf, 7, breach_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_fence_status_t packet;
|
||||
packet.breach_time = breach_time;
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t
|
||||
packet.breach_status = breach_status;
|
||||
packet.breach_type = breach_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 6, breach_status);
|
||||
_mav_put_uint8_t(buf, 7, breach_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_fence_status_t packet;
|
||||
packet.breach_time = breach_time;
|
||||
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uin
|
||||
packet.breach_status = breach_status;
|
||||
packet.breach_type = breach_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS;
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
// MESSAGE HWSTATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HWSTATUS 165
|
||||
|
||||
typedef struct __mavlink_hwstatus_t
|
||||
{
|
||||
uint16_t Vcc; ///< board voltage (mV)
|
||||
uint8_t I2Cerr; ///< I2C error count
|
||||
} mavlink_hwstatus_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HWSTATUS_LEN 3
|
||||
#define MAVLINK_MSG_ID_165_LEN 3
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_HWSTATUS { \
|
||||
"HWSTATUS", \
|
||||
2, \
|
||||
{ { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_hwstatus_t, Vcc) }, \
|
||||
{ "I2Cerr", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_hwstatus_t, I2Cerr) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a hwstatus 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 Vcc board voltage (mV)
|
||||
* @param I2Cerr I2C error count
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t Vcc, uint8_t I2Cerr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[3];
|
||||
_mav_put_uint16_t(buf, 0, Vcc);
|
||||
_mav_put_uint8_t(buf, 2, I2Cerr);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HWSTATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 3, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a hwstatus 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param Vcc board voltage (mV)
|
||||
* @param I2Cerr I2C error count
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t Vcc,uint8_t I2Cerr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[3];
|
||||
_mav_put_uint16_t(buf, 0, Vcc);
|
||||
_mav_put_uint8_t(buf, 2, I2Cerr);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HWSTATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hwstatus struct into a 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 hwstatus C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hwstatus_t* hwstatus)
|
||||
{
|
||||
return mavlink_msg_hwstatus_pack(system_id, component_id, msg, hwstatus->Vcc, hwstatus->I2Cerr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hwstatus message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param Vcc board voltage (mV)
|
||||
* @param I2Cerr I2C error count
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_hwstatus_send(mavlink_channel_t chan, uint16_t Vcc, uint8_t I2Cerr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[3];
|
||||
_mav_put_uint16_t(buf, 0, Vcc);
|
||||
_mav_put_uint8_t(buf, 2, I2Cerr);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, buf, 3, 21);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, 3, 21);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HWSTATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field Vcc from hwstatus message
|
||||
*
|
||||
* @return board voltage (mV)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_get_Vcc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field I2Cerr from hwstatus message
|
||||
*
|
||||
* @return I2C error count
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_hwstatus_get_I2Cerr(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a hwstatus message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param hwstatus C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_hwstatus_decode(const mavlink_message_t* msg, mavlink_hwstatus_t* hwstatus)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
hwstatus->Vcc = mavlink_msg_hwstatus_get_Vcc(msg);
|
||||
hwstatus->I2Cerr = mavlink_msg_hwstatus_get_I2Cerr(msg);
|
||||
#else
|
||||
memcpy(hwstatus, _MAV_PAYLOAD(msg), 3);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
// MESSAGE LIMITS_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LIMITS_STATUS 167
|
||||
|
||||
typedef struct __mavlink_limits_status_t
|
||||
{
|
||||
uint32_t last_trigger; ///< time of last breach in milliseconds since boot
|
||||
uint32_t last_action; ///< time of last recovery action in milliseconds since boot
|
||||
uint32_t last_recovery; ///< time of last successful recovery in milliseconds since boot
|
||||
uint32_t last_clear; ///< time of last all-clear in milliseconds since boot
|
||||
uint16_t breach_count; ///< number of fence breaches
|
||||
uint8_t limits_state; ///< state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
uint8_t mods_enabled; ///< AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
uint8_t mods_required; ///< AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
uint8_t mods_triggered; ///< AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
} mavlink_limits_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LIMITS_STATUS_LEN 22
|
||||
#define MAVLINK_MSG_ID_167_LEN 22
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LIMITS_STATUS { \
|
||||
"LIMITS_STATUS", \
|
||||
9, \
|
||||
{ { "last_trigger", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_limits_status_t, last_trigger) }, \
|
||||
{ "last_action", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_limits_status_t, last_action) }, \
|
||||
{ "last_recovery", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_limits_status_t, last_recovery) }, \
|
||||
{ "last_clear", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_limits_status_t, last_clear) }, \
|
||||
{ "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_limits_status_t, breach_count) }, \
|
||||
{ "limits_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_limits_status_t, limits_state) }, \
|
||||
{ "mods_enabled", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_limits_status_t, mods_enabled) }, \
|
||||
{ "mods_required", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_limits_status_t, mods_required) }, \
|
||||
{ "mods_triggered", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_limits_status_t, mods_triggered) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a limits_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 limits_state state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
* @param last_trigger time of last breach in milliseconds since boot
|
||||
* @param last_action time of last recovery action in milliseconds since boot
|
||||
* @param last_recovery time of last successful recovery in milliseconds since boot
|
||||
* @param last_clear time of last all-clear in milliseconds since boot
|
||||
* @param breach_count number of fence breaches
|
||||
* @param mods_enabled AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_required AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_triggered AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, last_trigger);
|
||||
_mav_put_uint32_t(buf, 4, last_action);
|
||||
_mav_put_uint32_t(buf, 8, last_recovery);
|
||||
_mav_put_uint32_t(buf, 12, last_clear);
|
||||
_mav_put_uint16_t(buf, 16, breach_count);
|
||||
_mav_put_uint8_t(buf, 18, limits_state);
|
||||
_mav_put_uint8_t(buf, 19, mods_enabled);
|
||||
_mav_put_uint8_t(buf, 20, mods_required);
|
||||
_mav_put_uint8_t(buf, 21, mods_triggered);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_limits_status_t packet;
|
||||
packet.last_trigger = last_trigger;
|
||||
packet.last_action = last_action;
|
||||
packet.last_recovery = last_recovery;
|
||||
packet.last_clear = last_clear;
|
||||
packet.breach_count = breach_count;
|
||||
packet.limits_state = limits_state;
|
||||
packet.mods_enabled = mods_enabled;
|
||||
packet.mods_required = mods_required;
|
||||
packet.mods_triggered = mods_triggered;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 22, 144);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a limits_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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param limits_state state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
* @param last_trigger time of last breach in milliseconds since boot
|
||||
* @param last_action time of last recovery action in milliseconds since boot
|
||||
* @param last_recovery time of last successful recovery in milliseconds since boot
|
||||
* @param last_clear time of last all-clear in milliseconds since boot
|
||||
* @param breach_count number of fence breaches
|
||||
* @param mods_enabled AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_required AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_triggered AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t limits_state,uint32_t last_trigger,uint32_t last_action,uint32_t last_recovery,uint32_t last_clear,uint16_t breach_count,uint8_t mods_enabled,uint8_t mods_required,uint8_t mods_triggered)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, last_trigger);
|
||||
_mav_put_uint32_t(buf, 4, last_action);
|
||||
_mav_put_uint32_t(buf, 8, last_recovery);
|
||||
_mav_put_uint32_t(buf, 12, last_clear);
|
||||
_mav_put_uint16_t(buf, 16, breach_count);
|
||||
_mav_put_uint8_t(buf, 18, limits_state);
|
||||
_mav_put_uint8_t(buf, 19, mods_enabled);
|
||||
_mav_put_uint8_t(buf, 20, mods_required);
|
||||
_mav_put_uint8_t(buf, 21, mods_triggered);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_limits_status_t packet;
|
||||
packet.last_trigger = last_trigger;
|
||||
packet.last_action = last_action;
|
||||
packet.last_recovery = last_recovery;
|
||||
packet.last_clear = last_clear;
|
||||
packet.breach_count = breach_count;
|
||||
packet.limits_state = limits_state;
|
||||
packet.mods_enabled = mods_enabled;
|
||||
packet.mods_required = mods_required;
|
||||
packet.mods_triggered = mods_triggered;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 144);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a limits_status struct into a 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 limits_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_limits_status_t* limits_status)
|
||||
{
|
||||
return mavlink_msg_limits_status_pack(system_id, component_id, msg, limits_status->limits_state, limits_status->last_trigger, limits_status->last_action, limits_status->last_recovery, limits_status->last_clear, limits_status->breach_count, limits_status->mods_enabled, limits_status->mods_required, limits_status->mods_triggered);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a limits_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param limits_state state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
* @param last_trigger time of last breach in milliseconds since boot
|
||||
* @param last_action time of last recovery action in milliseconds since boot
|
||||
* @param last_recovery time of last successful recovery in milliseconds since boot
|
||||
* @param last_clear time of last all-clear in milliseconds since boot
|
||||
* @param breach_count number of fence breaches
|
||||
* @param mods_enabled AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_required AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
* @param mods_triggered AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_limits_status_send(mavlink_channel_t chan, uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, last_trigger);
|
||||
_mav_put_uint32_t(buf, 4, last_action);
|
||||
_mav_put_uint32_t(buf, 8, last_recovery);
|
||||
_mav_put_uint32_t(buf, 12, last_clear);
|
||||
_mav_put_uint16_t(buf, 16, breach_count);
|
||||
_mav_put_uint8_t(buf, 18, limits_state);
|
||||
_mav_put_uint8_t(buf, 19, mods_enabled);
|
||||
_mav_put_uint8_t(buf, 20, mods_required);
|
||||
_mav_put_uint8_t(buf, 21, mods_triggered);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, 22, 144);
|
||||
#else
|
||||
mavlink_limits_status_t packet;
|
||||
packet.last_trigger = last_trigger;
|
||||
packet.last_action = last_action;
|
||||
packet.last_recovery = last_recovery;
|
||||
packet.last_clear = last_clear;
|
||||
packet.breach_count = breach_count;
|
||||
packet.limits_state = limits_state;
|
||||
packet.mods_enabled = mods_enabled;
|
||||
packet.mods_required = mods_required;
|
||||
packet.mods_triggered = mods_triggered;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)&packet, 22, 144);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LIMITS_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field limits_state from limits_status message
|
||||
*
|
||||
* @return state of AP_Limits, (see enum LimitState, LIMITS_STATE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_limits_status_get_limits_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_trigger from limits_status message
|
||||
*
|
||||
* @return time of last breach in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_limits_status_get_last_trigger(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_action from limits_status message
|
||||
*
|
||||
* @return time of last recovery action in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_limits_status_get_last_action(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_recovery from limits_status message
|
||||
*
|
||||
* @return time of last successful recovery in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_limits_status_get_last_recovery(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field last_clear from limits_status message
|
||||
*
|
||||
* @return time of last all-clear in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_limits_status_get_last_clear(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field breach_count from limits_status message
|
||||
*
|
||||
* @return number of fence breaches
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_get_breach_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mods_enabled from limits_status message
|
||||
*
|
||||
* @return AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_limits_status_get_mods_enabled(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 19);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mods_required from limits_status message
|
||||
*
|
||||
* @return AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_limits_status_get_mods_required(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mods_triggered from limits_status message
|
||||
*
|
||||
* @return AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_limits_status_get_mods_triggered(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a limits_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param limits_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_limits_status_decode(const mavlink_message_t* msg, mavlink_limits_status_t* limits_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
limits_status->last_trigger = mavlink_msg_limits_status_get_last_trigger(msg);
|
||||
limits_status->last_action = mavlink_msg_limits_status_get_last_action(msg);
|
||||
limits_status->last_recovery = mavlink_msg_limits_status_get_last_recovery(msg);
|
||||
limits_status->last_clear = mavlink_msg_limits_status_get_last_clear(msg);
|
||||
limits_status->breach_count = mavlink_msg_limits_status_get_breach_count(msg);
|
||||
limits_status->limits_state = mavlink_msg_limits_status_get_limits_state(msg);
|
||||
limits_status->mods_enabled = mavlink_msg_limits_status_get_mods_enabled(msg);
|
||||
limits_status->mods_required = mavlink_msg_limits_status_get_mods_required(msg);
|
||||
limits_status->mods_triggered = mavlink_msg_limits_status_get_mods_triggered(msg);
|
||||
#else
|
||||
memcpy(limits_status, _MAV_PAYLOAD(msg), 22);
|
||||
#endif
|
||||
}
|
||||
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t compo
|
||||
_mav_put_uint16_t(buf, 0, brkval);
|
||||
_mav_put_uint16_t(buf, 2, freemem);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_meminfo_t packet;
|
||||
packet.brkval = brkval;
|
||||
packet.freemem = freemem;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMINFO;
|
||||
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t
|
||||
_mav_put_uint16_t(buf, 0, brkval);
|
||||
_mav_put_uint16_t(buf, 2, freemem);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_meminfo_t packet;
|
||||
packet.brkval = brkval;
|
||||
packet.freemem = freemem;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMINFO;
|
||||
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t(buf, 4, stab_pitch);
|
||||
_mav_put_uint8_t(buf, 5, stab_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_mount_configure_t packet;
|
||||
packet.target_system = target_system;
|
||||
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8
|
||||
packet.stab_pitch = stab_pitch;
|
||||
packet.stab_yaw = stab_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
|
||||
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 4, stab_pitch);
|
||||
_mav_put_uint8_t(buf, 5, stab_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_mount_configure_t packet;
|
||||
packet.target_system = target_system;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id,
|
||||
packet.stab_pitch = stab_pitch;
|
||||
packet.stab_yaw = stab_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
|
||||
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
_mav_put_uint8_t(buf, 14, save_position);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_mount_control_t packet;
|
||||
packet.input_a = input_a;
|
||||
@@ -66,7 +66,7 @@ static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t
|
||||
packet.target_component = target_component;
|
||||
packet.save_position = save_position;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL;
|
||||
@@ -100,7 +100,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
_mav_put_uint8_t(buf, 14, save_position);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_mount_control_t packet;
|
||||
packet.input_a = input_a;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, ui
|
||||
packet.target_component = target_component;
|
||||
packet.save_position = save_position;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL;
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
|
||||
#else
|
||||
mavlink_mount_status_t packet;
|
||||
packet.pointing_a = pointing_a;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
|
||||
#else
|
||||
mavlink_mount_status_t packet;
|
||||
packet.pointing_a = pointing_a;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uin
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS;
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
// MESSAGE RADIO PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RADIO 166
|
||||
|
||||
typedef struct __mavlink_radio_t
|
||||
{
|
||||
uint16_t rxerrors; ///< receive errors
|
||||
uint16_t fixed; ///< count of error corrected packets
|
||||
uint8_t rssi; ///< local signal strength
|
||||
uint8_t remrssi; ///< remote signal strength
|
||||
uint8_t txbuf; ///< how full the tx buffer is as a percentage
|
||||
uint8_t noise; ///< background noise level
|
||||
uint8_t remnoise; ///< remote background noise level
|
||||
} mavlink_radio_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RADIO_LEN 9
|
||||
#define MAVLINK_MSG_ID_166_LEN 9
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_RADIO { \
|
||||
"RADIO", \
|
||||
7, \
|
||||
{ { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_t, rxerrors) }, \
|
||||
{ "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_t, fixed) }, \
|
||||
{ "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_t, rssi) }, \
|
||||
{ "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_t, remrssi) }, \
|
||||
{ "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_t, txbuf) }, \
|
||||
{ "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_t, noise) }, \
|
||||
{ "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_t, remnoise) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a radio 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 rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint16_t(buf, 0, rxerrors);
|
||||
_mav_put_uint16_t(buf, 2, fixed);
|
||||
_mav_put_uint8_t(buf, 4, rssi);
|
||||
_mav_put_uint8_t(buf, 5, remrssi);
|
||||
_mav_put_uint8_t(buf, 6, txbuf);
|
||||
_mav_put_uint8_t(buf, 7, noise);
|
||||
_mav_put_uint8_t(buf, 8, remnoise);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_radio_t packet;
|
||||
packet.rxerrors = rxerrors;
|
||||
packet.fixed = fixed;
|
||||
packet.rssi = rssi;
|
||||
packet.remrssi = remrssi;
|
||||
packet.txbuf = txbuf;
|
||||
packet.noise = noise;
|
||||
packet.remnoise = remnoise;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RADIO;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 9, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a radio 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint16_t(buf, 0, rxerrors);
|
||||
_mav_put_uint16_t(buf, 2, fixed);
|
||||
_mav_put_uint8_t(buf, 4, rssi);
|
||||
_mav_put_uint8_t(buf, 5, remrssi);
|
||||
_mav_put_uint8_t(buf, 6, txbuf);
|
||||
_mav_put_uint8_t(buf, 7, noise);
|
||||
_mav_put_uint8_t(buf, 8, remnoise);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_radio_t packet;
|
||||
packet.rxerrors = rxerrors;
|
||||
packet.fixed = fixed;
|
||||
packet.rssi = rssi;
|
||||
packet.remrssi = remrssi;
|
||||
packet.txbuf = txbuf;
|
||||
packet.noise = noise;
|
||||
packet.remnoise = remnoise;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RADIO;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a radio struct into a 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 radio C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_radio_t* radio)
|
||||
{
|
||||
return mavlink_msg_radio_pack(system_id, component_id, msg, radio->rssi, radio->remrssi, radio->txbuf, radio->noise, radio->remnoise, radio->rxerrors, radio->fixed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a radio message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param rssi local signal strength
|
||||
* @param remrssi remote signal strength
|
||||
* @param txbuf how full the tx buffer is as a percentage
|
||||
* @param noise background noise level
|
||||
* @param remnoise remote background noise level
|
||||
* @param rxerrors receive errors
|
||||
* @param fixed count of error corrected packets
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_radio_send(mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint16_t(buf, 0, rxerrors);
|
||||
_mav_put_uint16_t(buf, 2, fixed);
|
||||
_mav_put_uint8_t(buf, 4, rssi);
|
||||
_mav_put_uint8_t(buf, 5, remrssi);
|
||||
_mav_put_uint8_t(buf, 6, txbuf);
|
||||
_mav_put_uint8_t(buf, 7, noise);
|
||||
_mav_put_uint8_t(buf, 8, remnoise);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, 9, 21);
|
||||
#else
|
||||
mavlink_radio_t packet;
|
||||
packet.rxerrors = rxerrors;
|
||||
packet.fixed = fixed;
|
||||
packet.rssi = rssi;
|
||||
packet.remrssi = remrssi;
|
||||
packet.txbuf = txbuf;
|
||||
packet.noise = noise;
|
||||
packet.remnoise = remnoise;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (const char *)&packet, 9, 21);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RADIO UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field rssi from radio message
|
||||
*
|
||||
* @return local signal strength
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_rssi(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field remrssi from radio message
|
||||
*
|
||||
* @return remote signal strength
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_remrssi(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field txbuf from radio message
|
||||
*
|
||||
* @return how full the tx buffer is as a percentage
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_txbuf(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field noise from radio message
|
||||
*
|
||||
* @return background noise level
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_noise(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field remnoise from radio message
|
||||
*
|
||||
* @return remote background noise level
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_radio_get_remnoise(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rxerrors from radio message
|
||||
*
|
||||
* @return receive errors
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_get_rxerrors(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fixed from radio message
|
||||
*
|
||||
* @return count of error corrected packets
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_get_fixed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a radio message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param radio C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_radio_decode(const mavlink_message_t* msg, mavlink_radio_t* radio)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
radio->rxerrors = mavlink_msg_radio_get_rxerrors(msg);
|
||||
radio->fixed = mavlink_msg_radio_get_fixed(msg);
|
||||
radio->rssi = mavlink_msg_radio_get_rssi(msg);
|
||||
radio->remrssi = mavlink_msg_radio_get_remrssi(msg);
|
||||
radio->txbuf = mavlink_msg_radio_get_txbuf(msg);
|
||||
radio->noise = mavlink_msg_radio_get_noise(msg);
|
||||
radio->remnoise = mavlink_msg_radio_get_remnoise(msg);
|
||||
#else
|
||||
memcpy(radio, _MAV_PAYLOAD(msg), 9);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
// MESSAGE RANGEFINDER PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RANGEFINDER 173
|
||||
|
||||
typedef struct __mavlink_rangefinder_t
|
||||
{
|
||||
float distance; ///< distance in meters
|
||||
float voltage; ///< raw voltage if available, zero otherwise
|
||||
} mavlink_rangefinder_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RANGEFINDER_LEN 8
|
||||
#define MAVLINK_MSG_ID_173_LEN 8
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_RANGEFINDER { \
|
||||
"RANGEFINDER", \
|
||||
2, \
|
||||
{ { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_rangefinder_t, distance) }, \
|
||||
{ "voltage", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_rangefinder_t, voltage) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a rangefinder 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 distance distance in meters
|
||||
* @param voltage raw voltage if available, zero otherwise
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rangefinder_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float distance, float voltage)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[8];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RANGEFINDER;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 8, 83);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a rangefinder 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param distance distance in meters
|
||||
* @param voltage raw voltage if available, zero otherwise
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rangefinder_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float distance,float voltage)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[8];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RANGEFINDER;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 83);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rangefinder struct into a 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 rangefinder C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rangefinder_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rangefinder_t* rangefinder)
|
||||
{
|
||||
return mavlink_msg_rangefinder_pack(system_id, component_id, msg, rangefinder->distance, rangefinder->voltage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rangefinder message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param distance distance in meters
|
||||
* @param voltage raw voltage if available, zero otherwise
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_rangefinder_send(mavlink_channel_t chan, float distance, float voltage)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[8];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, buf, 8, 83);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, (const char *)&packet, 8, 83);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RANGEFINDER UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field distance from rangefinder message
|
||||
*
|
||||
* @return distance in meters
|
||||
*/
|
||||
static inline float mavlink_msg_rangefinder_get_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage from rangefinder message
|
||||
*
|
||||
* @return raw voltage if available, zero otherwise
|
||||
*/
|
||||
static inline float mavlink_msg_rangefinder_get_voltage(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a rangefinder message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param rangefinder C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_rangefinder_decode(const mavlink_message_t* msg, mavlink_rangefinder_t* rangefinder)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
rangefinder->distance = mavlink_msg_rangefinder_get_distance(msg);
|
||||
rangefinder->voltage = mavlink_msg_rangefinder_get_voltage(msg);
|
||||
#else
|
||||
memcpy(rangefinder, _MAV_PAYLOAD(msg), 8);
|
||||
#endif
|
||||
}
|
||||
@@ -80,7 +80,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_
|
||||
_mav_put_int16_t(buf, 38, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 40, mag_ofs_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42);
|
||||
#else
|
||||
mavlink_sensor_offsets_t packet;
|
||||
packet.mag_declination = mag_declination;
|
||||
@@ -96,7 +96,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u
|
||||
_mav_put_int16_t(buf, 38, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 40, mag_ofs_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42);
|
||||
#else
|
||||
mavlink_sensor_offsets_t packet;
|
||||
packet.mag_declination = mag_declination;
|
||||
@@ -158,7 +158,7 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_set_mag_offsets_t packet;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8);
|
||||
#else
|
||||
mavlink_set_mag_offsets_t packet;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id,
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
|
||||
|
||||
@@ -0,0 +1,364 @@
|
||||
// MESSAGE SIMSTATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SIMSTATE 164
|
||||
|
||||
typedef struct __mavlink_simstate_t
|
||||
{
|
||||
float roll; ///< Roll angle (rad)
|
||||
float pitch; ///< Pitch angle (rad)
|
||||
float yaw; ///< Yaw angle (rad)
|
||||
float xacc; ///< X acceleration m/s/s
|
||||
float yacc; ///< Y acceleration m/s/s
|
||||
float zacc; ///< Z acceleration m/s/s
|
||||
float xgyro; ///< Angular speed around X axis rad/s
|
||||
float ygyro; ///< Angular speed around Y axis rad/s
|
||||
float zgyro; ///< Angular speed around Z axis rad/s
|
||||
float lat; ///< Latitude in degrees
|
||||
float lng; ///< Longitude in degrees
|
||||
} mavlink_simstate_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SIMSTATE_LEN 44
|
||||
#define MAVLINK_MSG_ID_164_LEN 44
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_SIMSTATE { \
|
||||
"SIMSTATE", \
|
||||
11, \
|
||||
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_simstate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_simstate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_simstate_t, yaw) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_simstate_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_simstate_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_simstate_t, zacc) }, \
|
||||
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_simstate_t, xgyro) }, \
|
||||
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_simstate_t, ygyro) }, \
|
||||
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_simstate_t, zgyro) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_simstate_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_simstate_t, lng) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a simstate 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 roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param xacc X acceleration m/s/s
|
||||
* @param yacc Y acceleration m/s/s
|
||||
* @param zacc Z acceleration m/s/s
|
||||
* @param xgyro Angular speed around X axis rad/s
|
||||
* @param ygyro Angular speed around Y axis rad/s
|
||||
* @param zgyro Angular speed around Z axis rad/s
|
||||
* @param lat Latitude in degrees
|
||||
* @param lng Longitude in degrees
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[44];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, xacc);
|
||||
_mav_put_float(buf, 16, yacc);
|
||||
_mav_put_float(buf, 20, zacc);
|
||||
_mav_put_float(buf, 24, xgyro);
|
||||
_mav_put_float(buf, 28, ygyro);
|
||||
_mav_put_float(buf, 32, zgyro);
|
||||
_mav_put_float(buf, 36, lat);
|
||||
_mav_put_float(buf, 40, lng);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 44);
|
||||
#else
|
||||
mavlink_simstate_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 44);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SIMSTATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 44, 111);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a simstate 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param xacc X acceleration m/s/s
|
||||
* @param yacc Y acceleration m/s/s
|
||||
* @param zacc Z acceleration m/s/s
|
||||
* @param xgyro Angular speed around X axis rad/s
|
||||
* @param ygyro Angular speed around Y axis rad/s
|
||||
* @param zgyro Angular speed around Z axis rad/s
|
||||
* @param lat Latitude in degrees
|
||||
* @param lng Longitude in degrees
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float lat,float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[44];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, xacc);
|
||||
_mav_put_float(buf, 16, yacc);
|
||||
_mav_put_float(buf, 20, zacc);
|
||||
_mav_put_float(buf, 24, xgyro);
|
||||
_mav_put_float(buf, 28, ygyro);
|
||||
_mav_put_float(buf, 32, zgyro);
|
||||
_mav_put_float(buf, 36, lat);
|
||||
_mav_put_float(buf, 40, lng);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 44);
|
||||
#else
|
||||
mavlink_simstate_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 44);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SIMSTATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 44, 111);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a simstate struct into a 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 simstate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_simstate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_simstate_t* simstate)
|
||||
{
|
||||
return mavlink_msg_simstate_pack(system_id, component_id, msg, simstate->roll, simstate->pitch, simstate->yaw, simstate->xacc, simstate->yacc, simstate->zacc, simstate->xgyro, simstate->ygyro, simstate->zgyro, simstate->lat, simstate->lng);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a simstate message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param xacc X acceleration m/s/s
|
||||
* @param yacc Y acceleration m/s/s
|
||||
* @param zacc Z acceleration m/s/s
|
||||
* @param xgyro Angular speed around X axis rad/s
|
||||
* @param ygyro Angular speed around Y axis rad/s
|
||||
* @param zgyro Angular speed around Z axis rad/s
|
||||
* @param lat Latitude in degrees
|
||||
* @param lng Longitude in degrees
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_simstate_send(mavlink_channel_t chan, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float lat, float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[44];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, xacc);
|
||||
_mav_put_float(buf, 16, yacc);
|
||||
_mav_put_float(buf, 20, zacc);
|
||||
_mav_put_float(buf, 24, xgyro);
|
||||
_mav_put_float(buf, 28, ygyro);
|
||||
_mav_put_float(buf, 32, zgyro);
|
||||
_mav_put_float(buf, 36, lat);
|
||||
_mav_put_float(buf, 40, lng);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, buf, 44, 111);
|
||||
#else
|
||||
mavlink_simstate_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, (const char *)&packet, 44, 111);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SIMSTATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field roll from simstate message
|
||||
*
|
||||
* @return Roll angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from simstate message
|
||||
*
|
||||
* @return Pitch angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from simstate message
|
||||
*
|
||||
* @return Yaw angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from simstate message
|
||||
*
|
||||
* @return X acceleration m/s/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_xacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yacc from simstate message
|
||||
*
|
||||
* @return Y acceleration m/s/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_yacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zacc from simstate message
|
||||
*
|
||||
* @return Z acceleration m/s/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_zacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xgyro from simstate message
|
||||
*
|
||||
* @return Angular speed around X axis rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_xgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ygyro from simstate message
|
||||
*
|
||||
* @return Angular speed around Y axis rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_ygyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zgyro from simstate message
|
||||
*
|
||||
* @return Angular speed around Z axis rad/s
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_zgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from simstate message
|
||||
*
|
||||
* @return Latitude in degrees
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from simstate message
|
||||
*
|
||||
* @return Longitude in degrees
|
||||
*/
|
||||
static inline float mavlink_msg_simstate_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a simstate message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param simstate C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_simstate_decode(const mavlink_message_t* msg, mavlink_simstate_t* simstate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
simstate->roll = mavlink_msg_simstate_get_roll(msg);
|
||||
simstate->pitch = mavlink_msg_simstate_get_pitch(msg);
|
||||
simstate->yaw = mavlink_msg_simstate_get_yaw(msg);
|
||||
simstate->xacc = mavlink_msg_simstate_get_xacc(msg);
|
||||
simstate->yacc = mavlink_msg_simstate_get_yacc(msg);
|
||||
simstate->zacc = mavlink_msg_simstate_get_zacc(msg);
|
||||
simstate->xgyro = mavlink_msg_simstate_get_xgyro(msg);
|
||||
simstate->ygyro = mavlink_msg_simstate_get_ygyro(msg);
|
||||
simstate->zgyro = mavlink_msg_simstate_get_zgyro(msg);
|
||||
simstate->lat = mavlink_msg_simstate_get_lat(msg);
|
||||
simstate->lng = mavlink_msg_simstate_get_lng(msg);
|
||||
#else
|
||||
memcpy(simstate, _MAV_PAYLOAD(msg), 44);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
// MESSAGE WIND PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_WIND 168
|
||||
|
||||
typedef struct __mavlink_wind_t
|
||||
{
|
||||
float direction; ///< wind direction that wind is coming from (degrees)
|
||||
float speed; ///< wind speed in ground plane (m/s)
|
||||
float speed_z; ///< vertical wind speed (m/s)
|
||||
} mavlink_wind_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_WIND_LEN 12
|
||||
#define MAVLINK_MSG_ID_168_LEN 12
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_WIND { \
|
||||
"WIND", \
|
||||
3, \
|
||||
{ { "direction", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_wind_t, direction) }, \
|
||||
{ "speed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_wind_t, speed) }, \
|
||||
{ "speed_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_t, speed_z) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a wind 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 direction wind direction that wind is coming from (degrees)
|
||||
* @param speed wind speed in ground plane (m/s)
|
||||
* @param speed_z vertical wind speed (m/s)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float direction, float speed, float speed_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[12];
|
||||
_mav_put_float(buf, 0, direction);
|
||||
_mav_put_float(buf, 4, speed);
|
||||
_mav_put_float(buf, 8, speed_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_wind_t packet;
|
||||
packet.direction = direction;
|
||||
packet.speed = speed;
|
||||
packet.speed_z = speed_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_WIND;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 12, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a wind 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param direction wind direction that wind is coming from (degrees)
|
||||
* @param speed wind speed in ground plane (m/s)
|
||||
* @param speed_z vertical wind speed (m/s)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_wind_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float direction,float speed,float speed_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[12];
|
||||
_mav_put_float(buf, 0, direction);
|
||||
_mav_put_float(buf, 4, speed);
|
||||
_mav_put_float(buf, 8, speed_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_wind_t packet;
|
||||
packet.direction = direction;
|
||||
packet.speed = speed;
|
||||
packet.speed_z = speed_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_WIND;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a wind struct into a 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 wind C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_wind_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_t* wind)
|
||||
{
|
||||
return mavlink_msg_wind_pack(system_id, component_id, msg, wind->direction, wind->speed, wind->speed_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a wind message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param direction wind direction that wind is coming from (degrees)
|
||||
* @param speed wind speed in ground plane (m/s)
|
||||
* @param speed_z vertical wind speed (m/s)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_wind_send(mavlink_channel_t chan, float direction, float speed, float speed_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[12];
|
||||
_mav_put_float(buf, 0, direction);
|
||||
_mav_put_float(buf, 4, speed);
|
||||
_mav_put_float(buf, 8, speed_z);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, 12, 1);
|
||||
#else
|
||||
mavlink_wind_t packet;
|
||||
packet.direction = direction;
|
||||
packet.speed = speed;
|
||||
packet.speed_z = speed_z;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)&packet, 12, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE WIND UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field direction from wind message
|
||||
*
|
||||
* @return wind direction that wind is coming from (degrees)
|
||||
*/
|
||||
static inline float mavlink_msg_wind_get_direction(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field speed from wind message
|
||||
*
|
||||
* @return wind speed in ground plane (m/s)
|
||||
*/
|
||||
static inline float mavlink_msg_wind_get_speed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field speed_z from wind message
|
||||
*
|
||||
* @return vertical wind speed (m/s)
|
||||
*/
|
||||
static inline float mavlink_msg_wind_get_speed_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a wind message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param wind C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_wind_decode(const mavlink_message_t* msg, mavlink_wind_t* wind)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
wind->direction = mavlink_msg_wind_get_direction(msg);
|
||||
wind->speed = mavlink_msg_wind_get_speed(msg);
|
||||
wind->speed_z = mavlink_msg_wind_get_speed_z(msg);
|
||||
#else
|
||||
memcpy(wind, _MAV_PAYLOAD(msg), 12);
|
||||
#endif
|
||||
}
|
||||
@@ -534,14 +534,14 @@ static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, ma
|
||||
};
|
||||
mavlink_fence_point_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lng = packet_in.lng;
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
packet1.idx = packet_in.idx;
|
||||
packet1.count = packet_in.count;
|
||||
|
||||
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lng = packet_in.lng;
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
packet1.idx = packet_in.idx;
|
||||
packet1.count = packet_in.count;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_point_encode(system_id, component_id, &msg, &packet1);
|
||||
@@ -561,11 +561,11 @@ static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, ma
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_fence_point_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
|
||||
mavlink_msg_fence_point_decode(last_msg, &packet2);
|
||||
@@ -584,11 +584,11 @@ static void mavlink_test_fence_fetch_point(uint8_t system_id, uint8_t component_
|
||||
};
|
||||
mavlink_fence_fetch_point_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
packet1.idx = packet_in.idx;
|
||||
|
||||
|
||||
packet1.target_system = packet_in.target_system;
|
||||
packet1.target_component = packet_in.target_component;
|
||||
packet1.idx = packet_in.idx;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_fetch_point_encode(system_id, component_id, &msg, &packet1);
|
||||
@@ -608,11 +608,11 @@ static void mavlink_test_fence_fetch_point(uint8_t system_id, uint8_t component_
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx );
|
||||
mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
|
||||
@@ -632,12 +632,12 @@ static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, m
|
||||
};
|
||||
mavlink_fence_status_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.breach_time = packet_in.breach_time;
|
||||
packet1.breach_count = packet_in.breach_count;
|
||||
packet1.breach_status = packet_in.breach_status;
|
||||
packet1.breach_type = packet_in.breach_type;
|
||||
|
||||
|
||||
packet1.breach_time = packet_in.breach_time;
|
||||
packet1.breach_count = packet_in.breach_count;
|
||||
packet1.breach_status = packet_in.breach_status;
|
||||
packet1.breach_type = packet_in.breach_type;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1);
|
||||
@@ -657,17 +657,574 @@ static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, m
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_fence_status_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_fence_status_send(MAVLINK_COMM_1 , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time );
|
||||
mavlink_msg_fence_status_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_ahrs(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_ahrs_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
185.0,
|
||||
};
|
||||
mavlink_ahrs_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.omegaIx = packet_in.omegaIx;
|
||||
packet1.omegaIy = packet_in.omegaIy;
|
||||
packet1.omegaIz = packet_in.omegaIz;
|
||||
packet1.accel_weight = packet_in.accel_weight;
|
||||
packet1.renorm_val = packet_in.renorm_val;
|
||||
packet1.error_rp = packet_in.error_rp;
|
||||
packet1.error_yaw = packet_in.error_yaw;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_ahrs_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_ahrs_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_ahrs_pack(system_id, component_id, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
|
||||
mavlink_msg_ahrs_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_ahrs_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
|
||||
mavlink_msg_ahrs_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_ahrs_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_ahrs_send(MAVLINK_COMM_1 , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
|
||||
mavlink_msg_ahrs_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_simstate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_simstate_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
101.0,
|
||||
129.0,
|
||||
157.0,
|
||||
185.0,
|
||||
213.0,
|
||||
241.0,
|
||||
269.0,
|
||||
297.0,
|
||||
};
|
||||
mavlink_simstate_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.roll = packet_in.roll;
|
||||
packet1.pitch = packet_in.pitch;
|
||||
packet1.yaw = packet_in.yaw;
|
||||
packet1.xacc = packet_in.xacc;
|
||||
packet1.yacc = packet_in.yacc;
|
||||
packet1.zacc = packet_in.zacc;
|
||||
packet1.xgyro = packet_in.xgyro;
|
||||
packet1.ygyro = packet_in.ygyro;
|
||||
packet1.zgyro = packet_in.zgyro;
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lng = packet_in.lng;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_simstate_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_simstate_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_simstate_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
|
||||
mavlink_msg_simstate_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_simstate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
|
||||
mavlink_msg_simstate_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_simstate_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_simstate_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
|
||||
mavlink_msg_simstate_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_hwstatus(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_hwstatus_t packet_in = {
|
||||
17235,
|
||||
139,
|
||||
};
|
||||
mavlink_hwstatus_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.Vcc = packet_in.Vcc;
|
||||
packet1.I2Cerr = packet_in.I2Cerr;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_hwstatus_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_hwstatus_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_hwstatus_pack(system_id, component_id, &msg , packet1.Vcc , packet1.I2Cerr );
|
||||
mavlink_msg_hwstatus_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_hwstatus_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.I2Cerr );
|
||||
mavlink_msg_hwstatus_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_hwstatus_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_hwstatus_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.I2Cerr );
|
||||
mavlink_msg_hwstatus_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_radio(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_radio_t packet_in = {
|
||||
17235,
|
||||
17339,
|
||||
17,
|
||||
84,
|
||||
151,
|
||||
218,
|
||||
29,
|
||||
};
|
||||
mavlink_radio_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.rxerrors = packet_in.rxerrors;
|
||||
packet1.fixed = packet_in.fixed;
|
||||
packet1.rssi = packet_in.rssi;
|
||||
packet1.remrssi = packet_in.remrssi;
|
||||
packet1.txbuf = packet_in.txbuf;
|
||||
packet1.noise = packet_in.noise;
|
||||
packet1.remnoise = packet_in.remnoise;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_radio_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_radio_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_radio_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
|
||||
mavlink_msg_radio_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_radio_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
|
||||
mavlink_msg_radio_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_radio_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_radio_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
|
||||
mavlink_msg_radio_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_limits_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_limits_status_t packet_in = {
|
||||
963497464,
|
||||
963497672,
|
||||
963497880,
|
||||
963498088,
|
||||
18067,
|
||||
187,
|
||||
254,
|
||||
65,
|
||||
132,
|
||||
};
|
||||
mavlink_limits_status_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.last_trigger = packet_in.last_trigger;
|
||||
packet1.last_action = packet_in.last_action;
|
||||
packet1.last_recovery = packet_in.last_recovery;
|
||||
packet1.last_clear = packet_in.last_clear;
|
||||
packet1.breach_count = packet_in.breach_count;
|
||||
packet1.limits_state = packet_in.limits_state;
|
||||
packet1.mods_enabled = packet_in.mods_enabled;
|
||||
packet1.mods_required = packet_in.mods_required;
|
||||
packet1.mods_triggered = packet_in.mods_triggered;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_limits_status_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_limits_status_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_limits_status_pack(system_id, component_id, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
|
||||
mavlink_msg_limits_status_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_limits_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
|
||||
mavlink_msg_limits_status_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_limits_status_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_limits_status_send(MAVLINK_COMM_1 , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
|
||||
mavlink_msg_limits_status_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_wind(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_wind_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
73.0,
|
||||
};
|
||||
mavlink_wind_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.direction = packet_in.direction;
|
||||
packet1.speed = packet_in.speed;
|
||||
packet1.speed_z = packet_in.speed_z;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_wind_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_wind_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_wind_pack(system_id, component_id, &msg , packet1.direction , packet1.speed , packet1.speed_z );
|
||||
mavlink_msg_wind_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_wind_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.direction , packet1.speed , packet1.speed_z );
|
||||
mavlink_msg_wind_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_wind_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_wind_send(MAVLINK_COMM_1 , packet1.direction , packet1.speed , packet1.speed_z );
|
||||
mavlink_msg_wind_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_data16(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_data16_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154 },
|
||||
};
|
||||
mavlink_data16_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.type = packet_in.type;
|
||||
packet1.len = packet_in.len;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*16);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data16_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_data16_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data16_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data16_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data16_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data16_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_data16_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data16_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data16_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_data32(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_data32_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 },
|
||||
};
|
||||
mavlink_data32_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.type = packet_in.type;
|
||||
packet1.len = packet_in.len;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*32);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data32_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_data32_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data32_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data32_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data32_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data32_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_data32_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data32_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data32_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_data64(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_data64_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202 },
|
||||
};
|
||||
mavlink_data64_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.type = packet_in.type;
|
||||
packet1.len = packet_in.len;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*64);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data64_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_data64_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data64_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data64_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data64_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data64_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_data64_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data64_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data64_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_data96(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_data96_t packet_in = {
|
||||
5,
|
||||
72,
|
||||
{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234 },
|
||||
};
|
||||
mavlink_data96_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.type = packet_in.type;
|
||||
packet1.len = packet_in.len;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*96);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data96_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_data96_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data96_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data96_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data96_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data96_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_data96_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_data96_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
|
||||
mavlink_msg_data96_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_rangefinder(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_rangefinder_t packet_in = {
|
||||
17.0,
|
||||
45.0,
|
||||
};
|
||||
mavlink_rangefinder_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.distance = packet_in.distance;
|
||||
packet1.voltage = packet_in.voltage;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_rangefinder_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_rangefinder_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_rangefinder_pack(system_id, component_id, &msg , packet1.distance , packet1.voltage );
|
||||
mavlink_msg_rangefinder_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_rangefinder_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.distance , packet1.voltage );
|
||||
mavlink_msg_rangefinder_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_rangefinder_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_rangefinder_send(MAVLINK_COMM_1 , packet1.distance , packet1.voltage );
|
||||
mavlink_msg_rangefinder_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_test_sensor_offsets(system_id, component_id, last_msg);
|
||||
@@ -682,6 +1239,17 @@ static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id,
|
||||
mavlink_test_fence_point(system_id, component_id, last_msg);
|
||||
mavlink_test_fence_fetch_point(system_id, component_id, last_msg);
|
||||
mavlink_test_fence_status(system_id, component_id, last_msg);
|
||||
mavlink_test_ahrs(system_id, component_id, last_msg);
|
||||
mavlink_test_simstate(system_id, component_id, last_msg);
|
||||
mavlink_test_hwstatus(system_id, component_id, last_msg);
|
||||
mavlink_test_radio(system_id, component_id, last_msg);
|
||||
mavlink_test_limits_status(system_id, component_id, last_msg);
|
||||
mavlink_test_wind(system_id, component_id, last_msg);
|
||||
mavlink_test_data16(system_id, component_id, last_msg);
|
||||
mavlink_test_data32(system_id, component_id, last_msg);
|
||||
mavlink_test_data64(system_id, component_id, last_msg);
|
||||
mavlink_test_data96(system_id, component_id, last_msg);
|
||||
mavlink_test_rangefinder(system_id, component_id, last_msg);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Fri Dec 16 12:39:10 2011"
|
||||
#define MAVLINK_BUILD_DATE "Thu Apr 4 18:57:12 2013"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 254
|
||||
|
||||
#endif // MAVLINK_VERSION_H
|
||||
|
||||
@@ -15,6 +15,7 @@ extern "C" {
|
||||
#define X25_INIT_CRC 0xffff
|
||||
#define X25_VALIDATE_CRC 0xf0b8
|
||||
|
||||
#ifndef HAVE_CRC_ACCUMULATE
|
||||
/**
|
||||
* @brief Accumulate the X.25 CRC by adding one char at a time.
|
||||
*
|
||||
@@ -33,6 +34,7 @@ static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum)
|
||||
tmp ^= (tmp<<4);
|
||||
*crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Initiliaze the buffer for the X.25 CRC
|
||||
@@ -52,7 +54,7 @@ static inline void crc_init(uint16_t* crcAccum)
|
||||
* @param length length of the byte array
|
||||
* @return the checksum over the buffer bytes
|
||||
**/
|
||||
static inline uint16_t crc_calculate(uint8_t* pBuffer, uint16_t length)
|
||||
static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length)
|
||||
{
|
||||
uint16_t crcTmp;
|
||||
crc_init(&crcTmp);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -5,9 +5,9 @@
|
||||
typedef struct __mavlink_attitude_t
|
||||
{
|
||||
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
|
||||
float roll; ///< Roll angle (rad)
|
||||
float pitch; ///< Pitch angle (rad)
|
||||
float yaw; ///< Yaw angle (rad)
|
||||
float roll; ///< Roll angle (rad, -pi..+pi)
|
||||
float pitch; ///< Pitch angle (rad, -pi..+pi)
|
||||
float yaw; ///< Yaw angle (rad, -pi..+pi)
|
||||
float rollspeed; ///< Roll angular speed (rad/s)
|
||||
float pitchspeed; ///< Pitch angular speed (rad/s)
|
||||
float yawspeed; ///< Yaw angular speed (rad/s)
|
||||
@@ -39,9 +39,9 @@ typedef struct __mavlink_attitude_t
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param roll Roll angle (rad, -pi..+pi)
|
||||
* @param pitch Pitch angle (rad, -pi..+pi)
|
||||
* @param yaw Yaw angle (rad, -pi..+pi)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_attitude_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
|
||||
@@ -85,9 +85,9 @@ static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t comp
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param roll Roll angle (rad, -pi..+pi)
|
||||
* @param pitch Pitch angle (rad, -pi..+pi)
|
||||
* @param yaw Yaw angle (rad, -pi..+pi)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_attitude_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
|
||||
@@ -143,9 +143,9 @@ static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t co
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param roll Roll angle (rad, -pi..+pi)
|
||||
* @param pitch Pitch angle (rad, -pi..+pi)
|
||||
* @param yaw Yaw angle (rad, -pi..+pi)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
@@ -197,7 +197,7 @@ static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_messa
|
||||
/**
|
||||
* @brief Get field roll from attitude message
|
||||
*
|
||||
* @return Roll angle (rad)
|
||||
* @return Roll angle (rad, -pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -207,7 +207,7 @@ static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
|
||||
/**
|
||||
* @brief Get field pitch from attitude message
|
||||
*
|
||||
* @return Pitch angle (rad)
|
||||
* @return Pitch angle (rad, -pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -217,7 +217,7 @@ static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
|
||||
/**
|
||||
* @brief Get field yaw from attitude message
|
||||
*
|
||||
* @return Yaw angle (rad)
|
||||
* @return Yaw angle (rad, -pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, u
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
|
||||
@@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
|
||||
|
||||
@@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t comp
|
||||
char buf[32];
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
|
||||
#else
|
||||
mavlink_auth_key_t packet;
|
||||
|
||||
mav_array_memcpy(packet.key, key, sizeof(char)*32);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
|
||||
@@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t
|
||||
char buf[32];
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
|
||||
#else
|
||||
mavlink_auth_key_t packet;
|
||||
|
||||
mav_array_memcpy(packet.key, key, sizeof(char)*32);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
|
||||
|
||||
@@ -0,0 +1,320 @@
|
||||
// MESSAGE BATTERY_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS 147
|
||||
|
||||
typedef struct __mavlink_battery_status_t
|
||||
{
|
||||
uint16_t voltage_cell_1; ///< Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
|
||||
uint16_t voltage_cell_2; ///< Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
uint16_t voltage_cell_3; ///< Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
uint16_t voltage_cell_4; ///< Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
uint16_t voltage_cell_5; ///< Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
uint16_t voltage_cell_6; ///< Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
int16_t current_battery; ///< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
uint8_t accu_id; ///< Accupack ID
|
||||
int8_t battery_remaining; ///< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
} mavlink_battery_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 16
|
||||
#define MAVLINK_MSG_ID_147_LEN 16
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
|
||||
"BATTERY_STATUS", \
|
||||
9, \
|
||||
{ { "voltage_cell_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_battery_status_t, voltage_cell_1) }, \
|
||||
{ "voltage_cell_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_battery_status_t, voltage_cell_2) }, \
|
||||
{ "voltage_cell_3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_battery_status_t, voltage_cell_3) }, \
|
||||
{ "voltage_cell_4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_battery_status_t, voltage_cell_4) }, \
|
||||
{ "voltage_cell_5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_battery_status_t, voltage_cell_5) }, \
|
||||
{ "voltage_cell_6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_battery_status_t, voltage_cell_6) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_battery_status_t, current_battery) }, \
|
||||
{ "accu_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_battery_status_t, accu_id) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 15, offsetof(mavlink_battery_status_t, battery_remaining) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a battery_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 accu_id Accupack ID
|
||||
* @param voltage_cell_1 Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
|
||||
* @param voltage_cell_2 Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_3 Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_4 Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[16];
|
||||
_mav_put_uint16_t(buf, 0, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 2, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 4, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 6, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 12, current_battery);
|
||||
_mav_put_uint8_t(buf, 14, accu_id);
|
||||
_mav_put_int8_t(buf, 15, battery_remaining);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.voltage_cell_1 = voltage_cell_1;
|
||||
packet.voltage_cell_2 = voltage_cell_2;
|
||||
packet.voltage_cell_3 = voltage_cell_3;
|
||||
packet.voltage_cell_4 = voltage_cell_4;
|
||||
packet.voltage_cell_5 = voltage_cell_5;
|
||||
packet.voltage_cell_6 = voltage_cell_6;
|
||||
packet.current_battery = current_battery;
|
||||
packet.accu_id = accu_id;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 16, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a battery_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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param accu_id Accupack ID
|
||||
* @param voltage_cell_1 Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
|
||||
* @param voltage_cell_2 Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_3 Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_4 Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t accu_id,uint16_t voltage_cell_1,uint16_t voltage_cell_2,uint16_t voltage_cell_3,uint16_t voltage_cell_4,uint16_t voltage_cell_5,uint16_t voltage_cell_6,int16_t current_battery,int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[16];
|
||||
_mav_put_uint16_t(buf, 0, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 2, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 4, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 6, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 12, current_battery);
|
||||
_mav_put_uint8_t(buf, 14, accu_id);
|
||||
_mav_put_int8_t(buf, 15, battery_remaining);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.voltage_cell_1 = voltage_cell_1;
|
||||
packet.voltage_cell_2 = voltage_cell_2;
|
||||
packet.voltage_cell_3 = voltage_cell_3;
|
||||
packet.voltage_cell_4 = voltage_cell_4;
|
||||
packet.voltage_cell_5 = voltage_cell_5;
|
||||
packet.voltage_cell_6 = voltage_cell_6;
|
||||
packet.current_battery = current_battery;
|
||||
packet.accu_id = accu_id;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 16, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a battery_status struct into a 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 battery_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->accu_id, battery_status->voltage_cell_1, battery_status->voltage_cell_2, battery_status->voltage_cell_3, battery_status->voltage_cell_4, battery_status->voltage_cell_5, battery_status->voltage_cell_6, battery_status->current_battery, battery_status->battery_remaining);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a battery_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param accu_id Accupack ID
|
||||
* @param voltage_cell_1 Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
|
||||
* @param voltage_cell_2 Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_3 Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_4 Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_5 Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param voltage_cell_6 Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t accu_id, uint16_t voltage_cell_1, uint16_t voltage_cell_2, uint16_t voltage_cell_3, uint16_t voltage_cell_4, uint16_t voltage_cell_5, uint16_t voltage_cell_6, int16_t current_battery, int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[16];
|
||||
_mav_put_uint16_t(buf, 0, voltage_cell_1);
|
||||
_mav_put_uint16_t(buf, 2, voltage_cell_2);
|
||||
_mav_put_uint16_t(buf, 4, voltage_cell_3);
|
||||
_mav_put_uint16_t(buf, 6, voltage_cell_4);
|
||||
_mav_put_uint16_t(buf, 8, voltage_cell_5);
|
||||
_mav_put_uint16_t(buf, 10, voltage_cell_6);
|
||||
_mav_put_int16_t(buf, 12, current_battery);
|
||||
_mav_put_uint8_t(buf, 14, accu_id);
|
||||
_mav_put_int8_t(buf, 15, battery_remaining);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, 16, 42);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.voltage_cell_1 = voltage_cell_1;
|
||||
packet.voltage_cell_2 = voltage_cell_2;
|
||||
packet.voltage_cell_3 = voltage_cell_3;
|
||||
packet.voltage_cell_4 = voltage_cell_4;
|
||||
packet.voltage_cell_5 = voltage_cell_5;
|
||||
packet.voltage_cell_6 = voltage_cell_6;
|
||||
packet.current_battery = current_battery;
|
||||
packet.accu_id = accu_id;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, 16, 42);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE BATTERY_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field accu_id from battery_status message
|
||||
*
|
||||
* @return Accupack ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_accu_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage_cell_1 from battery_status message
|
||||
*
|
||||
* @return Battery voltage of cell 1, in millivolts (1 = 1 millivolt)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage_cell_2 from battery_status message
|
||||
*
|
||||
* @return Battery voltage of cell 2, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage_cell_3 from battery_status message
|
||||
*
|
||||
* @return Battery voltage of cell 3, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage_cell_4 from battery_status message
|
||||
*
|
||||
* @return Battery voltage of cell 4, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage_cell_5 from battery_status message
|
||||
*
|
||||
* @return Battery voltage of cell 5, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_5(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltage_cell_6 from battery_status message
|
||||
*
|
||||
* @return Battery voltage of cell 6, in millivolts (1 = 1 millivolt), -1: no cell
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltage_cell_6(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current_battery from battery_status message
|
||||
*
|
||||
* @return Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
*/
|
||||
static inline int16_t mavlink_msg_battery_status_get_current_battery(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field battery_remaining from battery_status message
|
||||
*
|
||||
* @return Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
|
||||
*/
|
||||
static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 15);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a battery_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param battery_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_battery_status_decode(const mavlink_message_t* msg, mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
battery_status->voltage_cell_1 = mavlink_msg_battery_status_get_voltage_cell_1(msg);
|
||||
battery_status->voltage_cell_2 = mavlink_msg_battery_status_get_voltage_cell_2(msg);
|
||||
battery_status->voltage_cell_3 = mavlink_msg_battery_status_get_voltage_cell_3(msg);
|
||||
battery_status->voltage_cell_4 = mavlink_msg_battery_status_get_voltage_cell_4(msg);
|
||||
battery_status->voltage_cell_5 = mavlink_msg_battery_status_get_voltage_cell_5(msg);
|
||||
battery_status->voltage_cell_6 = mavlink_msg_battery_status_get_voltage_cell_6(msg);
|
||||
battery_status->current_battery = mavlink_msg_battery_status_get_current_battery(msg);
|
||||
battery_status->accu_id = mavlink_msg_battery_status_get_accu_id(msg);
|
||||
battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg);
|
||||
#else
|
||||
memcpy(battery_status, _MAV_PAYLOAD(msg), 16);
|
||||
#endif
|
||||
}
|
||||
@@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_i
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, version);
|
||||
_mav_put_char_array(buf, 3, passkey, 25);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_change_operator_control_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.control_request = control_request;
|
||||
packet.version = version;
|
||||
mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
|
||||
@@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t sys
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, version);
|
||||
_mav_put_char_array(buf, 3, passkey, 25);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_change_operator_control_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.control_request = control_request;
|
||||
packet.version = version;
|
||||
mav_array_memcpy(packet.passkey, passkey, sizeof(char)*25);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t syst
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_change_operator_control_ack_t packet;
|
||||
packet.gcs_system_id = gcs_system_id;
|
||||
packet.control_request = control_request;
|
||||
packet.ack = ack;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_change_operator_control_ack_t packet;
|
||||
packet.gcs_system_id = gcs_system_id;
|
||||
packet.control_request = control_request;
|
||||
packet.ack = ack;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
|
||||
|
||||
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_command_ack_t packet;
|
||||
packet.command = command;
|
||||
packet.result = result;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
|
||||
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_command_ack_t packet;
|
||||
packet.command = command;
|
||||
packet.result = result;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
|
||||
|
||||
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 33);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
|
||||
#else
|
||||
mavlink_command_long_t packet;
|
||||
packet.param1 = param1;
|
||||
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t
|
||||
packet.target_component = target_component;
|
||||
packet.confirmation = confirmation;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 33);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
|
||||
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 33);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
|
||||
#else
|
||||
mavlink_command_long_t packet;
|
||||
packet.param1 = param1;
|
||||
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin
|
||||
packet.target_component = target_component;
|
||||
packet.confirmation = confirmation;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 33);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_data_stream_t packet;
|
||||
packet.message_rate = message_rate;
|
||||
packet.stream_id = stream_id;
|
||||
packet.on_off = on_off;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_data_stream_t packet;
|
||||
packet.message_rate = message_rate;
|
||||
packet.stream_id = stream_id;
|
||||
packet.on_off = on_off;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t compone
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_debug_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
packet.ind = ind;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t co
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_debug_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
packet.ind = ind;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG;
|
||||
|
||||
@@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 30);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30);
|
||||
#else
|
||||
mavlink_debug_vect_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t co
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
|
||||
@@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 30);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30);
|
||||
#else
|
||||
mavlink_debug_vect_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
// MESSAGE FILE_TRANSFER_DIR_LIST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST 111
|
||||
|
||||
typedef struct __mavlink_file_transfer_dir_list_t
|
||||
{
|
||||
uint64_t transfer_uid; ///< Unique transfer ID
|
||||
char dir_path[240]; ///< Directory path to list
|
||||
uint8_t flags; ///< RESERVED
|
||||
} mavlink_file_transfer_dir_list_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST_LEN 249
|
||||
#define MAVLINK_MSG_ID_111_LEN 249
|
||||
|
||||
#define MAVLINK_MSG_FILE_TRANSFER_DIR_LIST_FIELD_DIR_PATH_LEN 240
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_DIR_LIST { \
|
||||
"FILE_TRANSFER_DIR_LIST", \
|
||||
3, \
|
||||
{ { "transfer_uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_file_transfer_dir_list_t, transfer_uid) }, \
|
||||
{ "dir_path", NULL, MAVLINK_TYPE_CHAR, 240, 8, offsetof(mavlink_file_transfer_dir_list_t, dir_path) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 248, offsetof(mavlink_file_transfer_dir_list_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_dir_list 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 transfer_uid Unique transfer ID
|
||||
* @param dir_path Directory path to list
|
||||
* @param flags RESERVED
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_dir_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t transfer_uid, const char *dir_path, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[249];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint8_t(buf, 248, flags);
|
||||
_mav_put_char_array(buf, 8, dir_path, 240);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 249);
|
||||
#else
|
||||
mavlink_file_transfer_dir_list_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.flags = flags;
|
||||
mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 249);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 249, 93);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_dir_list 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param transfer_uid Unique transfer ID
|
||||
* @param dir_path Directory path to list
|
||||
* @param flags RESERVED
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_dir_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t transfer_uid,const char *dir_path,uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[249];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint8_t(buf, 248, flags);
|
||||
_mav_put_char_array(buf, 8, dir_path, 240);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 249);
|
||||
#else
|
||||
mavlink_file_transfer_dir_list_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.flags = flags;
|
||||
mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 249);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 249, 93);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a file_transfer_dir_list struct into a 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 file_transfer_dir_list C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_dir_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_dir_list_t* file_transfer_dir_list)
|
||||
{
|
||||
return mavlink_msg_file_transfer_dir_list_pack(system_id, component_id, msg, file_transfer_dir_list->transfer_uid, file_transfer_dir_list->dir_path, file_transfer_dir_list->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a file_transfer_dir_list message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param transfer_uid Unique transfer ID
|
||||
* @param dir_path Directory path to list
|
||||
* @param flags RESERVED
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_file_transfer_dir_list_send(mavlink_channel_t chan, uint64_t transfer_uid, const char *dir_path, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[249];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint8_t(buf, 248, flags);
|
||||
_mav_put_char_array(buf, 8, dir_path, 240);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, buf, 249, 93);
|
||||
#else
|
||||
mavlink_file_transfer_dir_list_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.flags = flags;
|
||||
mav_array_memcpy(packet.dir_path, dir_path, sizeof(char)*240);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST, (const char *)&packet, 249, 93);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FILE_TRANSFER_DIR_LIST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field transfer_uid from file_transfer_dir_list message
|
||||
*
|
||||
* @return Unique transfer ID
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_file_transfer_dir_list_get_transfer_uid(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field dir_path from file_transfer_dir_list message
|
||||
*
|
||||
* @return Directory path to list
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_dir_list_get_dir_path(const mavlink_message_t* msg, char *dir_path)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, dir_path, 240, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from file_transfer_dir_list message
|
||||
*
|
||||
* @return RESERVED
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_dir_list_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 248);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a file_transfer_dir_list message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param file_transfer_dir_list C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_dir_list_decode(const mavlink_message_t* msg, mavlink_file_transfer_dir_list_t* file_transfer_dir_list)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
file_transfer_dir_list->transfer_uid = mavlink_msg_file_transfer_dir_list_get_transfer_uid(msg);
|
||||
mavlink_msg_file_transfer_dir_list_get_dir_path(msg, file_transfer_dir_list->dir_path);
|
||||
file_transfer_dir_list->flags = mavlink_msg_file_transfer_dir_list_get_flags(msg);
|
||||
#else
|
||||
memcpy(file_transfer_dir_list, _MAV_PAYLOAD(msg), 249);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
// MESSAGE FILE_TRANSFER_RES PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_RES 112
|
||||
|
||||
typedef struct __mavlink_file_transfer_res_t
|
||||
{
|
||||
uint64_t transfer_uid; ///< Unique transfer ID
|
||||
uint8_t result; ///< 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
|
||||
} mavlink_file_transfer_res_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_RES_LEN 9
|
||||
#define MAVLINK_MSG_ID_112_LEN 9
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_RES { \
|
||||
"FILE_TRANSFER_RES", \
|
||||
2, \
|
||||
{ { "transfer_uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_file_transfer_res_t, transfer_uid) }, \
|
||||
{ "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_file_transfer_res_t, result) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_res 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 transfer_uid Unique transfer ID
|
||||
* @param result 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_res_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t transfer_uid, uint8_t result)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint8_t(buf, 8, result);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_file_transfer_res_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.result = result;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_RES;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 9, 124);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_res 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param transfer_uid Unique transfer ID
|
||||
* @param result 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_res_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t transfer_uid,uint8_t result)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint8_t(buf, 8, result);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_file_transfer_res_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.result = result;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_RES;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 124);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a file_transfer_res struct into a 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 file_transfer_res C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_res_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_res_t* file_transfer_res)
|
||||
{
|
||||
return mavlink_msg_file_transfer_res_pack(system_id, component_id, msg, file_transfer_res->transfer_uid, file_transfer_res->result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a file_transfer_res message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param transfer_uid Unique transfer ID
|
||||
* @param result 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_file_transfer_res_send(mavlink_channel_t chan, uint64_t transfer_uid, uint8_t result)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[9];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint8_t(buf, 8, result);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, buf, 9, 124);
|
||||
#else
|
||||
mavlink_file_transfer_res_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.result = result;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_RES, (const char *)&packet, 9, 124);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FILE_TRANSFER_RES UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field transfer_uid from file_transfer_res message
|
||||
*
|
||||
* @return Unique transfer ID
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_file_transfer_res_get_transfer_uid(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field result from file_transfer_res message
|
||||
*
|
||||
* @return 0: OK, 1: not permitted, 2: bad path / file name, 3: no space left on device
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_res_get_result(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a file_transfer_res message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param file_transfer_res C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_res_decode(const mavlink_message_t* msg, mavlink_file_transfer_res_t* file_transfer_res)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
file_transfer_res->transfer_uid = mavlink_msg_file_transfer_res_get_transfer_uid(msg);
|
||||
file_transfer_res->result = mavlink_msg_file_transfer_res_get_result(msg);
|
||||
#else
|
||||
memcpy(file_transfer_res, _MAV_PAYLOAD(msg), 9);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
// MESSAGE FILE_TRANSFER_START PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_START 110
|
||||
|
||||
typedef struct __mavlink_file_transfer_start_t
|
||||
{
|
||||
uint64_t transfer_uid; ///< Unique transfer ID
|
||||
uint32_t file_size; ///< File size in bytes
|
||||
char dest_path[240]; ///< Destination path
|
||||
uint8_t direction; ///< Transfer direction: 0: from requester, 1: to requester
|
||||
uint8_t flags; ///< RESERVED
|
||||
} mavlink_file_transfer_start_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_START_LEN 254
|
||||
#define MAVLINK_MSG_ID_110_LEN 254
|
||||
|
||||
#define MAVLINK_MSG_FILE_TRANSFER_START_FIELD_DEST_PATH_LEN 240
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_START { \
|
||||
"FILE_TRANSFER_START", \
|
||||
5, \
|
||||
{ { "transfer_uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_file_transfer_start_t, transfer_uid) }, \
|
||||
{ "file_size", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_file_transfer_start_t, file_size) }, \
|
||||
{ "dest_path", NULL, MAVLINK_TYPE_CHAR, 240, 12, offsetof(mavlink_file_transfer_start_t, dest_path) }, \
|
||||
{ "direction", NULL, MAVLINK_TYPE_UINT8_T, 0, 252, offsetof(mavlink_file_transfer_start_t, direction) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 253, offsetof(mavlink_file_transfer_start_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_start 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 transfer_uid Unique transfer ID
|
||||
* @param dest_path Destination path
|
||||
* @param direction Transfer direction: 0: from requester, 1: to requester
|
||||
* @param file_size File size in bytes
|
||||
* @param flags RESERVED
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_start_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t transfer_uid, const char *dest_path, uint8_t direction, uint32_t file_size, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[254];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint32_t(buf, 8, file_size);
|
||||
_mav_put_uint8_t(buf, 252, direction);
|
||||
_mav_put_uint8_t(buf, 253, flags);
|
||||
_mav_put_char_array(buf, 12, dest_path, 240);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 254);
|
||||
#else
|
||||
mavlink_file_transfer_start_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.file_size = file_size;
|
||||
packet.direction = direction;
|
||||
packet.flags = flags;
|
||||
mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 254);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_START;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 254, 235);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_start 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param transfer_uid Unique transfer ID
|
||||
* @param dest_path Destination path
|
||||
* @param direction Transfer direction: 0: from requester, 1: to requester
|
||||
* @param file_size File size in bytes
|
||||
* @param flags RESERVED
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_start_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t transfer_uid,const char *dest_path,uint8_t direction,uint32_t file_size,uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[254];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint32_t(buf, 8, file_size);
|
||||
_mav_put_uint8_t(buf, 252, direction);
|
||||
_mav_put_uint8_t(buf, 253, flags);
|
||||
_mav_put_char_array(buf, 12, dest_path, 240);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 254);
|
||||
#else
|
||||
mavlink_file_transfer_start_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.file_size = file_size;
|
||||
packet.direction = direction;
|
||||
packet.flags = flags;
|
||||
mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 254);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_START;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 254, 235);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a file_transfer_start struct into a 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 file_transfer_start C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_start_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_start_t* file_transfer_start)
|
||||
{
|
||||
return mavlink_msg_file_transfer_start_pack(system_id, component_id, msg, file_transfer_start->transfer_uid, file_transfer_start->dest_path, file_transfer_start->direction, file_transfer_start->file_size, file_transfer_start->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a file_transfer_start message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param transfer_uid Unique transfer ID
|
||||
* @param dest_path Destination path
|
||||
* @param direction Transfer direction: 0: from requester, 1: to requester
|
||||
* @param file_size File size in bytes
|
||||
* @param flags RESERVED
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_file_transfer_start_send(mavlink_channel_t chan, uint64_t transfer_uid, const char *dest_path, uint8_t direction, uint32_t file_size, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[254];
|
||||
_mav_put_uint64_t(buf, 0, transfer_uid);
|
||||
_mav_put_uint32_t(buf, 8, file_size);
|
||||
_mav_put_uint8_t(buf, 252, direction);
|
||||
_mav_put_uint8_t(buf, 253, flags);
|
||||
_mav_put_char_array(buf, 12, dest_path, 240);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, buf, 254, 235);
|
||||
#else
|
||||
mavlink_file_transfer_start_t packet;
|
||||
packet.transfer_uid = transfer_uid;
|
||||
packet.file_size = file_size;
|
||||
packet.direction = direction;
|
||||
packet.flags = flags;
|
||||
mav_array_memcpy(packet.dest_path, dest_path, sizeof(char)*240);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_START, (const char *)&packet, 254, 235);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FILE_TRANSFER_START UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field transfer_uid from file_transfer_start message
|
||||
*
|
||||
* @return Unique transfer ID
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_file_transfer_start_get_transfer_uid(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field dest_path from file_transfer_start message
|
||||
*
|
||||
* @return Destination path
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_start_get_dest_path(const mavlink_message_t* msg, char *dest_path)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, dest_path, 240, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field direction from file_transfer_start message
|
||||
*
|
||||
* @return Transfer direction: 0: from requester, 1: to requester
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_start_get_direction(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 252);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field file_size from file_transfer_start message
|
||||
*
|
||||
* @return File size in bytes
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_file_transfer_start_get_file_size(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from file_transfer_start message
|
||||
*
|
||||
* @return RESERVED
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_start_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 253);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a file_transfer_start message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param file_transfer_start C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_start_decode(const mavlink_message_t* msg, mavlink_file_transfer_start_t* file_transfer_start)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
file_transfer_start->transfer_uid = mavlink_msg_file_transfer_start_get_transfer_uid(msg);
|
||||
file_transfer_start->file_size = mavlink_msg_file_transfer_start_get_file_size(msg);
|
||||
mavlink_msg_file_transfer_start_get_dest_path(msg, file_transfer_start->dest_path);
|
||||
file_transfer_start->direction = mavlink_msg_file_transfer_start_get_direction(msg);
|
||||
file_transfer_start->flags = mavlink_msg_file_transfer_start_get_flags(msg);
|
||||
#else
|
||||
memcpy(file_transfer_start, _MAV_PAYLOAD(msg), 254);
|
||||
#endif
|
||||
}
|
||||
@@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_global_position_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, u
|
||||
packet.vz = vz;
|
||||
packet.hdg = hdg;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
|
||||
@@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_global_position_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_
|
||||
packet.vz = vz;
|
||||
packet.hdg = hdg;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys
|
||||
_mav_put_int16_t(buf, 12, yaw);
|
||||
_mav_put_uint8_t(buf, 14, coordinate_frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_global_position_setpoint_int_t packet;
|
||||
packet.latitude = latitude;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack(uint8_t sys
|
||||
packet.yaw = yaw;
|
||||
packet.coordinate_frame = coordinate_frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack_chan(uint8_
|
||||
_mav_put_int16_t(buf, 12, yaw);
|
||||
_mav_put_uint8_t(buf, 14, coordinate_frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_global_position_setpoint_int_t packet;
|
||||
packet.latitude = latitude;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_global_position_setpoint_int_pack_chan(uint8_
|
||||
packet.yaw = yaw;
|
||||
packet.coordinate_frame = coordinate_frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_SETPOINT_INT;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
typedef struct __mavlink_global_vision_position_estimate_t
|
||||
{
|
||||
uint64_t usec; ///< Timestamp (milliseconds)
|
||||
uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
float x; ///< Global X position
|
||||
float y; ///< Global Y position
|
||||
float z; ///< Global Z position
|
||||
@@ -38,7 +38,7 @@ typedef struct __mavlink_global_vision_position_estimate_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param usec Timestamp (milliseconds)
|
||||
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param x Global X position
|
||||
* @param y Global Y position
|
||||
* @param z Global Z position
|
||||
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t packet;
|
||||
packet.usec = usec;
|
||||
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
|
||||
@@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param usec Timestamp (milliseconds)
|
||||
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param x Global X position
|
||||
* @param y Global Y position
|
||||
* @param z Global Z position
|
||||
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t packet;
|
||||
packet.usec = usec;
|
||||
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uin
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_
|
||||
* @brief Send a global_vision_position_estimate message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param usec Timestamp (milliseconds)
|
||||
* @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param x Global X position
|
||||
* @param y Global Y position
|
||||
* @param z Global Z position
|
||||
@@ -187,7 +187,7 @@ static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_chan
|
||||
/**
|
||||
* @brief Get field usec from global_vision_position_estimate message
|
||||
*
|
||||
* @return Timestamp (milliseconds)
|
||||
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uin
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12);
|
||||
#else
|
||||
mavlink_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 12);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
|
||||
|
||||
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 30);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30);
|
||||
#else
|
||||
mavlink_gps_raw_int_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t c
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
|
||||
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 30);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 30);
|
||||
#else
|
||||
mavlink_gps_raw_int_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 30);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
|
||||
|
||||
@@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co
|
||||
_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
|
||||
_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
|
||||
_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 101);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101);
|
||||
#else
|
||||
mavlink_gps_status_t packet;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
@@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t co
|
||||
mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 101);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
|
||||
@@ -101,7 +101,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
|
||||
_mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
|
||||
_mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 101);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 101);
|
||||
#else
|
||||
mavlink_gps_status_t packet;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
@@ -110,7 +110,7 @@ static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8
|
||||
mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
|
||||
mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 101);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 101);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
typedef struct __mavlink_heartbeat_t
|
||||
{
|
||||
uint32_t custom_mode; ///< Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
|
||||
uint32_t custom_mode; ///< A bitfield for use for autopilot-specific flags.
|
||||
uint8_t type; ///< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
|
||||
uint8_t autopilot; ///< Autopilot type / class. defined in MAV_CLASS ENUM
|
||||
uint8_t autopilot; ///< Autopilot type / class. defined in MAV_AUTOPILOT ENUM
|
||||
uint8_t base_mode; ///< System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
|
||||
uint8_t system_status; ///< System status flag, see MAV_STATUS ENUM
|
||||
uint8_t mavlink_version; ///< MAVLink version
|
||||
uint8_t system_status; ///< System status flag, see MAV_STATE ENUM
|
||||
uint8_t mavlink_version; ///< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
|
||||
} mavlink_heartbeat_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HEARTBEAT_LEN 9
|
||||
@@ -37,10 +37,10 @@ typedef struct __mavlink_heartbeat_t
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
|
||||
* @param autopilot Autopilot type / class. defined in MAV_CLASS ENUM
|
||||
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
|
||||
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
|
||||
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
|
||||
* @param system_status System status flag, see MAV_STATUS ENUM
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags.
|
||||
* @param system_status System status flag, see MAV_STATE ENUM
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
@@ -55,7 +55,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com
|
||||
_mav_put_uint8_t(buf, 7, system_status);
|
||||
_mav_put_uint8_t(buf, 8, 3);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_heartbeat_t packet;
|
||||
packet.custom_mode = custom_mode;
|
||||
@@ -65,7 +65,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com
|
||||
packet.system_status = system_status;
|
||||
packet.mavlink_version = 3;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
|
||||
@@ -79,10 +79,10 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
|
||||
* @param autopilot Autopilot type / class. defined in MAV_CLASS ENUM
|
||||
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
|
||||
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
|
||||
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
|
||||
* @param system_status System status flag, see MAV_STATUS ENUM
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags.
|
||||
* @param system_status System status flag, see MAV_STATE ENUM
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_
|
||||
_mav_put_uint8_t(buf, 7, system_status);
|
||||
_mav_put_uint8_t(buf, 8, 3);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9);
|
||||
#else
|
||||
mavlink_heartbeat_t packet;
|
||||
packet.custom_mode = custom_mode;
|
||||
@@ -108,7 +108,7 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_
|
||||
packet.system_status = system_status;
|
||||
packet.mavlink_version = 3;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
|
||||
@@ -133,10 +133,10 @@ static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t c
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
|
||||
* @param autopilot Autopilot type / class. defined in MAV_CLASS ENUM
|
||||
* @param autopilot Autopilot type / class. defined in MAV_AUTOPILOT ENUM
|
||||
* @param base_mode System mode bitfield, see MAV_MODE_FLAGS ENUM in mavlink/include/mavlink_types.h
|
||||
* @param custom_mode Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
|
||||
* @param system_status System status flag, see MAV_STATUS ENUM
|
||||
* @param custom_mode A bitfield for use for autopilot-specific flags.
|
||||
* @param system_status System status flag, see MAV_STATE ENUM
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
@@ -183,7 +183,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* ms
|
||||
/**
|
||||
* @brief Get field autopilot from heartbeat message
|
||||
*
|
||||
* @return Autopilot type / class. defined in MAV_CLASS ENUM
|
||||
* @return Autopilot type / class. defined in MAV_AUTOPILOT ENUM
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -203,7 +203,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_
|
||||
/**
|
||||
* @brief Get field custom_mode from heartbeat message
|
||||
*
|
||||
* @return Navigation mode bitfield, see MAV_AUTOPILOT_CUSTOM_MODE ENUM for some examples. This field is autopilot-specific.
|
||||
* @return A bitfield for use for autopilot-specific flags.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -213,7 +213,7 @@ static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_messa
|
||||
/**
|
||||
* @brief Get field system_status from heartbeat message
|
||||
*
|
||||
* @return System status flag, see MAV_STATUS ENUM
|
||||
* @return System status flag, see MAV_STATE ENUM
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -223,7 +223,7 @@ static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_mess
|
||||
/**
|
||||
* @brief Get field mavlink_version from heartbeat message
|
||||
*
|
||||
* @return MAVLink version
|
||||
* @return MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,452 @@
|
||||
// MESSAGE HIGHRES_IMU PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGHRES_IMU 105
|
||||
|
||||
typedef struct __mavlink_highres_imu_t
|
||||
{
|
||||
uint64_t time_usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
float xacc; ///< X acceleration (m/s^2)
|
||||
float yacc; ///< Y acceleration (m/s^2)
|
||||
float zacc; ///< Z acceleration (m/s^2)
|
||||
float xgyro; ///< Angular speed around X axis (rad / sec)
|
||||
float ygyro; ///< Angular speed around Y axis (rad / sec)
|
||||
float zgyro; ///< Angular speed around Z axis (rad / sec)
|
||||
float xmag; ///< X Magnetic field (Gauss)
|
||||
float ymag; ///< Y Magnetic field (Gauss)
|
||||
float zmag; ///< Z Magnetic field (Gauss)
|
||||
float abs_pressure; ///< Absolute pressure in millibar
|
||||
float diff_pressure; ///< Differential pressure in millibar
|
||||
float pressure_alt; ///< Altitude calculated from pressure
|
||||
float temperature; ///< Temperature in degrees celsius
|
||||
uint16_t fields_updated; ///< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
} mavlink_highres_imu_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62
|
||||
#define MAVLINK_MSG_ID_105_LEN 62
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
|
||||
"HIGHRES_IMU", \
|
||||
15, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
|
||||
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
|
||||
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
|
||||
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
|
||||
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_highres_imu_t, xgyro) }, \
|
||||
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_highres_imu_t, ygyro) }, \
|
||||
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_highres_imu_t, zgyro) }, \
|
||||
{ "xmag", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_highres_imu_t, xmag) }, \
|
||||
{ "ymag", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_highres_imu_t, ymag) }, \
|
||||
{ "zmag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_highres_imu_t, zmag) }, \
|
||||
{ "abs_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_highres_imu_t, abs_pressure) }, \
|
||||
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
|
||||
{ "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
|
||||
{ "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a highres_imu 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 time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param xacc X acceleration (m/s^2)
|
||||
* @param yacc Y acceleration (m/s^2)
|
||||
* @param zacc Z acceleration (m/s^2)
|
||||
* @param xgyro Angular speed around X axis (rad / sec)
|
||||
* @param ygyro Angular speed around Y axis (rad / sec)
|
||||
* @param zgyro Angular speed around Z axis (rad / sec)
|
||||
* @param xmag X Magnetic field (Gauss)
|
||||
* @param ymag Y Magnetic field (Gauss)
|
||||
* @param zmag Z Magnetic field (Gauss)
|
||||
* @param abs_pressure Absolute pressure in millibar
|
||||
* @param diff_pressure Differential pressure in millibar
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature Temperature in degrees celsius
|
||||
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[62];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint16_t(buf, 60, fields_updated);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 62);
|
||||
#else
|
||||
mavlink_highres_imu_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 62);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 62, 93);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a highres_imu 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param xacc X acceleration (m/s^2)
|
||||
* @param yacc Y acceleration (m/s^2)
|
||||
* @param zacc Z acceleration (m/s^2)
|
||||
* @param xgyro Angular speed around X axis (rad / sec)
|
||||
* @param ygyro Angular speed around Y axis (rad / sec)
|
||||
* @param zgyro Angular speed around Z axis (rad / sec)
|
||||
* @param xmag X Magnetic field (Gauss)
|
||||
* @param ymag Y Magnetic field (Gauss)
|
||||
* @param zmag Z Magnetic field (Gauss)
|
||||
* @param abs_pressure Absolute pressure in millibar
|
||||
* @param diff_pressure Differential pressure in millibar
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature Temperature in degrees celsius
|
||||
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[62];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint16_t(buf, 60, fields_updated);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 62);
|
||||
#else
|
||||
mavlink_highres_imu_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 62);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 62, 93);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a highres_imu struct into a 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 highres_imu C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
|
||||
{
|
||||
return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a highres_imu message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param xacc X acceleration (m/s^2)
|
||||
* @param yacc Y acceleration (m/s^2)
|
||||
* @param zacc Z acceleration (m/s^2)
|
||||
* @param xgyro Angular speed around X axis (rad / sec)
|
||||
* @param ygyro Angular speed around Y axis (rad / sec)
|
||||
* @param zgyro Angular speed around Z axis (rad / sec)
|
||||
* @param xmag X Magnetic field (Gauss)
|
||||
* @param ymag Y Magnetic field (Gauss)
|
||||
* @param zmag Z Magnetic field (Gauss)
|
||||
* @param abs_pressure Absolute pressure in millibar
|
||||
* @param diff_pressure Differential pressure in millibar
|
||||
* @param pressure_alt Altitude calculated from pressure
|
||||
* @param temperature Temperature in degrees celsius
|
||||
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[62];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, xacc);
|
||||
_mav_put_float(buf, 12, yacc);
|
||||
_mav_put_float(buf, 16, zacc);
|
||||
_mav_put_float(buf, 20, xgyro);
|
||||
_mav_put_float(buf, 24, ygyro);
|
||||
_mav_put_float(buf, 28, zgyro);
|
||||
_mav_put_float(buf, 32, xmag);
|
||||
_mav_put_float(buf, 36, ymag);
|
||||
_mav_put_float(buf, 40, zmag);
|
||||
_mav_put_float(buf, 44, abs_pressure);
|
||||
_mav_put_float(buf, 48, diff_pressure);
|
||||
_mav_put_float(buf, 52, pressure_alt);
|
||||
_mav_put_float(buf, 56, temperature);
|
||||
_mav_put_uint16_t(buf, 60, fields_updated);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, 62, 93);
|
||||
#else
|
||||
mavlink_highres_imu_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.xacc = xacc;
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
packet.xgyro = xgyro;
|
||||
packet.ygyro = ygyro;
|
||||
packet.zgyro = zgyro;
|
||||
packet.xmag = xmag;
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
packet.abs_pressure = abs_pressure;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.pressure_alt = pressure_alt;
|
||||
packet.temperature = temperature;
|
||||
packet.fields_updated = fields_updated;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, 62, 93);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE HIGHRES_IMU UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from highres_imu message
|
||||
*
|
||||
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xacc from highres_imu message
|
||||
*
|
||||
* @return X acceleration (m/s^2)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_xacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yacc from highres_imu message
|
||||
*
|
||||
* @return Y acceleration (m/s^2)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_yacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zacc from highres_imu message
|
||||
*
|
||||
* @return Z acceleration (m/s^2)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_zacc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xgyro from highres_imu message
|
||||
*
|
||||
* @return Angular speed around X axis (rad / sec)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_xgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ygyro from highres_imu message
|
||||
*
|
||||
* @return Angular speed around Y axis (rad / sec)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_ygyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zgyro from highres_imu message
|
||||
*
|
||||
* @return Angular speed around Z axis (rad / sec)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_zgyro(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field xmag from highres_imu message
|
||||
*
|
||||
* @return X Magnetic field (Gauss)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_xmag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ymag from highres_imu message
|
||||
*
|
||||
* @return Y Magnetic field (Gauss)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_ymag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zmag from highres_imu message
|
||||
*
|
||||
* @return Z Magnetic field (Gauss)
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field abs_pressure from highres_imu message
|
||||
*
|
||||
* @return Absolute pressure in millibar
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diff_pressure from highres_imu message
|
||||
*
|
||||
* @return Differential pressure in millibar
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pressure_alt from highres_imu message
|
||||
*
|
||||
* @return Altitude calculated from pressure
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_pressure_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature from highres_imu message
|
||||
*
|
||||
* @return Temperature in degrees celsius
|
||||
*/
|
||||
static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 56);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fields_updated from highres_imu message
|
||||
*
|
||||
* @return Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a highres_imu message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param highres_imu C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, mavlink_highres_imu_t* highres_imu)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
highres_imu->time_usec = mavlink_msg_highres_imu_get_time_usec(msg);
|
||||
highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg);
|
||||
highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg);
|
||||
highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg);
|
||||
highres_imu->xgyro = mavlink_msg_highres_imu_get_xgyro(msg);
|
||||
highres_imu->ygyro = mavlink_msg_highres_imu_get_ygyro(msg);
|
||||
highres_imu->zgyro = mavlink_msg_highres_imu_get_zgyro(msg);
|
||||
highres_imu->xmag = mavlink_msg_highres_imu_get_xmag(msg);
|
||||
highres_imu->ymag = mavlink_msg_highres_imu_get_ymag(msg);
|
||||
highres_imu->zmag = mavlink_msg_highres_imu_get_zmag(msg);
|
||||
highres_imu->abs_pressure = mavlink_msg_highres_imu_get_abs_pressure(msg);
|
||||
highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg);
|
||||
highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg);
|
||||
highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg);
|
||||
highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg);
|
||||
#else
|
||||
memcpy(highres_imu, _MAV_PAYLOAD(msg), 62);
|
||||
#endif
|
||||
}
|
||||
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 40, mode);
|
||||
_mav_put_uint8_t(buf, 41, nav_mode);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42);
|
||||
#else
|
||||
mavlink_hil_controls_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack(uint8_t system_id, uint8_t
|
||||
packet.mode = mode;
|
||||
packet.nav_mode = nav_mode;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
|
||||
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 40, mode);
|
||||
_mav_put_uint8_t(buf, 41, nav_mode);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 42);
|
||||
#else
|
||||
mavlink_hil_controls_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_hil_controls_pack_chan(uint8_t system_id, uin
|
||||
packet.mode = mode;
|
||||
packet.nav_mode = nav_mode;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 42);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
|
||||
|
||||
@@ -88,7 +88,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin
|
||||
_mav_put_uint16_t(buf, 30, chan12_raw);
|
||||
_mav_put_uint8_t(buf, 32, rssi);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 33);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
|
||||
#else
|
||||
mavlink_hil_rc_inputs_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -106,7 +106,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uin
|
||||
packet.chan12_raw = chan12_raw;
|
||||
packet.rssi = rssi;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 33);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
|
||||
@@ -156,7 +156,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id
|
||||
_mav_put_uint16_t(buf, 30, chan12_raw);
|
||||
_mav_put_uint8_t(buf, 32, rssi);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 33);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 33);
|
||||
#else
|
||||
mavlink_hil_rc_inputs_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -174,7 +174,7 @@ static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id
|
||||
packet.chan12_raw = chan12_raw;
|
||||
packet.rssi = rssi;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 33);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 33);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
|
||||
|
||||
@@ -96,7 +96,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com
|
||||
_mav_put_int16_t(buf, 52, yacc);
|
||||
_mav_put_int16_t(buf, 54, zacc);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 56);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56);
|
||||
#else
|
||||
mavlink_hil_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -116,7 +116,7 @@ static inline uint16_t mavlink_msg_hil_state_pack(uint8_t system_id, uint8_t com
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 56);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
|
||||
@@ -170,7 +170,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_
|
||||
_mav_put_int16_t(buf, 52, yacc);
|
||||
_mav_put_int16_t(buf, 54, zacc);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 56);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 56);
|
||||
#else
|
||||
mavlink_hil_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -190,7 +190,7 @@ static inline uint16_t mavlink_msg_hil_state_pack_chan(uint8_t system_id, uint8_
|
||||
packet.yacc = yacc;
|
||||
packet.zacc = zacc;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 56);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 56);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HIL_STATE;
|
||||
|
||||
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui
|
||||
_mav_put_float(buf, 20, vy);
|
||||
_mav_put_float(buf, 24, vz);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_local_position_ned_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, ui
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
|
||||
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i
|
||||
_mav_put_float(buf, 20, vy);
|
||||
_mav_put_float(buf, 24, vz);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_local_position_ned_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_i
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
|
||||
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89
|
||||
|
||||
typedef struct __mavlink_local_position_ned_system_global_offset_t
|
||||
{
|
||||
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
|
||||
float x; ///< X Position
|
||||
float y; ///< Y Position
|
||||
float z; ///< Z Position
|
||||
float roll; ///< Roll
|
||||
float pitch; ///< Pitch
|
||||
float yaw; ///< Yaw
|
||||
} mavlink_local_position_ned_system_global_offset_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28
|
||||
#define MAVLINK_MSG_ID_89_LEN 28
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \
|
||||
"LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_system_global_offset_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_system_global_offset_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a local_position_ned_system_global_offset message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param x X Position
|
||||
* @param y Y Position
|
||||
* @param z Z Position
|
||||
* @param roll Roll
|
||||
* @param pitch Pitch
|
||||
* @param yaw Yaw
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_local_position_ned_system_global_offset_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 28, 231);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a local_position_ned_system_global_offset message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param x X Position
|
||||
* @param y Y Position
|
||||
* @param z Z Position
|
||||
* @param roll Roll
|
||||
* @param pitch Pitch
|
||||
* @param yaw Yaw
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float x,float y,float z,float roll,float pitch,float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
|
||||
#else
|
||||
mavlink_local_position_ned_system_global_offset_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 231);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a local_position_ned_system_global_offset struct into a 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 local_position_ned_system_global_offset C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
|
||||
{
|
||||
return mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a local_position_ned_system_global_offset message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param x X Position
|
||||
* @param y Y Position
|
||||
* @param z Z Position
|
||||
* @param roll Roll
|
||||
* @param pitch Pitch
|
||||
* @param yaw Yaw
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[28];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, x);
|
||||
_mav_put_float(buf, 8, y);
|
||||
_mav_put_float(buf, 12, z);
|
||||
_mav_put_float(buf, 16, roll);
|
||||
_mav_put_float(buf, 20, pitch);
|
||||
_mav_put_float(buf, 24, yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, 28, 231);
|
||||
#else
|
||||
mavlink_local_position_ned_system_global_offset_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, 28, 231);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return Timestamp (milliseconds since system boot)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return X Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return Y Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return Z Position
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return Roll
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return Pitch
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from local_position_ned_system_global_offset message
|
||||
*
|
||||
* @return Yaw
|
||||
*/
|
||||
static inline float mavlink_msg_local_position_ned_system_global_offset_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a local_position_ned_system_global_offset message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param local_position_ned_system_global_offset C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_local_position_ned_system_global_offset_decode(const mavlink_message_t* msg, mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
local_position_ned_system_global_offset->time_boot_ms = mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(msg);
|
||||
local_position_ned_system_global_offset->x = mavlink_msg_local_position_ned_system_global_offset_get_x(msg);
|
||||
local_position_ned_system_global_offset->y = mavlink_msg_local_position_ned_system_global_offset_get_y(msg);
|
||||
local_position_ned_system_global_offset->z = mavlink_msg_local_position_ned_system_global_offset_get_z(msg);
|
||||
local_position_ned_system_global_offset->roll = mavlink_msg_local_position_ned_system_global_offset_get_roll(msg);
|
||||
local_position_ned_system_global_offset->pitch = mavlink_msg_local_position_ned_system_global_offset_get_pitch(msg);
|
||||
local_position_ned_system_global_offset->yaw = mavlink_msg_local_position_ned_system_global_offset_get_yaw(msg);
|
||||
#else
|
||||
memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), 28);
|
||||
#endif
|
||||
}
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_uint8_t(buf, 16, coordinate_frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 17);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17);
|
||||
#else
|
||||
mavlink_local_position_setpoint_t packet;
|
||||
packet.x = x;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack(uint8_t system_i
|
||||
packet.yaw = yaw;
|
||||
packet.coordinate_frame = coordinate_frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 17);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_uint8_t(buf, 16, coordinate_frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 17);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 17);
|
||||
#else
|
||||
mavlink_local_position_setpoint_t packet;
|
||||
packet.x = x;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_local_position_setpoint_pack_chan(uint8_t sys
|
||||
packet.yaw = yaw;
|
||||
packet.coordinate_frame = coordinate_frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 17);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 17);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT;
|
||||
|
||||
@@ -4,34 +4,28 @@
|
||||
|
||||
typedef struct __mavlink_manual_control_t
|
||||
{
|
||||
float roll; ///< roll
|
||||
float pitch; ///< pitch
|
||||
float yaw; ///< yaw
|
||||
float thrust; ///< thrust
|
||||
uint8_t target; ///< The system to be controlled
|
||||
uint8_t roll_manual; ///< roll control enabled auto:0, manual:1
|
||||
uint8_t pitch_manual; ///< pitch auto:0, manual:1
|
||||
uint8_t yaw_manual; ///< yaw auto:0, manual:1
|
||||
uint8_t thrust_manual; ///< thrust auto:0, manual:1
|
||||
int16_t x; ///< X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
int16_t y; ///< Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
int16_t z; ///< Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
|
||||
int16_t r; ///< R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
uint16_t buttons; ///< A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
uint8_t target; ///< The system to be controlled.
|
||||
} mavlink_manual_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 21
|
||||
#define MAVLINK_MSG_ID_69_LEN 21
|
||||
#define MAVLINK_MSG_ID_MANUAL_CONTROL_LEN 11
|
||||
#define MAVLINK_MSG_ID_69_LEN 11
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_MANUAL_CONTROL { \
|
||||
"MANUAL_CONTROL", \
|
||||
9, \
|
||||
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_manual_control_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_control_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_control_t, yaw) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_control_t, thrust) }, \
|
||||
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_manual_control_t, target) }, \
|
||||
{ "roll_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_manual_control_t, roll_manual) }, \
|
||||
{ "pitch_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_manual_control_t, pitch_manual) }, \
|
||||
{ "yaw_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_manual_control_t, yaw_manual) }, \
|
||||
{ "thrust_manual", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_control_t, thrust_manual) }, \
|
||||
6, \
|
||||
{ { "x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_manual_control_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_manual_control_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_manual_control_t, z) }, \
|
||||
{ "r", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_manual_control_t, r) }, \
|
||||
{ "buttons", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_manual_control_t, buttons) }, \
|
||||
{ "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_manual_control_t, target) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -42,50 +36,41 @@ typedef struct __mavlink_manual_control_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target The system to be controlled
|
||||
* @param roll roll
|
||||
* @param pitch pitch
|
||||
* @param yaw yaw
|
||||
* @param thrust thrust
|
||||
* @param roll_manual roll control enabled auto:0, manual:1
|
||||
* @param pitch_manual pitch auto:0, manual:1
|
||||
* @param yaw_manual yaw auto:0, manual:1
|
||||
* @param thrust_manual thrust auto:0, manual:1
|
||||
* @param target The system to be controlled.
|
||||
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
|
||||
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
|
||||
uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[21];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, thrust);
|
||||
_mav_put_uint8_t(buf, 16, target);
|
||||
_mav_put_uint8_t(buf, 17, roll_manual);
|
||||
_mav_put_uint8_t(buf, 18, pitch_manual);
|
||||
_mav_put_uint8_t(buf, 19, yaw_manual);
|
||||
_mav_put_uint8_t(buf, 20, thrust_manual);
|
||||
char buf[11];
|
||||
_mav_put_int16_t(buf, 0, x);
|
||||
_mav_put_int16_t(buf, 2, y);
|
||||
_mav_put_int16_t(buf, 4, z);
|
||||
_mav_put_int16_t(buf, 6, r);
|
||||
_mav_put_uint16_t(buf, 8, buttons);
|
||||
_mav_put_uint8_t(buf, 10, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 11);
|
||||
#else
|
||||
mavlink_manual_control_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.r = r;
|
||||
packet.buttons = buttons;
|
||||
packet.target = target;
|
||||
packet.roll_manual = roll_manual;
|
||||
packet.pitch_manual = pitch_manual;
|
||||
packet.yaw_manual = yaw_manual;
|
||||
packet.thrust_manual = thrust_manual;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 11);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 21, 52);
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 11, 243);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,51 +79,42 @@ static inline uint16_t mavlink_msg_manual_control_pack(uint8_t system_id, uint8_
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target The system to be controlled
|
||||
* @param roll roll
|
||||
* @param pitch pitch
|
||||
* @param yaw yaw
|
||||
* @param thrust thrust
|
||||
* @param roll_manual roll control enabled auto:0, manual:1
|
||||
* @param pitch_manual pitch auto:0, manual:1
|
||||
* @param yaw_manual yaw auto:0, manual:1
|
||||
* @param thrust_manual thrust auto:0, manual:1
|
||||
* @param target The system to be controlled.
|
||||
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
|
||||
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target,float roll,float pitch,float yaw,float thrust,uint8_t roll_manual,uint8_t pitch_manual,uint8_t yaw_manual,uint8_t thrust_manual)
|
||||
uint8_t target,int16_t x,int16_t y,int16_t z,int16_t r,uint16_t buttons)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[21];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, thrust);
|
||||
_mav_put_uint8_t(buf, 16, target);
|
||||
_mav_put_uint8_t(buf, 17, roll_manual);
|
||||
_mav_put_uint8_t(buf, 18, pitch_manual);
|
||||
_mav_put_uint8_t(buf, 19, yaw_manual);
|
||||
_mav_put_uint8_t(buf, 20, thrust_manual);
|
||||
char buf[11];
|
||||
_mav_put_int16_t(buf, 0, x);
|
||||
_mav_put_int16_t(buf, 2, y);
|
||||
_mav_put_int16_t(buf, 4, z);
|
||||
_mav_put_int16_t(buf, 6, r);
|
||||
_mav_put_uint16_t(buf, 8, buttons);
|
||||
_mav_put_uint8_t(buf, 10, target);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 11);
|
||||
#else
|
||||
mavlink_manual_control_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.r = r;
|
||||
packet.buttons = buttons;
|
||||
packet.target = target;
|
||||
packet.roll_manual = roll_manual;
|
||||
packet.pitch_manual = pitch_manual;
|
||||
packet.yaw_manual = yaw_manual;
|
||||
packet.thrust_manual = thrust_manual;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 11);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MANUAL_CONTROL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 21, 52);
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 11, 243);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,53 +127,44 @@ static inline uint16_t mavlink_msg_manual_control_pack_chan(uint8_t system_id, u
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_control_t* manual_control)
|
||||
{
|
||||
return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->roll, manual_control->pitch, manual_control->yaw, manual_control->thrust, manual_control->roll_manual, manual_control->pitch_manual, manual_control->yaw_manual, manual_control->thrust_manual);
|
||||
return mavlink_msg_manual_control_pack(system_id, component_id, msg, manual_control->target, manual_control->x, manual_control->y, manual_control->z, manual_control->r, manual_control->buttons);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a manual_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target The system to be controlled
|
||||
* @param roll roll
|
||||
* @param pitch pitch
|
||||
* @param yaw yaw
|
||||
* @param thrust thrust
|
||||
* @param roll_manual roll control enabled auto:0, manual:1
|
||||
* @param pitch_manual pitch auto:0, manual:1
|
||||
* @param yaw_manual yaw auto:0, manual:1
|
||||
* @param thrust_manual thrust auto:0, manual:1
|
||||
* @param target The system to be controlled.
|
||||
* @param x X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
* @param y Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
* @param z Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
|
||||
* @param r R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
* @param buttons A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
|
||||
static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8_t target, int16_t x, int16_t y, int16_t z, int16_t r, uint16_t buttons)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[21];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, thrust);
|
||||
_mav_put_uint8_t(buf, 16, target);
|
||||
_mav_put_uint8_t(buf, 17, roll_manual);
|
||||
_mav_put_uint8_t(buf, 18, pitch_manual);
|
||||
_mav_put_uint8_t(buf, 19, yaw_manual);
|
||||
_mav_put_uint8_t(buf, 20, thrust_manual);
|
||||
char buf[11];
|
||||
_mav_put_int16_t(buf, 0, x);
|
||||
_mav_put_int16_t(buf, 2, y);
|
||||
_mav_put_int16_t(buf, 4, z);
|
||||
_mav_put_int16_t(buf, 6, r);
|
||||
_mav_put_uint16_t(buf, 8, buttons);
|
||||
_mav_put_uint8_t(buf, 10, target);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, 21, 52);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, buf, 11, 243);
|
||||
#else
|
||||
mavlink_manual_control_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.r = r;
|
||||
packet.buttons = buttons;
|
||||
packet.target = target;
|
||||
packet.roll_manual = roll_manual;
|
||||
packet.pitch_manual = pitch_manual;
|
||||
packet.yaw_manual = yaw_manual;
|
||||
packet.thrust_manual = thrust_manual;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, 21, 52);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_CONTROL, (const char *)&packet, 11, 243);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -209,91 +176,61 @@ static inline void mavlink_msg_manual_control_send(mavlink_channel_t chan, uint8
|
||||
/**
|
||||
* @brief Get field target from manual_control message
|
||||
*
|
||||
* @return The system to be controlled
|
||||
* @return The system to be controlled.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_control_get_target(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 16);
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from manual_control message
|
||||
* @brief Get field x from manual_control message
|
||||
*
|
||||
* @return roll
|
||||
* @return X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle.
|
||||
*/
|
||||
static inline float mavlink_msg_manual_control_get_roll(const mavlink_message_t* msg)
|
||||
static inline int16_t mavlink_msg_manual_control_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
return _MAV_RETURN_int16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from manual_control message
|
||||
* @brief Get field y from manual_control message
|
||||
*
|
||||
* @return pitch
|
||||
* @return Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle.
|
||||
*/
|
||||
static inline float mavlink_msg_manual_control_get_pitch(const mavlink_message_t* msg)
|
||||
static inline int16_t mavlink_msg_manual_control_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
return _MAV_RETURN_int16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from manual_control message
|
||||
* @brief Get field z from manual_control message
|
||||
*
|
||||
* @return yaw
|
||||
* @return Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle.
|
||||
*/
|
||||
static inline float mavlink_msg_manual_control_get_yaw(const mavlink_message_t* msg)
|
||||
static inline int16_t mavlink_msg_manual_control_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
return _MAV_RETURN_int16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field thrust from manual_control message
|
||||
* @brief Get field r from manual_control message
|
||||
*
|
||||
* @return thrust
|
||||
* @return R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle.
|
||||
*/
|
||||
static inline float mavlink_msg_manual_control_get_thrust(const mavlink_message_t* msg)
|
||||
static inline int16_t mavlink_msg_manual_control_get_r(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
return _MAV_RETURN_int16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll_manual from manual_control message
|
||||
* @brief Get field buttons from manual_control message
|
||||
*
|
||||
* @return roll control enabled auto:0, manual:1
|
||||
* @return A bitfield corresponding to the joystick buttons' current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_control_get_roll_manual(const mavlink_message_t* msg)
|
||||
static inline uint16_t mavlink_msg_manual_control_get_buttons(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 17);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch_manual from manual_control message
|
||||
*
|
||||
* @return pitch auto:0, manual:1
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_control_get_pitch_manual(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw_manual from manual_control message
|
||||
*
|
||||
* @return yaw auto:0, manual:1
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_control_get_yaw_manual(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 19);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field thrust_manual from manual_control message
|
||||
*
|
||||
* @return thrust auto:0, manual:1
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_control_get_thrust_manual(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 20);
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,16 +242,13 @@ static inline uint8_t mavlink_msg_manual_control_get_thrust_manual(const mavlink
|
||||
static inline void mavlink_msg_manual_control_decode(const mavlink_message_t* msg, mavlink_manual_control_t* manual_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
manual_control->roll = mavlink_msg_manual_control_get_roll(msg);
|
||||
manual_control->pitch = mavlink_msg_manual_control_get_pitch(msg);
|
||||
manual_control->yaw = mavlink_msg_manual_control_get_yaw(msg);
|
||||
manual_control->thrust = mavlink_msg_manual_control_get_thrust(msg);
|
||||
manual_control->x = mavlink_msg_manual_control_get_x(msg);
|
||||
manual_control->y = mavlink_msg_manual_control_get_y(msg);
|
||||
manual_control->z = mavlink_msg_manual_control_get_z(msg);
|
||||
manual_control->r = mavlink_msg_manual_control_get_r(msg);
|
||||
manual_control->buttons = mavlink_msg_manual_control_get_buttons(msg);
|
||||
manual_control->target = mavlink_msg_manual_control_get_target(msg);
|
||||
manual_control->roll_manual = mavlink_msg_manual_control_get_roll_manual(msg);
|
||||
manual_control->pitch_manual = mavlink_msg_manual_control_get_pitch_manual(msg);
|
||||
manual_control->yaw_manual = mavlink_msg_manual_control_get_yaw_manual(msg);
|
||||
manual_control->thrust_manual = mavlink_msg_manual_control_get_thrust_manual(msg);
|
||||
#else
|
||||
memcpy(manual_control, _MAV_PAYLOAD(msg), 21);
|
||||
memcpy(manual_control, _MAV_PAYLOAD(msg), 11);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
// MESSAGE MANUAL_SETPOINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_SETPOINT 81
|
||||
|
||||
typedef struct __mavlink_manual_setpoint_t
|
||||
{
|
||||
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot
|
||||
float roll; ///< Desired roll rate in radians per second
|
||||
float pitch; ///< Desired pitch rate in radians per second
|
||||
float yaw; ///< Desired yaw rate in radians per second
|
||||
float thrust; ///< Collective thrust, normalized to 0 .. 1
|
||||
uint8_t mode_switch; ///< Flight mode switch position, 0.. 255
|
||||
uint8_t manual_override_switch; ///< Override mode switch position, 0.. 255
|
||||
} mavlink_manual_setpoint_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MANUAL_SETPOINT_LEN 22
|
||||
#define MAVLINK_MSG_ID_81_LEN 22
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT { \
|
||||
"MANUAL_SETPOINT", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_manual_setpoint_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_manual_setpoint_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_manual_setpoint_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_manual_setpoint_t, yaw) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_manual_setpoint_t, thrust) }, \
|
||||
{ "mode_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_manual_setpoint_t, mode_switch) }, \
|
||||
{ "manual_override_switch", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_manual_setpoint_t, manual_override_switch) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a manual_setpoint message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Timestamp in milliseconds since system boot
|
||||
* @param roll Desired roll rate in radians per second
|
||||
* @param pitch Desired pitch rate in radians per second
|
||||
* @param yaw Desired yaw rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
* @param mode_switch Flight mode switch position, 0.. 255
|
||||
* @param manual_override_switch Override mode switch position, 0.. 255
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
_mav_put_uint8_t(buf, 20, mode_switch);
|
||||
_mav_put_uint8_t(buf, 21, manual_override_switch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_manual_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.mode_switch = mode_switch;
|
||||
packet.manual_override_switch = manual_override_switch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 22, 106);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a manual_setpoint message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp in milliseconds since system boot
|
||||
* @param roll Desired roll rate in radians per second
|
||||
* @param pitch Desired pitch rate in radians per second
|
||||
* @param yaw Desired yaw rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
* @param mode_switch Flight mode switch position, 0.. 255
|
||||
* @param manual_override_switch Override mode switch position, 0.. 255
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float roll,float pitch,float yaw,float thrust,uint8_t mode_switch,uint8_t manual_override_switch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
_mav_put_uint8_t(buf, 20, mode_switch);
|
||||
_mav_put_uint8_t(buf, 21, manual_override_switch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_manual_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.mode_switch = mode_switch;
|
||||
packet.manual_override_switch = manual_override_switch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MANUAL_SETPOINT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 22, 106);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a manual_setpoint struct into a 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 manual_setpoint C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_manual_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_manual_setpoint_t* manual_setpoint)
|
||||
{
|
||||
return mavlink_msg_manual_setpoint_pack(system_id, component_id, msg, manual_setpoint->time_boot_ms, manual_setpoint->roll, manual_setpoint->pitch, manual_setpoint->yaw, manual_setpoint->thrust, manual_setpoint->mode_switch, manual_setpoint->manual_override_switch);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a manual_setpoint message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp in milliseconds since system boot
|
||||
* @param roll Desired roll rate in radians per second
|
||||
* @param pitch Desired pitch rate in radians per second
|
||||
* @param yaw Desired yaw rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
* @param mode_switch Flight mode switch position, 0.. 255
|
||||
* @param manual_override_switch Override mode switch position, 0.. 255
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_manual_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float thrust, uint8_t mode_switch, uint8_t manual_override_switch)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[22];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll);
|
||||
_mav_put_float(buf, 8, pitch);
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
_mav_put_uint8_t(buf, 20, mode_switch);
|
||||
_mav_put_uint8_t(buf, 21, manual_override_switch);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, buf, 22, 106);
|
||||
#else
|
||||
mavlink_manual_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
packet.mode_switch = mode_switch;
|
||||
packet.manual_override_switch = manual_override_switch;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MANUAL_SETPOINT, (const char *)&packet, 22, 106);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MANUAL_SETPOINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from manual_setpoint message
|
||||
*
|
||||
* @return Timestamp in milliseconds since system boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_manual_setpoint_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from manual_setpoint message
|
||||
*
|
||||
* @return Desired roll rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_manual_setpoint_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from manual_setpoint message
|
||||
*
|
||||
* @return Desired pitch rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_manual_setpoint_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from manual_setpoint message
|
||||
*
|
||||
* @return Desired yaw rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_manual_setpoint_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field thrust from manual_setpoint message
|
||||
*
|
||||
* @return Collective thrust, normalized to 0 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_manual_setpoint_get_thrust(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mode_switch from manual_setpoint message
|
||||
*
|
||||
* @return Flight mode switch position, 0.. 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_setpoint_get_mode_switch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field manual_override_switch from manual_setpoint message
|
||||
*
|
||||
* @return Override mode switch position, 0.. 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_manual_setpoint_get_manual_override_switch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a manual_setpoint message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param manual_setpoint C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_manual_setpoint_decode(const mavlink_message_t* msg, mavlink_manual_setpoint_t* manual_setpoint)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
manual_setpoint->time_boot_ms = mavlink_msg_manual_setpoint_get_time_boot_ms(msg);
|
||||
manual_setpoint->roll = mavlink_msg_manual_setpoint_get_roll(msg);
|
||||
manual_setpoint->pitch = mavlink_msg_manual_setpoint_get_pitch(msg);
|
||||
manual_setpoint->yaw = mavlink_msg_manual_setpoint_get_yaw(msg);
|
||||
manual_setpoint->thrust = mavlink_msg_manual_setpoint_get_thrust(msg);
|
||||
manual_setpoint->mode_switch = mavlink_msg_manual_setpoint_get_mode_switch(msg);
|
||||
manual_setpoint->manual_override_switch = mavlink_msg_manual_setpoint_get_manual_override_switch(msg);
|
||||
#else
|
||||
memcpy(manual_setpoint, _MAV_PAYLOAD(msg), 22);
|
||||
#endif
|
||||
}
|
||||
@@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_memory_vect_pack(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint8_t(buf, 2, ver);
|
||||
_mav_put_uint8_t(buf, 3, type);
|
||||
_mav_put_int8_t_array(buf, 4, value, 32);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36);
|
||||
#else
|
||||
mavlink_memory_vect_t packet;
|
||||
packet.address = address;
|
||||
packet.ver = ver;
|
||||
packet.type = type;
|
||||
mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT;
|
||||
@@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_memory_vect_pack_chan(uint8_t system_id, uint
|
||||
_mav_put_uint8_t(buf, 2, ver);
|
||||
_mav_put_uint8_t(buf, 3, type);
|
||||
_mav_put_int8_t_array(buf, 4, value, 32);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36);
|
||||
#else
|
||||
mavlink_memory_vect_t packet;
|
||||
packet.address = address;
|
||||
packet.ver = ver;
|
||||
packet.type = type;
|
||||
mav_array_memcpy(packet.value, value, sizeof(int8_t)*32);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMORY_VECT;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_mission_ack_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.type = type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ACK;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3);
|
||||
#else
|
||||
mavlink_mission_ack_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.type = type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ACK;
|
||||
|
||||
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_mission_clear_all_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
|
||||
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_mission_clear_all_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_mission_count_t packet;
|
||||
packet.count = count;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, ui
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_mission_count_t packet;
|
||||
packet.count = count;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT;
|
||||
|
||||
@@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8
|
||||
char buf[2];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_mission_current_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT;
|
||||
@@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id,
|
||||
char buf[2];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_mission_current_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT;
|
||||
|
||||
@@ -88,7 +88,7 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 37);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37);
|
||||
#else
|
||||
mavlink_mission_item_t packet;
|
||||
packet.param1 = param1;
|
||||
@@ -106,7 +106,7 @@ static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id, uint8_t
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 37);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM;
|
||||
@@ -156,7 +156,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin
|
||||
_mav_put_uint8_t(buf, 35, current);
|
||||
_mav_put_uint8_t(buf, 36, autocontinue);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 37);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 37);
|
||||
#else
|
||||
mavlink_mission_item_t packet;
|
||||
packet.param1 = param1;
|
||||
@@ -174,7 +174,7 @@ static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id, uin
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 37);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 37);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM;
|
||||
|
||||
@@ -36,12 +36,12 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id,
|
||||
char buf[2];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_mission_item_reached_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
|
||||
@@ -65,12 +65,12 @@ static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system
|
||||
char buf[2];
|
||||
_mav_put_uint16_t(buf, 0, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_mission_item_reached_t packet;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_mission_request_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_mission_request_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST;
|
||||
|
||||
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_mission_request_list_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
|
||||
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_mission_request_list_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
|
||||
|
||||
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_mission_request_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t sys
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_mission_request_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST;
|
||||
|
||||
@@ -44,14 +44,14 @@ static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, u
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_mission_set_current_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT;
|
||||
@@ -79,14 +79,14 @@ static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4);
|
||||
#else
|
||||
mavlink_mission_set_current_t packet;
|
||||
packet.seq = seq;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT;
|
||||
|
||||
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_mission_write_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t syste
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_mission_write_partial_list_t packet;
|
||||
packet.start_index = start_index;
|
||||
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST;
|
||||
|
||||
@@ -43,13 +43,13 @@ static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uin
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_named_value_float_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT;
|
||||
@@ -76,13 +76,13 @@ static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_named_value_float_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT;
|
||||
|
||||
@@ -43,13 +43,13 @@ static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_named_value_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT;
|
||||
@@ -76,13 +76,13 @@ static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, value);
|
||||
_mav_put_char_array(buf, 8, name, 10);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_named_value_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT;
|
||||
|
||||
@@ -64,7 +64,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id,
|
||||
_mav_put_int16_t(buf, 22, target_bearing);
|
||||
_mav_put_uint16_t(buf, 24, wp_dist);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 26);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
|
||||
#else
|
||||
mavlink_nav_controller_output_t packet;
|
||||
packet.nav_roll = nav_roll;
|
||||
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack(uint8_t system_id,
|
||||
packet.target_bearing = target_bearing;
|
||||
packet.wp_dist = wp_dist;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT;
|
||||
@@ -114,7 +114,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste
|
||||
_mav_put_int16_t(buf, 22, target_bearing);
|
||||
_mav_put_uint16_t(buf, 24, wp_dist);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 26);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
|
||||
#else
|
||||
mavlink_nav_controller_output_t packet;
|
||||
packet.nav_roll = nav_roll;
|
||||
@@ -126,7 +126,7 @@ static inline uint16_t mavlink_msg_nav_controller_output_pack_chan(uint8_t syste
|
||||
packet.target_bearing = target_bearing;
|
||||
packet.wp_dist = wp_dist;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT;
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
// MESSAGE OMNIDIRECTIONAL_FLOW PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW 106
|
||||
|
||||
typedef struct __mavlink_omnidirectional_flow_t
|
||||
{
|
||||
uint64_t time_usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
float front_distance_m; ///< Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
|
||||
int16_t left[10]; ///< Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
|
||||
int16_t right[10]; ///< Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
|
||||
uint8_t sensor_id; ///< Sensor ID
|
||||
uint8_t quality; ///< Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
} mavlink_omnidirectional_flow_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW_LEN 54
|
||||
#define MAVLINK_MSG_ID_106_LEN 54
|
||||
|
||||
#define MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_LEFT_LEN 10
|
||||
#define MAVLINK_MSG_OMNIDIRECTIONAL_FLOW_FIELD_RIGHT_LEN 10
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_OMNIDIRECTIONAL_FLOW { \
|
||||
"OMNIDIRECTIONAL_FLOW", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_omnidirectional_flow_t, time_usec) }, \
|
||||
{ "front_distance_m", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_omnidirectional_flow_t, front_distance_m) }, \
|
||||
{ "left", NULL, MAVLINK_TYPE_INT16_T, 10, 12, offsetof(mavlink_omnidirectional_flow_t, left) }, \
|
||||
{ "right", NULL, MAVLINK_TYPE_INT16_T, 10, 32, offsetof(mavlink_omnidirectional_flow_t, right) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_omnidirectional_flow_t, sensor_id) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_omnidirectional_flow_t, quality) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a omnidirectional_flow 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 time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param sensor_id Sensor ID
|
||||
* @param left Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
|
||||
* @param right Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param front_distance_m Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_omnidirectional_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t sensor_id, const int16_t *left, const int16_t *right, uint8_t quality, float front_distance_m)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[54];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, front_distance_m);
|
||||
_mav_put_uint8_t(buf, 52, sensor_id);
|
||||
_mav_put_uint8_t(buf, 53, quality);
|
||||
_mav_put_int16_t_array(buf, 12, left, 10);
|
||||
_mav_put_int16_t_array(buf, 32, right, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54);
|
||||
#else
|
||||
mavlink_omnidirectional_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.front_distance_m = front_distance_m;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
mav_array_memcpy(packet.left, left, sizeof(int16_t)*10);
|
||||
mav_array_memcpy(packet.right, right, sizeof(int16_t)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 54, 211);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a omnidirectional_flow 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 was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param sensor_id Sensor ID
|
||||
* @param left Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
|
||||
* @param right Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param front_distance_m Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_omnidirectional_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t sensor_id,const int16_t *left,const int16_t *right,uint8_t quality,float front_distance_m)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[54];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, front_distance_m);
|
||||
_mav_put_uint8_t(buf, 52, sensor_id);
|
||||
_mav_put_uint8_t(buf, 53, quality);
|
||||
_mav_put_int16_t_array(buf, 12, left, 10);
|
||||
_mav_put_int16_t_array(buf, 32, right, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 54);
|
||||
#else
|
||||
mavlink_omnidirectional_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.front_distance_m = front_distance_m;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
mav_array_memcpy(packet.left, left, sizeof(int16_t)*10);
|
||||
mav_array_memcpy(packet.right, right, sizeof(int16_t)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 54);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 54, 211);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a omnidirectional_flow struct into a 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 omnidirectional_flow C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_omnidirectional_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_omnidirectional_flow_t* omnidirectional_flow)
|
||||
{
|
||||
return mavlink_msg_omnidirectional_flow_pack(system_id, component_id, msg, omnidirectional_flow->time_usec, omnidirectional_flow->sensor_id, omnidirectional_flow->left, omnidirectional_flow->right, omnidirectional_flow->quality, omnidirectional_flow->front_distance_m);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a omnidirectional_flow message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
* @param sensor_id Sensor ID
|
||||
* @param left Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
|
||||
* @param right Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param front_distance_m Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_omnidirectional_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, const int16_t *left, const int16_t *right, uint8_t quality, float front_distance_m)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[54];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, front_distance_m);
|
||||
_mav_put_uint8_t(buf, 52, sensor_id);
|
||||
_mav_put_uint8_t(buf, 53, quality);
|
||||
_mav_put_int16_t_array(buf, 12, left, 10);
|
||||
_mav_put_int16_t_array(buf, 32, right, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, buf, 54, 211);
|
||||
#else
|
||||
mavlink_omnidirectional_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.front_distance_m = front_distance_m;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
mav_array_memcpy(packet.left, left, sizeof(int16_t)*10);
|
||||
mav_array_memcpy(packet.right, right, sizeof(int16_t)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW, (const char *)&packet, 54, 211);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE OMNIDIRECTIONAL_FLOW UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from omnidirectional_flow message
|
||||
*
|
||||
* @return Timestamp (microseconds, synced to UNIX time or since system boot)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_omnidirectional_flow_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field sensor_id from omnidirectional_flow message
|
||||
*
|
||||
* @return Sensor ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_omnidirectional_flow_get_sensor_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field left from omnidirectional_flow message
|
||||
*
|
||||
* @return Flow in deci pixels (1 = 0.1 pixel) on left hemisphere
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_omnidirectional_flow_get_left(const mavlink_message_t* msg, int16_t *left)
|
||||
{
|
||||
return _MAV_RETURN_int16_t_array(msg, left, 10, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field right from omnidirectional_flow message
|
||||
*
|
||||
* @return Flow in deci pixels (1 = 0.1 pixel) on right hemisphere
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_omnidirectional_flow_get_right(const mavlink_message_t* msg, int16_t *right)
|
||||
{
|
||||
return _MAV_RETURN_int16_t_array(msg, right, 10, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field quality from omnidirectional_flow message
|
||||
*
|
||||
* @return Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_omnidirectional_flow_get_quality(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 53);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field front_distance_m from omnidirectional_flow message
|
||||
*
|
||||
* @return Front distance in meters. Positive value (including zero): distance known. Negative value: Unknown distance
|
||||
*/
|
||||
static inline float mavlink_msg_omnidirectional_flow_get_front_distance_m(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a omnidirectional_flow message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param omnidirectional_flow C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_omnidirectional_flow_decode(const mavlink_message_t* msg, mavlink_omnidirectional_flow_t* omnidirectional_flow)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
omnidirectional_flow->time_usec = mavlink_msg_omnidirectional_flow_get_time_usec(msg);
|
||||
omnidirectional_flow->front_distance_m = mavlink_msg_omnidirectional_flow_get_front_distance_m(msg);
|
||||
mavlink_msg_omnidirectional_flow_get_left(msg, omnidirectional_flow->left);
|
||||
mavlink_msg_omnidirectional_flow_get_right(msg, omnidirectional_flow->right);
|
||||
omnidirectional_flow->sensor_id = mavlink_msg_omnidirectional_flow_get_sensor_id(msg);
|
||||
omnidirectional_flow->quality = mavlink_msg_omnidirectional_flow_get_quality(msg);
|
||||
#else
|
||||
memcpy(omnidirectional_flow, _MAV_PAYLOAD(msg), 54);
|
||||
#endif
|
||||
}
|
||||
@@ -5,27 +5,31 @@
|
||||
typedef struct __mavlink_optical_flow_t
|
||||
{
|
||||
uint64_t time_usec; ///< Timestamp (UNIX)
|
||||
float ground_distance; ///< Ground distance in meters
|
||||
float flow_comp_m_x; ///< Flow in meters in x-sensor direction, angular-speed compensated
|
||||
float flow_comp_m_y; ///< Flow in meters in y-sensor direction, angular-speed compensated
|
||||
float ground_distance; ///< Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
|
||||
int16_t flow_x; ///< Flow in pixels in x-sensor direction
|
||||
int16_t flow_y; ///< Flow in pixels in y-sensor direction
|
||||
uint8_t sensor_id; ///< Sensor ID
|
||||
uint8_t quality; ///< Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
} mavlink_optical_flow_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 18
|
||||
#define MAVLINK_MSG_ID_100_LEN 18
|
||||
#define MAVLINK_MSG_ID_OPTICAL_FLOW_LEN 26
|
||||
#define MAVLINK_MSG_ID_100_LEN 26
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_OPTICAL_FLOW { \
|
||||
"OPTICAL_FLOW", \
|
||||
6, \
|
||||
8, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_optical_flow_t, time_usec) }, \
|
||||
{ "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, ground_distance) }, \
|
||||
{ "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_optical_flow_t, flow_x) }, \
|
||||
{ "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_optical_flow_t, flow_y) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_optical_flow_t, sensor_id) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_optical_flow_t, quality) }, \
|
||||
{ "flow_comp_m_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_optical_flow_t, flow_comp_m_x) }, \
|
||||
{ "flow_comp_m_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_optical_flow_t, flow_comp_m_y) }, \
|
||||
{ "ground_distance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_optical_flow_t, ground_distance) }, \
|
||||
{ "flow_x", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_optical_flow_t, flow_x) }, \
|
||||
{ "flow_y", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_optical_flow_t, flow_y) }, \
|
||||
{ "sensor_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_optical_flow_t, sensor_id) }, \
|
||||
{ "quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_optical_flow_t, quality) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -40,37 +44,43 @@ typedef struct __mavlink_optical_flow_t
|
||||
* @param sensor_id Sensor ID
|
||||
* @param flow_x Flow in pixels in x-sensor direction
|
||||
* @param flow_y Flow in pixels in y-sensor direction
|
||||
* @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
|
||||
* @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param ground_distance Ground distance in meters
|
||||
* @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, uint8_t quality, float ground_distance)
|
||||
uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
char buf[26];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, ground_distance);
|
||||
_mav_put_int16_t(buf, 12, flow_x);
|
||||
_mav_put_int16_t(buf, 14, flow_y);
|
||||
_mav_put_uint8_t(buf, 16, sensor_id);
|
||||
_mav_put_uint8_t(buf, 17, quality);
|
||||
_mav_put_float(buf, 8, flow_comp_m_x);
|
||||
_mav_put_float(buf, 12, flow_comp_m_y);
|
||||
_mav_put_float(buf, 16, ground_distance);
|
||||
_mav_put_int16_t(buf, 20, flow_x);
|
||||
_mav_put_int16_t(buf, 22, flow_y);
|
||||
_mav_put_uint8_t(buf, 24, sensor_id);
|
||||
_mav_put_uint8_t(buf, 25, quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
|
||||
#else
|
||||
mavlink_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flow_comp_m_x = flow_comp_m_x;
|
||||
packet.flow_comp_m_y = flow_comp_m_y;
|
||||
packet.ground_distance = ground_distance;
|
||||
packet.flow_x = flow_x;
|
||||
packet.flow_y = flow_y;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 18, 19);
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 26, 175);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,38 +93,44 @@ static inline uint16_t mavlink_msg_optical_flow_pack(uint8_t system_id, uint8_t
|
||||
* @param sensor_id Sensor ID
|
||||
* @param flow_x Flow in pixels in x-sensor direction
|
||||
* @param flow_y Flow in pixels in y-sensor direction
|
||||
* @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
|
||||
* @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param ground_distance Ground distance in meters
|
||||
* @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,uint8_t quality,float ground_distance)
|
||||
uint64_t time_usec,uint8_t sensor_id,int16_t flow_x,int16_t flow_y,float flow_comp_m_x,float flow_comp_m_y,uint8_t quality,float ground_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
char buf[26];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, ground_distance);
|
||||
_mav_put_int16_t(buf, 12, flow_x);
|
||||
_mav_put_int16_t(buf, 14, flow_y);
|
||||
_mav_put_uint8_t(buf, 16, sensor_id);
|
||||
_mav_put_uint8_t(buf, 17, quality);
|
||||
_mav_put_float(buf, 8, flow_comp_m_x);
|
||||
_mav_put_float(buf, 12, flow_comp_m_y);
|
||||
_mav_put_float(buf, 16, ground_distance);
|
||||
_mav_put_int16_t(buf, 20, flow_x);
|
||||
_mav_put_int16_t(buf, 22, flow_y);
|
||||
_mav_put_uint8_t(buf, 24, sensor_id);
|
||||
_mav_put_uint8_t(buf, 25, quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
|
||||
#else
|
||||
mavlink_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flow_comp_m_x = flow_comp_m_x;
|
||||
packet.flow_comp_m_y = flow_comp_m_y;
|
||||
packet.ground_distance = ground_distance;
|
||||
packet.flow_x = flow_x;
|
||||
packet.flow_y = flow_y;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_OPTICAL_FLOW;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 19);
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 26, 175);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,7 +143,7 @@ static inline uint16_t mavlink_msg_optical_flow_pack_chan(uint8_t system_id, uin
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_optical_flow_t* optical_flow)
|
||||
{
|
||||
return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->quality, optical_flow->ground_distance);
|
||||
return mavlink_msg_optical_flow_pack(system_id, component_id, msg, optical_flow->time_usec, optical_flow->sensor_id, optical_flow->flow_x, optical_flow->flow_y, optical_flow->flow_comp_m_x, optical_flow->flow_comp_m_y, optical_flow->quality, optical_flow->ground_distance);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,33 +154,39 @@ static inline uint16_t mavlink_msg_optical_flow_encode(uint8_t system_id, uint8_
|
||||
* @param sensor_id Sensor ID
|
||||
* @param flow_x Flow in pixels in x-sensor direction
|
||||
* @param flow_y Flow in pixels in y-sensor direction
|
||||
* @param flow_comp_m_x Flow in meters in x-sensor direction, angular-speed compensated
|
||||
* @param flow_comp_m_y Flow in meters in y-sensor direction, angular-speed compensated
|
||||
* @param quality Optical flow quality / confidence. 0: bad, 255: maximum quality
|
||||
* @param ground_distance Ground distance in meters
|
||||
* @param ground_distance Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, uint8_t quality, float ground_distance)
|
||||
static inline void mavlink_msg_optical_flow_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t sensor_id, int16_t flow_x, int16_t flow_y, float flow_comp_m_x, float flow_comp_m_y, uint8_t quality, float ground_distance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[18];
|
||||
char buf[26];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, ground_distance);
|
||||
_mav_put_int16_t(buf, 12, flow_x);
|
||||
_mav_put_int16_t(buf, 14, flow_y);
|
||||
_mav_put_uint8_t(buf, 16, sensor_id);
|
||||
_mav_put_uint8_t(buf, 17, quality);
|
||||
_mav_put_float(buf, 8, flow_comp_m_x);
|
||||
_mav_put_float(buf, 12, flow_comp_m_y);
|
||||
_mav_put_float(buf, 16, ground_distance);
|
||||
_mav_put_int16_t(buf, 20, flow_x);
|
||||
_mav_put_int16_t(buf, 22, flow_y);
|
||||
_mav_put_uint8_t(buf, 24, sensor_id);
|
||||
_mav_put_uint8_t(buf, 25, quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, 18, 19);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, buf, 26, 175);
|
||||
#else
|
||||
mavlink_optical_flow_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.flow_comp_m_x = flow_comp_m_x;
|
||||
packet.flow_comp_m_y = flow_comp_m_y;
|
||||
packet.ground_distance = ground_distance;
|
||||
packet.flow_x = flow_x;
|
||||
packet.flow_y = flow_y;
|
||||
packet.sensor_id = sensor_id;
|
||||
packet.quality = quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, 18, 19);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPTICAL_FLOW, (const char *)&packet, 26, 175);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -190,7 +212,7 @@ static inline uint64_t mavlink_msg_optical_flow_get_time_usec(const mavlink_mess
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 16);
|
||||
return _MAV_RETURN_uint8_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,7 +222,7 @@ static inline uint8_t mavlink_msg_optical_flow_get_sensor_id(const mavlink_messa
|
||||
*/
|
||||
static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 12);
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,7 +232,27 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_x(const mavlink_message_
|
||||
*/
|
||||
static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 14);
|
||||
return _MAV_RETURN_int16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flow_comp_m_x from optical_flow message
|
||||
*
|
||||
* @return Flow in meters in x-sensor direction, angular-speed compensated
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_get_flow_comp_m_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flow_comp_m_y from optical_flow message
|
||||
*
|
||||
* @return Flow in meters in y-sensor direction, angular-speed compensated
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_get_flow_comp_m_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,17 +262,17 @@ static inline int16_t mavlink_msg_optical_flow_get_flow_y(const mavlink_message_
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_optical_flow_get_quality(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 17);
|
||||
return _MAV_RETURN_uint8_t(msg, 25);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ground_distance from optical_flow message
|
||||
*
|
||||
* @return Ground distance in meters
|
||||
* @return Ground distance in meters. Positive value: distance known. Negative value: Unknown distance
|
||||
*/
|
||||
static inline float mavlink_msg_optical_flow_get_ground_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,12 +285,14 @@ static inline void mavlink_msg_optical_flow_decode(const mavlink_message_t* msg,
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
optical_flow->time_usec = mavlink_msg_optical_flow_get_time_usec(msg);
|
||||
optical_flow->flow_comp_m_x = mavlink_msg_optical_flow_get_flow_comp_m_x(msg);
|
||||
optical_flow->flow_comp_m_y = mavlink_msg_optical_flow_get_flow_comp_m_y(msg);
|
||||
optical_flow->ground_distance = mavlink_msg_optical_flow_get_ground_distance(msg);
|
||||
optical_flow->flow_x = mavlink_msg_optical_flow_get_flow_x(msg);
|
||||
optical_flow->flow_y = mavlink_msg_optical_flow_get_flow_y(msg);
|
||||
optical_flow->sensor_id = mavlink_msg_optical_flow_get_sensor_id(msg);
|
||||
optical_flow->quality = mavlink_msg_optical_flow_get_quality(msg);
|
||||
#else
|
||||
memcpy(optical_flow, _MAV_PAYLOAD(msg), 18);
|
||||
memcpy(optical_flow, _MAV_PAYLOAD(msg), 26);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, ui
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_param_request_list_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST;
|
||||
@@ -72,13 +72,13 @@ static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_i
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
|
||||
#else
|
||||
mavlink_param_request_list_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 2);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST;
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
typedef struct __mavlink_param_request_read_t
|
||||
{
|
||||
int16_t param_index; ///< Parameter index. Send -1 to use the param ID field as identifier
|
||||
int16_t param_index; ///< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
char param_id[16]; ///< Onboard parameter id
|
||||
char param_id[16]; ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
} mavlink_param_request_read_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_PARAM_REQUEST_READ_LEN 20
|
||||
@@ -34,8 +34,8 @@ typedef struct __mavlink_param_request_read_t
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_index Parameter index. Send -1 to use the param ID field as identifier
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
@@ -47,14 +47,14 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_char_array(buf, 4, param_id, 16);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
|
||||
#else
|
||||
mavlink_param_request_read_t packet;
|
||||
packet.param_index = param_index;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ;
|
||||
@@ -69,8 +69,8 @@ static inline uint16_t mavlink_msg_param_request_read_pack(uint8_t system_id, ui
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_index Parameter index. Send -1 to use the param ID field as identifier
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
@@ -83,14 +83,14 @@ static inline uint16_t mavlink_msg_param_request_read_pack_chan(uint8_t system_i
|
||||
_mav_put_uint8_t(buf, 2, target_system);
|
||||
_mav_put_uint8_t(buf, 3, target_component);
|
||||
_mav_put_char_array(buf, 4, param_id, 16);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
|
||||
#else
|
||||
mavlink_param_request_read_t packet;
|
||||
packet.param_index = param_index;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ;
|
||||
@@ -116,8 +116,8 @@ static inline uint16_t mavlink_msg_param_request_read_encode(uint8_t system_id,
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_index Parameter index. Send -1 to use the param ID field as identifier
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
@@ -168,7 +168,7 @@ static inline uint8_t mavlink_msg_param_request_read_get_target_component(const
|
||||
/**
|
||||
* @brief Get field param_id from param_request_read message
|
||||
*
|
||||
* @return Onboard parameter id
|
||||
* @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink_message_t* msg, char *param_id)
|
||||
{
|
||||
@@ -178,7 +178,7 @@ static inline uint16_t mavlink_msg_param_request_read_get_param_id(const mavlink
|
||||
/**
|
||||
* @brief Get field param_index from param_request_read message
|
||||
*
|
||||
* @return Parameter index. Send -1 to use the param ID field as identifier
|
||||
* @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)
|
||||
*/
|
||||
static inline int16_t mavlink_msg_param_request_read_get_param_index(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -7,8 +7,8 @@ typedef struct __mavlink_param_set_t
|
||||
float param_value; ///< Onboard parameter value
|
||||
uint8_t target_system; ///< System ID
|
||||
uint8_t target_component; ///< Component ID
|
||||
char param_id[16]; ///< Onboard parameter id
|
||||
uint8_t param_type; ///< Onboard parameter type: see MAV_VAR enum
|
||||
char param_id[16]; ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
uint8_t param_type; ///< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
} mavlink_param_set_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_PARAM_SET_LEN 23
|
||||
@@ -36,9 +36,9 @@ typedef struct __mavlink_param_set_t
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_value Onboard parameter value
|
||||
* @param param_type Onboard parameter type: see MAV_VAR enum
|
||||
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
@@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 22, param_type);
|
||||
_mav_put_char_array(buf, 6, param_id, 16);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 23);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23);
|
||||
#else
|
||||
mavlink_param_set_t packet;
|
||||
packet.param_value = param_value;
|
||||
@@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com
|
||||
packet.target_component = target_component;
|
||||
packet.param_type = param_type;
|
||||
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 23);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PARAM_SET;
|
||||
@@ -74,9 +74,9 @@ static inline uint16_t mavlink_msg_param_set_pack(uint8_t system_id, uint8_t com
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_value Onboard parameter value
|
||||
* @param param_type Onboard parameter type: see MAV_VAR enum
|
||||
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
@@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 22, param_type);
|
||||
_mav_put_char_array(buf, 6, param_id, 16);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 23);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 23);
|
||||
#else
|
||||
mavlink_param_set_t packet;
|
||||
packet.param_value = param_value;
|
||||
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_param_set_pack_chan(uint8_t system_id, uint8_
|
||||
packet.target_component = target_component;
|
||||
packet.param_type = param_type;
|
||||
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 23);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 23);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PARAM_SET;
|
||||
@@ -124,9 +124,9 @@ static inline uint16_t mavlink_msg_param_set_encode(uint8_t system_id, uint8_t c
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_value Onboard parameter value
|
||||
* @param param_type Onboard parameter type: see MAV_VAR enum
|
||||
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
@@ -179,7 +179,7 @@ static inline uint8_t mavlink_msg_param_set_get_target_component(const mavlink_m
|
||||
/**
|
||||
* @brief Get field param_id from param_set message
|
||||
*
|
||||
* @return Onboard parameter id
|
||||
* @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_param_set_get_param_id(const mavlink_message_t* msg, char *param_id)
|
||||
{
|
||||
@@ -199,7 +199,7 @@ static inline float mavlink_msg_param_set_get_param_value(const mavlink_message_
|
||||
/**
|
||||
* @brief Get field param_type from param_set message
|
||||
*
|
||||
* @return Onboard parameter type: see MAV_VAR enum
|
||||
* @return Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_param_set_get_param_type(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -7,8 +7,8 @@ typedef struct __mavlink_param_value_t
|
||||
float param_value; ///< Onboard parameter value
|
||||
uint16_t param_count; ///< Total number of onboard parameters
|
||||
uint16_t param_index; ///< Index of this onboard parameter
|
||||
char param_id[16]; ///< Onboard parameter id
|
||||
uint8_t param_type; ///< Onboard parameter type: see MAV_VAR enum
|
||||
char param_id[16]; ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
uint8_t param_type; ///< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
} mavlink_param_value_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_PARAM_VALUE_LEN 25
|
||||
@@ -34,9 +34,9 @@ typedef struct __mavlink_param_value_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_value Onboard parameter value
|
||||
* @param param_type Onboard parameter type: see MAV_VAR enum
|
||||
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
* @param param_count Total number of onboard parameters
|
||||
* @param param_index Index of this onboard parameter
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
@@ -51,7 +51,7 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c
|
||||
_mav_put_uint16_t(buf, 6, param_index);
|
||||
_mav_put_uint8_t(buf, 24, param_type);
|
||||
_mav_put_char_array(buf, 8, param_id, 16);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
|
||||
#else
|
||||
mavlink_param_value_t packet;
|
||||
packet.param_value = param_value;
|
||||
@@ -59,7 +59,7 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c
|
||||
packet.param_index = param_index;
|
||||
packet.param_type = param_type;
|
||||
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE;
|
||||
@@ -72,9 +72,9 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_value Onboard parameter value
|
||||
* @param param_type Onboard parameter type: see MAV_VAR enum
|
||||
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
* @param param_count Total number of onboard parameters
|
||||
* @param param_index Index of this onboard parameter
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
@@ -90,7 +90,7 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint
|
||||
_mav_put_uint16_t(buf, 6, param_index);
|
||||
_mav_put_uint8_t(buf, 24, param_type);
|
||||
_mav_put_char_array(buf, 8, param_id, 16);
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
|
||||
#else
|
||||
mavlink_param_value_t packet;
|
||||
packet.param_value = param_value;
|
||||
@@ -98,7 +98,7 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint
|
||||
packet.param_index = param_index;
|
||||
packet.param_type = param_type;
|
||||
mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE;
|
||||
@@ -122,9 +122,9 @@ static inline uint16_t mavlink_msg_param_value_encode(uint8_t system_id, uint8_t
|
||||
* @brief Send a param_value message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param param_id Onboard parameter id
|
||||
* @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
* @param param_value Onboard parameter value
|
||||
* @param param_type Onboard parameter type: see MAV_VAR enum
|
||||
* @param param_type Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
* @param param_count Total number of onboard parameters
|
||||
* @param param_index Index of this onboard parameter
|
||||
*/
|
||||
@@ -159,7 +159,7 @@ static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const ch
|
||||
/**
|
||||
* @brief Get field param_id from param_value message
|
||||
*
|
||||
* @return Onboard parameter id
|
||||
* @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_param_value_get_param_id(const mavlink_message_t* msg, char *param_id)
|
||||
{
|
||||
@@ -179,7 +179,7 @@ static inline float mavlink_msg_param_value_get_param_value(const mavlink_messag
|
||||
/**
|
||||
* @brief Get field param_type from param_value message
|
||||
*
|
||||
* @return Onboard parameter type: see MAV_VAR enum
|
||||
* @return Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_param_value_get_param_type(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
|
||||
#else
|
||||
mavlink_ping_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t componen
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PING;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
|
||||
#else
|
||||
mavlink_ping_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t com
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PING;
|
||||
|
||||
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo
|
||||
_mav_put_int16_t(buf, 22, ymag);
|
||||
_mav_put_int16_t(buf, 24, zmag);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 26);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
|
||||
#else
|
||||
mavlink_raw_imu_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack(uint8_t system_id, uint8_t compo
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RAW_IMU;
|
||||
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t
|
||||
_mav_put_int16_t(buf, 22, ymag);
|
||||
_mav_put_int16_t(buf, 24, zmag);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 26);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 26);
|
||||
#else
|
||||
mavlink_raw_imu_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_raw_imu_pack_chan(uint8_t system_id, uint8_t
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 26);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 26);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RAW_IMU;
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t
|
||||
_mav_put_int16_t(buf, 12, press_diff2);
|
||||
_mav_put_int16_t(buf, 14, temperature);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
|
||||
#else
|
||||
mavlink_raw_pressure_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack(uint8_t system_id, uint8_t
|
||||
packet.press_diff2 = press_diff2;
|
||||
packet.temperature = temperature;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin
|
||||
_mav_put_int16_t(buf, 12, press_diff2);
|
||||
_mav_put_int16_t(buf, 14, temperature);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 16);
|
||||
#else
|
||||
mavlink_raw_pressure_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_raw_pressure_pack_chan(uint8_t system_id, uin
|
||||
packet.press_diff2 = press_diff2;
|
||||
packet.temperature = temperature;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 16);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RAW_PRESSURE;
|
||||
|
||||
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 16, target_system);
|
||||
_mav_put_uint8_t(buf, 17, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_rc_channels_override_t packet;
|
||||
packet.chan1_raw = chan1_raw;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id,
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
|
||||
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system
|
||||
_mav_put_uint8_t(buf, 16, target_system);
|
||||
_mav_put_uint8_t(buf, 17, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18);
|
||||
#else
|
||||
mavlink_rc_channels_override_t packet;
|
||||
packet.chan1_raw = chan1_raw;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 18);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
typedef struct __mavlink_rc_channels_raw_t
|
||||
{
|
||||
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
|
||||
uint16_t chan1_raw; ///< RC channel 1 value, in microseconds
|
||||
uint16_t chan2_raw; ///< RC channel 2 value, in microseconds
|
||||
uint16_t chan3_raw; ///< RC channel 3 value, in microseconds
|
||||
uint16_t chan4_raw; ///< RC channel 4 value, in microseconds
|
||||
uint16_t chan5_raw; ///< RC channel 5 value, in microseconds
|
||||
uint16_t chan6_raw; ///< RC channel 6 value, in microseconds
|
||||
uint16_t chan7_raw; ///< RC channel 7 value, in microseconds
|
||||
uint16_t chan8_raw; ///< RC channel 8 value, in microseconds
|
||||
uint8_t port; ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
uint16_t chan1_raw; ///< RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
uint16_t chan2_raw; ///< RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
uint16_t chan3_raw; ///< RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
uint16_t chan4_raw; ///< RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
uint16_t chan5_raw; ///< RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
uint16_t chan6_raw; ///< RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
uint16_t chan7_raw; ///< RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
uint16_t chan8_raw; ///< RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
uint8_t port; ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
} mavlink_rc_channels_raw_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22
|
||||
@@ -47,16 +47,16 @@ typedef struct __mavlink_rc_channels_raw_t
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param chan1_raw RC channel 1 value, in microseconds
|
||||
* @param chan2_raw RC channel 2 value, in microseconds
|
||||
* @param chan3_raw RC channel 3 value, in microseconds
|
||||
* @param chan4_raw RC channel 4 value, in microseconds
|
||||
* @param chan5_raw RC channel 5 value, in microseconds
|
||||
* @param chan6_raw RC channel 6 value, in microseconds
|
||||
* @param chan7_raw RC channel 7 value, in microseconds
|
||||
* @param chan8_raw RC channel 8 value, in microseconds
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
* @param chan1_raw RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan2_raw RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan3_raw RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan4_raw RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan5_raw RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan6_raw RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan7_raw RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan8_raw RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8
|
||||
_mav_put_uint8_t(buf, 20, port);
|
||||
_mav_put_uint8_t(buf, 21, rssi);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_rc_channels_raw_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8
|
||||
packet.port = port;
|
||||
packet.rssi = rssi;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW;
|
||||
@@ -105,16 +105,16 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param chan1_raw RC channel 1 value, in microseconds
|
||||
* @param chan2_raw RC channel 2 value, in microseconds
|
||||
* @param chan3_raw RC channel 3 value, in microseconds
|
||||
* @param chan4_raw RC channel 4 value, in microseconds
|
||||
* @param chan5_raw RC channel 5 value, in microseconds
|
||||
* @param chan6_raw RC channel 6 value, in microseconds
|
||||
* @param chan7_raw RC channel 7 value, in microseconds
|
||||
* @param chan8_raw RC channel 8 value, in microseconds
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
* @param chan1_raw RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan2_raw RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan3_raw RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan4_raw RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan5_raw RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan6_raw RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan7_raw RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan8_raw RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint8_t(buf, 20, port);
|
||||
_mav_put_uint8_t(buf, 21, rssi);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_rc_channels_raw_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id,
|
||||
packet.port = port;
|
||||
packet.rssi = rssi;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW;
|
||||
@@ -175,16 +175,16 @@ static inline uint16_t mavlink_msg_rc_channels_raw_encode(uint8_t system_id, uin
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param chan1_raw RC channel 1 value, in microseconds
|
||||
* @param chan2_raw RC channel 2 value, in microseconds
|
||||
* @param chan3_raw RC channel 3 value, in microseconds
|
||||
* @param chan4_raw RC channel 4 value, in microseconds
|
||||
* @param chan5_raw RC channel 5 value, in microseconds
|
||||
* @param chan6_raw RC channel 6 value, in microseconds
|
||||
* @param chan7_raw RC channel 7 value, in microseconds
|
||||
* @param chan8_raw RC channel 8 value, in microseconds
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
* @param chan1_raw RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan2_raw RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan3_raw RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan4_raw RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan5_raw RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan6_raw RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan7_raw RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param chan8_raw RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
@@ -241,7 +241,7 @@ static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlin
|
||||
/**
|
||||
* @brief Get field port from rc_channels_raw message
|
||||
*
|
||||
* @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -251,7 +251,7 @@ static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message
|
||||
/**
|
||||
* @brief Get field chan1_raw from rc_channels_raw message
|
||||
*
|
||||
* @return RC channel 1 value, in microseconds
|
||||
* @return RC channel 1 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -261,7 +261,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_m
|
||||
/**
|
||||
* @brief Get field chan2_raw from rc_channels_raw message
|
||||
*
|
||||
* @return RC channel 2 value, in microseconds
|
||||
* @return RC channel 2 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_m
|
||||
/**
|
||||
* @brief Get field chan3_raw from rc_channels_raw message
|
||||
*
|
||||
* @return RC channel 3 value, in microseconds
|
||||
* @return RC channel 3 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -281,7 +281,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_m
|
||||
/**
|
||||
* @brief Get field chan4_raw from rc_channels_raw message
|
||||
*
|
||||
* @return RC channel 4 value, in microseconds
|
||||
* @return RC channel 4 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -291,7 +291,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_m
|
||||
/**
|
||||
* @brief Get field chan5_raw from rc_channels_raw message
|
||||
*
|
||||
* @return RC channel 5 value, in microseconds
|
||||
* @return RC channel 5 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -301,7 +301,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_m
|
||||
/**
|
||||
* @brief Get field chan6_raw from rc_channels_raw message
|
||||
*
|
||||
* @return RC channel 6 value, in microseconds
|
||||
* @return RC channel 6 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -311,7 +311,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_m
|
||||
/**
|
||||
* @brief Get field chan7_raw from rc_channels_raw message
|
||||
*
|
||||
* @return RC channel 7 value, in microseconds
|
||||
* @return RC channel 7 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -321,7 +321,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_m
|
||||
/**
|
||||
* @brief Get field chan8_raw from rc_channels_raw message
|
||||
*
|
||||
* @return RC channel 8 value, in microseconds
|
||||
* @return RC channel 8 value, in microseconds. A value of 65535 implies the channel is unused.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -331,7 +331,7 @@ static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_m
|
||||
/**
|
||||
* @brief Get field rssi from rc_channels_raw message
|
||||
*
|
||||
* @return Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
* @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
typedef struct __mavlink_rc_channels_scaled_t
|
||||
{
|
||||
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
|
||||
int16_t chan1_scaled; ///< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
int16_t chan2_scaled; ///< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
int16_t chan3_scaled; ///< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
int16_t chan4_scaled; ///< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
int16_t chan5_scaled; ///< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
int16_t chan6_scaled; ///< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
int16_t chan7_scaled; ///< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
int16_t chan8_scaled; ///< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
uint8_t port; ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
int16_t chan1_scaled; ///< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
int16_t chan2_scaled; ///< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
int16_t chan3_scaled; ///< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
int16_t chan4_scaled; ///< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
int16_t chan5_scaled; ///< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
int16_t chan6_scaled; ///< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
int16_t chan7_scaled; ///< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
int16_t chan8_scaled; ///< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
uint8_t port; ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
uint8_t rssi; ///< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
} mavlink_rc_channels_scaled_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22
|
||||
@@ -47,16 +47,16 @@ typedef struct __mavlink_rc_channels_scaled_t
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
@@ -76,7 +76,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui
|
||||
_mav_put_uint8_t(buf, 20, port);
|
||||
_mav_put_uint8_t(buf, 21, rssi);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_rc_channels_scaled_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -91,7 +91,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui
|
||||
packet.port = port;
|
||||
packet.rssi = rssi;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED;
|
||||
@@ -105,16 +105,16 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, ui
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
@@ -135,7 +135,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i
|
||||
_mav_put_uint8_t(buf, 20, port);
|
||||
_mav_put_uint8_t(buf, 21, rssi);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_rc_channels_scaled_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -150,7 +150,7 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_i
|
||||
packet.port = port;
|
||||
packet.rssi = rssi;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED;
|
||||
@@ -175,16 +175,16 @@ static inline uint16_t mavlink_msg_rc_channels_scaled_encode(uint8_t system_id,
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
* @param chan1_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
* @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
@@ -241,7 +241,7 @@ static inline uint32_t mavlink_msg_rc_channels_scaled_get_time_boot_ms(const mav
|
||||
/**
|
||||
* @brief Get field port from rc_channels_scaled message
|
||||
*
|
||||
* @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -251,7 +251,7 @@ static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_mess
|
||||
/**
|
||||
* @brief Get field chan1_scaled from rc_channels_scaled message
|
||||
*
|
||||
* @return RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @return RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -261,7 +261,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavl
|
||||
/**
|
||||
* @brief Get field chan2_scaled from rc_channels_scaled message
|
||||
*
|
||||
* @return RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @return RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavl
|
||||
/**
|
||||
* @brief Get field chan3_scaled from rc_channels_scaled message
|
||||
*
|
||||
* @return RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @return RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -281,7 +281,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavl
|
||||
/**
|
||||
* @brief Get field chan4_scaled from rc_channels_scaled message
|
||||
*
|
||||
* @return RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @return RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -291,7 +291,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavl
|
||||
/**
|
||||
* @brief Get field chan5_scaled from rc_channels_scaled message
|
||||
*
|
||||
* @return RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @return RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -301,7 +301,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavl
|
||||
/**
|
||||
* @brief Get field chan6_scaled from rc_channels_scaled message
|
||||
*
|
||||
* @return RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @return RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -311,7 +311,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavl
|
||||
/**
|
||||
* @brief Get field chan7_scaled from rc_channels_scaled message
|
||||
*
|
||||
* @return RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @return RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -321,7 +321,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavl
|
||||
/**
|
||||
* @brief Get field chan8_scaled from rc_channels_scaled message
|
||||
*
|
||||
* @return RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000
|
||||
* @return RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) 32767.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavlink_message_t* msg)
|
||||
{
|
||||
@@ -331,7 +331,7 @@ static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavl
|
||||
/**
|
||||
* @brief Get field rssi from rc_channels_scaled message
|
||||
*
|
||||
* @return Receive signal strength indicator, 0: 0%, 255: 100%
|
||||
* @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u
|
||||
_mav_put_uint8_t(buf, 4, req_stream_id);
|
||||
_mav_put_uint8_t(buf, 5, start_stop);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_request_data_stream_t packet;
|
||||
packet.req_message_rate = req_message_rate;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack(uint8_t system_id, u
|
||||
packet.req_stream_id = req_stream_id;
|
||||
packet.start_stop = start_stop;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_
|
||||
_mav_put_uint8_t(buf, 4, req_stream_id);
|
||||
_mav_put_uint8_t(buf, 5, start_stop);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6);
|
||||
#else
|
||||
mavlink_request_data_stream_t packet;
|
||||
packet.req_message_rate = req_message_rate;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_request_data_stream_pack_chan(uint8_t system_
|
||||
packet.req_stream_id = req_stream_id;
|
||||
packet.start_stop = start_stop;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 6);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM;
|
||||
|
||||
+232
@@ -0,0 +1,232 @@
|
||||
// MESSAGE ROLL_PITCH_YAW_RATES_THRUST_SETPOINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT 80
|
||||
|
||||
typedef struct __mavlink_roll_pitch_yaw_rates_thrust_setpoint_t
|
||||
{
|
||||
uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot
|
||||
float roll_rate; ///< Desired roll rate in radians per second
|
||||
float pitch_rate; ///< Desired pitch rate in radians per second
|
||||
float yaw_rate; ///< Desired yaw rate in radians per second
|
||||
float thrust; ///< Collective thrust, normalized to 0 .. 1
|
||||
} mavlink_roll_pitch_yaw_rates_thrust_setpoint_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT_LEN 20
|
||||
#define MAVLINK_MSG_ID_80_LEN 20
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT { \
|
||||
"ROLL_PITCH_YAW_RATES_THRUST_SETPOINT", \
|
||||
5, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, time_boot_ms) }, \
|
||||
{ "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, roll_rate) }, \
|
||||
{ "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, pitch_rate) }, \
|
||||
{ "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, yaw_rate) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_roll_pitch_yaw_rates_thrust_setpoint_t, thrust) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a roll_pitch_yaw_rates_thrust_setpoint message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Timestamp in milliseconds since system boot
|
||||
* @param roll_rate Desired roll rate in radians per second
|
||||
* @param pitch_rate Desired pitch rate in radians per second
|
||||
* @param yaw_rate Desired yaw rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[20];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll_rate);
|
||||
_mav_put_float(buf, 8, pitch_rate);
|
||||
_mav_put_float(buf, 12, yaw_rate);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
|
||||
#else
|
||||
mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, 20, 127);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a roll_pitch_yaw_rates_thrust_setpoint message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp in milliseconds since system boot
|
||||
* @param roll_rate Desired roll rate in radians per second
|
||||
* @param pitch_rate Desired pitch rate in radians per second
|
||||
* @param yaw_rate Desired yaw rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float roll_rate,float pitch_rate,float yaw_rate,float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[20];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll_rate);
|
||||
_mav_put_float(buf, 8, pitch_rate);
|
||||
_mav_put_float(buf, 12, yaw_rate);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
|
||||
#else
|
||||
mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 127);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a roll_pitch_yaw_rates_thrust_setpoint struct into a 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 roll_pitch_yaw_rates_thrust_setpoint C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_roll_pitch_yaw_rates_thrust_setpoint_t* roll_pitch_yaw_rates_thrust_setpoint)
|
||||
{
|
||||
return mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_pack(system_id, component_id, msg, roll_pitch_yaw_rates_thrust_setpoint->time_boot_ms, roll_pitch_yaw_rates_thrust_setpoint->roll_rate, roll_pitch_yaw_rates_thrust_setpoint->pitch_rate, roll_pitch_yaw_rates_thrust_setpoint->yaw_rate, roll_pitch_yaw_rates_thrust_setpoint->thrust);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a roll_pitch_yaw_rates_thrust_setpoint message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp in milliseconds since system boot
|
||||
* @param roll_rate Desired roll rate in radians per second
|
||||
* @param pitch_rate Desired pitch rate in radians per second
|
||||
* @param yaw_rate Desired yaw rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll_rate, float pitch_rate, float yaw_rate, float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[20];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, roll_rate);
|
||||
_mav_put_float(buf, 8, pitch_rate);
|
||||
_mav_put_float(buf, 12, yaw_rate);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, buf, 20, 127);
|
||||
#else
|
||||
mavlink_roll_pitch_yaw_rates_thrust_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT, (const char *)&packet, 20, 127);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ROLL_PITCH_YAW_RATES_THRUST_SETPOINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from roll_pitch_yaw_rates_thrust_setpoint message
|
||||
*
|
||||
* @return Timestamp in milliseconds since system boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll_rate from roll_pitch_yaw_rates_thrust_setpoint message
|
||||
*
|
||||
* @return Desired roll rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_roll_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch_rate from roll_pitch_yaw_rates_thrust_setpoint message
|
||||
*
|
||||
* @return Desired pitch rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_pitch_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw_rate from roll_pitch_yaw_rates_thrust_setpoint message
|
||||
*
|
||||
* @return Desired yaw rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_yaw_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field thrust from roll_pitch_yaw_rates_thrust_setpoint message
|
||||
*
|
||||
* @return Collective thrust, normalized to 0 .. 1
|
||||
*/
|
||||
static inline float mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_thrust(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a roll_pitch_yaw_rates_thrust_setpoint message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param roll_pitch_yaw_rates_thrust_setpoint C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_decode(const mavlink_message_t* msg, mavlink_roll_pitch_yaw_rates_thrust_setpoint_t* roll_pitch_yaw_rates_thrust_setpoint)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
roll_pitch_yaw_rates_thrust_setpoint->time_boot_ms = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_time_boot_ms(msg);
|
||||
roll_pitch_yaw_rates_thrust_setpoint->roll_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_roll_rate(msg);
|
||||
roll_pitch_yaw_rates_thrust_setpoint->pitch_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_pitch_rate(msg);
|
||||
roll_pitch_yaw_rates_thrust_setpoint->yaw_rate = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_yaw_rate(msg);
|
||||
roll_pitch_yaw_rates_thrust_setpoint->thrust = mavlink_msg_roll_pitch_yaw_rates_thrust_setpoint_get_thrust(msg);
|
||||
#else
|
||||
memcpy(roll_pitch_yaw_rates_thrust_setpoint, _MAV_PAYLOAD(msg), 20);
|
||||
#endif
|
||||
}
|
||||
+4
-4
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin
|
||||
_mav_put_float(buf, 12, yaw_speed);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
|
||||
#else
|
||||
mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(uin
|
||||
packet.yaw_speed = yaw_speed;
|
||||
packet.thrust = thrust;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha
|
||||
_mav_put_float(buf, 12, yaw_speed);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
|
||||
#else
|
||||
mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_cha
|
||||
packet.yaw_speed = yaw_speed;
|
||||
packet.thrust = thrust;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT;
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
|
||||
#else
|
||||
mavlink_roll_pitch_yaw_thrust_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(uint8_t s
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint
|
||||
_mav_put_float(buf, 12, yaw);
|
||||
_mav_put_float(buf, 16, thrust);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20);
|
||||
#else
|
||||
mavlink_roll_pitch_yaw_thrust_setpoint_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(uint
|
||||
packet.yaw = yaw;
|
||||
packet.thrust = thrust;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT;
|
||||
|
||||
@@ -60,7 +60,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u
|
||||
_mav_put_float(buf, 20, p2z);
|
||||
_mav_put_uint8_t(buf, 24, frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
|
||||
#else
|
||||
mavlink_safety_allowed_area_t packet;
|
||||
packet.p1x = p1x;
|
||||
@@ -71,7 +71,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, u
|
||||
packet.p2z = p2z;
|
||||
packet.frame = frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA;
|
||||
@@ -107,7 +107,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_
|
||||
_mav_put_float(buf, 20, p2z);
|
||||
_mav_put_uint8_t(buf, 24, frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25);
|
||||
#else
|
||||
mavlink_safety_allowed_area_t packet;
|
||||
packet.p1x = p1x;
|
||||
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_
|
||||
packet.p2z = p2z;
|
||||
packet.frame = frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 25);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA;
|
||||
|
||||
@@ -68,7 +68,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i
|
||||
_mav_put_uint8_t(buf, 25, target_component);
|
||||
_mav_put_uint8_t(buf, 26, frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 27);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27);
|
||||
#else
|
||||
mavlink_safety_set_allowed_area_t packet;
|
||||
packet.p1x = p1x;
|
||||
@@ -81,7 +81,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_i
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 27);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA;
|
||||
@@ -121,7 +121,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys
|
||||
_mav_put_uint8_t(buf, 25, target_component);
|
||||
_mav_put_uint8_t(buf, 26, frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 27);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 27);
|
||||
#else
|
||||
mavlink_safety_set_allowed_area_t packet;
|
||||
packet.p1x = p1x;
|
||||
@@ -134,7 +134,7 @@ static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t sys
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 27);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 27);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA;
|
||||
|
||||
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co
|
||||
_mav_put_int16_t(buf, 18, ymag);
|
||||
_mav_put_int16_t(buf, 20, zmag);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_scaled_imu_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t co
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SCALED_IMU;
|
||||
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8
|
||||
_mav_put_int16_t(buf, 18, ymag);
|
||||
_mav_put_int16_t(buf, 20, zmag);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 22);
|
||||
#else
|
||||
mavlink_scaled_imu_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_scaled_imu_pack_chan(uint8_t system_id, uint8
|
||||
packet.ymag = ymag;
|
||||
packet.zmag = zmag;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 22);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 22);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SCALED_IMU;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
typedef struct __mavlink_scaled_pressure_t
|
||||
{
|
||||
uint32_t time_boot_ms; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
|
||||
float press_abs; ///< Absolute pressure (hectopascal)
|
||||
float press_diff; ///< Differential pressure 1 (hectopascal)
|
||||
int16_t temperature; ///< Temperature measurement (0.01 degrees celsius)
|
||||
@@ -32,7 +32,7 @@ typedef struct __mavlink_scaled_pressure_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param press_abs Absolute pressure (hectopascal)
|
||||
* @param press_diff Differential pressure 1 (hectopascal)
|
||||
* @param temperature Temperature measurement (0.01 degrees celsius)
|
||||
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8
|
||||
_mav_put_float(buf, 8, press_diff);
|
||||
_mav_put_int16_t(buf, 12, temperature);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
|
||||
#else
|
||||
mavlink_scaled_pressure_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8
|
||||
packet.press_diff = press_diff;
|
||||
packet.temperature = temperature;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE;
|
||||
@@ -69,7 +69,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack(uint8_t system_id, uint8
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param press_abs Absolute pressure (hectopascal)
|
||||
* @param press_diff Differential pressure 1 (hectopascal)
|
||||
* @param temperature Temperature measurement (0.01 degrees celsius)
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id,
|
||||
_mav_put_float(buf, 8, press_diff);
|
||||
_mav_put_int16_t(buf, 12, temperature);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14);
|
||||
#else
|
||||
mavlink_scaled_pressure_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_pack_chan(uint8_t system_id,
|
||||
packet.press_diff = press_diff;
|
||||
packet.temperature = temperature;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 14);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SCALED_PRESSURE;
|
||||
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_scaled_pressure_encode(uint8_t system_id, uin
|
||||
* @brief Send a scaled_pressure message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param press_abs Absolute pressure (hectopascal)
|
||||
* @param press_diff Differential pressure 1 (hectopascal)
|
||||
* @param temperature Temperature measurement (0.01 degrees celsius)
|
||||
@@ -154,7 +154,7 @@ static inline void mavlink_msg_scaled_pressure_send(mavlink_channel_t chan, uint
|
||||
/**
|
||||
* @brief Get field time_boot_ms from scaled_pressure message
|
||||
*
|
||||
* @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
* @return Timestamp (milliseconds since system boot)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_scaled_pressure_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
typedef struct __mavlink_servo_output_raw_t
|
||||
{
|
||||
uint32_t time_usec; ///< Timestamp (since UNIX epoch or microseconds since system boot)
|
||||
uint32_t time_usec; ///< Timestamp (microseconds since system boot)
|
||||
uint16_t servo1_raw; ///< Servo output 1 value, in microseconds
|
||||
uint16_t servo2_raw; ///< Servo output 2 value, in microseconds
|
||||
uint16_t servo3_raw; ///< Servo output 3 value, in microseconds
|
||||
@@ -44,7 +44,7 @@ typedef struct __mavlink_servo_output_raw_t
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_usec Timestamp (since UNIX epoch or microseconds since system boot)
|
||||
* @param time_usec Timestamp (microseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param servo1_raw Servo output 1 value, in microseconds
|
||||
* @param servo2_raw Servo output 2 value, in microseconds
|
||||
@@ -72,7 +72,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
|
||||
_mav_put_uint16_t(buf, 18, servo8_raw);
|
||||
_mav_put_uint8_t(buf, 20, port);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21);
|
||||
#else
|
||||
mavlink_servo_output_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
|
||||
packet.servo8_raw = servo8_raw;
|
||||
packet.port = port;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
|
||||
@@ -99,7 +99,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message was sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (since UNIX epoch or microseconds since system boot)
|
||||
* @param time_usec Timestamp (microseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param servo1_raw Servo output 1 value, in microseconds
|
||||
* @param servo2_raw Servo output 2 value, in microseconds
|
||||
@@ -128,7 +128,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id,
|
||||
_mav_put_uint16_t(buf, 18, servo8_raw);
|
||||
_mav_put_uint8_t(buf, 20, port);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 21);
|
||||
#else
|
||||
mavlink_servo_output_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id,
|
||||
packet.servo8_raw = servo8_raw;
|
||||
packet.port = port;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 21);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 21);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
|
||||
@@ -166,7 +166,7 @@ static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, ui
|
||||
* @brief Send a servo_output_raw message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (since UNIX epoch or microseconds since system boot)
|
||||
* @param time_usec Timestamp (microseconds since system boot)
|
||||
* @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos.
|
||||
* @param servo1_raw Servo output 1 value, in microseconds
|
||||
* @param servo2_raw Servo output 2 value, in microseconds
|
||||
@@ -220,7 +220,7 @@ static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uin
|
||||
/**
|
||||
* @brief Get field time_usec from servo_output_raw message
|
||||
*
|
||||
* @return Timestamp (since UNIX epoch or microseconds since system boot)
|
||||
* @return Timestamp (microseconds since system boot)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t
|
||||
_mav_put_int16_t(buf, 12, yaw);
|
||||
_mav_put_uint8_t(buf, 14, coordinate_frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_set_global_position_setpoint_int_t packet;
|
||||
packet.latitude = latitude;
|
||||
@@ -61,7 +61,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack(uint8_t
|
||||
packet.yaw = yaw;
|
||||
packet.coordinate_frame = coordinate_frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT;
|
||||
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack_chan(ui
|
||||
_mav_put_int16_t(buf, 12, yaw);
|
||||
_mav_put_uint8_t(buf, 14, coordinate_frame);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15);
|
||||
#else
|
||||
mavlink_set_global_position_setpoint_int_t packet;
|
||||
packet.latitude = latitude;
|
||||
@@ -102,7 +102,7 @@ static inline uint16_t mavlink_msg_set_global_position_setpoint_int_pack_chan(ui
|
||||
packet.yaw = yaw;
|
||||
packet.coordinate_frame = coordinate_frame;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 15);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT;
|
||||
|
||||
@@ -48,7 +48,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id,
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13);
|
||||
#else
|
||||
mavlink_set_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
@@ -56,7 +56,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack(uint8_t system_id,
|
||||
packet.altitude = altitude;
|
||||
packet.target_system = target_system;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN;
|
||||
@@ -86,7 +86,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), buf, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13);
|
||||
#else
|
||||
mavlink_set_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
@@ -94,7 +94,7 @@ static inline uint16_t mavlink_msg_set_gps_global_origin_pack_chan(uint8_t syste
|
||||
packet.altitude = altitude;
|
||||
packet.target_system = target_system;
|
||||
|
||||
memcpy(_MAV_PAYLOAD(msg), &packet, 13);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user