Replace thirdparty/GCS_MAVLink with a git submodule (#4556)
* Replace thirdparty/GCS_MAVLink with a git submodule * Try to recover from missing submodules
This commit is contained in:
@@ -83,6 +83,17 @@ elseif(TELEMETRY STREQUAL JETI)
|
||||
elseif(TELEMETRY STREQUAL MAVLINK)
|
||||
add_definitions(-DTELEMETRY_MAVLINK)
|
||||
include_directories(${THIRDPARTY_DIR} gui/${GUI_DIR} targets/common/avr)
|
||||
if(NOT EXISTS ${THIRDPARTY_DIR}/GCS_MAVLink/include_v1.0/mavlink_types.h)
|
||||
message(WARNING "Warning: ${THIRDPARTY_DIR}/GCS_MAVLink/include_v1.0 is empty, trying to clone submodules")
|
||||
execute_process(COMMAND git submodule update --init
|
||||
RESULT_VARIABLE GIT_SUBMODULE_RESULT
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
if(NOT ${GIT_SUBMODULE_RESULT} EQUAL 0)
|
||||
message(FATAL_ERROR "Error: Cannot clone submodule at ${THIRDPARTY_DIR}/GCS_MAVLink/include_v1.0
|
||||
If you downloaded this project as a ZIP file, please instead run
|
||||
'git clone --recursive https://github.com/opentx/opentx.git'")
|
||||
endif()
|
||||
endif()
|
||||
set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
targets/common/avr/telemetry_driver.cpp
|
||||
|
||||
-165
@@ -1,165 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
MAVLink Micro Air Vehicle Message Marshalling Library
|
||||
|
||||
This is a library for lightweight communication between
|
||||
Micro Air Vehicles (swarm) and/or ground control stations.
|
||||
It serializes C-structs for serial channels and can be used with
|
||||
any type of radio modem.
|
||||
|
||||
For help, please visit the mailing list: http://groups.google.com/group/mavlink
|
||||
|
||||
MAVLink is licensed under the terms of the Lesser General Public License of the Free Software Foundation (LGPL).
|
||||
As MAVLink is a header-only library, compiling an application with it is considered "using the libary", not a derived work. MAVLink can therefore be used without limits in any closed-source application without publishing the source code of the closed-source application.
|
||||
|
||||
To generate/update packets, select mavlink_standard_message.xml
|
||||
in the QGroundControl station settings view, select mavlink/include as
|
||||
the output directory and click on "Save and Generate".
|
||||
You will find the newly generated/updated message_xx.h files in
|
||||
the mavlink/include/generated folder.
|
||||
|
||||
To use MAVLink, #include the <mavlink.h> file, not the individual
|
||||
message files. In some cases you will have to add the main folder to the include search path as well. To be safe, we recommend these flags:
|
||||
|
||||
gcc -I mavlink/include -I mavlink/include/<your message set, e.g. common>
|
||||
|
||||
For more information, please visit:
|
||||
|
||||
http://qgroundcontrol.org/mavlink/
|
||||
|
||||
(c) 2009-2011 Lorenz Meier <mail@qgroundcontrol.org>
|
||||
|
||||
+1
Submodule radio/src/thirdparty/GCS_MAVLink/include_v1.0 added at 21083c3af5
File diff suppressed because one or more lines are too long
@@ -1,34 +0,0 @@
|
||||
/** @file
|
||||
* @brief MAVLink comm protocol built from ardupilotmega.xml
|
||||
* @see http://mavlink.org
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef MAVLINK_H
|
||||
#define MAVLINK_H
|
||||
|
||||
#define MAVLINK_PRIMARY_XML_IDX 0
|
||||
|
||||
#ifndef MAVLINK_STX
|
||||
#define MAVLINK_STX 254
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_ENDIAN
|
||||
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_ALIGNED_FIELDS
|
||||
#define MAVLINK_ALIGNED_FIELDS 1
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_CRC_EXTRA
|
||||
#define MAVLINK_CRC_EXTRA 1
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_COMMAND_24BIT 0
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "ardupilotmega.h"
|
||||
|
||||
#endif // MAVLINK_H
|
||||
-363
@@ -1,363 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE AHRS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS 163
|
||||
|
||||
MAVPACKED(
|
||||
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_AHRS_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_163_LEN 28
|
||||
#define MAVLINK_MSG_ID_163_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS_CRC 127
|
||||
#define MAVLINK_MSG_ID_163_CRC 127
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AHRS { \
|
||||
163, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_AHRS_LEN];
|
||||
_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, MAVLINK_MSG_ID_AHRS_LEN);
|
||||
#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, MAVLINK_MSG_ID_AHRS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AHRS_MIN_LEN, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_AHRS_LEN];
|
||||
_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, MAVLINK_MSG_ID_AHRS_LEN);
|
||||
#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, MAVLINK_MSG_ID_AHRS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AHRS_MIN_LEN, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ahrs struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a ahrs struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ahrs C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ahrs_t* ahrs)
|
||||
{
|
||||
return mavlink_msg_ahrs_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_AHRS_LEN];
|
||||
_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, MAVLINK_MSG_ID_AHRS_MIN_LEN, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC);
|
||||
#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, MAVLINK_MSG_ID_AHRS_MIN_LEN, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ahrs message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs_send_struct(mavlink_channel_t chan, const mavlink_ahrs_t* ahrs)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_ahrs_send(chan, ahrs->omegaIx, ahrs->omegaIy, ahrs->omegaIz, ahrs->accel_weight, ahrs->renorm_val, ahrs->error_rp, ahrs->error_yaw);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, (const char *)ahrs, MAVLINK_MSG_ID_AHRS_MIN_LEN, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AHRS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs_send_buf(mavlink_message_t *msgbuf, 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 = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_AHRS_MIN_LEN, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC);
|
||||
#else
|
||||
mavlink_ahrs_t *packet = (mavlink_ahrs_t *)msgbuf;
|
||||
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, MAVLINK_MSG_ID_AHRS_MIN_LEN, MAVLINK_MSG_ID_AHRS_LEN, MAVLINK_MSG_ID_AHRS_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AHRS_LEN? msg->len : MAVLINK_MSG_ID_AHRS_LEN;
|
||||
memset(ahrs, 0, MAVLINK_MSG_ID_AHRS_LEN);
|
||||
memcpy(ahrs, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-338
@@ -1,338 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE AHRS2 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS2 178
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_ahrs2_t {
|
||||
float roll; /*< Roll angle (rad)*/
|
||||
float pitch; /*< Pitch angle (rad)*/
|
||||
float yaw; /*< Yaw angle (rad)*/
|
||||
float altitude; /*< Altitude (MSL)*/
|
||||
int32_t lat; /*< Latitude in degrees * 1E7*/
|
||||
int32_t lng; /*< Longitude in degrees * 1E7*/
|
||||
}) mavlink_ahrs2_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS2_LEN 24
|
||||
#define MAVLINK_MSG_ID_AHRS2_MIN_LEN 24
|
||||
#define MAVLINK_MSG_ID_178_LEN 24
|
||||
#define MAVLINK_MSG_ID_178_MIN_LEN 24
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS2_CRC 47
|
||||
#define MAVLINK_MSG_ID_178_CRC 47
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AHRS2 { \
|
||||
178, \
|
||||
"AHRS2", \
|
||||
6, \
|
||||
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs2_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs2_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs2_t, yaw) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs2_t, altitude) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_ahrs2_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_ahrs2_t, lng) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AHRS2 { \
|
||||
"AHRS2", \
|
||||
6, \
|
||||
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs2_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs2_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs2_t, yaw) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs2_t, altitude) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_ahrs2_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_ahrs2_t, lng) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a ahrs2 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 altitude Altitude (MSL)
|
||||
* @param lat Latitude in degrees * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float roll, float pitch, float yaw, float altitude, int32_t lat, int32_t lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AHRS2_LEN];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, altitude);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lng);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AHRS2_LEN);
|
||||
#else
|
||||
mavlink_ahrs2_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.altitude = altitude;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AHRS2_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS2;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a ahrs2 message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param altitude Altitude (MSL)
|
||||
* @param lat Latitude in degrees * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float roll,float pitch,float yaw,float altitude,int32_t lat,int32_t lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AHRS2_LEN];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, altitude);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lng);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AHRS2_LEN);
|
||||
#else
|
||||
mavlink_ahrs2_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.altitude = altitude;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AHRS2_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS2;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ahrs2 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ahrs2 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ahrs2_t* ahrs2)
|
||||
{
|
||||
return mavlink_msg_ahrs2_pack(system_id, component_id, msg, ahrs2->roll, ahrs2->pitch, ahrs2->yaw, ahrs2->altitude, ahrs2->lat, ahrs2->lng);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ahrs2 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ahrs2 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ahrs2_t* ahrs2)
|
||||
{
|
||||
return mavlink_msg_ahrs2_pack_chan(system_id, component_id, chan, msg, ahrs2->roll, ahrs2->pitch, ahrs2->yaw, ahrs2->altitude, ahrs2->lat, ahrs2->lng);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ahrs2 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 altitude Altitude (MSL)
|
||||
* @param lat Latitude in degrees * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_ahrs2_send(mavlink_channel_t chan, float roll, float pitch, float yaw, float altitude, int32_t lat, int32_t lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AHRS2_LEN];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, altitude);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lng);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, buf, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
|
||||
#else
|
||||
mavlink_ahrs2_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.altitude = altitude;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, (const char *)&packet, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ahrs2 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs2_send_struct(mavlink_channel_t chan, const mavlink_ahrs2_t* ahrs2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_ahrs2_send(chan, ahrs2->roll, ahrs2->pitch, ahrs2->yaw, ahrs2->altitude, ahrs2->lat, ahrs2->lng);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, (const char *)ahrs2, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AHRS2_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float roll, float pitch, float yaw, float altitude, int32_t lat, int32_t lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, altitude);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lng);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, buf, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
|
||||
#else
|
||||
mavlink_ahrs2_t *packet = (mavlink_ahrs2_t *)msgbuf;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
packet->altitude = altitude;
|
||||
packet->lat = lat;
|
||||
packet->lng = lng;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS2, (const char *)packet, MAVLINK_MSG_ID_AHRS2_MIN_LEN, MAVLINK_MSG_ID_AHRS2_LEN, MAVLINK_MSG_ID_AHRS2_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AHRS2 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field roll from ahrs2 message
|
||||
*
|
||||
* @return Roll angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs2_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from ahrs2 message
|
||||
*
|
||||
* @return Pitch angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs2_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from ahrs2 message
|
||||
*
|
||||
* @return Yaw angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs2_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from ahrs2 message
|
||||
*
|
||||
* @return Altitude (MSL)
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs2_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from ahrs2 message
|
||||
*
|
||||
* @return Latitude in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_ahrs2_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from ahrs2 message
|
||||
*
|
||||
* @return Longitude in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_ahrs2_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a ahrs2 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param ahrs2 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs2_decode(const mavlink_message_t* msg, mavlink_ahrs2_t* ahrs2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
ahrs2->roll = mavlink_msg_ahrs2_get_roll(msg);
|
||||
ahrs2->pitch = mavlink_msg_ahrs2_get_pitch(msg);
|
||||
ahrs2->yaw = mavlink_msg_ahrs2_get_yaw(msg);
|
||||
ahrs2->altitude = mavlink_msg_ahrs2_get_altitude(msg);
|
||||
ahrs2->lat = mavlink_msg_ahrs2_get_lat(msg);
|
||||
ahrs2->lng = mavlink_msg_ahrs2_get_lng(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AHRS2_LEN? msg->len : MAVLINK_MSG_ID_AHRS2_LEN;
|
||||
memset(ahrs2, 0, MAVLINK_MSG_ID_AHRS2_LEN);
|
||||
memcpy(ahrs2, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-438
@@ -1,438 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE AHRS3 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS3 182
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_ahrs3_t {
|
||||
float roll; /*< Roll angle (rad)*/
|
||||
float pitch; /*< Pitch angle (rad)*/
|
||||
float yaw; /*< Yaw angle (rad)*/
|
||||
float altitude; /*< Altitude (MSL)*/
|
||||
int32_t lat; /*< Latitude in degrees * 1E7*/
|
||||
int32_t lng; /*< Longitude in degrees * 1E7*/
|
||||
float v1; /*< test variable1*/
|
||||
float v2; /*< test variable2*/
|
||||
float v3; /*< test variable3*/
|
||||
float v4; /*< test variable4*/
|
||||
}) mavlink_ahrs3_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS3_LEN 40
|
||||
#define MAVLINK_MSG_ID_AHRS3_MIN_LEN 40
|
||||
#define MAVLINK_MSG_ID_182_LEN 40
|
||||
#define MAVLINK_MSG_ID_182_MIN_LEN 40
|
||||
|
||||
#define MAVLINK_MSG_ID_AHRS3_CRC 229
|
||||
#define MAVLINK_MSG_ID_182_CRC 229
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AHRS3 { \
|
||||
182, \
|
||||
"AHRS3", \
|
||||
10, \
|
||||
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs3_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs3_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs3_t, yaw) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs3_t, altitude) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_ahrs3_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_ahrs3_t, lng) }, \
|
||||
{ "v1", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_ahrs3_t, v1) }, \
|
||||
{ "v2", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_ahrs3_t, v2) }, \
|
||||
{ "v3", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_ahrs3_t, v3) }, \
|
||||
{ "v4", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_ahrs3_t, v4) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AHRS3 { \
|
||||
"AHRS3", \
|
||||
10, \
|
||||
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs3_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs3_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs3_t, yaw) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs3_t, altitude) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_ahrs3_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_ahrs3_t, lng) }, \
|
||||
{ "v1", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_ahrs3_t, v1) }, \
|
||||
{ "v2", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_ahrs3_t, v2) }, \
|
||||
{ "v3", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_ahrs3_t, v3) }, \
|
||||
{ "v4", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_ahrs3_t, v4) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a ahrs3 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 altitude Altitude (MSL)
|
||||
* @param lat Latitude in degrees * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
* @param v1 test variable1
|
||||
* @param v2 test variable2
|
||||
* @param v3 test variable3
|
||||
* @param v4 test variable4
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float roll, float pitch, float yaw, float altitude, int32_t lat, int32_t lng, float v1, float v2, float v3, float v4)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AHRS3_LEN];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, altitude);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lng);
|
||||
_mav_put_float(buf, 24, v1);
|
||||
_mav_put_float(buf, 28, v2);
|
||||
_mav_put_float(buf, 32, v3);
|
||||
_mav_put_float(buf, 36, v4);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AHRS3_LEN);
|
||||
#else
|
||||
mavlink_ahrs3_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.altitude = altitude;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.v1 = v1;
|
||||
packet.v2 = v2;
|
||||
packet.v3 = v3;
|
||||
packet.v4 = v4;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AHRS3_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS3;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AHRS3_MIN_LEN, MAVLINK_MSG_ID_AHRS3_LEN, MAVLINK_MSG_ID_AHRS3_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a ahrs3 message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param roll Roll angle (rad)
|
||||
* @param pitch Pitch angle (rad)
|
||||
* @param yaw Yaw angle (rad)
|
||||
* @param altitude Altitude (MSL)
|
||||
* @param lat Latitude in degrees * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
* @param v1 test variable1
|
||||
* @param v2 test variable2
|
||||
* @param v3 test variable3
|
||||
* @param v4 test variable4
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float roll,float pitch,float yaw,float altitude,int32_t lat,int32_t lng,float v1,float v2,float v3,float v4)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AHRS3_LEN];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, altitude);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lng);
|
||||
_mav_put_float(buf, 24, v1);
|
||||
_mav_put_float(buf, 28, v2);
|
||||
_mav_put_float(buf, 32, v3);
|
||||
_mav_put_float(buf, 36, v4);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AHRS3_LEN);
|
||||
#else
|
||||
mavlink_ahrs3_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.altitude = altitude;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.v1 = v1;
|
||||
packet.v2 = v2;
|
||||
packet.v3 = v3;
|
||||
packet.v4 = v4;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AHRS3_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AHRS3;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AHRS3_MIN_LEN, MAVLINK_MSG_ID_AHRS3_LEN, MAVLINK_MSG_ID_AHRS3_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ahrs3 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ahrs3 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs3_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ahrs3_t* ahrs3)
|
||||
{
|
||||
return mavlink_msg_ahrs3_pack(system_id, component_id, msg, ahrs3->roll, ahrs3->pitch, ahrs3->yaw, ahrs3->altitude, ahrs3->lat, ahrs3->lng, ahrs3->v1, ahrs3->v2, ahrs3->v3, ahrs3->v4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ahrs3 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ahrs3 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ahrs3_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ahrs3_t* ahrs3)
|
||||
{
|
||||
return mavlink_msg_ahrs3_pack_chan(system_id, component_id, chan, msg, ahrs3->roll, ahrs3->pitch, ahrs3->yaw, ahrs3->altitude, ahrs3->lat, ahrs3->lng, ahrs3->v1, ahrs3->v2, ahrs3->v3, ahrs3->v4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ahrs3 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 altitude Altitude (MSL)
|
||||
* @param lat Latitude in degrees * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
* @param v1 test variable1
|
||||
* @param v2 test variable2
|
||||
* @param v3 test variable3
|
||||
* @param v4 test variable4
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_ahrs3_send(mavlink_channel_t chan, float roll, float pitch, float yaw, float altitude, int32_t lat, int32_t lng, float v1, float v2, float v3, float v4)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AHRS3_LEN];
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, altitude);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lng);
|
||||
_mav_put_float(buf, 24, v1);
|
||||
_mav_put_float(buf, 28, v2);
|
||||
_mav_put_float(buf, 32, v3);
|
||||
_mav_put_float(buf, 36, v4);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS3, buf, MAVLINK_MSG_ID_AHRS3_MIN_LEN, MAVLINK_MSG_ID_AHRS3_LEN, MAVLINK_MSG_ID_AHRS3_CRC);
|
||||
#else
|
||||
mavlink_ahrs3_t packet;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.altitude = altitude;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.v1 = v1;
|
||||
packet.v2 = v2;
|
||||
packet.v3 = v3;
|
||||
packet.v4 = v4;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS3, (const char *)&packet, MAVLINK_MSG_ID_AHRS3_MIN_LEN, MAVLINK_MSG_ID_AHRS3_LEN, MAVLINK_MSG_ID_AHRS3_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ahrs3 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs3_send_struct(mavlink_channel_t chan, const mavlink_ahrs3_t* ahrs3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_ahrs3_send(chan, ahrs3->roll, ahrs3->pitch, ahrs3->yaw, ahrs3->altitude, ahrs3->lat, ahrs3->lng, ahrs3->v1, ahrs3->v2, ahrs3->v3, ahrs3->v4);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS3, (const char *)ahrs3, MAVLINK_MSG_ID_AHRS3_MIN_LEN, MAVLINK_MSG_ID_AHRS3_LEN, MAVLINK_MSG_ID_AHRS3_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AHRS3_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs3_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float roll, float pitch, float yaw, float altitude, int32_t lat, int32_t lng, float v1, float v2, float v3, float v4)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, altitude);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lng);
|
||||
_mav_put_float(buf, 24, v1);
|
||||
_mav_put_float(buf, 28, v2);
|
||||
_mav_put_float(buf, 32, v3);
|
||||
_mav_put_float(buf, 36, v4);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS3, buf, MAVLINK_MSG_ID_AHRS3_MIN_LEN, MAVLINK_MSG_ID_AHRS3_LEN, MAVLINK_MSG_ID_AHRS3_CRC);
|
||||
#else
|
||||
mavlink_ahrs3_t *packet = (mavlink_ahrs3_t *)msgbuf;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
packet->altitude = altitude;
|
||||
packet->lat = lat;
|
||||
packet->lng = lng;
|
||||
packet->v1 = v1;
|
||||
packet->v2 = v2;
|
||||
packet->v3 = v3;
|
||||
packet->v4 = v4;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS3, (const char *)packet, MAVLINK_MSG_ID_AHRS3_MIN_LEN, MAVLINK_MSG_ID_AHRS3_LEN, MAVLINK_MSG_ID_AHRS3_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AHRS3 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field roll from ahrs3 message
|
||||
*
|
||||
* @return Roll angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs3_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from ahrs3 message
|
||||
*
|
||||
* @return Pitch angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs3_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from ahrs3 message
|
||||
*
|
||||
* @return Yaw angle (rad)
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs3_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from ahrs3 message
|
||||
*
|
||||
* @return Altitude (MSL)
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs3_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from ahrs3 message
|
||||
*
|
||||
* @return Latitude in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_ahrs3_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from ahrs3 message
|
||||
*
|
||||
* @return Longitude in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_ahrs3_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field v1 from ahrs3 message
|
||||
*
|
||||
* @return test variable1
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs3_get_v1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field v2 from ahrs3 message
|
||||
*
|
||||
* @return test variable2
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs3_get_v2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field v3 from ahrs3 message
|
||||
*
|
||||
* @return test variable3
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs3_get_v3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field v4 from ahrs3 message
|
||||
*
|
||||
* @return test variable4
|
||||
*/
|
||||
static inline float mavlink_msg_ahrs3_get_v4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a ahrs3 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param ahrs3 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_ahrs3_decode(const mavlink_message_t* msg, mavlink_ahrs3_t* ahrs3)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
ahrs3->roll = mavlink_msg_ahrs3_get_roll(msg);
|
||||
ahrs3->pitch = mavlink_msg_ahrs3_get_pitch(msg);
|
||||
ahrs3->yaw = mavlink_msg_ahrs3_get_yaw(msg);
|
||||
ahrs3->altitude = mavlink_msg_ahrs3_get_altitude(msg);
|
||||
ahrs3->lat = mavlink_msg_ahrs3_get_lat(msg);
|
||||
ahrs3->lng = mavlink_msg_ahrs3_get_lng(msg);
|
||||
ahrs3->v1 = mavlink_msg_ahrs3_get_v1(msg);
|
||||
ahrs3->v2 = mavlink_msg_ahrs3_get_v2(msg);
|
||||
ahrs3->v3 = mavlink_msg_ahrs3_get_v3(msg);
|
||||
ahrs3->v4 = mavlink_msg_ahrs3_get_v4(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AHRS3_LEN? msg->len : MAVLINK_MSG_ID_AHRS3_LEN;
|
||||
memset(ahrs3, 0, MAVLINK_MSG_ID_AHRS3_LEN);
|
||||
memcpy(ahrs3, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-488
@@ -1,488 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE AIRSPEED_AUTOCAL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AIRSPEED_AUTOCAL 174
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_airspeed_autocal_t {
|
||||
float vx; /*< GPS velocity north m/s*/
|
||||
float vy; /*< GPS velocity east m/s*/
|
||||
float vz; /*< GPS velocity down m/s*/
|
||||
float diff_pressure; /*< Differential pressure pascals*/
|
||||
float EAS2TAS; /*< Estimated to true airspeed ratio*/
|
||||
float ratio; /*< Airspeed ratio*/
|
||||
float state_x; /*< EKF state x*/
|
||||
float state_y; /*< EKF state y*/
|
||||
float state_z; /*< EKF state z*/
|
||||
float Pax; /*< EKF Pax*/
|
||||
float Pby; /*< EKF Pby*/
|
||||
float Pcz; /*< EKF Pcz*/
|
||||
}) mavlink_airspeed_autocal_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN 48
|
||||
#define MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN 48
|
||||
#define MAVLINK_MSG_ID_174_LEN 48
|
||||
#define MAVLINK_MSG_ID_174_MIN_LEN 48
|
||||
|
||||
#define MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC 167
|
||||
#define MAVLINK_MSG_ID_174_CRC 167
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AIRSPEED_AUTOCAL { \
|
||||
174, \
|
||||
"AIRSPEED_AUTOCAL", \
|
||||
12, \
|
||||
{ { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_airspeed_autocal_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_airspeed_autocal_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_airspeed_autocal_t, vz) }, \
|
||||
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_airspeed_autocal_t, diff_pressure) }, \
|
||||
{ "EAS2TAS", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_airspeed_autocal_t, EAS2TAS) }, \
|
||||
{ "ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_airspeed_autocal_t, ratio) }, \
|
||||
{ "state_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_airspeed_autocal_t, state_x) }, \
|
||||
{ "state_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_airspeed_autocal_t, state_y) }, \
|
||||
{ "state_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_airspeed_autocal_t, state_z) }, \
|
||||
{ "Pax", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_airspeed_autocal_t, Pax) }, \
|
||||
{ "Pby", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_airspeed_autocal_t, Pby) }, \
|
||||
{ "Pcz", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_airspeed_autocal_t, Pcz) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AIRSPEED_AUTOCAL { \
|
||||
"AIRSPEED_AUTOCAL", \
|
||||
12, \
|
||||
{ { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_airspeed_autocal_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_airspeed_autocal_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_airspeed_autocal_t, vz) }, \
|
||||
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_airspeed_autocal_t, diff_pressure) }, \
|
||||
{ "EAS2TAS", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_airspeed_autocal_t, EAS2TAS) }, \
|
||||
{ "ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_airspeed_autocal_t, ratio) }, \
|
||||
{ "state_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_airspeed_autocal_t, state_x) }, \
|
||||
{ "state_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_airspeed_autocal_t, state_y) }, \
|
||||
{ "state_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_airspeed_autocal_t, state_z) }, \
|
||||
{ "Pax", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_airspeed_autocal_t, Pax) }, \
|
||||
{ "Pby", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_airspeed_autocal_t, Pby) }, \
|
||||
{ "Pcz", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_airspeed_autocal_t, Pcz) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a airspeed_autocal 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 vx GPS velocity north m/s
|
||||
* @param vy GPS velocity east m/s
|
||||
* @param vz GPS velocity down m/s
|
||||
* @param diff_pressure Differential pressure pascals
|
||||
* @param EAS2TAS Estimated to true airspeed ratio
|
||||
* @param ratio Airspeed ratio
|
||||
* @param state_x EKF state x
|
||||
* @param state_y EKF state y
|
||||
* @param state_z EKF state z
|
||||
* @param Pax EKF Pax
|
||||
* @param Pby EKF Pby
|
||||
* @param Pcz EKF Pcz
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_airspeed_autocal_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float vx, float vy, float vz, float diff_pressure, float EAS2TAS, float ratio, float state_x, float state_y, float state_z, float Pax, float Pby, float Pcz)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN];
|
||||
_mav_put_float(buf, 0, vx);
|
||||
_mav_put_float(buf, 4, vy);
|
||||
_mav_put_float(buf, 8, vz);
|
||||
_mav_put_float(buf, 12, diff_pressure);
|
||||
_mav_put_float(buf, 16, EAS2TAS);
|
||||
_mav_put_float(buf, 20, ratio);
|
||||
_mav_put_float(buf, 24, state_x);
|
||||
_mav_put_float(buf, 28, state_y);
|
||||
_mav_put_float(buf, 32, state_z);
|
||||
_mav_put_float(buf, 36, Pax);
|
||||
_mav_put_float(buf, 40, Pby);
|
||||
_mav_put_float(buf, 44, Pcz);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
|
||||
#else
|
||||
mavlink_airspeed_autocal_t packet;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.EAS2TAS = EAS2TAS;
|
||||
packet.ratio = ratio;
|
||||
packet.state_x = state_x;
|
||||
packet.state_y = state_y;
|
||||
packet.state_z = state_z;
|
||||
packet.Pax = Pax;
|
||||
packet.Pby = Pby;
|
||||
packet.Pcz = Pcz;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a airspeed_autocal message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vx GPS velocity north m/s
|
||||
* @param vy GPS velocity east m/s
|
||||
* @param vz GPS velocity down m/s
|
||||
* @param diff_pressure Differential pressure pascals
|
||||
* @param EAS2TAS Estimated to true airspeed ratio
|
||||
* @param ratio Airspeed ratio
|
||||
* @param state_x EKF state x
|
||||
* @param state_y EKF state y
|
||||
* @param state_z EKF state z
|
||||
* @param Pax EKF Pax
|
||||
* @param Pby EKF Pby
|
||||
* @param Pcz EKF Pcz
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_airspeed_autocal_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float vx,float vy,float vz,float diff_pressure,float EAS2TAS,float ratio,float state_x,float state_y,float state_z,float Pax,float Pby,float Pcz)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN];
|
||||
_mav_put_float(buf, 0, vx);
|
||||
_mav_put_float(buf, 4, vy);
|
||||
_mav_put_float(buf, 8, vz);
|
||||
_mav_put_float(buf, 12, diff_pressure);
|
||||
_mav_put_float(buf, 16, EAS2TAS);
|
||||
_mav_put_float(buf, 20, ratio);
|
||||
_mav_put_float(buf, 24, state_x);
|
||||
_mav_put_float(buf, 28, state_y);
|
||||
_mav_put_float(buf, 32, state_z);
|
||||
_mav_put_float(buf, 36, Pax);
|
||||
_mav_put_float(buf, 40, Pby);
|
||||
_mav_put_float(buf, 44, Pcz);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
|
||||
#else
|
||||
mavlink_airspeed_autocal_t packet;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.EAS2TAS = EAS2TAS;
|
||||
packet.ratio = ratio;
|
||||
packet.state_x = state_x;
|
||||
packet.state_y = state_y;
|
||||
packet.state_z = state_z;
|
||||
packet.Pax = Pax;
|
||||
packet.Pby = Pby;
|
||||
packet.Pcz = Pcz;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a airspeed_autocal struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param airspeed_autocal C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_airspeed_autocal_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_airspeed_autocal_t* airspeed_autocal)
|
||||
{
|
||||
return mavlink_msg_airspeed_autocal_pack(system_id, component_id, msg, airspeed_autocal->vx, airspeed_autocal->vy, airspeed_autocal->vz, airspeed_autocal->diff_pressure, airspeed_autocal->EAS2TAS, airspeed_autocal->ratio, airspeed_autocal->state_x, airspeed_autocal->state_y, airspeed_autocal->state_z, airspeed_autocal->Pax, airspeed_autocal->Pby, airspeed_autocal->Pcz);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a airspeed_autocal struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param airspeed_autocal C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_airspeed_autocal_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_airspeed_autocal_t* airspeed_autocal)
|
||||
{
|
||||
return mavlink_msg_airspeed_autocal_pack_chan(system_id, component_id, chan, msg, airspeed_autocal->vx, airspeed_autocal->vy, airspeed_autocal->vz, airspeed_autocal->diff_pressure, airspeed_autocal->EAS2TAS, airspeed_autocal->ratio, airspeed_autocal->state_x, airspeed_autocal->state_y, airspeed_autocal->state_z, airspeed_autocal->Pax, airspeed_autocal->Pby, airspeed_autocal->Pcz);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a airspeed_autocal message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param vx GPS velocity north m/s
|
||||
* @param vy GPS velocity east m/s
|
||||
* @param vz GPS velocity down m/s
|
||||
* @param diff_pressure Differential pressure pascals
|
||||
* @param EAS2TAS Estimated to true airspeed ratio
|
||||
* @param ratio Airspeed ratio
|
||||
* @param state_x EKF state x
|
||||
* @param state_y EKF state y
|
||||
* @param state_z EKF state z
|
||||
* @param Pax EKF Pax
|
||||
* @param Pby EKF Pby
|
||||
* @param Pcz EKF Pcz
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_airspeed_autocal_send(mavlink_channel_t chan, float vx, float vy, float vz, float diff_pressure, float EAS2TAS, float ratio, float state_x, float state_y, float state_z, float Pax, float Pby, float Pcz)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN];
|
||||
_mav_put_float(buf, 0, vx);
|
||||
_mav_put_float(buf, 4, vy);
|
||||
_mav_put_float(buf, 8, vz);
|
||||
_mav_put_float(buf, 12, diff_pressure);
|
||||
_mav_put_float(buf, 16, EAS2TAS);
|
||||
_mav_put_float(buf, 20, ratio);
|
||||
_mav_put_float(buf, 24, state_x);
|
||||
_mav_put_float(buf, 28, state_y);
|
||||
_mav_put_float(buf, 32, state_z);
|
||||
_mav_put_float(buf, 36, Pax);
|
||||
_mav_put_float(buf, 40, Pby);
|
||||
_mav_put_float(buf, 44, Pcz);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, buf, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
|
||||
#else
|
||||
mavlink_airspeed_autocal_t packet;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.diff_pressure = diff_pressure;
|
||||
packet.EAS2TAS = EAS2TAS;
|
||||
packet.ratio = ratio;
|
||||
packet.state_x = state_x;
|
||||
packet.state_y = state_y;
|
||||
packet.state_z = state_z;
|
||||
packet.Pax = Pax;
|
||||
packet.Pby = Pby;
|
||||
packet.Pcz = Pcz;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, (const char *)&packet, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a airspeed_autocal message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_airspeed_autocal_send_struct(mavlink_channel_t chan, const mavlink_airspeed_autocal_t* airspeed_autocal)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_airspeed_autocal_send(chan, airspeed_autocal->vx, airspeed_autocal->vy, airspeed_autocal->vz, airspeed_autocal->diff_pressure, airspeed_autocal->EAS2TAS, airspeed_autocal->ratio, airspeed_autocal->state_x, airspeed_autocal->state_y, airspeed_autocal->state_z, airspeed_autocal->Pax, airspeed_autocal->Pby, airspeed_autocal->Pcz);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, (const char *)airspeed_autocal, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_airspeed_autocal_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float vx, float vy, float vz, float diff_pressure, float EAS2TAS, float ratio, float state_x, float state_y, float state_z, float Pax, float Pby, float Pcz)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, vx);
|
||||
_mav_put_float(buf, 4, vy);
|
||||
_mav_put_float(buf, 8, vz);
|
||||
_mav_put_float(buf, 12, diff_pressure);
|
||||
_mav_put_float(buf, 16, EAS2TAS);
|
||||
_mav_put_float(buf, 20, ratio);
|
||||
_mav_put_float(buf, 24, state_x);
|
||||
_mav_put_float(buf, 28, state_y);
|
||||
_mav_put_float(buf, 32, state_z);
|
||||
_mav_put_float(buf, 36, Pax);
|
||||
_mav_put_float(buf, 40, Pby);
|
||||
_mav_put_float(buf, 44, Pcz);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, buf, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
|
||||
#else
|
||||
mavlink_airspeed_autocal_t *packet = (mavlink_airspeed_autocal_t *)msgbuf;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->diff_pressure = diff_pressure;
|
||||
packet->EAS2TAS = EAS2TAS;
|
||||
packet->ratio = ratio;
|
||||
packet->state_x = state_x;
|
||||
packet->state_y = state_y;
|
||||
packet->state_z = state_z;
|
||||
packet->Pax = Pax;
|
||||
packet->Pby = Pby;
|
||||
packet->Pcz = Pcz;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL, (const char *)packet, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AIRSPEED_AUTOCAL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field vx from airspeed_autocal message
|
||||
*
|
||||
* @return GPS velocity north m/s
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from airspeed_autocal message
|
||||
*
|
||||
* @return GPS velocity east m/s
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from airspeed_autocal message
|
||||
*
|
||||
* @return GPS velocity down m/s
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diff_pressure from airspeed_autocal message
|
||||
*
|
||||
* @return Differential pressure pascals
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_diff_pressure(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field EAS2TAS from airspeed_autocal message
|
||||
*
|
||||
* @return Estimated to true airspeed ratio
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_EAS2TAS(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ratio from airspeed_autocal message
|
||||
*
|
||||
* @return Airspeed ratio
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field state_x from airspeed_autocal message
|
||||
*
|
||||
* @return EKF state x
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_state_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field state_y from airspeed_autocal message
|
||||
*
|
||||
* @return EKF state y
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_state_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field state_z from airspeed_autocal message
|
||||
*
|
||||
* @return EKF state z
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_state_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field Pax from airspeed_autocal message
|
||||
*
|
||||
* @return EKF Pax
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_Pax(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field Pby from airspeed_autocal message
|
||||
*
|
||||
* @return EKF Pby
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_Pby(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field Pcz from airspeed_autocal message
|
||||
*
|
||||
* @return EKF Pcz
|
||||
*/
|
||||
static inline float mavlink_msg_airspeed_autocal_get_Pcz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a airspeed_autocal message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param airspeed_autocal C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_airspeed_autocal_decode(const mavlink_message_t* msg, mavlink_airspeed_autocal_t* airspeed_autocal)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
airspeed_autocal->vx = mavlink_msg_airspeed_autocal_get_vx(msg);
|
||||
airspeed_autocal->vy = mavlink_msg_airspeed_autocal_get_vy(msg);
|
||||
airspeed_autocal->vz = mavlink_msg_airspeed_autocal_get_vz(msg);
|
||||
airspeed_autocal->diff_pressure = mavlink_msg_airspeed_autocal_get_diff_pressure(msg);
|
||||
airspeed_autocal->EAS2TAS = mavlink_msg_airspeed_autocal_get_EAS2TAS(msg);
|
||||
airspeed_autocal->ratio = mavlink_msg_airspeed_autocal_get_ratio(msg);
|
||||
airspeed_autocal->state_x = mavlink_msg_airspeed_autocal_get_state_x(msg);
|
||||
airspeed_autocal->state_y = mavlink_msg_airspeed_autocal_get_state_y(msg);
|
||||
airspeed_autocal->state_z = mavlink_msg_airspeed_autocal_get_state_z(msg);
|
||||
airspeed_autocal->Pax = mavlink_msg_airspeed_autocal_get_Pax(msg);
|
||||
airspeed_autocal->Pby = mavlink_msg_airspeed_autocal_get_Pby(msg);
|
||||
airspeed_autocal->Pcz = mavlink_msg_airspeed_autocal_get_Pcz(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN? msg->len : MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN;
|
||||
memset(airspeed_autocal, 0, MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_LEN);
|
||||
memcpy(airspeed_autocal, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-338
@@ -1,338 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE AP_ADC PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AP_ADC 153
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_ap_adc_t {
|
||||
uint16_t adc1; /*< ADC output 1*/
|
||||
uint16_t adc2; /*< ADC output 2*/
|
||||
uint16_t adc3; /*< ADC output 3*/
|
||||
uint16_t adc4; /*< ADC output 4*/
|
||||
uint16_t adc5; /*< ADC output 5*/
|
||||
uint16_t adc6; /*< ADC output 6*/
|
||||
}) mavlink_ap_adc_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AP_ADC_LEN 12
|
||||
#define MAVLINK_MSG_ID_AP_ADC_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_153_LEN 12
|
||||
#define MAVLINK_MSG_ID_153_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_AP_ADC_CRC 188
|
||||
#define MAVLINK_MSG_ID_153_CRC 188
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AP_ADC { \
|
||||
153, \
|
||||
"AP_ADC", \
|
||||
6, \
|
||||
{ { "adc1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ap_adc_t, adc1) }, \
|
||||
{ "adc2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_ap_adc_t, adc2) }, \
|
||||
{ "adc3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_ap_adc_t, adc3) }, \
|
||||
{ "adc4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_ap_adc_t, adc4) }, \
|
||||
{ "adc5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_ap_adc_t, adc5) }, \
|
||||
{ "adc6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_ap_adc_t, adc6) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AP_ADC { \
|
||||
"AP_ADC", \
|
||||
6, \
|
||||
{ { "adc1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ap_adc_t, adc1) }, \
|
||||
{ "adc2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_ap_adc_t, adc2) }, \
|
||||
{ "adc3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_ap_adc_t, adc3) }, \
|
||||
{ "adc4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_ap_adc_t, adc4) }, \
|
||||
{ "adc5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_ap_adc_t, adc5) }, \
|
||||
{ "adc6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_ap_adc_t, adc6) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a ap_adc message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param adc1 ADC output 1
|
||||
* @param adc2 ADC output 2
|
||||
* @param adc3 ADC output 3
|
||||
* @param adc4 ADC output 4
|
||||
* @param adc5 ADC output 5
|
||||
* @param adc6 ADC output 6
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AP_ADC_LEN];
|
||||
_mav_put_uint16_t(buf, 0, adc1);
|
||||
_mav_put_uint16_t(buf, 2, adc2);
|
||||
_mav_put_uint16_t(buf, 4, adc3);
|
||||
_mav_put_uint16_t(buf, 6, adc4);
|
||||
_mav_put_uint16_t(buf, 8, adc5);
|
||||
_mav_put_uint16_t(buf, 10, adc6);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AP_ADC_LEN);
|
||||
#else
|
||||
mavlink_ap_adc_t packet;
|
||||
packet.adc1 = adc1;
|
||||
packet.adc2 = adc2;
|
||||
packet.adc3 = adc3;
|
||||
packet.adc4 = adc4;
|
||||
packet.adc5 = adc5;
|
||||
packet.adc6 = adc6;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AP_ADC_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AP_ADC;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AP_ADC_MIN_LEN, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a ap_adc message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param adc1 ADC output 1
|
||||
* @param adc2 ADC output 2
|
||||
* @param adc3 ADC output 3
|
||||
* @param adc4 ADC output 4
|
||||
* @param adc5 ADC output 5
|
||||
* @param adc6 ADC output 6
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t adc1,uint16_t adc2,uint16_t adc3,uint16_t adc4,uint16_t adc5,uint16_t adc6)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AP_ADC_LEN];
|
||||
_mav_put_uint16_t(buf, 0, adc1);
|
||||
_mav_put_uint16_t(buf, 2, adc2);
|
||||
_mav_put_uint16_t(buf, 4, adc3);
|
||||
_mav_put_uint16_t(buf, 6, adc4);
|
||||
_mav_put_uint16_t(buf, 8, adc5);
|
||||
_mav_put_uint16_t(buf, 10, adc6);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AP_ADC_LEN);
|
||||
#else
|
||||
mavlink_ap_adc_t packet;
|
||||
packet.adc1 = adc1;
|
||||
packet.adc2 = adc2;
|
||||
packet.adc3 = adc3;
|
||||
packet.adc4 = adc4;
|
||||
packet.adc5 = adc5;
|
||||
packet.adc6 = adc6;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AP_ADC_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AP_ADC;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AP_ADC_MIN_LEN, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ap_adc struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ap_adc C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ap_adc_t* ap_adc)
|
||||
{
|
||||
return mavlink_msg_ap_adc_pack(system_id, component_id, msg, ap_adc->adc1, ap_adc->adc2, ap_adc->adc3, ap_adc->adc4, ap_adc->adc5, ap_adc->adc6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ap_adc struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ap_adc C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ap_adc_t* ap_adc)
|
||||
{
|
||||
return mavlink_msg_ap_adc_pack_chan(system_id, component_id, chan, msg, ap_adc->adc1, ap_adc->adc2, ap_adc->adc3, ap_adc->adc4, ap_adc->adc5, ap_adc->adc6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ap_adc message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param adc1 ADC output 1
|
||||
* @param adc2 ADC output 2
|
||||
* @param adc3 ADC output 3
|
||||
* @param adc4 ADC output 4
|
||||
* @param adc5 ADC output 5
|
||||
* @param adc6 ADC output 6
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_ap_adc_send(mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AP_ADC_LEN];
|
||||
_mav_put_uint16_t(buf, 0, adc1);
|
||||
_mav_put_uint16_t(buf, 2, adc2);
|
||||
_mav_put_uint16_t(buf, 4, adc3);
|
||||
_mav_put_uint16_t(buf, 6, adc4);
|
||||
_mav_put_uint16_t(buf, 8, adc5);
|
||||
_mav_put_uint16_t(buf, 10, adc6);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, buf, MAVLINK_MSG_ID_AP_ADC_MIN_LEN, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC);
|
||||
#else
|
||||
mavlink_ap_adc_t packet;
|
||||
packet.adc1 = adc1;
|
||||
packet.adc2 = adc2;
|
||||
packet.adc3 = adc3;
|
||||
packet.adc4 = adc4;
|
||||
packet.adc5 = adc5;
|
||||
packet.adc6 = adc6;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)&packet, MAVLINK_MSG_ID_AP_ADC_MIN_LEN, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ap_adc message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_ap_adc_send_struct(mavlink_channel_t chan, const mavlink_ap_adc_t* ap_adc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_ap_adc_send(chan, ap_adc->adc1, ap_adc->adc2, ap_adc->adc3, ap_adc->adc4, ap_adc->adc5, ap_adc->adc6);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)ap_adc, MAVLINK_MSG_ID_AP_ADC_MIN_LEN, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AP_ADC_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_ap_adc_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, adc1);
|
||||
_mav_put_uint16_t(buf, 2, adc2);
|
||||
_mav_put_uint16_t(buf, 4, adc3);
|
||||
_mav_put_uint16_t(buf, 6, adc4);
|
||||
_mav_put_uint16_t(buf, 8, adc5);
|
||||
_mav_put_uint16_t(buf, 10, adc6);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, buf, MAVLINK_MSG_ID_AP_ADC_MIN_LEN, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC);
|
||||
#else
|
||||
mavlink_ap_adc_t *packet = (mavlink_ap_adc_t *)msgbuf;
|
||||
packet->adc1 = adc1;
|
||||
packet->adc2 = adc2;
|
||||
packet->adc3 = adc3;
|
||||
packet->adc4 = adc4;
|
||||
packet->adc5 = adc5;
|
||||
packet->adc6 = adc6;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)packet, MAVLINK_MSG_ID_AP_ADC_MIN_LEN, MAVLINK_MSG_ID_AP_ADC_LEN, MAVLINK_MSG_ID_AP_ADC_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AP_ADC UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field adc1 from ap_adc message
|
||||
*
|
||||
* @return ADC output 1
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_get_adc1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field adc2 from ap_adc message
|
||||
*
|
||||
* @return ADC output 2
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_get_adc2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field adc3 from ap_adc message
|
||||
*
|
||||
* @return ADC output 3
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_get_adc3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field adc4 from ap_adc message
|
||||
*
|
||||
* @return ADC output 4
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_get_adc4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field adc5 from ap_adc message
|
||||
*
|
||||
* @return ADC output 5
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_get_adc5(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field adc6 from ap_adc message
|
||||
*
|
||||
* @return ADC output 6
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ap_adc_get_adc6(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a ap_adc message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param ap_adc C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_ap_adc_decode(const mavlink_message_t* msg, mavlink_ap_adc_t* ap_adc)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
ap_adc->adc1 = mavlink_msg_ap_adc_get_adc1(msg);
|
||||
ap_adc->adc2 = mavlink_msg_ap_adc_get_adc2(msg);
|
||||
ap_adc->adc3 = mavlink_msg_ap_adc_get_adc3(msg);
|
||||
ap_adc->adc4 = mavlink_msg_ap_adc_get_adc4(msg);
|
||||
ap_adc->adc5 = mavlink_msg_ap_adc_get_adc5(msg);
|
||||
ap_adc->adc6 = mavlink_msg_ap_adc_get_adc6(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AP_ADC_LEN? msg->len : MAVLINK_MSG_ID_AP_ADC_LEN;
|
||||
memset(ap_adc, 0, MAVLINK_MSG_ID_AP_ADC_LEN);
|
||||
memcpy(ap_adc, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE AUTOPILOT_VERSION_REQUEST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST 183
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_autopilot_version_request_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_autopilot_version_request_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN 2
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_183_LEN 2
|
||||
#define MAVLINK_MSG_ID_183_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_CRC 85
|
||||
#define MAVLINK_MSG_ID_183_CRC 85
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION_REQUEST { \
|
||||
183, \
|
||||
"AUTOPILOT_VERSION_REQUEST", \
|
||||
2, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_autopilot_version_request_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_autopilot_version_request_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION_REQUEST { \
|
||||
"AUTOPILOT_VERSION_REQUEST", \
|
||||
2, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_autopilot_version_request_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_autopilot_version_request_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a autopilot_version_request message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_autopilot_version_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a autopilot_version_request message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_autopilot_version_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a autopilot_version_request struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param autopilot_version_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_autopilot_version_request_t* autopilot_version_request)
|
||||
{
|
||||
return mavlink_msg_autopilot_version_request_pack(system_id, component_id, msg, autopilot_version_request->target_system, autopilot_version_request->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a autopilot_version_request struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param autopilot_version_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_autopilot_version_request_t* autopilot_version_request)
|
||||
{
|
||||
return mavlink_msg_autopilot_version_request_pack_chan(system_id, component_id, chan, msg, autopilot_version_request->target_system, autopilot_version_request->target_component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a autopilot_version_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_autopilot_version_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_CRC);
|
||||
#else
|
||||
mavlink_autopilot_version_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a autopilot_version_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_request_send_struct(mavlink_channel_t chan, const mavlink_autopilot_version_request_t* autopilot_version_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_autopilot_version_request_send(chan, autopilot_version_request->target_system, autopilot_version_request->target_component);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST, (const char *)autopilot_version_request, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_CRC);
|
||||
#else
|
||||
mavlink_autopilot_version_request_t *packet = (mavlink_autopilot_version_request_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST, (const char *)packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AUTOPILOT_VERSION_REQUEST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from autopilot_version_request message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_autopilot_version_request_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from autopilot_version_request message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_autopilot_version_request_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a autopilot_version_request message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param autopilot_version_request C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_request_decode(const mavlink_message_t* msg, mavlink_autopilot_version_request_t* autopilot_version_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
autopilot_version_request->target_system = mavlink_msg_autopilot_version_request_get_target_system(msg);
|
||||
autopilot_version_request->target_component = mavlink_msg_autopilot_version_request_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN;
|
||||
memset(autopilot_version_request, 0, MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_LEN);
|
||||
memcpy(autopilot_version_request, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE BATTERY2 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY2 181
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_battery2_t {
|
||||
uint16_t voltage; /*< voltage in millivolts*/
|
||||
int16_t current_battery; /*< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current*/
|
||||
}) mavlink_battery2_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY2_LEN 4
|
||||
#define MAVLINK_MSG_ID_BATTERY2_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_181_LEN 4
|
||||
#define MAVLINK_MSG_ID_181_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY2_CRC 174
|
||||
#define MAVLINK_MSG_ID_181_CRC 174
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_BATTERY2 { \
|
||||
181, \
|
||||
"BATTERY2", \
|
||||
2, \
|
||||
{ { "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_battery2_t, voltage) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_battery2_t, current_battery) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_BATTERY2 { \
|
||||
"BATTERY2", \
|
||||
2, \
|
||||
{ { "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_battery2_t, voltage) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_battery2_t, current_battery) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a battery2 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 voltage voltage in millivolts
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t voltage, int16_t current_battery)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY2_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage);
|
||||
_mav_put_int16_t(buf, 2, current_battery);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY2_LEN);
|
||||
#else
|
||||
mavlink_battery2_t packet;
|
||||
packet.voltage = voltage;
|
||||
packet.current_battery = current_battery;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY2_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BATTERY2;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY2_MIN_LEN, MAVLINK_MSG_ID_BATTERY2_LEN, MAVLINK_MSG_ID_BATTERY2_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a battery2 message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param voltage voltage in millivolts
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t voltage,int16_t current_battery)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY2_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage);
|
||||
_mav_put_int16_t(buf, 2, current_battery);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY2_LEN);
|
||||
#else
|
||||
mavlink_battery2_t packet;
|
||||
packet.voltage = voltage;
|
||||
packet.current_battery = current_battery;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY2_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BATTERY2;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY2_MIN_LEN, MAVLINK_MSG_ID_BATTERY2_LEN, MAVLINK_MSG_ID_BATTERY2_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a battery2 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param battery2 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_battery2_t* battery2)
|
||||
{
|
||||
return mavlink_msg_battery2_pack(system_id, component_id, msg, battery2->voltage, battery2->current_battery);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a battery2 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param battery2 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_battery2_t* battery2)
|
||||
{
|
||||
return mavlink_msg_battery2_pack_chan(system_id, component_id, chan, msg, battery2->voltage, battery2->current_battery);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a battery2 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param voltage voltage in millivolts
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_battery2_send(mavlink_channel_t chan, uint16_t voltage, int16_t current_battery)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY2_LEN];
|
||||
_mav_put_uint16_t(buf, 0, voltage);
|
||||
_mav_put_int16_t(buf, 2, current_battery);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY2, buf, MAVLINK_MSG_ID_BATTERY2_MIN_LEN, MAVLINK_MSG_ID_BATTERY2_LEN, MAVLINK_MSG_ID_BATTERY2_CRC);
|
||||
#else
|
||||
mavlink_battery2_t packet;
|
||||
packet.voltage = voltage;
|
||||
packet.current_battery = current_battery;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY2, (const char *)&packet, MAVLINK_MSG_ID_BATTERY2_MIN_LEN, MAVLINK_MSG_ID_BATTERY2_LEN, MAVLINK_MSG_ID_BATTERY2_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a battery2 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_battery2_send_struct(mavlink_channel_t chan, const mavlink_battery2_t* battery2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_battery2_send(chan, battery2->voltage, battery2->current_battery);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY2, (const char *)battery2, MAVLINK_MSG_ID_BATTERY2_MIN_LEN, MAVLINK_MSG_ID_BATTERY2_LEN, MAVLINK_MSG_ID_BATTERY2_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_BATTERY2_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_battery2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t voltage, int16_t current_battery)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, voltage);
|
||||
_mav_put_int16_t(buf, 2, current_battery);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY2, buf, MAVLINK_MSG_ID_BATTERY2_MIN_LEN, MAVLINK_MSG_ID_BATTERY2_LEN, MAVLINK_MSG_ID_BATTERY2_CRC);
|
||||
#else
|
||||
mavlink_battery2_t *packet = (mavlink_battery2_t *)msgbuf;
|
||||
packet->voltage = voltage;
|
||||
packet->current_battery = current_battery;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY2, (const char *)packet, MAVLINK_MSG_ID_BATTERY2_MIN_LEN, MAVLINK_MSG_ID_BATTERY2_LEN, MAVLINK_MSG_ID_BATTERY2_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE BATTERY2 UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field voltage from battery2 message
|
||||
*
|
||||
* @return voltage in millivolts
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery2_get_voltage(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current_battery from battery2 message
|
||||
*
|
||||
* @return Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
*/
|
||||
static inline int16_t mavlink_msg_battery2_get_current_battery(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a battery2 message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param battery2 C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_battery2_decode(const mavlink_message_t* msg, mavlink_battery2_t* battery2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
battery2->voltage = mavlink_msg_battery2_get_voltage(msg);
|
||||
battery2->current_battery = mavlink_msg_battery2_get_current_battery(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_BATTERY2_LEN? msg->len : MAVLINK_MSG_ID_BATTERY2_LEN;
|
||||
memset(battery2, 0, MAVLINK_MSG_ID_BATTERY2_LEN);
|
||||
memcpy(battery2, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-513
@@ -1,513 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE CAMERA_FEEDBACK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_FEEDBACK 180
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_camera_feedback_t {
|
||||
uint64_t time_usec; /*< Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB)*/
|
||||
int32_t lat; /*< Latitude in (deg * 1E7)*/
|
||||
int32_t lng; /*< Longitude in (deg * 1E7)*/
|
||||
float alt_msl; /*< Altitude Absolute (meters AMSL)*/
|
||||
float alt_rel; /*< Altitude Relative (meters above HOME location)*/
|
||||
float roll; /*< Camera Roll angle (earth frame, degrees, +-180)*/
|
||||
float pitch; /*< Camera Pitch angle (earth frame, degrees, +-180)*/
|
||||
float yaw; /*< Camera Yaw (earth frame, degrees, 0-360, true)*/
|
||||
float foc_len; /*< Focal Length (mm)*/
|
||||
uint16_t img_idx; /*< Image index*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t cam_idx; /*< Camera ID*/
|
||||
uint8_t flags; /*< See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask*/
|
||||
}) mavlink_camera_feedback_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN 45
|
||||
#define MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN 45
|
||||
#define MAVLINK_MSG_ID_180_LEN 45
|
||||
#define MAVLINK_MSG_ID_180_MIN_LEN 45
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC 52
|
||||
#define MAVLINK_MSG_ID_180_CRC 52
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_FEEDBACK { \
|
||||
180, \
|
||||
"CAMERA_FEEDBACK", \
|
||||
13, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_feedback_t, time_usec) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_camera_feedback_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_feedback_t, lng) }, \
|
||||
{ "alt_msl", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_feedback_t, alt_msl) }, \
|
||||
{ "alt_rel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_feedback_t, alt_rel) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_camera_feedback_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_camera_feedback_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_camera_feedback_t, yaw) }, \
|
||||
{ "foc_len", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_camera_feedback_t, foc_len) }, \
|
||||
{ "img_idx", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_camera_feedback_t, img_idx) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_camera_feedback_t, target_system) }, \
|
||||
{ "cam_idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_camera_feedback_t, cam_idx) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 44, offsetof(mavlink_camera_feedback_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_FEEDBACK { \
|
||||
"CAMERA_FEEDBACK", \
|
||||
13, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_feedback_t, time_usec) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_camera_feedback_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_feedback_t, lng) }, \
|
||||
{ "alt_msl", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_feedback_t, alt_msl) }, \
|
||||
{ "alt_rel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_feedback_t, alt_rel) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_camera_feedback_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_camera_feedback_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_camera_feedback_t, yaw) }, \
|
||||
{ "foc_len", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_camera_feedback_t, foc_len) }, \
|
||||
{ "img_idx", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_camera_feedback_t, img_idx) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_camera_feedback_t, target_system) }, \
|
||||
{ "cam_idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_camera_feedback_t, cam_idx) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 44, offsetof(mavlink_camera_feedback_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_feedback 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 Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB)
|
||||
* @param target_system System ID
|
||||
* @param cam_idx Camera ID
|
||||
* @param img_idx Image index
|
||||
* @param lat Latitude in (deg * 1E7)
|
||||
* @param lng Longitude in (deg * 1E7)
|
||||
* @param alt_msl Altitude Absolute (meters AMSL)
|
||||
* @param alt_rel Altitude Relative (meters above HOME location)
|
||||
* @param roll Camera Roll angle (earth frame, degrees, +-180)
|
||||
* @param pitch Camera Pitch angle (earth frame, degrees, +-180)
|
||||
* @param yaw Camera Yaw (earth frame, degrees, 0-360, true)
|
||||
* @param foc_len Focal Length (mm)
|
||||
* @param flags See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_feedback_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, int32_t lat, int32_t lng, float alt_msl, float alt_rel, float roll, float pitch, float yaw, float foc_len, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lng);
|
||||
_mav_put_float(buf, 16, alt_msl);
|
||||
_mav_put_float(buf, 20, alt_rel);
|
||||
_mav_put_float(buf, 24, roll);
|
||||
_mav_put_float(buf, 28, pitch);
|
||||
_mav_put_float(buf, 32, yaw);
|
||||
_mav_put_float(buf, 36, foc_len);
|
||||
_mav_put_uint16_t(buf, 40, img_idx);
|
||||
_mav_put_uint8_t(buf, 42, target_system);
|
||||
_mav_put_uint8_t(buf, 43, cam_idx);
|
||||
_mav_put_uint8_t(buf, 44, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
|
||||
#else
|
||||
mavlink_camera_feedback_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt_msl = alt_msl;
|
||||
packet.alt_rel = alt_rel;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.foc_len = foc_len;
|
||||
packet.img_idx = img_idx;
|
||||
packet.target_system = target_system;
|
||||
packet.cam_idx = cam_idx;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_feedback message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB)
|
||||
* @param target_system System ID
|
||||
* @param cam_idx Camera ID
|
||||
* @param img_idx Image index
|
||||
* @param lat Latitude in (deg * 1E7)
|
||||
* @param lng Longitude in (deg * 1E7)
|
||||
* @param alt_msl Altitude Absolute (meters AMSL)
|
||||
* @param alt_rel Altitude Relative (meters above HOME location)
|
||||
* @param roll Camera Roll angle (earth frame, degrees, +-180)
|
||||
* @param pitch Camera Pitch angle (earth frame, degrees, +-180)
|
||||
* @param yaw Camera Yaw (earth frame, degrees, 0-360, true)
|
||||
* @param foc_len Focal Length (mm)
|
||||
* @param flags See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_feedback_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t target_system,uint8_t cam_idx,uint16_t img_idx,int32_t lat,int32_t lng,float alt_msl,float alt_rel,float roll,float pitch,float yaw,float foc_len,uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lng);
|
||||
_mav_put_float(buf, 16, alt_msl);
|
||||
_mav_put_float(buf, 20, alt_rel);
|
||||
_mav_put_float(buf, 24, roll);
|
||||
_mav_put_float(buf, 28, pitch);
|
||||
_mav_put_float(buf, 32, yaw);
|
||||
_mav_put_float(buf, 36, foc_len);
|
||||
_mav_put_uint16_t(buf, 40, img_idx);
|
||||
_mav_put_uint8_t(buf, 42, target_system);
|
||||
_mav_put_uint8_t(buf, 43, cam_idx);
|
||||
_mav_put_uint8_t(buf, 44, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
|
||||
#else
|
||||
mavlink_camera_feedback_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt_msl = alt_msl;
|
||||
packet.alt_rel = alt_rel;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.foc_len = foc_len;
|
||||
packet.img_idx = img_idx;
|
||||
packet.target_system = target_system;
|
||||
packet.cam_idx = cam_idx;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_feedback struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_feedback C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_feedback_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_feedback_t* camera_feedback)
|
||||
{
|
||||
return mavlink_msg_camera_feedback_pack(system_id, component_id, msg, camera_feedback->time_usec, camera_feedback->target_system, camera_feedback->cam_idx, camera_feedback->img_idx, camera_feedback->lat, camera_feedback->lng, camera_feedback->alt_msl, camera_feedback->alt_rel, camera_feedback->roll, camera_feedback->pitch, camera_feedback->yaw, camera_feedback->foc_len, camera_feedback->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_feedback struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_feedback C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_feedback_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_feedback_t* camera_feedback)
|
||||
{
|
||||
return mavlink_msg_camera_feedback_pack_chan(system_id, component_id, chan, msg, camera_feedback->time_usec, camera_feedback->target_system, camera_feedback->cam_idx, camera_feedback->img_idx, camera_feedback->lat, camera_feedback->lng, camera_feedback->alt_msl, camera_feedback->alt_rel, camera_feedback->roll, camera_feedback->pitch, camera_feedback->yaw, camera_feedback->foc_len, camera_feedback->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_feedback message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB)
|
||||
* @param target_system System ID
|
||||
* @param cam_idx Camera ID
|
||||
* @param img_idx Image index
|
||||
* @param lat Latitude in (deg * 1E7)
|
||||
* @param lng Longitude in (deg * 1E7)
|
||||
* @param alt_msl Altitude Absolute (meters AMSL)
|
||||
* @param alt_rel Altitude Relative (meters above HOME location)
|
||||
* @param roll Camera Roll angle (earth frame, degrees, +-180)
|
||||
* @param pitch Camera Pitch angle (earth frame, degrees, +-180)
|
||||
* @param yaw Camera Yaw (earth frame, degrees, 0-360, true)
|
||||
* @param foc_len Focal Length (mm)
|
||||
* @param flags See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_camera_feedback_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, int32_t lat, int32_t lng, float alt_msl, float alt_rel, float roll, float pitch, float yaw, float foc_len, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lng);
|
||||
_mav_put_float(buf, 16, alt_msl);
|
||||
_mav_put_float(buf, 20, alt_rel);
|
||||
_mav_put_float(buf, 24, roll);
|
||||
_mav_put_float(buf, 28, pitch);
|
||||
_mav_put_float(buf, 32, yaw);
|
||||
_mav_put_float(buf, 36, foc_len);
|
||||
_mav_put_uint16_t(buf, 40, img_idx);
|
||||
_mav_put_uint8_t(buf, 42, target_system);
|
||||
_mav_put_uint8_t(buf, 43, cam_idx);
|
||||
_mav_put_uint8_t(buf, 44, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
|
||||
#else
|
||||
mavlink_camera_feedback_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt_msl = alt_msl;
|
||||
packet.alt_rel = alt_rel;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.foc_len = foc_len;
|
||||
packet.img_idx = img_idx;
|
||||
packet.target_system = target_system;
|
||||
packet.cam_idx = cam_idx;
|
||||
packet.flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_feedback message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_camera_feedback_send_struct(mavlink_channel_t chan, const mavlink_camera_feedback_t* camera_feedback)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_camera_feedback_send(chan, camera_feedback->time_usec, camera_feedback->target_system, camera_feedback->cam_idx, camera_feedback->img_idx, camera_feedback->lat, camera_feedback->lng, camera_feedback->alt_msl, camera_feedback->alt_rel, camera_feedback->roll, camera_feedback->pitch, camera_feedback->yaw, camera_feedback->foc_len, camera_feedback->flags);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, (const char *)camera_feedback, MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_camera_feedback_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, int32_t lat, int32_t lng, float alt_msl, float alt_rel, float roll, float pitch, float yaw, float foc_len, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lng);
|
||||
_mav_put_float(buf, 16, alt_msl);
|
||||
_mav_put_float(buf, 20, alt_rel);
|
||||
_mav_put_float(buf, 24, roll);
|
||||
_mav_put_float(buf, 28, pitch);
|
||||
_mav_put_float(buf, 32, yaw);
|
||||
_mav_put_float(buf, 36, foc_len);
|
||||
_mav_put_uint16_t(buf, 40, img_idx);
|
||||
_mav_put_uint8_t(buf, 42, target_system);
|
||||
_mav_put_uint8_t(buf, 43, cam_idx);
|
||||
_mav_put_uint8_t(buf, 44, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, buf, MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
|
||||
#else
|
||||
mavlink_camera_feedback_t *packet = (mavlink_camera_feedback_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->lat = lat;
|
||||
packet->lng = lng;
|
||||
packet->alt_msl = alt_msl;
|
||||
packet->alt_rel = alt_rel;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
packet->foc_len = foc_len;
|
||||
packet->img_idx = img_idx;
|
||||
packet->target_system = target_system;
|
||||
packet->cam_idx = cam_idx;
|
||||
packet->flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_FEEDBACK, (const char *)packet, MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN, MAVLINK_MSG_ID_CAMERA_FEEDBACK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CAMERA_FEEDBACK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from camera_feedback message
|
||||
*
|
||||
* @return Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_camera_feedback_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from camera_feedback message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_feedback_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cam_idx from camera_feedback message
|
||||
*
|
||||
* @return Camera ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_feedback_get_cam_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 43);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field img_idx from camera_feedback message
|
||||
*
|
||||
* @return Image index
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_feedback_get_img_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from camera_feedback message
|
||||
*
|
||||
* @return Latitude in (deg * 1E7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_camera_feedback_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from camera_feedback message
|
||||
*
|
||||
* @return Longitude in (deg * 1E7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_camera_feedback_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt_msl from camera_feedback message
|
||||
*
|
||||
* @return Altitude Absolute (meters AMSL)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_feedback_get_alt_msl(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt_rel from camera_feedback message
|
||||
*
|
||||
* @return Altitude Relative (meters above HOME location)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_feedback_get_alt_rel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from camera_feedback message
|
||||
*
|
||||
* @return Camera Roll angle (earth frame, degrees, +-180)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_feedback_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from camera_feedback message
|
||||
*
|
||||
* @return Camera Pitch angle (earth frame, degrees, +-180)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_feedback_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from camera_feedback message
|
||||
*
|
||||
* @return Camera Yaw (earth frame, degrees, 0-360, true)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_feedback_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field foc_len from camera_feedback message
|
||||
*
|
||||
* @return Focal Length (mm)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_feedback_get_foc_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from camera_feedback message
|
||||
*
|
||||
* @return See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_feedback_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a camera_feedback message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param camera_feedback C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_camera_feedback_decode(const mavlink_message_t* msg, mavlink_camera_feedback_t* camera_feedback)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
camera_feedback->time_usec = mavlink_msg_camera_feedback_get_time_usec(msg);
|
||||
camera_feedback->lat = mavlink_msg_camera_feedback_get_lat(msg);
|
||||
camera_feedback->lng = mavlink_msg_camera_feedback_get_lng(msg);
|
||||
camera_feedback->alt_msl = mavlink_msg_camera_feedback_get_alt_msl(msg);
|
||||
camera_feedback->alt_rel = mavlink_msg_camera_feedback_get_alt_rel(msg);
|
||||
camera_feedback->roll = mavlink_msg_camera_feedback_get_roll(msg);
|
||||
camera_feedback->pitch = mavlink_msg_camera_feedback_get_pitch(msg);
|
||||
camera_feedback->yaw = mavlink_msg_camera_feedback_get_yaw(msg);
|
||||
camera_feedback->foc_len = mavlink_msg_camera_feedback_get_foc_len(msg);
|
||||
camera_feedback->img_idx = mavlink_msg_camera_feedback_get_img_idx(msg);
|
||||
camera_feedback->target_system = mavlink_msg_camera_feedback_get_target_system(msg);
|
||||
camera_feedback->cam_idx = mavlink_msg_camera_feedback_get_cam_idx(msg);
|
||||
camera_feedback->flags = mavlink_msg_camera_feedback_get_flags(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN;
|
||||
memset(camera_feedback, 0, MAVLINK_MSG_ID_CAMERA_FEEDBACK_LEN);
|
||||
memcpy(camera_feedback, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-413
@@ -1,413 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE CAMERA_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_STATUS 179
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_camera_status_t {
|
||||
uint64_t time_usec; /*< Image timestamp (microseconds since UNIX epoch, according to camera clock)*/
|
||||
float p1; /*< Parameter 1 (meaning depends on event, see CAMERA_STATUS_TYPES enum)*/
|
||||
float p2; /*< Parameter 2 (meaning depends on event, see CAMERA_STATUS_TYPES enum)*/
|
||||
float p3; /*< Parameter 3 (meaning depends on event, see CAMERA_STATUS_TYPES enum)*/
|
||||
float p4; /*< Parameter 4 (meaning depends on event, see CAMERA_STATUS_TYPES enum)*/
|
||||
uint16_t img_idx; /*< Image index*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t cam_idx; /*< Camera ID*/
|
||||
uint8_t event_id; /*< See CAMERA_STATUS_TYPES enum for definition of the bitmask*/
|
||||
}) mavlink_camera_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_STATUS_LEN 29
|
||||
#define MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN 29
|
||||
#define MAVLINK_MSG_ID_179_LEN 29
|
||||
#define MAVLINK_MSG_ID_179_MIN_LEN 29
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_STATUS_CRC 189
|
||||
#define MAVLINK_MSG_ID_179_CRC 189
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_STATUS { \
|
||||
179, \
|
||||
"CAMERA_STATUS", \
|
||||
9, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_status_t, time_usec) }, \
|
||||
{ "p1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_status_t, p1) }, \
|
||||
{ "p2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_status_t, p2) }, \
|
||||
{ "p3", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_status_t, p3) }, \
|
||||
{ "p4", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_status_t, p4) }, \
|
||||
{ "img_idx", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_status_t, img_idx) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_camera_status_t, target_system) }, \
|
||||
{ "cam_idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_camera_status_t, cam_idx) }, \
|
||||
{ "event_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_camera_status_t, event_id) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_STATUS { \
|
||||
"CAMERA_STATUS", \
|
||||
9, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_status_t, time_usec) }, \
|
||||
{ "p1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_status_t, p1) }, \
|
||||
{ "p2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_status_t, p2) }, \
|
||||
{ "p3", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_status_t, p3) }, \
|
||||
{ "p4", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_status_t, p4) }, \
|
||||
{ "img_idx", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_status_t, img_idx) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_camera_status_t, target_system) }, \
|
||||
{ "cam_idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_camera_status_t, cam_idx) }, \
|
||||
{ "event_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_camera_status_t, event_id) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_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 time_usec Image timestamp (microseconds since UNIX epoch, according to camera clock)
|
||||
* @param target_system System ID
|
||||
* @param cam_idx Camera ID
|
||||
* @param img_idx Image index
|
||||
* @param event_id See CAMERA_STATUS_TYPES enum for definition of the bitmask
|
||||
* @param p1 Parameter 1 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p2 Parameter 2 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p3 Parameter 3 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p4 Parameter 4 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, p1);
|
||||
_mav_put_float(buf, 12, p2);
|
||||
_mav_put_float(buf, 16, p3);
|
||||
_mav_put_float(buf, 20, p4);
|
||||
_mav_put_uint16_t(buf, 24, img_idx);
|
||||
_mav_put_uint8_t(buf, 26, target_system);
|
||||
_mav_put_uint8_t(buf, 27, cam_idx);
|
||||
_mav_put_uint8_t(buf, 28, event_id);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
|
||||
#else
|
||||
mavlink_camera_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.p1 = p1;
|
||||
packet.p2 = p2;
|
||||
packet.p3 = p3;
|
||||
packet.p4 = p4;
|
||||
packet.img_idx = img_idx;
|
||||
packet.target_system = target_system;
|
||||
packet.cam_idx = cam_idx;
|
||||
packet.event_id = event_id;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Image timestamp (microseconds since UNIX epoch, according to camera clock)
|
||||
* @param target_system System ID
|
||||
* @param cam_idx Camera ID
|
||||
* @param img_idx Image index
|
||||
* @param event_id See CAMERA_STATUS_TYPES enum for definition of the bitmask
|
||||
* @param p1 Parameter 1 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p2 Parameter 2 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p3 Parameter 3 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p4 Parameter 4 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t target_system,uint8_t cam_idx,uint16_t img_idx,uint8_t event_id,float p1,float p2,float p3,float p4)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, p1);
|
||||
_mav_put_float(buf, 12, p2);
|
||||
_mav_put_float(buf, 16, p3);
|
||||
_mav_put_float(buf, 20, p4);
|
||||
_mav_put_uint16_t(buf, 24, img_idx);
|
||||
_mav_put_uint8_t(buf, 26, target_system);
|
||||
_mav_put_uint8_t(buf, 27, cam_idx);
|
||||
_mav_put_uint8_t(buf, 28, event_id);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
|
||||
#else
|
||||
mavlink_camera_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.p1 = p1;
|
||||
packet.p2 = p2;
|
||||
packet.p3 = p3;
|
||||
packet.p4 = p4;
|
||||
packet.img_idx = img_idx;
|
||||
packet.target_system = target_system;
|
||||
packet.cam_idx = cam_idx;
|
||||
packet.event_id = event_id;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_status_t* camera_status)
|
||||
{
|
||||
return mavlink_msg_camera_status_pack(system_id, component_id, msg, camera_status->time_usec, camera_status->target_system, camera_status->cam_idx, camera_status->img_idx, camera_status->event_id, camera_status->p1, camera_status->p2, camera_status->p3, camera_status->p4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_status_t* camera_status)
|
||||
{
|
||||
return mavlink_msg_camera_status_pack_chan(system_id, component_id, chan, msg, camera_status->time_usec, camera_status->target_system, camera_status->cam_idx, camera_status->img_idx, camera_status->event_id, camera_status->p1, camera_status->p2, camera_status->p3, camera_status->p4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Image timestamp (microseconds since UNIX epoch, according to camera clock)
|
||||
* @param target_system System ID
|
||||
* @param cam_idx Camera ID
|
||||
* @param img_idx Image index
|
||||
* @param event_id See CAMERA_STATUS_TYPES enum for definition of the bitmask
|
||||
* @param p1 Parameter 1 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p2 Parameter 2 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p3 Parameter 3 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
* @param p4 Parameter 4 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_camera_status_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, p1);
|
||||
_mav_put_float(buf, 12, p2);
|
||||
_mav_put_float(buf, 16, p3);
|
||||
_mav_put_float(buf, 20, p4);
|
||||
_mav_put_uint16_t(buf, 24, img_idx);
|
||||
_mav_put_uint8_t(buf, 26, target_system);
|
||||
_mav_put_uint8_t(buf, 27, cam_idx);
|
||||
_mav_put_uint8_t(buf, 28, event_id);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, buf, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
|
||||
#else
|
||||
mavlink_camera_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.p1 = p1;
|
||||
packet.p2 = p2;
|
||||
packet.p3 = p3;
|
||||
packet.p4 = p4;
|
||||
packet.img_idx = img_idx;
|
||||
packet.target_system = target_system;
|
||||
packet.cam_idx = cam_idx;
|
||||
packet.event_id = event_id;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_camera_status_send_struct(mavlink_channel_t chan, const mavlink_camera_status_t* camera_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_camera_status_send(chan, camera_status->time_usec, camera_status->target_system, camera_status->cam_idx, camera_status->img_idx, camera_status->event_id, camera_status->p1, camera_status->p2, camera_status->p3, camera_status->p4);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, (const char *)camera_status, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CAMERA_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_camera_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, p1);
|
||||
_mav_put_float(buf, 12, p2);
|
||||
_mav_put_float(buf, 16, p3);
|
||||
_mav_put_float(buf, 20, p4);
|
||||
_mav_put_uint16_t(buf, 24, img_idx);
|
||||
_mav_put_uint8_t(buf, 26, target_system);
|
||||
_mav_put_uint8_t(buf, 27, cam_idx);
|
||||
_mav_put_uint8_t(buf, 28, event_id);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, buf, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
|
||||
#else
|
||||
mavlink_camera_status_t *packet = (mavlink_camera_status_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->p1 = p1;
|
||||
packet->p2 = p2;
|
||||
packet->p3 = p3;
|
||||
packet->p4 = p4;
|
||||
packet->img_idx = img_idx;
|
||||
packet->target_system = target_system;
|
||||
packet->cam_idx = cam_idx;
|
||||
packet->event_id = event_id;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, (const char *)packet, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CAMERA_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from camera_status message
|
||||
*
|
||||
* @return Image timestamp (microseconds since UNIX epoch, according to camera clock)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_camera_status_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from camera_status message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_status_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cam_idx from camera_status message
|
||||
*
|
||||
* @return Camera ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_status_get_cam_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 27);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field img_idx from camera_status message
|
||||
*
|
||||
* @return Image index
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_status_get_img_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field event_id from camera_status message
|
||||
*
|
||||
* @return See CAMERA_STATUS_TYPES enum for definition of the bitmask
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_camera_status_get_event_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field p1 from camera_status message
|
||||
*
|
||||
* @return Parameter 1 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_status_get_p1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field p2 from camera_status message
|
||||
*
|
||||
* @return Parameter 2 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_status_get_p2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field p3 from camera_status message
|
||||
*
|
||||
* @return Parameter 3 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_status_get_p3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field p4 from camera_status message
|
||||
*
|
||||
* @return Parameter 4 (meaning depends on event, see CAMERA_STATUS_TYPES enum)
|
||||
*/
|
||||
static inline float mavlink_msg_camera_status_get_p4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a camera_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param camera_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_camera_status_decode(const mavlink_message_t* msg, mavlink_camera_status_t* camera_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
camera_status->time_usec = mavlink_msg_camera_status_get_time_usec(msg);
|
||||
camera_status->p1 = mavlink_msg_camera_status_get_p1(msg);
|
||||
camera_status->p2 = mavlink_msg_camera_status_get_p2(msg);
|
||||
camera_status->p3 = mavlink_msg_camera_status_get_p3(msg);
|
||||
camera_status->p4 = mavlink_msg_camera_status_get_p4(msg);
|
||||
camera_status->img_idx = mavlink_msg_camera_status_get_img_idx(msg);
|
||||
camera_status->target_system = mavlink_msg_camera_status_get_target_system(msg);
|
||||
camera_status->cam_idx = mavlink_msg_camera_status_get_cam_idx(msg);
|
||||
camera_status->event_id = mavlink_msg_camera_status_get_event_id(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_STATUS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_STATUS_LEN;
|
||||
memset(camera_status, 0, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
|
||||
memcpy(camera_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-338
@@ -1,338 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE COMPASSMOT_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COMPASSMOT_STATUS 177
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_compassmot_status_t {
|
||||
float current; /*< current (amps)*/
|
||||
float CompensationX; /*< Motor Compensation X*/
|
||||
float CompensationY; /*< Motor Compensation Y*/
|
||||
float CompensationZ; /*< Motor Compensation Z*/
|
||||
uint16_t throttle; /*< throttle (percent*10)*/
|
||||
uint16_t interference; /*< interference (percent)*/
|
||||
}) mavlink_compassmot_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN 20
|
||||
#define MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN 20
|
||||
#define MAVLINK_MSG_ID_177_LEN 20
|
||||
#define MAVLINK_MSG_ID_177_MIN_LEN 20
|
||||
|
||||
#define MAVLINK_MSG_ID_COMPASSMOT_STATUS_CRC 240
|
||||
#define MAVLINK_MSG_ID_177_CRC 240
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COMPASSMOT_STATUS { \
|
||||
177, \
|
||||
"COMPASSMOT_STATUS", \
|
||||
6, \
|
||||
{ { "current", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_compassmot_status_t, current) }, \
|
||||
{ "CompensationX", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_compassmot_status_t, CompensationX) }, \
|
||||
{ "CompensationY", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_compassmot_status_t, CompensationY) }, \
|
||||
{ "CompensationZ", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_compassmot_status_t, CompensationZ) }, \
|
||||
{ "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_compassmot_status_t, throttle) }, \
|
||||
{ "interference", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_compassmot_status_t, interference) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COMPASSMOT_STATUS { \
|
||||
"COMPASSMOT_STATUS", \
|
||||
6, \
|
||||
{ { "current", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_compassmot_status_t, current) }, \
|
||||
{ "CompensationX", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_compassmot_status_t, CompensationX) }, \
|
||||
{ "CompensationY", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_compassmot_status_t, CompensationY) }, \
|
||||
{ "CompensationZ", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_compassmot_status_t, CompensationZ) }, \
|
||||
{ "throttle", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_compassmot_status_t, throttle) }, \
|
||||
{ "interference", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_compassmot_status_t, interference) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a compassmot_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 throttle throttle (percent*10)
|
||||
* @param current current (amps)
|
||||
* @param interference interference (percent)
|
||||
* @param CompensationX Motor Compensation X
|
||||
* @param CompensationY Motor Compensation Y
|
||||
* @param CompensationZ Motor Compensation Z
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_compassmot_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t throttle, float current, uint16_t interference, float CompensationX, float CompensationY, float CompensationZ)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN];
|
||||
_mav_put_float(buf, 0, current);
|
||||
_mav_put_float(buf, 4, CompensationX);
|
||||
_mav_put_float(buf, 8, CompensationY);
|
||||
_mav_put_float(buf, 12, CompensationZ);
|
||||
_mav_put_uint16_t(buf, 16, throttle);
|
||||
_mav_put_uint16_t(buf, 18, interference);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN);
|
||||
#else
|
||||
mavlink_compassmot_status_t packet;
|
||||
packet.current = current;
|
||||
packet.CompensationX = CompensationX;
|
||||
packet.CompensationY = CompensationY;
|
||||
packet.CompensationZ = CompensationZ;
|
||||
packet.throttle = throttle;
|
||||
packet.interference = interference;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a compassmot_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param throttle throttle (percent*10)
|
||||
* @param current current (amps)
|
||||
* @param interference interference (percent)
|
||||
* @param CompensationX Motor Compensation X
|
||||
* @param CompensationY Motor Compensation Y
|
||||
* @param CompensationZ Motor Compensation Z
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_compassmot_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t throttle,float current,uint16_t interference,float CompensationX,float CompensationY,float CompensationZ)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN];
|
||||
_mav_put_float(buf, 0, current);
|
||||
_mav_put_float(buf, 4, CompensationX);
|
||||
_mav_put_float(buf, 8, CompensationY);
|
||||
_mav_put_float(buf, 12, CompensationZ);
|
||||
_mav_put_uint16_t(buf, 16, throttle);
|
||||
_mav_put_uint16_t(buf, 18, interference);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN);
|
||||
#else
|
||||
mavlink_compassmot_status_t packet;
|
||||
packet.current = current;
|
||||
packet.CompensationX = CompensationX;
|
||||
packet.CompensationY = CompensationY;
|
||||
packet.CompensationZ = CompensationZ;
|
||||
packet.throttle = throttle;
|
||||
packet.interference = interference;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a compassmot_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param compassmot_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_compassmot_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_compassmot_status_t* compassmot_status)
|
||||
{
|
||||
return mavlink_msg_compassmot_status_pack(system_id, component_id, msg, compassmot_status->throttle, compassmot_status->current, compassmot_status->interference, compassmot_status->CompensationX, compassmot_status->CompensationY, compassmot_status->CompensationZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a compassmot_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param compassmot_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_compassmot_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_compassmot_status_t* compassmot_status)
|
||||
{
|
||||
return mavlink_msg_compassmot_status_pack_chan(system_id, component_id, chan, msg, compassmot_status->throttle, compassmot_status->current, compassmot_status->interference, compassmot_status->CompensationX, compassmot_status->CompensationY, compassmot_status->CompensationZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a compassmot_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param throttle throttle (percent*10)
|
||||
* @param current current (amps)
|
||||
* @param interference interference (percent)
|
||||
* @param CompensationX Motor Compensation X
|
||||
* @param CompensationY Motor Compensation Y
|
||||
* @param CompensationZ Motor Compensation Z
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_compassmot_status_send(mavlink_channel_t chan, uint16_t throttle, float current, uint16_t interference, float CompensationX, float CompensationY, float CompensationZ)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN];
|
||||
_mav_put_float(buf, 0, current);
|
||||
_mav_put_float(buf, 4, CompensationX);
|
||||
_mav_put_float(buf, 8, CompensationY);
|
||||
_mav_put_float(buf, 12, CompensationZ);
|
||||
_mav_put_uint16_t(buf, 16, throttle);
|
||||
_mav_put_uint16_t(buf, 18, interference);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPASSMOT_STATUS, buf, MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_CRC);
|
||||
#else
|
||||
mavlink_compassmot_status_t packet;
|
||||
packet.current = current;
|
||||
packet.CompensationX = CompensationX;
|
||||
packet.CompensationY = CompensationY;
|
||||
packet.CompensationZ = CompensationZ;
|
||||
packet.throttle = throttle;
|
||||
packet.interference = interference;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPASSMOT_STATUS, (const char *)&packet, MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a compassmot_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_compassmot_status_send_struct(mavlink_channel_t chan, const mavlink_compassmot_status_t* compassmot_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_compassmot_status_send(chan, compassmot_status->throttle, compassmot_status->current, compassmot_status->interference, compassmot_status->CompensationX, compassmot_status->CompensationY, compassmot_status->CompensationZ);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPASSMOT_STATUS, (const char *)compassmot_status, MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_compassmot_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t throttle, float current, uint16_t interference, float CompensationX, float CompensationY, float CompensationZ)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, current);
|
||||
_mav_put_float(buf, 4, CompensationX);
|
||||
_mav_put_float(buf, 8, CompensationY);
|
||||
_mav_put_float(buf, 12, CompensationZ);
|
||||
_mav_put_uint16_t(buf, 16, throttle);
|
||||
_mav_put_uint16_t(buf, 18, interference);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPASSMOT_STATUS, buf, MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_CRC);
|
||||
#else
|
||||
mavlink_compassmot_status_t *packet = (mavlink_compassmot_status_t *)msgbuf;
|
||||
packet->current = current;
|
||||
packet->CompensationX = CompensationX;
|
||||
packet->CompensationY = CompensationY;
|
||||
packet->CompensationZ = CompensationZ;
|
||||
packet->throttle = throttle;
|
||||
packet->interference = interference;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPASSMOT_STATUS, (const char *)packet, MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN, MAVLINK_MSG_ID_COMPASSMOT_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COMPASSMOT_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field throttle from compassmot_status message
|
||||
*
|
||||
* @return throttle (percent*10)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_compassmot_status_get_throttle(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current from compassmot_status message
|
||||
*
|
||||
* @return current (amps)
|
||||
*/
|
||||
static inline float mavlink_msg_compassmot_status_get_current(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field interference from compassmot_status message
|
||||
*
|
||||
* @return interference (percent)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_compassmot_status_get_interference(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field CompensationX from compassmot_status message
|
||||
*
|
||||
* @return Motor Compensation X
|
||||
*/
|
||||
static inline float mavlink_msg_compassmot_status_get_CompensationX(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field CompensationY from compassmot_status message
|
||||
*
|
||||
* @return Motor Compensation Y
|
||||
*/
|
||||
static inline float mavlink_msg_compassmot_status_get_CompensationY(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field CompensationZ from compassmot_status message
|
||||
*
|
||||
* @return Motor Compensation Z
|
||||
*/
|
||||
static inline float mavlink_msg_compassmot_status_get_CompensationZ(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a compassmot_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param compassmot_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_compassmot_status_decode(const mavlink_message_t* msg, mavlink_compassmot_status_t* compassmot_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
compassmot_status->current = mavlink_msg_compassmot_status_get_current(msg);
|
||||
compassmot_status->CompensationX = mavlink_msg_compassmot_status_get_CompensationX(msg);
|
||||
compassmot_status->CompensationY = mavlink_msg_compassmot_status_get_CompensationY(msg);
|
||||
compassmot_status->CompensationZ = mavlink_msg_compassmot_status_get_CompensationZ(msg);
|
||||
compassmot_status->throttle = mavlink_msg_compassmot_status_get_throttle(msg);
|
||||
compassmot_status->interference = mavlink_msg_compassmot_status_get_interference(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN? msg->len : MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN;
|
||||
memset(compassmot_status, 0, MAVLINK_MSG_ID_COMPASSMOT_STATUS_LEN);
|
||||
memcpy(compassmot_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-255
@@ -1,255 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA16 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA16 169
|
||||
|
||||
MAVPACKED(
|
||||
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_DATA16_MIN_LEN 18
|
||||
#define MAVLINK_MSG_ID_169_LEN 18
|
||||
#define MAVLINK_MSG_ID_169_MIN_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA16_CRC 234
|
||||
#define MAVLINK_MSG_ID_169_CRC 234
|
||||
|
||||
#define MAVLINK_MSG_DATA16_FIELD_DATA_LEN 16
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA16 { \
|
||||
169, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_DATA16_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA16_LEN);
|
||||
#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, MAVLINK_MSG_ID_DATA16_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA16;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA16_MIN_LEN, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_DATA16_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA16_LEN);
|
||||
#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, MAVLINK_MSG_ID_DATA16_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA16;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA16_MIN_LEN, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data16 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a data16 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data16 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data16_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data16_t* data16)
|
||||
{
|
||||
return mavlink_msg_data16_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_DATA16_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA16_MIN_LEN, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC);
|
||||
#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, MAVLINK_MSG_ID_DATA16_MIN_LEN, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data16 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data16_send_struct(mavlink_channel_t chan, const mavlink_data16_t* data16)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data16_send(chan, data16->type, data16->len, data16->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA16, (const char *)data16, MAVLINK_MSG_ID_DATA16_MIN_LEN, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA16_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_data16_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_DATA16_MIN_LEN, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC);
|
||||
#else
|
||||
mavlink_data16_t *packet = (mavlink_data16_t *)msgbuf;
|
||||
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, MAVLINK_MSG_ID_DATA16_MIN_LEN, MAVLINK_MSG_ID_DATA16_LEN, MAVLINK_MSG_ID_DATA16_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA16_LEN? msg->len : MAVLINK_MSG_ID_DATA16_LEN;
|
||||
memset(data16, 0, MAVLINK_MSG_ID_DATA16_LEN);
|
||||
memcpy(data16, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-255
@@ -1,255 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA32 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA32 170
|
||||
|
||||
MAVPACKED(
|
||||
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_DATA32_MIN_LEN 34
|
||||
#define MAVLINK_MSG_ID_170_LEN 34
|
||||
#define MAVLINK_MSG_ID_170_MIN_LEN 34
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA32_CRC 73
|
||||
#define MAVLINK_MSG_ID_170_CRC 73
|
||||
|
||||
#define MAVLINK_MSG_DATA32_FIELD_DATA_LEN 32
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA32 { \
|
||||
170, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_DATA32_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA32_LEN);
|
||||
#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, MAVLINK_MSG_ID_DATA32_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA32;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA32_MIN_LEN, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_DATA32_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA32_LEN);
|
||||
#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, MAVLINK_MSG_ID_DATA32_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA32;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA32_MIN_LEN, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data32 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a data32 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data32 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data32_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data32_t* data32)
|
||||
{
|
||||
return mavlink_msg_data32_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_DATA32_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA32_MIN_LEN, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC);
|
||||
#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, MAVLINK_MSG_ID_DATA32_MIN_LEN, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data32 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data32_send_struct(mavlink_channel_t chan, const mavlink_data32_t* data32)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data32_send(chan, data32->type, data32->len, data32->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA32, (const char *)data32, MAVLINK_MSG_ID_DATA32_MIN_LEN, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA32_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_data32_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_DATA32_MIN_LEN, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC);
|
||||
#else
|
||||
mavlink_data32_t *packet = (mavlink_data32_t *)msgbuf;
|
||||
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, MAVLINK_MSG_ID_DATA32_MIN_LEN, MAVLINK_MSG_ID_DATA32_LEN, MAVLINK_MSG_ID_DATA32_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA32_LEN? msg->len : MAVLINK_MSG_ID_DATA32_LEN;
|
||||
memset(data32, 0, MAVLINK_MSG_ID_DATA32_LEN);
|
||||
memcpy(data32, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-255
@@ -1,255 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA64 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA64 171
|
||||
|
||||
MAVPACKED(
|
||||
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_DATA64_MIN_LEN 66
|
||||
#define MAVLINK_MSG_ID_171_LEN 66
|
||||
#define MAVLINK_MSG_ID_171_MIN_LEN 66
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA64_CRC 181
|
||||
#define MAVLINK_MSG_ID_171_CRC 181
|
||||
|
||||
#define MAVLINK_MSG_DATA64_FIELD_DATA_LEN 64
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA64 { \
|
||||
171, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_DATA64_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA64_LEN);
|
||||
#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, MAVLINK_MSG_ID_DATA64_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA64;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA64_MIN_LEN, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_DATA64_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA64_LEN);
|
||||
#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, MAVLINK_MSG_ID_DATA64_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA64;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA64_MIN_LEN, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data64 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a data64 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data64 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data64_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data64_t* data64)
|
||||
{
|
||||
return mavlink_msg_data64_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_DATA64_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA64_MIN_LEN, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC);
|
||||
#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, MAVLINK_MSG_ID_DATA64_MIN_LEN, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data64 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data64_send_struct(mavlink_channel_t chan, const mavlink_data64_t* data64)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data64_send(chan, data64->type, data64->len, data64->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA64, (const char *)data64, MAVLINK_MSG_ID_DATA64_MIN_LEN, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA64_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_data64_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_DATA64_MIN_LEN, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC);
|
||||
#else
|
||||
mavlink_data64_t *packet = (mavlink_data64_t *)msgbuf;
|
||||
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, MAVLINK_MSG_ID_DATA64_MIN_LEN, MAVLINK_MSG_ID_DATA64_LEN, MAVLINK_MSG_ID_DATA64_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA64_LEN? msg->len : MAVLINK_MSG_ID_DATA64_LEN;
|
||||
memset(data64, 0, MAVLINK_MSG_ID_DATA64_LEN);
|
||||
memcpy(data64, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-255
@@ -1,255 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA96 PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA96 172
|
||||
|
||||
MAVPACKED(
|
||||
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_DATA96_MIN_LEN 98
|
||||
#define MAVLINK_MSG_ID_172_LEN 98
|
||||
#define MAVLINK_MSG_ID_172_MIN_LEN 98
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA96_CRC 22
|
||||
#define MAVLINK_MSG_ID_172_CRC 22
|
||||
|
||||
#define MAVLINK_MSG_DATA96_FIELD_DATA_LEN 96
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA96 { \
|
||||
172, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_DATA96_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA96_LEN);
|
||||
#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, MAVLINK_MSG_ID_DATA96_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA96;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA96_MIN_LEN, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_DATA96_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA96_LEN);
|
||||
#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, MAVLINK_MSG_ID_DATA96_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA96;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA96_MIN_LEN, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data96 struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a data96 struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data96 C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data96_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data96_t* data96)
|
||||
{
|
||||
return mavlink_msg_data96_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_DATA96_LEN];
|
||||
_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, MAVLINK_MSG_ID_DATA96_MIN_LEN, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC);
|
||||
#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, MAVLINK_MSG_ID_DATA96_MIN_LEN, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data96 message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data96_send_struct(mavlink_channel_t chan, const mavlink_data96_t* data96)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data96_send(chan, data96->type, data96->len, data96->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA96, (const char *)data96, MAVLINK_MSG_ID_DATA96_MIN_LEN, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA96_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_data96_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_DATA96_MIN_LEN, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC);
|
||||
#else
|
||||
mavlink_data96_t *packet = (mavlink_data96_t *)msgbuf;
|
||||
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, MAVLINK_MSG_ID_DATA96_MIN_LEN, MAVLINK_MSG_ID_DATA96_LEN, MAVLINK_MSG_ID_DATA96_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA96_LEN? msg->len : MAVLINK_MSG_ID_DATA96_LEN;
|
||||
memset(data96, 0, MAVLINK_MSG_ID_DATA96_LEN);
|
||||
memcpy(data96, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-463
@@ -1,463 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DIGICAM_CONFIGURE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE 154
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_digicam_configure_t {
|
||||
float extra_value; /*< Correspondent value to given extra_param*/
|
||||
uint16_t shutter_speed; /*< Divisor number //e.g. 1000 means 1/1000 (0 means ignore)*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mode; /*< Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)*/
|
||||
uint8_t aperture; /*< F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)*/
|
||||
uint8_t iso; /*< ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)*/
|
||||
uint8_t exposure_type; /*< Exposure type enumeration from 1 to N (0 means ignore)*/
|
||||
uint8_t command_id; /*< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once*/
|
||||
uint8_t engine_cut_off; /*< Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)*/
|
||||
uint8_t extra_param; /*< Extra parameters enumeration (0 means ignore)*/
|
||||
}) mavlink_digicam_configure_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN 15
|
||||
#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN 15
|
||||
#define MAVLINK_MSG_ID_154_LEN 15
|
||||
#define MAVLINK_MSG_ID_154_MIN_LEN 15
|
||||
|
||||
#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC 84
|
||||
#define MAVLINK_MSG_ID_154_CRC 84
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \
|
||||
154, \
|
||||
"DIGICAM_CONFIGURE", \
|
||||
11, \
|
||||
{ { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_configure_t, extra_value) }, \
|
||||
{ "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, target_component) }, \
|
||||
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, mode) }, \
|
||||
{ "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, aperture) }, \
|
||||
{ "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, iso) }, \
|
||||
{ "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_configure_t, exposure_type) }, \
|
||||
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_configure_t, command_id) }, \
|
||||
{ "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \
|
||||
{ "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_digicam_configure_t, extra_param) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \
|
||||
"DIGICAM_CONFIGURE", \
|
||||
11, \
|
||||
{ { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_configure_t, extra_value) }, \
|
||||
{ "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, target_component) }, \
|
||||
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, mode) }, \
|
||||
{ "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, aperture) }, \
|
||||
{ "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, iso) }, \
|
||||
{ "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_configure_t, exposure_type) }, \
|
||||
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_configure_t, command_id) }, \
|
||||
{ "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \
|
||||
{ "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_digicam_configure_t, extra_param) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a digicam_configure message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
|
||||
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
|
||||
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
|
||||
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
|
||||
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore)
|
||||
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
|
||||
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
|
||||
* @param extra_param Extra parameters enumeration (0 means ignore)
|
||||
* @param extra_value Correspondent value to given extra_param
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN];
|
||||
_mav_put_float(buf, 0, extra_value);
|
||||
_mav_put_uint16_t(buf, 4, shutter_speed);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
_mav_put_uint8_t(buf, 8, mode);
|
||||
_mav_put_uint8_t(buf, 9, aperture);
|
||||
_mav_put_uint8_t(buf, 10, iso);
|
||||
_mav_put_uint8_t(buf, 11, exposure_type);
|
||||
_mav_put_uint8_t(buf, 12, command_id);
|
||||
_mav_put_uint8_t(buf, 13, engine_cut_off);
|
||||
_mav_put_uint8_t(buf, 14, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
|
||||
#else
|
||||
mavlink_digicam_configure_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
packet.shutter_speed = shutter_speed;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mode = mode;
|
||||
packet.aperture = aperture;
|
||||
packet.iso = iso;
|
||||
packet.exposure_type = exposure_type;
|
||||
packet.command_id = command_id;
|
||||
packet.engine_cut_off = engine_cut_off;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a digicam_configure message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
|
||||
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
|
||||
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
|
||||
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
|
||||
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore)
|
||||
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
|
||||
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
|
||||
* @param extra_param Extra parameters enumeration (0 means ignore)
|
||||
* @param extra_value Correspondent value to given extra_param
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t mode,uint16_t shutter_speed,uint8_t aperture,uint8_t iso,uint8_t exposure_type,uint8_t command_id,uint8_t engine_cut_off,uint8_t extra_param,float extra_value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN];
|
||||
_mav_put_float(buf, 0, extra_value);
|
||||
_mav_put_uint16_t(buf, 4, shutter_speed);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
_mav_put_uint8_t(buf, 8, mode);
|
||||
_mav_put_uint8_t(buf, 9, aperture);
|
||||
_mav_put_uint8_t(buf, 10, iso);
|
||||
_mav_put_uint8_t(buf, 11, exposure_type);
|
||||
_mav_put_uint8_t(buf, 12, command_id);
|
||||
_mav_put_uint8_t(buf, 13, engine_cut_off);
|
||||
_mav_put_uint8_t(buf, 14, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
|
||||
#else
|
||||
mavlink_digicam_configure_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
packet.shutter_speed = shutter_speed;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mode = mode;
|
||||
packet.aperture = aperture;
|
||||
packet.iso = iso;
|
||||
packet.exposure_type = exposure_type;
|
||||
packet.command_id = command_id;
|
||||
packet.engine_cut_off = engine_cut_off;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a digicam_configure struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param digicam_configure C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_configure_t* digicam_configure)
|
||||
{
|
||||
return mavlink_msg_digicam_configure_pack(system_id, component_id, msg, digicam_configure->target_system, digicam_configure->target_component, digicam_configure->mode, digicam_configure->shutter_speed, digicam_configure->aperture, digicam_configure->iso, digicam_configure->exposure_type, digicam_configure->command_id, digicam_configure->engine_cut_off, digicam_configure->extra_param, digicam_configure->extra_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a digicam_configure struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param digicam_configure C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_configure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_digicam_configure_t* digicam_configure)
|
||||
{
|
||||
return mavlink_msg_digicam_configure_pack_chan(system_id, component_id, chan, msg, digicam_configure->target_system, digicam_configure->target_component, digicam_configure->mode, digicam_configure->shutter_speed, digicam_configure->aperture, digicam_configure->iso, digicam_configure->exposure_type, digicam_configure->command_id, digicam_configure->engine_cut_off, digicam_configure->extra_param, digicam_configure->extra_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a digicam_configure message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
|
||||
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
|
||||
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
|
||||
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
|
||||
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore)
|
||||
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
|
||||
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
|
||||
* @param extra_param Extra parameters enumeration (0 means ignore)
|
||||
* @param extra_value Correspondent value to given extra_param
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_digicam_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN];
|
||||
_mav_put_float(buf, 0, extra_value);
|
||||
_mav_put_uint16_t(buf, 4, shutter_speed);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
_mav_put_uint8_t(buf, 8, mode);
|
||||
_mav_put_uint8_t(buf, 9, aperture);
|
||||
_mav_put_uint8_t(buf, 10, iso);
|
||||
_mav_put_uint8_t(buf, 11, exposure_type);
|
||||
_mav_put_uint8_t(buf, 12, command_id);
|
||||
_mav_put_uint8_t(buf, 13, engine_cut_off);
|
||||
_mav_put_uint8_t(buf, 14, extra_param);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
|
||||
#else
|
||||
mavlink_digicam_configure_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
packet.shutter_speed = shutter_speed;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mode = mode;
|
||||
packet.aperture = aperture;
|
||||
packet.iso = iso;
|
||||
packet.exposure_type = exposure_type;
|
||||
packet.command_id = command_id;
|
||||
packet.engine_cut_off = engine_cut_off;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a digicam_configure message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_digicam_configure_send_struct(mavlink_channel_t chan, const mavlink_digicam_configure_t* digicam_configure)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_digicam_configure_send(chan, digicam_configure->target_system, digicam_configure->target_component, digicam_configure->mode, digicam_configure->shutter_speed, digicam_configure->aperture, digicam_configure->iso, digicam_configure->exposure_type, digicam_configure->command_id, digicam_configure->engine_cut_off, digicam_configure->extra_param, digicam_configure->extra_value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)digicam_configure, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_digicam_configure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, extra_value);
|
||||
_mav_put_uint16_t(buf, 4, shutter_speed);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
_mav_put_uint8_t(buf, 8, mode);
|
||||
_mav_put_uint8_t(buf, 9, aperture);
|
||||
_mav_put_uint8_t(buf, 10, iso);
|
||||
_mav_put_uint8_t(buf, 11, exposure_type);
|
||||
_mav_put_uint8_t(buf, 12, command_id);
|
||||
_mav_put_uint8_t(buf, 13, engine_cut_off);
|
||||
_mav_put_uint8_t(buf, 14, extra_param);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
|
||||
#else
|
||||
mavlink_digicam_configure_t *packet = (mavlink_digicam_configure_t *)msgbuf;
|
||||
packet->extra_value = extra_value;
|
||||
packet->shutter_speed = shutter_speed;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mode = mode;
|
||||
packet->aperture = aperture;
|
||||
packet->iso = iso;
|
||||
packet->exposure_type = exposure_type;
|
||||
packet->command_id = command_id;
|
||||
packet->engine_cut_off = engine_cut_off;
|
||||
packet->extra_param = extra_param;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DIGICAM_CONFIGURE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from digicam_configure message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from digicam_configure message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mode from digicam_configure message
|
||||
*
|
||||
* @return Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field shutter_speed from digicam_configure message
|
||||
*
|
||||
* @return Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_configure_get_shutter_speed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field aperture from digicam_configure message
|
||||
*
|
||||
* @return F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_aperture(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 9);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field iso from digicam_configure message
|
||||
*
|
||||
* @return ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_iso(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field exposure_type from digicam_configure message
|
||||
*
|
||||
* @return Exposure type enumeration from 1 to N (0 means ignore)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_exposure_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field command_id from digicam_configure message
|
||||
*
|
||||
* @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_command_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field engine_cut_off from digicam_configure message
|
||||
*
|
||||
* @return Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_engine_cut_off(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field extra_param from digicam_configure message
|
||||
*
|
||||
* @return Extra parameters enumeration (0 means ignore)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_configure_get_extra_param(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field extra_value from digicam_configure message
|
||||
*
|
||||
* @return Correspondent value to given extra_param
|
||||
*/
|
||||
static inline float mavlink_msg_digicam_configure_get_extra_value(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a digicam_configure message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param digicam_configure C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_digicam_configure_decode(const mavlink_message_t* msg, mavlink_digicam_configure_t* digicam_configure)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
digicam_configure->extra_value = mavlink_msg_digicam_configure_get_extra_value(msg);
|
||||
digicam_configure->shutter_speed = mavlink_msg_digicam_configure_get_shutter_speed(msg);
|
||||
digicam_configure->target_system = mavlink_msg_digicam_configure_get_target_system(msg);
|
||||
digicam_configure->target_component = mavlink_msg_digicam_configure_get_target_component(msg);
|
||||
digicam_configure->mode = mavlink_msg_digicam_configure_get_mode(msg);
|
||||
digicam_configure->aperture = mavlink_msg_digicam_configure_get_aperture(msg);
|
||||
digicam_configure->iso = mavlink_msg_digicam_configure_get_iso(msg);
|
||||
digicam_configure->exposure_type = mavlink_msg_digicam_configure_get_exposure_type(msg);
|
||||
digicam_configure->command_id = mavlink_msg_digicam_configure_get_command_id(msg);
|
||||
digicam_configure->engine_cut_off = mavlink_msg_digicam_configure_get_engine_cut_off(msg);
|
||||
digicam_configure->extra_param = mavlink_msg_digicam_configure_get_extra_param(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN? msg->len : MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN;
|
||||
memset(digicam_configure, 0, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
|
||||
memcpy(digicam_configure, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-438
@@ -1,438 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DIGICAM_CONTROL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DIGICAM_CONTROL 155
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_digicam_control_t {
|
||||
float extra_value; /*< Correspondent value to given extra_param*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t session; /*< 0: stop, 1: start or keep it up //Session control e.g. show/hide lens*/
|
||||
uint8_t zoom_pos; /*< 1 to N //Zoom's absolute position (0 means ignore)*/
|
||||
int8_t zoom_step; /*< -100 to 100 //Zooming step value to offset zoom from the current position*/
|
||||
uint8_t focus_lock; /*< 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus*/
|
||||
uint8_t shot; /*< 0: ignore, 1: shot or start filming*/
|
||||
uint8_t command_id; /*< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once*/
|
||||
uint8_t extra_param; /*< Extra parameters enumeration (0 means ignore)*/
|
||||
}) mavlink_digicam_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN 13
|
||||
#define MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN 13
|
||||
#define MAVLINK_MSG_ID_155_LEN 13
|
||||
#define MAVLINK_MSG_ID_155_MIN_LEN 13
|
||||
|
||||
#define MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC 22
|
||||
#define MAVLINK_MSG_ID_155_CRC 22
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \
|
||||
155, \
|
||||
"DIGICAM_CONTROL", \
|
||||
10, \
|
||||
{ { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_control_t, extra_value) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_digicam_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_control_t, target_component) }, \
|
||||
{ "session", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_control_t, session) }, \
|
||||
{ "zoom_pos", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_control_t, zoom_pos) }, \
|
||||
{ "zoom_step", NULL, MAVLINK_TYPE_INT8_T, 0, 8, offsetof(mavlink_digicam_control_t, zoom_step) }, \
|
||||
{ "focus_lock", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_control_t, focus_lock) }, \
|
||||
{ "shot", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_control_t, shot) }, \
|
||||
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_control_t, command_id) }, \
|
||||
{ "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_control_t, extra_param) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \
|
||||
"DIGICAM_CONTROL", \
|
||||
10, \
|
||||
{ { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_control_t, extra_value) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_digicam_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_control_t, target_component) }, \
|
||||
{ "session", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_control_t, session) }, \
|
||||
{ "zoom_pos", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_control_t, zoom_pos) }, \
|
||||
{ "zoom_step", NULL, MAVLINK_TYPE_INT8_T, 0, 8, offsetof(mavlink_digicam_control_t, zoom_step) }, \
|
||||
{ "focus_lock", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_control_t, focus_lock) }, \
|
||||
{ "shot", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_control_t, shot) }, \
|
||||
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_control_t, command_id) }, \
|
||||
{ "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_control_t, extra_param) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a digicam_control message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
|
||||
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore)
|
||||
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position
|
||||
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
|
||||
* @param shot 0: ignore, 1: shot or start filming
|
||||
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
|
||||
* @param extra_param Extra parameters enumeration (0 means ignore)
|
||||
* @param extra_value Correspondent value to given extra_param
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, extra_value);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, session);
|
||||
_mav_put_uint8_t(buf, 7, zoom_pos);
|
||||
_mav_put_int8_t(buf, 8, zoom_step);
|
||||
_mav_put_uint8_t(buf, 9, focus_lock);
|
||||
_mav_put_uint8_t(buf, 10, shot);
|
||||
_mav_put_uint8_t(buf, 11, command_id);
|
||||
_mav_put_uint8_t(buf, 12, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_digicam_control_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.session = session;
|
||||
packet.zoom_pos = zoom_pos;
|
||||
packet.zoom_step = zoom_step;
|
||||
packet.focus_lock = focus_lock;
|
||||
packet.shot = shot;
|
||||
packet.command_id = command_id;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a digicam_control message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
|
||||
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore)
|
||||
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position
|
||||
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
|
||||
* @param shot 0: ignore, 1: shot or start filming
|
||||
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
|
||||
* @param extra_param Extra parameters enumeration (0 means ignore)
|
||||
* @param extra_value Correspondent value to given extra_param
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t session,uint8_t zoom_pos,int8_t zoom_step,uint8_t focus_lock,uint8_t shot,uint8_t command_id,uint8_t extra_param,float extra_value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, extra_value);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, session);
|
||||
_mav_put_uint8_t(buf, 7, zoom_pos);
|
||||
_mav_put_int8_t(buf, 8, zoom_step);
|
||||
_mav_put_uint8_t(buf, 9, focus_lock);
|
||||
_mav_put_uint8_t(buf, 10, shot);
|
||||
_mav_put_uint8_t(buf, 11, command_id);
|
||||
_mav_put_uint8_t(buf, 12, extra_param);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_digicam_control_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.session = session;
|
||||
packet.zoom_pos = zoom_pos;
|
||||
packet.zoom_step = zoom_step;
|
||||
packet.focus_lock = focus_lock;
|
||||
packet.shot = shot;
|
||||
packet.command_id = command_id;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a digicam_control struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param digicam_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_control_t* digicam_control)
|
||||
{
|
||||
return mavlink_msg_digicam_control_pack(system_id, component_id, msg, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a digicam_control struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param digicam_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_digicam_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_digicam_control_t* digicam_control)
|
||||
{
|
||||
return mavlink_msg_digicam_control_pack_chan(system_id, component_id, chan, msg, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a digicam_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
|
||||
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore)
|
||||
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position
|
||||
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
|
||||
* @param shot 0: ignore, 1: shot or start filming
|
||||
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
|
||||
* @param extra_param Extra parameters enumeration (0 means ignore)
|
||||
* @param extra_value Correspondent value to given extra_param
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_digicam_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, extra_value);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, session);
|
||||
_mav_put_uint8_t(buf, 7, zoom_pos);
|
||||
_mav_put_int8_t(buf, 8, zoom_step);
|
||||
_mav_put_uint8_t(buf, 9, focus_lock);
|
||||
_mav_put_uint8_t(buf, 10, shot);
|
||||
_mav_put_uint8_t(buf, 11, command_id);
|
||||
_mav_put_uint8_t(buf, 12, extra_param);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_digicam_control_t packet;
|
||||
packet.extra_value = extra_value;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.session = session;
|
||||
packet.zoom_pos = zoom_pos;
|
||||
packet.zoom_step = zoom_step;
|
||||
packet.focus_lock = focus_lock;
|
||||
packet.shot = shot;
|
||||
packet.command_id = command_id;
|
||||
packet.extra_param = extra_param;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a digicam_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_digicam_control_send_struct(mavlink_channel_t chan, const mavlink_digicam_control_t* digicam_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_digicam_control_send(chan, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)digicam_control, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_digicam_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, extra_value);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, session);
|
||||
_mav_put_uint8_t(buf, 7, zoom_pos);
|
||||
_mav_put_int8_t(buf, 8, zoom_step);
|
||||
_mav_put_uint8_t(buf, 9, focus_lock);
|
||||
_mav_put_uint8_t(buf, 10, shot);
|
||||
_mav_put_uint8_t(buf, 11, command_id);
|
||||
_mav_put_uint8_t(buf, 12, extra_param);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_digicam_control_t *packet = (mavlink_digicam_control_t *)msgbuf;
|
||||
packet->extra_value = extra_value;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->session = session;
|
||||
packet->zoom_pos = zoom_pos;
|
||||
packet->zoom_step = zoom_step;
|
||||
packet->focus_lock = focus_lock;
|
||||
packet->shot = shot;
|
||||
packet->command_id = command_id;
|
||||
packet->extra_param = extra_param;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)packet, MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN, MAVLINK_MSG_ID_DIGICAM_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DIGICAM_CONTROL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from digicam_control message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_control_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from digicam_control message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_control_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field session from digicam_control message
|
||||
*
|
||||
* @return 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_control_get_session(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zoom_pos from digicam_control message
|
||||
*
|
||||
* @return 1 to N //Zoom's absolute position (0 means ignore)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_control_get_zoom_pos(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field zoom_step from digicam_control message
|
||||
*
|
||||
* @return -100 to 100 //Zooming step value to offset zoom from the current position
|
||||
*/
|
||||
static inline int8_t mavlink_msg_digicam_control_get_zoom_step(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field focus_lock from digicam_control message
|
||||
*
|
||||
* @return 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_control_get_focus_lock(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 9);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field shot from digicam_control message
|
||||
*
|
||||
* @return 0: ignore, 1: shot or start filming
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_control_get_shot(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field command_id from digicam_control message
|
||||
*
|
||||
* @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_control_get_command_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field extra_param from digicam_control message
|
||||
*
|
||||
* @return Extra parameters enumeration (0 means ignore)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_digicam_control_get_extra_param(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field extra_value from digicam_control message
|
||||
*
|
||||
* @return Correspondent value to given extra_param
|
||||
*/
|
||||
static inline float mavlink_msg_digicam_control_get_extra_value(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a digicam_control message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param digicam_control C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_digicam_control_decode(const mavlink_message_t* msg, mavlink_digicam_control_t* digicam_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
digicam_control->extra_value = mavlink_msg_digicam_control_get_extra_value(msg);
|
||||
digicam_control->target_system = mavlink_msg_digicam_control_get_target_system(msg);
|
||||
digicam_control->target_component = mavlink_msg_digicam_control_get_target_component(msg);
|
||||
digicam_control->session = mavlink_msg_digicam_control_get_session(msg);
|
||||
digicam_control->zoom_pos = mavlink_msg_digicam_control_get_zoom_pos(msg);
|
||||
digicam_control->zoom_step = mavlink_msg_digicam_control_get_zoom_step(msg);
|
||||
digicam_control->focus_lock = mavlink_msg_digicam_control_get_focus_lock(msg);
|
||||
digicam_control->shot = mavlink_msg_digicam_control_get_shot(msg);
|
||||
digicam_control->command_id = mavlink_msg_digicam_control_get_command_id(msg);
|
||||
digicam_control->extra_param = mavlink_msg_digicam_control_get_extra_param(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN;
|
||||
memset(digicam_control, 0, MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN);
|
||||
memcpy(digicam_control, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-338
@@ -1,338 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE EKF_STATUS_REPORT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_EKF_STATUS_REPORT 193
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_ekf_status_report_t {
|
||||
float velocity_variance; /*< Velocity variance*/
|
||||
float pos_horiz_variance; /*< Horizontal Position variance*/
|
||||
float pos_vert_variance; /*< Vertical Position variance*/
|
||||
float compass_variance; /*< Compass variance*/
|
||||
float terrain_alt_variance; /*< Terrain Altitude variance*/
|
||||
uint16_t flags; /*< Flags*/
|
||||
}) mavlink_ekf_status_report_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN 22
|
||||
#define MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN 22
|
||||
#define MAVLINK_MSG_ID_193_LEN 22
|
||||
#define MAVLINK_MSG_ID_193_MIN_LEN 22
|
||||
|
||||
#define MAVLINK_MSG_ID_EKF_STATUS_REPORT_CRC 71
|
||||
#define MAVLINK_MSG_ID_193_CRC 71
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_EKF_STATUS_REPORT { \
|
||||
193, \
|
||||
"EKF_STATUS_REPORT", \
|
||||
6, \
|
||||
{ { "velocity_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ekf_status_report_t, velocity_variance) }, \
|
||||
{ "pos_horiz_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ekf_status_report_t, pos_horiz_variance) }, \
|
||||
{ "pos_vert_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ekf_status_report_t, pos_vert_variance) }, \
|
||||
{ "compass_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ekf_status_report_t, compass_variance) }, \
|
||||
{ "terrain_alt_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_ekf_status_report_t, terrain_alt_variance) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_ekf_status_report_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_EKF_STATUS_REPORT { \
|
||||
"EKF_STATUS_REPORT", \
|
||||
6, \
|
||||
{ { "velocity_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ekf_status_report_t, velocity_variance) }, \
|
||||
{ "pos_horiz_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ekf_status_report_t, pos_horiz_variance) }, \
|
||||
{ "pos_vert_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ekf_status_report_t, pos_vert_variance) }, \
|
||||
{ "compass_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ekf_status_report_t, compass_variance) }, \
|
||||
{ "terrain_alt_variance", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_ekf_status_report_t, terrain_alt_variance) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_ekf_status_report_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a ekf_status_report 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 flags Flags
|
||||
* @param velocity_variance Velocity variance
|
||||
* @param pos_horiz_variance Horizontal Position variance
|
||||
* @param pos_vert_variance Vertical Position variance
|
||||
* @param compass_variance Compass variance
|
||||
* @param terrain_alt_variance Terrain Altitude variance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ekf_status_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t flags, float velocity_variance, float pos_horiz_variance, float pos_vert_variance, float compass_variance, float terrain_alt_variance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, velocity_variance);
|
||||
_mav_put_float(buf, 4, pos_horiz_variance);
|
||||
_mav_put_float(buf, 8, pos_vert_variance);
|
||||
_mav_put_float(buf, 12, compass_variance);
|
||||
_mav_put_float(buf, 16, terrain_alt_variance);
|
||||
_mav_put_uint16_t(buf, 20, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN);
|
||||
#else
|
||||
mavlink_ekf_status_report_t packet;
|
||||
packet.velocity_variance = velocity_variance;
|
||||
packet.pos_horiz_variance = pos_horiz_variance;
|
||||
packet.pos_vert_variance = pos_vert_variance;
|
||||
packet.compass_variance = compass_variance;
|
||||
packet.terrain_alt_variance = terrain_alt_variance;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_EKF_STATUS_REPORT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a ekf_status_report message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param flags Flags
|
||||
* @param velocity_variance Velocity variance
|
||||
* @param pos_horiz_variance Horizontal Position variance
|
||||
* @param pos_vert_variance Vertical Position variance
|
||||
* @param compass_variance Compass variance
|
||||
* @param terrain_alt_variance Terrain Altitude variance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ekf_status_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t flags,float velocity_variance,float pos_horiz_variance,float pos_vert_variance,float compass_variance,float terrain_alt_variance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, velocity_variance);
|
||||
_mav_put_float(buf, 4, pos_horiz_variance);
|
||||
_mav_put_float(buf, 8, pos_vert_variance);
|
||||
_mav_put_float(buf, 12, compass_variance);
|
||||
_mav_put_float(buf, 16, terrain_alt_variance);
|
||||
_mav_put_uint16_t(buf, 20, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN);
|
||||
#else
|
||||
mavlink_ekf_status_report_t packet;
|
||||
packet.velocity_variance = velocity_variance;
|
||||
packet.pos_horiz_variance = pos_horiz_variance;
|
||||
packet.pos_vert_variance = pos_vert_variance;
|
||||
packet.compass_variance = compass_variance;
|
||||
packet.terrain_alt_variance = terrain_alt_variance;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_EKF_STATUS_REPORT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ekf_status_report struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ekf_status_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ekf_status_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ekf_status_report_t* ekf_status_report)
|
||||
{
|
||||
return mavlink_msg_ekf_status_report_pack(system_id, component_id, msg, ekf_status_report->flags, ekf_status_report->velocity_variance, ekf_status_report->pos_horiz_variance, ekf_status_report->pos_vert_variance, ekf_status_report->compass_variance, ekf_status_report->terrain_alt_variance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a ekf_status_report struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ekf_status_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ekf_status_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_ekf_status_report_t* ekf_status_report)
|
||||
{
|
||||
return mavlink_msg_ekf_status_report_pack_chan(system_id, component_id, chan, msg, ekf_status_report->flags, ekf_status_report->velocity_variance, ekf_status_report->pos_horiz_variance, ekf_status_report->pos_vert_variance, ekf_status_report->compass_variance, ekf_status_report->terrain_alt_variance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ekf_status_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param flags Flags
|
||||
* @param velocity_variance Velocity variance
|
||||
* @param pos_horiz_variance Horizontal Position variance
|
||||
* @param pos_vert_variance Vertical Position variance
|
||||
* @param compass_variance Compass variance
|
||||
* @param terrain_alt_variance Terrain Altitude variance
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_ekf_status_report_send(mavlink_channel_t chan, uint16_t flags, float velocity_variance, float pos_horiz_variance, float pos_vert_variance, float compass_variance, float terrain_alt_variance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, velocity_variance);
|
||||
_mav_put_float(buf, 4, pos_horiz_variance);
|
||||
_mav_put_float(buf, 8, pos_vert_variance);
|
||||
_mav_put_float(buf, 12, compass_variance);
|
||||
_mav_put_float(buf, 16, terrain_alt_variance);
|
||||
_mav_put_uint16_t(buf, 20, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_STATUS_REPORT, buf, MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_CRC);
|
||||
#else
|
||||
mavlink_ekf_status_report_t packet;
|
||||
packet.velocity_variance = velocity_variance;
|
||||
packet.pos_horiz_variance = pos_horiz_variance;
|
||||
packet.pos_vert_variance = pos_vert_variance;
|
||||
packet.compass_variance = compass_variance;
|
||||
packet.terrain_alt_variance = terrain_alt_variance;
|
||||
packet.flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_STATUS_REPORT, (const char *)&packet, MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a ekf_status_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_ekf_status_report_send_struct(mavlink_channel_t chan, const mavlink_ekf_status_report_t* ekf_status_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_ekf_status_report_send(chan, ekf_status_report->flags, ekf_status_report->velocity_variance, ekf_status_report->pos_horiz_variance, ekf_status_report->pos_vert_variance, ekf_status_report->compass_variance, ekf_status_report->terrain_alt_variance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_STATUS_REPORT, (const char *)ekf_status_report, MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_ekf_status_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t flags, float velocity_variance, float pos_horiz_variance, float pos_vert_variance, float compass_variance, float terrain_alt_variance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, velocity_variance);
|
||||
_mav_put_float(buf, 4, pos_horiz_variance);
|
||||
_mav_put_float(buf, 8, pos_vert_variance);
|
||||
_mav_put_float(buf, 12, compass_variance);
|
||||
_mav_put_float(buf, 16, terrain_alt_variance);
|
||||
_mav_put_uint16_t(buf, 20, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_STATUS_REPORT, buf, MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_CRC);
|
||||
#else
|
||||
mavlink_ekf_status_report_t *packet = (mavlink_ekf_status_report_t *)msgbuf;
|
||||
packet->velocity_variance = velocity_variance;
|
||||
packet->pos_horiz_variance = pos_horiz_variance;
|
||||
packet->pos_vert_variance = pos_vert_variance;
|
||||
packet->compass_variance = compass_variance;
|
||||
packet->terrain_alt_variance = terrain_alt_variance;
|
||||
packet->flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EKF_STATUS_REPORT, (const char *)packet, MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN, MAVLINK_MSG_ID_EKF_STATUS_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE EKF_STATUS_REPORT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field flags from ekf_status_report message
|
||||
*
|
||||
* @return Flags
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_ekf_status_report_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field velocity_variance from ekf_status_report message
|
||||
*
|
||||
* @return Velocity variance
|
||||
*/
|
||||
static inline float mavlink_msg_ekf_status_report_get_velocity_variance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_horiz_variance from ekf_status_report message
|
||||
*
|
||||
* @return Horizontal Position variance
|
||||
*/
|
||||
static inline float mavlink_msg_ekf_status_report_get_pos_horiz_variance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_vert_variance from ekf_status_report message
|
||||
*
|
||||
* @return Vertical Position variance
|
||||
*/
|
||||
static inline float mavlink_msg_ekf_status_report_get_pos_vert_variance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field compass_variance from ekf_status_report message
|
||||
*
|
||||
* @return Compass variance
|
||||
*/
|
||||
static inline float mavlink_msg_ekf_status_report_get_compass_variance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field terrain_alt_variance from ekf_status_report message
|
||||
*
|
||||
* @return Terrain Altitude variance
|
||||
*/
|
||||
static inline float mavlink_msg_ekf_status_report_get_terrain_alt_variance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a ekf_status_report message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param ekf_status_report C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_ekf_status_report_decode(const mavlink_message_t* msg, mavlink_ekf_status_report_t* ekf_status_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
ekf_status_report->velocity_variance = mavlink_msg_ekf_status_report_get_velocity_variance(msg);
|
||||
ekf_status_report->pos_horiz_variance = mavlink_msg_ekf_status_report_get_pos_horiz_variance(msg);
|
||||
ekf_status_report->pos_vert_variance = mavlink_msg_ekf_status_report_get_pos_vert_variance(msg);
|
||||
ekf_status_report->compass_variance = mavlink_msg_ekf_status_report_get_compass_variance(msg);
|
||||
ekf_status_report->terrain_alt_variance = mavlink_msg_ekf_status_report_get_terrain_alt_variance(msg);
|
||||
ekf_status_report->flags = mavlink_msg_ekf_status_report_get_flags(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN? msg->len : MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN;
|
||||
memset(ekf_status_report, 0, MAVLINK_MSG_ID_EKF_STATUS_REPORT_LEN);
|
||||
memcpy(ekf_status_report, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-263
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE FENCE_FETCH_POINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT 161
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_fence_fetch_point_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t idx; /*< point index (first point is 1, 0 is for return point)*/
|
||||
}) mavlink_fence_fetch_point_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN 3
|
||||
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_161_LEN 3
|
||||
#define MAVLINK_MSG_ID_161_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC 68
|
||||
#define MAVLINK_MSG_ID_161_CRC 68
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT { \
|
||||
161, \
|
||||
"FENCE_FETCH_POINT", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_fetch_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_fetch_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_fetch_point_t, idx) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT { \
|
||||
"FENCE_FETCH_POINT", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_fetch_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_fetch_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_fetch_point_t, idx) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a fence_fetch_point message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 1, 0 is for return point)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN);
|
||||
#else
|
||||
mavlink_fence_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a fence_fetch_point message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 1, 0 is for return point)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN);
|
||||
#else
|
||||
mavlink_fence_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a fence_fetch_point struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param fence_fetch_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_fetch_point_t* fence_fetch_point)
|
||||
{
|
||||
return mavlink_msg_fence_fetch_point_pack(system_id, component_id, msg, fence_fetch_point->target_system, fence_fetch_point->target_component, fence_fetch_point->idx);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a fence_fetch_point struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param fence_fetch_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_fetch_point_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_fence_fetch_point_t* fence_fetch_point)
|
||||
{
|
||||
return mavlink_msg_fence_fetch_point_pack_chan(system_id, component_id, chan, msg, fence_fetch_point->target_system, fence_fetch_point->target_component, fence_fetch_point->idx);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a fence_fetch_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 1, 0 is for return point)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_fence_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC);
|
||||
#else
|
||||
mavlink_fence_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)&packet, MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a fence_fetch_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_fence_fetch_point_send_struct(mavlink_channel_t chan, const mavlink_fence_fetch_point_t* fence_fetch_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_fence_fetch_point_send(chan, fence_fetch_point->target_system, fence_fetch_point->target_component, fence_fetch_point->idx);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)fence_fetch_point, MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_fence_fetch_point_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC);
|
||||
#else
|
||||
mavlink_fence_fetch_point_t *packet = (mavlink_fence_fetch_point_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->idx = idx;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)packet, MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN, MAVLINK_MSG_ID_FENCE_FETCH_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FENCE_FETCH_POINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from fence_fetch_point message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_fetch_point_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from fence_fetch_point message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_fetch_point_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field idx from fence_fetch_point message
|
||||
*
|
||||
* @return point index (first point is 1, 0 is for return point)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_fetch_point_get_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a fence_fetch_point message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param fence_fetch_point C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_fence_fetch_point_decode(const mavlink_message_t* msg, mavlink_fence_fetch_point_t* fence_fetch_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
fence_fetch_point->target_system = mavlink_msg_fence_fetch_point_get_target_system(msg);
|
||||
fence_fetch_point->target_component = mavlink_msg_fence_fetch_point_get_target_component(msg);
|
||||
fence_fetch_point->idx = mavlink_msg_fence_fetch_point_get_idx(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN? msg->len : MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN;
|
||||
memset(fence_fetch_point, 0, MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN);
|
||||
memcpy(fence_fetch_point, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-338
@@ -1,338 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE FENCE_POINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_POINT 160
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_fence_point_t {
|
||||
float lat; /*< Latitude of point*/
|
||||
float lng; /*< Longitude of point*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t idx; /*< point index (first point is 1, 0 is for return point)*/
|
||||
uint8_t count; /*< total number of points (for sanity checking)*/
|
||||
}) mavlink_fence_point_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_POINT_LEN 12
|
||||
#define MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_160_LEN 12
|
||||
#define MAVLINK_MSG_ID_160_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_POINT_CRC 78
|
||||
#define MAVLINK_MSG_ID_160_CRC 78
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_FENCE_POINT { \
|
||||
160, \
|
||||
"FENCE_POINT", \
|
||||
6, \
|
||||
{ { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_fence_point_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fence_point_t, lng) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_fence_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_fence_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_fence_point_t, idx) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_fence_point_t, count) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FENCE_POINT { \
|
||||
"FENCE_POINT", \
|
||||
6, \
|
||||
{ { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_fence_point_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fence_point_t, lng) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_fence_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_fence_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_fence_point_t, idx) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_fence_point_t, count) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a fence_point message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 1, 0 is for return point)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point
|
||||
* @param lng Longitude of point
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_POINT_LEN];
|
||||
_mav_put_float(buf, 0, lat);
|
||||
_mav_put_float(buf, 4, lng);
|
||||
_mav_put_uint8_t(buf, 8, target_system);
|
||||
_mav_put_uint8_t(buf, 9, target_component);
|
||||
_mav_put_uint8_t(buf, 10, idx);
|
||||
_mav_put_uint8_t(buf, 11, count);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_POINT_LEN);
|
||||
#else
|
||||
mavlink_fence_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a fence_point message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 1, 0 is for return point)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point
|
||||
* @param lng Longitude of point
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t idx,uint8_t count,float lat,float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_POINT_LEN];
|
||||
_mav_put_float(buf, 0, lat);
|
||||
_mav_put_float(buf, 4, lng);
|
||||
_mav_put_uint8_t(buf, 8, target_system);
|
||||
_mav_put_uint8_t(buf, 9, target_component);
|
||||
_mav_put_uint8_t(buf, 10, idx);
|
||||
_mav_put_uint8_t(buf, 11, count);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_POINT_LEN);
|
||||
#else
|
||||
mavlink_fence_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a fence_point struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param fence_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_point_t* fence_point)
|
||||
{
|
||||
return mavlink_msg_fence_point_pack(system_id, component_id, msg, fence_point->target_system, fence_point->target_component, fence_point->idx, fence_point->count, fence_point->lat, fence_point->lng);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a fence_point struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param fence_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_point_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_fence_point_t* fence_point)
|
||||
{
|
||||
return mavlink_msg_fence_point_pack_chan(system_id, component_id, chan, msg, fence_point->target_system, fence_point->target_component, fence_point->idx, fence_point->count, fence_point->lat, fence_point->lng);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a fence_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 1, 0 is for return point)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point
|
||||
* @param lng Longitude of point
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_fence_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_POINT_LEN];
|
||||
_mav_put_float(buf, 0, lat);
|
||||
_mav_put_float(buf, 4, lng);
|
||||
_mav_put_uint8_t(buf, 8, target_system);
|
||||
_mav_put_uint8_t(buf, 9, target_component);
|
||||
_mav_put_uint8_t(buf, 10, idx);
|
||||
_mav_put_uint8_t(buf, 11, count);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
|
||||
#else
|
||||
mavlink_fence_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)&packet, MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a fence_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_fence_point_send_struct(mavlink_channel_t chan, const mavlink_fence_point_t* fence_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_fence_point_send(chan, fence_point->target_system, fence_point->target_component, fence_point->idx, fence_point->count, fence_point->lat, fence_point->lng);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)fence_point, MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_FENCE_POINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_fence_point_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, lat);
|
||||
_mav_put_float(buf, 4, lng);
|
||||
_mav_put_uint8_t(buf, 8, target_system);
|
||||
_mav_put_uint8_t(buf, 9, target_component);
|
||||
_mav_put_uint8_t(buf, 10, idx);
|
||||
_mav_put_uint8_t(buf, 11, count);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
|
||||
#else
|
||||
mavlink_fence_point_t *packet = (mavlink_fence_point_t *)msgbuf;
|
||||
packet->lat = lat;
|
||||
packet->lng = lng;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->idx = idx;
|
||||
packet->count = count;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)packet, MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FENCE_POINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from fence_point message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_point_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from fence_point message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_point_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 9);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field idx from fence_point message
|
||||
*
|
||||
* @return point index (first point is 1, 0 is for return point)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_point_get_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field count from fence_point message
|
||||
*
|
||||
* @return total number of points (for sanity checking)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_point_get_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from fence_point message
|
||||
*
|
||||
* @return Latitude of point
|
||||
*/
|
||||
static inline float mavlink_msg_fence_point_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from fence_point message
|
||||
*
|
||||
* @return Longitude of point
|
||||
*/
|
||||
static inline float mavlink_msg_fence_point_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a fence_point message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param fence_point C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_fence_point_decode(const mavlink_message_t* msg, mavlink_fence_point_t* fence_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
fence_point->lat = mavlink_msg_fence_point_get_lat(msg);
|
||||
fence_point->lng = mavlink_msg_fence_point_get_lng(msg);
|
||||
fence_point->target_system = mavlink_msg_fence_point_get_target_system(msg);
|
||||
fence_point->target_component = mavlink_msg_fence_point_get_target_component(msg);
|
||||
fence_point->idx = mavlink_msg_fence_point_get_idx(msg);
|
||||
fence_point->count = mavlink_msg_fence_point_get_count(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FENCE_POINT_LEN? msg->len : MAVLINK_MSG_ID_FENCE_POINT_LEN;
|
||||
memset(fence_point, 0, MAVLINK_MSG_ID_FENCE_POINT_LEN);
|
||||
memcpy(fence_point, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-288
@@ -1,288 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE FENCE_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_STATUS 162
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_fence_status_t {
|
||||
uint32_t breach_time; /*< time of last breach in milliseconds since boot*/
|
||||
uint16_t breach_count; /*< number of fence breaches*/
|
||||
uint8_t breach_status; /*< 0 if currently inside fence, 1 if outside*/
|
||||
uint8_t breach_type; /*< last breach type (see FENCE_BREACH_* enum)*/
|
||||
}) mavlink_fence_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_STATUS_LEN 8
|
||||
#define MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN 8
|
||||
#define MAVLINK_MSG_ID_162_LEN 8
|
||||
#define MAVLINK_MSG_ID_162_MIN_LEN 8
|
||||
|
||||
#define MAVLINK_MSG_ID_FENCE_STATUS_CRC 189
|
||||
#define MAVLINK_MSG_ID_162_CRC 189
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \
|
||||
162, \
|
||||
"FENCE_STATUS", \
|
||||
4, \
|
||||
{ { "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_fence_status_t, breach_time) }, \
|
||||
{ "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_fence_status_t, breach_count) }, \
|
||||
{ "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_fence_status_t, breach_status) }, \
|
||||
{ "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_fence_status_t, breach_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \
|
||||
"FENCE_STATUS", \
|
||||
4, \
|
||||
{ { "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_fence_status_t, breach_time) }, \
|
||||
{ "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_fence_status_t, breach_count) }, \
|
||||
{ "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_fence_status_t, breach_status) }, \
|
||||
{ "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_fence_status_t, breach_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a fence_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 breach_status 0 if currently inside fence, 1 if outside
|
||||
* @param breach_count number of fence breaches
|
||||
* @param breach_type last breach type (see FENCE_BREACH_* enum)
|
||||
* @param breach_time time of last breach in milliseconds since boot
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, breach_time);
|
||||
_mav_put_uint16_t(buf, 4, breach_count);
|
||||
_mav_put_uint8_t(buf, 6, breach_status);
|
||||
_mav_put_uint8_t(buf, 7, breach_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
|
||||
#else
|
||||
mavlink_fence_status_t packet;
|
||||
packet.breach_time = breach_time;
|
||||
packet.breach_count = breach_count;
|
||||
packet.breach_status = breach_status;
|
||||
packet.breach_type = breach_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a fence_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param breach_status 0 if currently inside fence, 1 if outside
|
||||
* @param breach_count number of fence breaches
|
||||
* @param breach_type last breach type (see FENCE_BREACH_* enum)
|
||||
* @param breach_time time of last breach in milliseconds since boot
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t breach_status,uint16_t breach_count,uint8_t breach_type,uint32_t breach_time)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, breach_time);
|
||||
_mav_put_uint16_t(buf, 4, breach_count);
|
||||
_mav_put_uint8_t(buf, 6, breach_status);
|
||||
_mav_put_uint8_t(buf, 7, breach_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
|
||||
#else
|
||||
mavlink_fence_status_t packet;
|
||||
packet.breach_time = breach_time;
|
||||
packet.breach_count = breach_count;
|
||||
packet.breach_status = breach_status;
|
||||
packet.breach_type = breach_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a fence_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param fence_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_status_t* fence_status)
|
||||
{
|
||||
return mavlink_msg_fence_status_pack(system_id, component_id, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a fence_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param fence_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_fence_status_t* fence_status)
|
||||
{
|
||||
return mavlink_msg_fence_status_pack_chan(system_id, component_id, chan, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a fence_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param breach_status 0 if currently inside fence, 1 if outside
|
||||
* @param breach_count number of fence breaches
|
||||
* @param breach_type last breach type (see FENCE_BREACH_* enum)
|
||||
* @param breach_time time of last breach in milliseconds since boot
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_fence_status_send(mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, breach_time);
|
||||
_mav_put_uint16_t(buf, 4, breach_count);
|
||||
_mav_put_uint8_t(buf, 6, breach_status);
|
||||
_mav_put_uint8_t(buf, 7, breach_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
|
||||
#else
|
||||
mavlink_fence_status_t packet;
|
||||
packet.breach_time = breach_time;
|
||||
packet.breach_count = breach_count;
|
||||
packet.breach_status = breach_status;
|
||||
packet.breach_type = breach_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a fence_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_fence_status_send_struct(mavlink_channel_t chan, const mavlink_fence_status_t* fence_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_fence_status_send(chan, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)fence_status, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_FENCE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_fence_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, breach_time);
|
||||
_mav_put_uint16_t(buf, 4, breach_count);
|
||||
_mav_put_uint8_t(buf, 6, breach_status);
|
||||
_mav_put_uint8_t(buf, 7, breach_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
|
||||
#else
|
||||
mavlink_fence_status_t *packet = (mavlink_fence_status_t *)msgbuf;
|
||||
packet->breach_time = breach_time;
|
||||
packet->breach_count = breach_count;
|
||||
packet->breach_status = breach_status;
|
||||
packet->breach_type = breach_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)packet, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FENCE_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field breach_status from fence_status message
|
||||
*
|
||||
* @return 0 if currently inside fence, 1 if outside
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_status_get_breach_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field breach_count from fence_status message
|
||||
*
|
||||
* @return number of fence breaches
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_fence_status_get_breach_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field breach_type from fence_status message
|
||||
*
|
||||
* @return last breach type (see FENCE_BREACH_* enum)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_fence_status_get_breach_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field breach_time from fence_status message
|
||||
*
|
||||
* @return time of last breach in milliseconds since boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_fence_status_get_breach_time(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a fence_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param fence_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_fence_status_decode(const mavlink_message_t* msg, mavlink_fence_status_t* fence_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
fence_status->breach_time = mavlink_msg_fence_status_get_breach_time(msg);
|
||||
fence_status->breach_count = mavlink_msg_fence_status_get_breach_count(msg);
|
||||
fence_status->breach_status = mavlink_msg_fence_status_get_breach_status(msg);
|
||||
fence_status->breach_type = mavlink_msg_fence_status_get_breach_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FENCE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_FENCE_STATUS_LEN;
|
||||
memset(fence_status, 0, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
|
||||
memcpy(fence_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-313
@@ -1,313 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GIMBAL_CONTROL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_CONTROL 201
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gimbal_control_t {
|
||||
float demanded_rate_x; /*< Demanded angular rate X (rad/s)*/
|
||||
float demanded_rate_y; /*< Demanded angular rate Y (rad/s)*/
|
||||
float demanded_rate_z; /*< Demanded angular rate Z (rad/s)*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_gimbal_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN 14
|
||||
#define MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN 14
|
||||
#define MAVLINK_MSG_ID_201_LEN 14
|
||||
#define MAVLINK_MSG_ID_201_MIN_LEN 14
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC 205
|
||||
#define MAVLINK_MSG_ID_201_CRC 205
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GIMBAL_CONTROL { \
|
||||
201, \
|
||||
"GIMBAL_CONTROL", \
|
||||
5, \
|
||||
{ { "demanded_rate_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_gimbal_control_t, demanded_rate_x) }, \
|
||||
{ "demanded_rate_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_gimbal_control_t, demanded_rate_y) }, \
|
||||
{ "demanded_rate_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_control_t, demanded_rate_z) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_gimbal_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_gimbal_control_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GIMBAL_CONTROL { \
|
||||
"GIMBAL_CONTROL", \
|
||||
5, \
|
||||
{ { "demanded_rate_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_gimbal_control_t, demanded_rate_x) }, \
|
||||
{ "demanded_rate_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_gimbal_control_t, demanded_rate_y) }, \
|
||||
{ "demanded_rate_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_control_t, demanded_rate_z) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_gimbal_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_gimbal_control_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_control message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param demanded_rate_x Demanded angular rate X (rad/s)
|
||||
* @param demanded_rate_y Demanded angular rate Y (rad/s)
|
||||
* @param demanded_rate_z Demanded angular rate Z (rad/s)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, float demanded_rate_x, float demanded_rate_y, float demanded_rate_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, demanded_rate_x);
|
||||
_mav_put_float(buf, 4, demanded_rate_y);
|
||||
_mav_put_float(buf, 8, demanded_rate_z);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_gimbal_control_t packet;
|
||||
packet.demanded_rate_x = demanded_rate_x;
|
||||
packet.demanded_rate_y = demanded_rate_y;
|
||||
packet.demanded_rate_z = demanded_rate_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_control message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param demanded_rate_x Demanded angular rate X (rad/s)
|
||||
* @param demanded_rate_y Demanded angular rate Y (rad/s)
|
||||
* @param demanded_rate_z Demanded angular rate Z (rad/s)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,float demanded_rate_x,float demanded_rate_y,float demanded_rate_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, demanded_rate_x);
|
||||
_mav_put_float(buf, 4, demanded_rate_y);
|
||||
_mav_put_float(buf, 8, demanded_rate_z);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_gimbal_control_t packet;
|
||||
packet.demanded_rate_x = demanded_rate_x;
|
||||
packet.demanded_rate_y = demanded_rate_y;
|
||||
packet.demanded_rate_z = demanded_rate_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_control struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gimbal_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_control_t* gimbal_control)
|
||||
{
|
||||
return mavlink_msg_gimbal_control_pack(system_id, component_id, msg, gimbal_control->target_system, gimbal_control->target_component, gimbal_control->demanded_rate_x, gimbal_control->demanded_rate_y, gimbal_control->demanded_rate_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_control struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gimbal_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_control_t* gimbal_control)
|
||||
{
|
||||
return mavlink_msg_gimbal_control_pack_chan(system_id, component_id, chan, msg, gimbal_control->target_system, gimbal_control->target_component, gimbal_control->demanded_rate_x, gimbal_control->demanded_rate_y, gimbal_control->demanded_rate_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gimbal_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param demanded_rate_x Demanded angular rate X (rad/s)
|
||||
* @param demanded_rate_y Demanded angular rate Y (rad/s)
|
||||
* @param demanded_rate_z Demanded angular rate Z (rad/s)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gimbal_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float demanded_rate_x, float demanded_rate_y, float demanded_rate_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN];
|
||||
_mav_put_float(buf, 0, demanded_rate_x);
|
||||
_mav_put_float(buf, 4, demanded_rate_y);
|
||||
_mav_put_float(buf, 8, demanded_rate_z);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_gimbal_control_t packet;
|
||||
packet.demanded_rate_x = demanded_rate_x;
|
||||
packet.demanded_rate_y = demanded_rate_y;
|
||||
packet.demanded_rate_z = demanded_rate_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gimbal_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_control_send_struct(mavlink_channel_t chan, const mavlink_gimbal_control_t* gimbal_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gimbal_control_send(chan, gimbal_control->target_system, gimbal_control->target_component, gimbal_control->demanded_rate_x, gimbal_control->demanded_rate_y, gimbal_control->demanded_rate_z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, (const char *)gimbal_control, MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float demanded_rate_x, float demanded_rate_y, float demanded_rate_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, demanded_rate_x);
|
||||
_mav_put_float(buf, 4, demanded_rate_y);
|
||||
_mav_put_float(buf, 8, demanded_rate_z);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, buf, MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_gimbal_control_t *packet = (mavlink_gimbal_control_t *)msgbuf;
|
||||
packet->demanded_rate_x = demanded_rate_x;
|
||||
packet->demanded_rate_y = demanded_rate_y;
|
||||
packet->demanded_rate_z = demanded_rate_z;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_CONTROL, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN, MAVLINK_MSG_ID_GIMBAL_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GIMBAL_CONTROL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from gimbal_control message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gimbal_control_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from gimbal_control message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gimbal_control_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field demanded_rate_x from gimbal_control message
|
||||
*
|
||||
* @return Demanded angular rate X (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_demanded_rate_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field demanded_rate_y from gimbal_control message
|
||||
*
|
||||
* @return Demanded angular rate Y (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_demanded_rate_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field demanded_rate_z from gimbal_control message
|
||||
*
|
||||
* @return Demanded angular rate Z (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_control_get_demanded_rate_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gimbal_control message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gimbal_control C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_control_decode(const mavlink_message_t* msg, mavlink_gimbal_control_t* gimbal_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gimbal_control->demanded_rate_x = mavlink_msg_gimbal_control_get_demanded_rate_x(msg);
|
||||
gimbal_control->demanded_rate_y = mavlink_msg_gimbal_control_get_demanded_rate_y(msg);
|
||||
gimbal_control->demanded_rate_z = mavlink_msg_gimbal_control_get_demanded_rate_z(msg);
|
||||
gimbal_control->target_system = mavlink_msg_gimbal_control_get_target_system(msg);
|
||||
gimbal_control->target_component = mavlink_msg_gimbal_control_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN;
|
||||
memset(gimbal_control, 0, MAVLINK_MSG_ID_GIMBAL_CONTROL_LEN);
|
||||
memcpy(gimbal_control, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-488
@@ -1,488 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GIMBAL_REPORT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_REPORT 200
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gimbal_report_t {
|
||||
float delta_time; /*< Time since last update (seconds)*/
|
||||
float delta_angle_x; /*< Delta angle X (radians)*/
|
||||
float delta_angle_y; /*< Delta angle Y (radians)*/
|
||||
float delta_angle_z; /*< Delta angle X (radians)*/
|
||||
float delta_velocity_x; /*< Delta velocity X (m/s)*/
|
||||
float delta_velocity_y; /*< Delta velocity Y (m/s)*/
|
||||
float delta_velocity_z; /*< Delta velocity Z (m/s)*/
|
||||
float joint_roll; /*< Joint ROLL (radians)*/
|
||||
float joint_el; /*< Joint EL (radians)*/
|
||||
float joint_az; /*< Joint AZ (radians)*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_gimbal_report_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_REPORT_LEN 42
|
||||
#define MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN 42
|
||||
#define MAVLINK_MSG_ID_200_LEN 42
|
||||
#define MAVLINK_MSG_ID_200_MIN_LEN 42
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_REPORT_CRC 134
|
||||
#define MAVLINK_MSG_ID_200_CRC 134
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GIMBAL_REPORT { \
|
||||
200, \
|
||||
"GIMBAL_REPORT", \
|
||||
12, \
|
||||
{ { "delta_time", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_gimbal_report_t, delta_time) }, \
|
||||
{ "delta_angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_gimbal_report_t, delta_angle_x) }, \
|
||||
{ "delta_angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_report_t, delta_angle_y) }, \
|
||||
{ "delta_angle_z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_gimbal_report_t, delta_angle_z) }, \
|
||||
{ "delta_velocity_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_report_t, delta_velocity_x) }, \
|
||||
{ "delta_velocity_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_report_t, delta_velocity_y) }, \
|
||||
{ "delta_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_report_t, delta_velocity_z) }, \
|
||||
{ "joint_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_report_t, joint_roll) }, \
|
||||
{ "joint_el", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gimbal_report_t, joint_el) }, \
|
||||
{ "joint_az", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gimbal_report_t, joint_az) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_gimbal_report_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_gimbal_report_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GIMBAL_REPORT { \
|
||||
"GIMBAL_REPORT", \
|
||||
12, \
|
||||
{ { "delta_time", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_gimbal_report_t, delta_time) }, \
|
||||
{ "delta_angle_x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_gimbal_report_t, delta_angle_x) }, \
|
||||
{ "delta_angle_y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_gimbal_report_t, delta_angle_y) }, \
|
||||
{ "delta_angle_z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_gimbal_report_t, delta_angle_z) }, \
|
||||
{ "delta_velocity_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_gimbal_report_t, delta_velocity_x) }, \
|
||||
{ "delta_velocity_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_report_t, delta_velocity_y) }, \
|
||||
{ "delta_velocity_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_report_t, delta_velocity_z) }, \
|
||||
{ "joint_roll", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_report_t, joint_roll) }, \
|
||||
{ "joint_el", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gimbal_report_t, joint_el) }, \
|
||||
{ "joint_az", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gimbal_report_t, joint_az) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_gimbal_report_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_gimbal_report_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_report message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param delta_time Time since last update (seconds)
|
||||
* @param delta_angle_x Delta angle X (radians)
|
||||
* @param delta_angle_y Delta angle Y (radians)
|
||||
* @param delta_angle_z Delta angle X (radians)
|
||||
* @param delta_velocity_x Delta velocity X (m/s)
|
||||
* @param delta_velocity_y Delta velocity Y (m/s)
|
||||
* @param delta_velocity_z Delta velocity Z (m/s)
|
||||
* @param joint_roll Joint ROLL (radians)
|
||||
* @param joint_el Joint EL (radians)
|
||||
* @param joint_az Joint AZ (radians)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, float delta_time, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_roll, float joint_el, float joint_az)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, delta_time);
|
||||
_mav_put_float(buf, 4, delta_angle_x);
|
||||
_mav_put_float(buf, 8, delta_angle_y);
|
||||
_mav_put_float(buf, 12, delta_angle_z);
|
||||
_mav_put_float(buf, 16, delta_velocity_x);
|
||||
_mav_put_float(buf, 20, delta_velocity_y);
|
||||
_mav_put_float(buf, 24, delta_velocity_z);
|
||||
_mav_put_float(buf, 28, joint_roll);
|
||||
_mav_put_float(buf, 32, joint_el);
|
||||
_mav_put_float(buf, 36, joint_az);
|
||||
_mav_put_uint8_t(buf, 40, target_system);
|
||||
_mav_put_uint8_t(buf, 41, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#else
|
||||
mavlink_gimbal_report_t packet;
|
||||
packet.delta_time = delta_time;
|
||||
packet.delta_angle_x = delta_angle_x;
|
||||
packet.delta_angle_y = delta_angle_y;
|
||||
packet.delta_angle_z = delta_angle_z;
|
||||
packet.delta_velocity_x = delta_velocity_x;
|
||||
packet.delta_velocity_y = delta_velocity_y;
|
||||
packet.delta_velocity_z = delta_velocity_z;
|
||||
packet.joint_roll = joint_roll;
|
||||
packet.joint_el = joint_el;
|
||||
packet.joint_az = joint_az;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_REPORT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_report message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param delta_time Time since last update (seconds)
|
||||
* @param delta_angle_x Delta angle X (radians)
|
||||
* @param delta_angle_y Delta angle Y (radians)
|
||||
* @param delta_angle_z Delta angle X (radians)
|
||||
* @param delta_velocity_x Delta velocity X (m/s)
|
||||
* @param delta_velocity_y Delta velocity Y (m/s)
|
||||
* @param delta_velocity_z Delta velocity Z (m/s)
|
||||
* @param joint_roll Joint ROLL (radians)
|
||||
* @param joint_el Joint EL (radians)
|
||||
* @param joint_az Joint AZ (radians)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,float delta_time,float delta_angle_x,float delta_angle_y,float delta_angle_z,float delta_velocity_x,float delta_velocity_y,float delta_velocity_z,float joint_roll,float joint_el,float joint_az)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, delta_time);
|
||||
_mav_put_float(buf, 4, delta_angle_x);
|
||||
_mav_put_float(buf, 8, delta_angle_y);
|
||||
_mav_put_float(buf, 12, delta_angle_z);
|
||||
_mav_put_float(buf, 16, delta_velocity_x);
|
||||
_mav_put_float(buf, 20, delta_velocity_y);
|
||||
_mav_put_float(buf, 24, delta_velocity_z);
|
||||
_mav_put_float(buf, 28, joint_roll);
|
||||
_mav_put_float(buf, 32, joint_el);
|
||||
_mav_put_float(buf, 36, joint_az);
|
||||
_mav_put_uint8_t(buf, 40, target_system);
|
||||
_mav_put_uint8_t(buf, 41, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#else
|
||||
mavlink_gimbal_report_t packet;
|
||||
packet.delta_time = delta_time;
|
||||
packet.delta_angle_x = delta_angle_x;
|
||||
packet.delta_angle_y = delta_angle_y;
|
||||
packet.delta_angle_z = delta_angle_z;
|
||||
packet.delta_velocity_x = delta_velocity_x;
|
||||
packet.delta_velocity_y = delta_velocity_y;
|
||||
packet.delta_velocity_z = delta_velocity_z;
|
||||
packet.joint_roll = joint_roll;
|
||||
packet.joint_el = joint_el;
|
||||
packet.joint_az = joint_az;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_REPORT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_report struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gimbal_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_report_t* gimbal_report)
|
||||
{
|
||||
return mavlink_msg_gimbal_report_pack(system_id, component_id, msg, gimbal_report->target_system, gimbal_report->target_component, gimbal_report->delta_time, gimbal_report->delta_angle_x, gimbal_report->delta_angle_y, gimbal_report->delta_angle_z, gimbal_report->delta_velocity_x, gimbal_report->delta_velocity_y, gimbal_report->delta_velocity_z, gimbal_report->joint_roll, gimbal_report->joint_el, gimbal_report->joint_az);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_report struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gimbal_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_report_t* gimbal_report)
|
||||
{
|
||||
return mavlink_msg_gimbal_report_pack_chan(system_id, component_id, chan, msg, gimbal_report->target_system, gimbal_report->target_component, gimbal_report->delta_time, gimbal_report->delta_angle_x, gimbal_report->delta_angle_y, gimbal_report->delta_angle_z, gimbal_report->delta_velocity_x, gimbal_report->delta_velocity_y, gimbal_report->delta_velocity_z, gimbal_report->joint_roll, gimbal_report->joint_el, gimbal_report->joint_az);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gimbal_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param delta_time Time since last update (seconds)
|
||||
* @param delta_angle_x Delta angle X (radians)
|
||||
* @param delta_angle_y Delta angle Y (radians)
|
||||
* @param delta_angle_z Delta angle X (radians)
|
||||
* @param delta_velocity_x Delta velocity X (m/s)
|
||||
* @param delta_velocity_y Delta velocity Y (m/s)
|
||||
* @param delta_velocity_z Delta velocity Z (m/s)
|
||||
* @param joint_roll Joint ROLL (radians)
|
||||
* @param joint_el Joint EL (radians)
|
||||
* @param joint_az Joint AZ (radians)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gimbal_report_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float delta_time, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_roll, float joint_el, float joint_az)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, delta_time);
|
||||
_mav_put_float(buf, 4, delta_angle_x);
|
||||
_mav_put_float(buf, 8, delta_angle_y);
|
||||
_mav_put_float(buf, 12, delta_angle_z);
|
||||
_mav_put_float(buf, 16, delta_velocity_x);
|
||||
_mav_put_float(buf, 20, delta_velocity_y);
|
||||
_mav_put_float(buf, 24, delta_velocity_z);
|
||||
_mav_put_float(buf, 28, joint_roll);
|
||||
_mav_put_float(buf, 32, joint_el);
|
||||
_mav_put_float(buf, 36, joint_az);
|
||||
_mav_put_uint8_t(buf, 40, target_system);
|
||||
_mav_put_uint8_t(buf, 41, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#else
|
||||
mavlink_gimbal_report_t packet;
|
||||
packet.delta_time = delta_time;
|
||||
packet.delta_angle_x = delta_angle_x;
|
||||
packet.delta_angle_y = delta_angle_y;
|
||||
packet.delta_angle_z = delta_angle_z;
|
||||
packet.delta_velocity_x = delta_velocity_x;
|
||||
packet.delta_velocity_y = delta_velocity_y;
|
||||
packet.delta_velocity_z = delta_velocity_z;
|
||||
packet.joint_roll = joint_roll;
|
||||
packet.joint_el = joint_el;
|
||||
packet.joint_az = joint_az;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gimbal_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_report_send_struct(mavlink_channel_t chan, const mavlink_gimbal_report_t* gimbal_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gimbal_report_send(chan, gimbal_report->target_system, gimbal_report->target_component, gimbal_report->delta_time, gimbal_report->delta_angle_x, gimbal_report->delta_angle_y, gimbal_report->delta_angle_z, gimbal_report->delta_velocity_x, gimbal_report->delta_velocity_y, gimbal_report->delta_velocity_z, gimbal_report->joint_roll, gimbal_report->joint_el, gimbal_report->joint_az);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)gimbal_report, MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GIMBAL_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float delta_time, float delta_angle_x, float delta_angle_y, float delta_angle_z, float delta_velocity_x, float delta_velocity_y, float delta_velocity_z, float joint_roll, float joint_el, float joint_az)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, delta_time);
|
||||
_mav_put_float(buf, 4, delta_angle_x);
|
||||
_mav_put_float(buf, 8, delta_angle_y);
|
||||
_mav_put_float(buf, 12, delta_angle_z);
|
||||
_mav_put_float(buf, 16, delta_velocity_x);
|
||||
_mav_put_float(buf, 20, delta_velocity_y);
|
||||
_mav_put_float(buf, 24, delta_velocity_z);
|
||||
_mav_put_float(buf, 28, joint_roll);
|
||||
_mav_put_float(buf, 32, joint_el);
|
||||
_mav_put_float(buf, 36, joint_az);
|
||||
_mav_put_uint8_t(buf, 40, target_system);
|
||||
_mav_put_uint8_t(buf, 41, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#else
|
||||
mavlink_gimbal_report_t *packet = (mavlink_gimbal_report_t *)msgbuf;
|
||||
packet->delta_time = delta_time;
|
||||
packet->delta_angle_x = delta_angle_x;
|
||||
packet->delta_angle_y = delta_angle_y;
|
||||
packet->delta_angle_z = delta_angle_z;
|
||||
packet->delta_velocity_x = delta_velocity_x;
|
||||
packet->delta_velocity_y = delta_velocity_y;
|
||||
packet->delta_velocity_z = delta_velocity_z;
|
||||
packet->joint_roll = joint_roll;
|
||||
packet->joint_el = joint_el;
|
||||
packet->joint_az = joint_az;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_REPORT, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GIMBAL_REPORT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from gimbal_report message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gimbal_report_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from gimbal_report message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gimbal_report_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 41);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_time from gimbal_report message
|
||||
*
|
||||
* @return Time since last update (seconds)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_time(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_angle_x from gimbal_report message
|
||||
*
|
||||
* @return Delta angle X (radians)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_angle_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_angle_y from gimbal_report message
|
||||
*
|
||||
* @return Delta angle Y (radians)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_angle_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_angle_z from gimbal_report message
|
||||
*
|
||||
* @return Delta angle X (radians)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_angle_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_velocity_x from gimbal_report message
|
||||
*
|
||||
* @return Delta velocity X (m/s)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_velocity_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_velocity_y from gimbal_report message
|
||||
*
|
||||
* @return Delta velocity Y (m/s)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_velocity_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field delta_velocity_z from gimbal_report message
|
||||
*
|
||||
* @return Delta velocity Z (m/s)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_delta_velocity_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field joint_roll from gimbal_report message
|
||||
*
|
||||
* @return Joint ROLL (radians)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_joint_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field joint_el from gimbal_report message
|
||||
*
|
||||
* @return Joint EL (radians)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_joint_el(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field joint_az from gimbal_report message
|
||||
*
|
||||
* @return Joint AZ (radians)
|
||||
*/
|
||||
static inline float mavlink_msg_gimbal_report_get_joint_az(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gimbal_report message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gimbal_report C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_report_decode(const mavlink_message_t* msg, mavlink_gimbal_report_t* gimbal_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gimbal_report->delta_time = mavlink_msg_gimbal_report_get_delta_time(msg);
|
||||
gimbal_report->delta_angle_x = mavlink_msg_gimbal_report_get_delta_angle_x(msg);
|
||||
gimbal_report->delta_angle_y = mavlink_msg_gimbal_report_get_delta_angle_y(msg);
|
||||
gimbal_report->delta_angle_z = mavlink_msg_gimbal_report_get_delta_angle_z(msg);
|
||||
gimbal_report->delta_velocity_x = mavlink_msg_gimbal_report_get_delta_velocity_x(msg);
|
||||
gimbal_report->delta_velocity_y = mavlink_msg_gimbal_report_get_delta_velocity_y(msg);
|
||||
gimbal_report->delta_velocity_z = mavlink_msg_gimbal_report_get_delta_velocity_z(msg);
|
||||
gimbal_report->joint_roll = mavlink_msg_gimbal_report_get_joint_roll(msg);
|
||||
gimbal_report->joint_el = mavlink_msg_gimbal_report_get_joint_el(msg);
|
||||
gimbal_report->joint_az = mavlink_msg_gimbal_report_get_joint_az(msg);
|
||||
gimbal_report->target_system = mavlink_msg_gimbal_report_get_target_system(msg);
|
||||
gimbal_report->target_component = mavlink_msg_gimbal_report_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GIMBAL_REPORT_LEN? msg->len : MAVLINK_MSG_ID_GIMBAL_REPORT_LEN;
|
||||
memset(gimbal_report, 0, MAVLINK_MSG_ID_GIMBAL_REPORT_LEN);
|
||||
memcpy(gimbal_report, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-313
@@ -1,313 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GIMBAL_TORQUE_CMD_REPORT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT 214
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gimbal_torque_cmd_report_t {
|
||||
int16_t rl_torque_cmd; /*< Roll Torque Command*/
|
||||
int16_t el_torque_cmd; /*< Elevation Torque Command*/
|
||||
int16_t az_torque_cmd; /*< Azimuth Torque Command*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_gimbal_torque_cmd_report_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN 8
|
||||
#define MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN 8
|
||||
#define MAVLINK_MSG_ID_214_LEN 8
|
||||
#define MAVLINK_MSG_ID_214_MIN_LEN 8
|
||||
|
||||
#define MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_CRC 69
|
||||
#define MAVLINK_MSG_ID_214_CRC 69
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GIMBAL_TORQUE_CMD_REPORT { \
|
||||
214, \
|
||||
"GIMBAL_TORQUE_CMD_REPORT", \
|
||||
5, \
|
||||
{ { "rl_torque_cmd", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_gimbal_torque_cmd_report_t, rl_torque_cmd) }, \
|
||||
{ "el_torque_cmd", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_gimbal_torque_cmd_report_t, el_torque_cmd) }, \
|
||||
{ "az_torque_cmd", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_gimbal_torque_cmd_report_t, az_torque_cmd) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_gimbal_torque_cmd_report_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_gimbal_torque_cmd_report_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GIMBAL_TORQUE_CMD_REPORT { \
|
||||
"GIMBAL_TORQUE_CMD_REPORT", \
|
||||
5, \
|
||||
{ { "rl_torque_cmd", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_gimbal_torque_cmd_report_t, rl_torque_cmd) }, \
|
||||
{ "el_torque_cmd", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_gimbal_torque_cmd_report_t, el_torque_cmd) }, \
|
||||
{ "az_torque_cmd", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_gimbal_torque_cmd_report_t, az_torque_cmd) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_gimbal_torque_cmd_report_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_gimbal_torque_cmd_report_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_torque_cmd_report message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param rl_torque_cmd Roll Torque Command
|
||||
* @param el_torque_cmd Elevation Torque Command
|
||||
* @param az_torque_cmd Azimuth Torque Command
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_torque_cmd_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, int16_t rl_torque_cmd, int16_t el_torque_cmd, int16_t az_torque_cmd)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN];
|
||||
_mav_put_int16_t(buf, 0, rl_torque_cmd);
|
||||
_mav_put_int16_t(buf, 2, el_torque_cmd);
|
||||
_mav_put_int16_t(buf, 4, az_torque_cmd);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN);
|
||||
#else
|
||||
mavlink_gimbal_torque_cmd_report_t packet;
|
||||
packet.rl_torque_cmd = rl_torque_cmd;
|
||||
packet.el_torque_cmd = el_torque_cmd;
|
||||
packet.az_torque_cmd = az_torque_cmd;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gimbal_torque_cmd_report message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param rl_torque_cmd Roll Torque Command
|
||||
* @param el_torque_cmd Elevation Torque Command
|
||||
* @param az_torque_cmd Azimuth Torque Command
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_torque_cmd_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,int16_t rl_torque_cmd,int16_t el_torque_cmd,int16_t az_torque_cmd)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN];
|
||||
_mav_put_int16_t(buf, 0, rl_torque_cmd);
|
||||
_mav_put_int16_t(buf, 2, el_torque_cmd);
|
||||
_mav_put_int16_t(buf, 4, az_torque_cmd);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN);
|
||||
#else
|
||||
mavlink_gimbal_torque_cmd_report_t packet;
|
||||
packet.rl_torque_cmd = rl_torque_cmd;
|
||||
packet.el_torque_cmd = el_torque_cmd;
|
||||
packet.az_torque_cmd = az_torque_cmd;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_torque_cmd_report struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gimbal_torque_cmd_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_torque_cmd_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_torque_cmd_report_t* gimbal_torque_cmd_report)
|
||||
{
|
||||
return mavlink_msg_gimbal_torque_cmd_report_pack(system_id, component_id, msg, gimbal_torque_cmd_report->target_system, gimbal_torque_cmd_report->target_component, gimbal_torque_cmd_report->rl_torque_cmd, gimbal_torque_cmd_report->el_torque_cmd, gimbal_torque_cmd_report->az_torque_cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gimbal_torque_cmd_report struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gimbal_torque_cmd_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gimbal_torque_cmd_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_torque_cmd_report_t* gimbal_torque_cmd_report)
|
||||
{
|
||||
return mavlink_msg_gimbal_torque_cmd_report_pack_chan(system_id, component_id, chan, msg, gimbal_torque_cmd_report->target_system, gimbal_torque_cmd_report->target_component, gimbal_torque_cmd_report->rl_torque_cmd, gimbal_torque_cmd_report->el_torque_cmd, gimbal_torque_cmd_report->az_torque_cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gimbal_torque_cmd_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param rl_torque_cmd Roll Torque Command
|
||||
* @param el_torque_cmd Elevation Torque Command
|
||||
* @param az_torque_cmd Azimuth Torque Command
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gimbal_torque_cmd_report_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t rl_torque_cmd, int16_t el_torque_cmd, int16_t az_torque_cmd)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN];
|
||||
_mav_put_int16_t(buf, 0, rl_torque_cmd);
|
||||
_mav_put_int16_t(buf, 2, el_torque_cmd);
|
||||
_mav_put_int16_t(buf, 4, az_torque_cmd);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_CRC);
|
||||
#else
|
||||
mavlink_gimbal_torque_cmd_report_t packet;
|
||||
packet.rl_torque_cmd = rl_torque_cmd;
|
||||
packet.el_torque_cmd = el_torque_cmd;
|
||||
packet.az_torque_cmd = az_torque_cmd;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gimbal_torque_cmd_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_torque_cmd_report_send_struct(mavlink_channel_t chan, const mavlink_gimbal_torque_cmd_report_t* gimbal_torque_cmd_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gimbal_torque_cmd_report_send(chan, gimbal_torque_cmd_report->target_system, gimbal_torque_cmd_report->target_component, gimbal_torque_cmd_report->rl_torque_cmd, gimbal_torque_cmd_report->el_torque_cmd, gimbal_torque_cmd_report->az_torque_cmd);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT, (const char *)gimbal_torque_cmd_report, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_torque_cmd_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t rl_torque_cmd, int16_t el_torque_cmd, int16_t az_torque_cmd)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int16_t(buf, 0, rl_torque_cmd);
|
||||
_mav_put_int16_t(buf, 2, el_torque_cmd);
|
||||
_mav_put_int16_t(buf, 4, az_torque_cmd);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT, buf, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_CRC);
|
||||
#else
|
||||
mavlink_gimbal_torque_cmd_report_t *packet = (mavlink_gimbal_torque_cmd_report_t *)msgbuf;
|
||||
packet->rl_torque_cmd = rl_torque_cmd;
|
||||
packet->el_torque_cmd = el_torque_cmd;
|
||||
packet->az_torque_cmd = az_torque_cmd;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GIMBAL_TORQUE_CMD_REPORT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from gimbal_torque_cmd_report message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gimbal_torque_cmd_report_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from gimbal_torque_cmd_report message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gimbal_torque_cmd_report_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rl_torque_cmd from gimbal_torque_cmd_report message
|
||||
*
|
||||
* @return Roll Torque Command
|
||||
*/
|
||||
static inline int16_t mavlink_msg_gimbal_torque_cmd_report_get_rl_torque_cmd(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field el_torque_cmd from gimbal_torque_cmd_report message
|
||||
*
|
||||
* @return Elevation Torque Command
|
||||
*/
|
||||
static inline int16_t mavlink_msg_gimbal_torque_cmd_report_get_el_torque_cmd(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field az_torque_cmd from gimbal_torque_cmd_report message
|
||||
*
|
||||
* @return Azimuth Torque Command
|
||||
*/
|
||||
static inline int16_t mavlink_msg_gimbal_torque_cmd_report_get_az_torque_cmd(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gimbal_torque_cmd_report message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gimbal_torque_cmd_report C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gimbal_torque_cmd_report_decode(const mavlink_message_t* msg, mavlink_gimbal_torque_cmd_report_t* gimbal_torque_cmd_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gimbal_torque_cmd_report->rl_torque_cmd = mavlink_msg_gimbal_torque_cmd_report_get_rl_torque_cmd(msg);
|
||||
gimbal_torque_cmd_report->el_torque_cmd = mavlink_msg_gimbal_torque_cmd_report_get_el_torque_cmd(msg);
|
||||
gimbal_torque_cmd_report->az_torque_cmd = mavlink_msg_gimbal_torque_cmd_report_get_az_torque_cmd(msg);
|
||||
gimbal_torque_cmd_report->target_system = mavlink_msg_gimbal_torque_cmd_report_get_target_system(msg);
|
||||
gimbal_torque_cmd_report->target_component = mavlink_msg_gimbal_torque_cmd_report_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN? msg->len : MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN;
|
||||
memset(gimbal_torque_cmd_report, 0, MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_LEN);
|
||||
memcpy(gimbal_torque_cmd_report, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-263
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GOPRO_GET_REQUEST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_GET_REQUEST 216
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gopro_get_request_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t cmd_id; /*< Command ID*/
|
||||
}) mavlink_gopro_get_request_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN 3
|
||||
#define MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_216_LEN 3
|
||||
#define MAVLINK_MSG_ID_216_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_GET_REQUEST_CRC 50
|
||||
#define MAVLINK_MSG_ID_216_CRC 50
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_GET_REQUEST { \
|
||||
216, \
|
||||
"GOPRO_GET_REQUEST", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_get_request_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_get_request_t, target_component) }, \
|
||||
{ "cmd_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gopro_get_request_t, cmd_id) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_GET_REQUEST { \
|
||||
"GOPRO_GET_REQUEST", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_get_request_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_get_request_t, target_component) }, \
|
||||
{ "cmd_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gopro_get_request_t, cmd_id) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_get_request message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param cmd_id Command ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t cmd_id)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, cmd_id);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_gopro_get_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.cmd_id = cmd_id;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_GET_REQUEST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_get_request message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param cmd_id Command ID
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t cmd_id)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, cmd_id);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_gopro_get_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.cmd_id = cmd_id;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_GET_REQUEST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_get_request struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_get_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gopro_get_request_t* gopro_get_request)
|
||||
{
|
||||
return mavlink_msg_gopro_get_request_pack(system_id, component_id, msg, gopro_get_request->target_system, gopro_get_request->target_component, gopro_get_request->cmd_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_get_request struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_get_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gopro_get_request_t* gopro_get_request)
|
||||
{
|
||||
return mavlink_msg_gopro_get_request_pack_chan(system_id, component_id, chan, msg, gopro_get_request->target_system, gopro_get_request->target_component, gopro_get_request->cmd_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_get_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param cmd_id Command ID
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gopro_get_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t cmd_id)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, cmd_id);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_REQUEST, buf, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_CRC);
|
||||
#else
|
||||
mavlink_gopro_get_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.cmd_id = cmd_id;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_get_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_get_request_send_struct(mavlink_channel_t chan, const mavlink_gopro_get_request_t* gopro_get_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gopro_get_request_send(chan, gopro_get_request->target_system, gopro_get_request->target_component, gopro_get_request->cmd_id);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_REQUEST, (const char *)gopro_get_request, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_get_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t cmd_id)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, cmd_id);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_REQUEST, buf, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_CRC);
|
||||
#else
|
||||
mavlink_gopro_get_request_t *packet = (mavlink_gopro_get_request_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->cmd_id = cmd_id;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_REQUEST, (const char *)packet, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GOPRO_GET_REQUEST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from gopro_get_request message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_get_request_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from gopro_get_request message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_get_request_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cmd_id from gopro_get_request message
|
||||
*
|
||||
* @return Command ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_get_request_get_cmd_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gopro_get_request message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gopro_get_request C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_get_request_decode(const mavlink_message_t* msg, mavlink_gopro_get_request_t* gopro_get_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gopro_get_request->target_system = mavlink_msg_gopro_get_request_get_target_system(msg);
|
||||
gopro_get_request->target_component = mavlink_msg_gopro_get_request_get_target_component(msg);
|
||||
gopro_get_request->cmd_id = mavlink_msg_gopro_get_request_get_cmd_id(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN;
|
||||
memset(gopro_get_request, 0, MAVLINK_MSG_ID_GOPRO_GET_REQUEST_LEN);
|
||||
memcpy(gopro_get_request, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-255
@@ -1,255 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GOPRO_GET_RESPONSE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_GET_RESPONSE 217
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gopro_get_response_t {
|
||||
uint8_t cmd_id; /*< Command ID*/
|
||||
uint8_t status; /*< Status*/
|
||||
uint8_t value[4]; /*< Value*/
|
||||
}) mavlink_gopro_get_response_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN 6
|
||||
#define MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN 6
|
||||
#define MAVLINK_MSG_ID_217_LEN 6
|
||||
#define MAVLINK_MSG_ID_217_MIN_LEN 6
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_CRC 202
|
||||
#define MAVLINK_MSG_ID_217_CRC 202
|
||||
|
||||
#define MAVLINK_MSG_GOPRO_GET_RESPONSE_FIELD_VALUE_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_GET_RESPONSE { \
|
||||
217, \
|
||||
"GOPRO_GET_RESPONSE", \
|
||||
3, \
|
||||
{ { "cmd_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_get_response_t, cmd_id) }, \
|
||||
{ "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_get_response_t, status) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_UINT8_T, 4, 2, offsetof(mavlink_gopro_get_response_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_GET_RESPONSE { \
|
||||
"GOPRO_GET_RESPONSE", \
|
||||
3, \
|
||||
{ { "cmd_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_get_response_t, cmd_id) }, \
|
||||
{ "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_get_response_t, status) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_UINT8_T, 4, 2, offsetof(mavlink_gopro_get_response_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_get_response 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 cmd_id Command ID
|
||||
* @param status Status
|
||||
* @param value Value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_response_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t cmd_id, uint8_t status, const uint8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, cmd_id);
|
||||
_mav_put_uint8_t(buf, 1, status);
|
||||
_mav_put_uint8_t_array(buf, 2, value, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN);
|
||||
#else
|
||||
mavlink_gopro_get_response_t packet;
|
||||
packet.cmd_id = cmd_id;
|
||||
packet.status = status;
|
||||
mav_array_memcpy(packet.value, value, sizeof(uint8_t)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_get_response message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param cmd_id Command ID
|
||||
* @param status Status
|
||||
* @param value Value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_response_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t cmd_id,uint8_t status,const uint8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, cmd_id);
|
||||
_mav_put_uint8_t(buf, 1, status);
|
||||
_mav_put_uint8_t_array(buf, 2, value, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN);
|
||||
#else
|
||||
mavlink_gopro_get_response_t packet;
|
||||
packet.cmd_id = cmd_id;
|
||||
packet.status = status;
|
||||
mav_array_memcpy(packet.value, value, sizeof(uint8_t)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_get_response struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_get_response C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_response_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gopro_get_response_t* gopro_get_response)
|
||||
{
|
||||
return mavlink_msg_gopro_get_response_pack(system_id, component_id, msg, gopro_get_response->cmd_id, gopro_get_response->status, gopro_get_response->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_get_response struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_get_response C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_response_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gopro_get_response_t* gopro_get_response)
|
||||
{
|
||||
return mavlink_msg_gopro_get_response_pack_chan(system_id, component_id, chan, msg, gopro_get_response->cmd_id, gopro_get_response->status, gopro_get_response->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_get_response message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param cmd_id Command ID
|
||||
* @param status Status
|
||||
* @param value Value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gopro_get_response_send(mavlink_channel_t chan, uint8_t cmd_id, uint8_t status, const uint8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, cmd_id);
|
||||
_mav_put_uint8_t(buf, 1, status);
|
||||
_mav_put_uint8_t_array(buf, 2, value, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE, buf, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_CRC);
|
||||
#else
|
||||
mavlink_gopro_get_response_t packet;
|
||||
packet.cmd_id = cmd_id;
|
||||
packet.status = status;
|
||||
mav_array_memcpy(packet.value, value, sizeof(uint8_t)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE, (const char *)&packet, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_get_response message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_get_response_send_struct(mavlink_channel_t chan, const mavlink_gopro_get_response_t* gopro_get_response)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gopro_get_response_send(chan, gopro_get_response->cmd_id, gopro_get_response->status, gopro_get_response->value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE, (const char *)gopro_get_response, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_get_response_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t cmd_id, uint8_t status, const uint8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, cmd_id);
|
||||
_mav_put_uint8_t(buf, 1, status);
|
||||
_mav_put_uint8_t_array(buf, 2, value, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE, buf, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_CRC);
|
||||
#else
|
||||
mavlink_gopro_get_response_t *packet = (mavlink_gopro_get_response_t *)msgbuf;
|
||||
packet->cmd_id = cmd_id;
|
||||
packet->status = status;
|
||||
mav_array_memcpy(packet->value, value, sizeof(uint8_t)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE, (const char *)packet, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GOPRO_GET_RESPONSE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field cmd_id from gopro_get_response message
|
||||
*
|
||||
* @return Command ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_get_response_get_cmd_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field status from gopro_get_response message
|
||||
*
|
||||
* @return Status
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_get_response_get_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field value from gopro_get_response message
|
||||
*
|
||||
* @return Value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_get_response_get_value(const mavlink_message_t* msg, uint8_t *value)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, value, 4, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gopro_get_response message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gopro_get_response C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_get_response_decode(const mavlink_message_t* msg, mavlink_gopro_get_response_t* gopro_get_response)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gopro_get_response->cmd_id = mavlink_msg_gopro_get_response_get_cmd_id(msg);
|
||||
gopro_get_response->status = mavlink_msg_gopro_get_response_get_status(msg);
|
||||
mavlink_msg_gopro_get_response_get_value(msg, gopro_get_response->value);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN? msg->len : MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN;
|
||||
memset(gopro_get_response, 0, MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_LEN);
|
||||
memcpy(gopro_get_response, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-263
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GOPRO_HEARTBEAT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_HEARTBEAT 215
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gopro_heartbeat_t {
|
||||
uint8_t status; /*< Status*/
|
||||
uint8_t capture_mode; /*< Current capture mode*/
|
||||
uint8_t flags; /*< additional status bits*/
|
||||
}) mavlink_gopro_heartbeat_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN 3
|
||||
#define MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_215_LEN 3
|
||||
#define MAVLINK_MSG_ID_215_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_HEARTBEAT_CRC 101
|
||||
#define MAVLINK_MSG_ID_215_CRC 101
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_HEARTBEAT { \
|
||||
215, \
|
||||
"GOPRO_HEARTBEAT", \
|
||||
3, \
|
||||
{ { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_heartbeat_t, status) }, \
|
||||
{ "capture_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_heartbeat_t, capture_mode) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gopro_heartbeat_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_HEARTBEAT { \
|
||||
"GOPRO_HEARTBEAT", \
|
||||
3, \
|
||||
{ { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_heartbeat_t, status) }, \
|
||||
{ "capture_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_heartbeat_t, capture_mode) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gopro_heartbeat_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_heartbeat message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param status Status
|
||||
* @param capture_mode Current capture mode
|
||||
* @param flags additional status bits
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t status, uint8_t capture_mode, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, status);
|
||||
_mav_put_uint8_t(buf, 1, capture_mode);
|
||||
_mav_put_uint8_t(buf, 2, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN);
|
||||
#else
|
||||
mavlink_gopro_heartbeat_t packet;
|
||||
packet.status = status;
|
||||
packet.capture_mode = capture_mode;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_HEARTBEAT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_heartbeat message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param status Status
|
||||
* @param capture_mode Current capture mode
|
||||
* @param flags additional status bits
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t status,uint8_t capture_mode,uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, status);
|
||||
_mav_put_uint8_t(buf, 1, capture_mode);
|
||||
_mav_put_uint8_t(buf, 2, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN);
|
||||
#else
|
||||
mavlink_gopro_heartbeat_t packet;
|
||||
packet.status = status;
|
||||
packet.capture_mode = capture_mode;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_HEARTBEAT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_heartbeat struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_heartbeat C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gopro_heartbeat_t* gopro_heartbeat)
|
||||
{
|
||||
return mavlink_msg_gopro_heartbeat_pack(system_id, component_id, msg, gopro_heartbeat->status, gopro_heartbeat->capture_mode, gopro_heartbeat->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_heartbeat struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_heartbeat C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_heartbeat_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gopro_heartbeat_t* gopro_heartbeat)
|
||||
{
|
||||
return mavlink_msg_gopro_heartbeat_pack_chan(system_id, component_id, chan, msg, gopro_heartbeat->status, gopro_heartbeat->capture_mode, gopro_heartbeat->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_heartbeat message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param status Status
|
||||
* @param capture_mode Current capture mode
|
||||
* @param flags additional status bits
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gopro_heartbeat_send(mavlink_channel_t chan, uint8_t status, uint8_t capture_mode, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, status);
|
||||
_mav_put_uint8_t(buf, 1, capture_mode);
|
||||
_mav_put_uint8_t(buf, 2, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_HEARTBEAT, buf, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_CRC);
|
||||
#else
|
||||
mavlink_gopro_heartbeat_t packet;
|
||||
packet.status = status;
|
||||
packet.capture_mode = capture_mode;
|
||||
packet.flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_heartbeat message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_heartbeat_send_struct(mavlink_channel_t chan, const mavlink_gopro_heartbeat_t* gopro_heartbeat)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gopro_heartbeat_send(chan, gopro_heartbeat->status, gopro_heartbeat->capture_mode, gopro_heartbeat->flags);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_HEARTBEAT, (const char *)gopro_heartbeat, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_heartbeat_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t status, uint8_t capture_mode, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, status);
|
||||
_mav_put_uint8_t(buf, 1, capture_mode);
|
||||
_mav_put_uint8_t(buf, 2, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_HEARTBEAT, buf, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_CRC);
|
||||
#else
|
||||
mavlink_gopro_heartbeat_t *packet = (mavlink_gopro_heartbeat_t *)msgbuf;
|
||||
packet->status = status;
|
||||
packet->capture_mode = capture_mode;
|
||||
packet->flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GOPRO_HEARTBEAT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field status from gopro_heartbeat message
|
||||
*
|
||||
* @return Status
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_heartbeat_get_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field capture_mode from gopro_heartbeat message
|
||||
*
|
||||
* @return Current capture mode
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_heartbeat_get_capture_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from gopro_heartbeat message
|
||||
*
|
||||
* @return additional status bits
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_heartbeat_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gopro_heartbeat message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gopro_heartbeat C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_heartbeat_decode(const mavlink_message_t* msg, mavlink_gopro_heartbeat_t* gopro_heartbeat)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gopro_heartbeat->status = mavlink_msg_gopro_heartbeat_get_status(msg);
|
||||
gopro_heartbeat->capture_mode = mavlink_msg_gopro_heartbeat_get_capture_mode(msg);
|
||||
gopro_heartbeat->flags = mavlink_msg_gopro_heartbeat_get_flags(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN? msg->len : MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN;
|
||||
memset(gopro_heartbeat, 0, MAVLINK_MSG_ID_GOPRO_HEARTBEAT_LEN);
|
||||
memcpy(gopro_heartbeat, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-280
@@ -1,280 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GOPRO_SET_REQUEST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_SET_REQUEST 218
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gopro_set_request_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t cmd_id; /*< Command ID*/
|
||||
uint8_t value[4]; /*< Value*/
|
||||
}) mavlink_gopro_set_request_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN 7
|
||||
#define MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN 7
|
||||
#define MAVLINK_MSG_ID_218_LEN 7
|
||||
#define MAVLINK_MSG_ID_218_MIN_LEN 7
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_SET_REQUEST_CRC 17
|
||||
#define MAVLINK_MSG_ID_218_CRC 17
|
||||
|
||||
#define MAVLINK_MSG_GOPRO_SET_REQUEST_FIELD_VALUE_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_SET_REQUEST { \
|
||||
218, \
|
||||
"GOPRO_SET_REQUEST", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_set_request_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_set_request_t, target_component) }, \
|
||||
{ "cmd_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gopro_set_request_t, cmd_id) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_UINT8_T, 4, 3, offsetof(mavlink_gopro_set_request_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_SET_REQUEST { \
|
||||
"GOPRO_SET_REQUEST", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_set_request_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_set_request_t, target_component) }, \
|
||||
{ "cmd_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gopro_set_request_t, cmd_id) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_UINT8_T, 4, 3, offsetof(mavlink_gopro_set_request_t, value) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_set_request message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param cmd_id Command ID
|
||||
* @param value Value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t cmd_id, const uint8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, cmd_id);
|
||||
_mav_put_uint8_t_array(buf, 3, value, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_gopro_set_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.cmd_id = cmd_id;
|
||||
mav_array_memcpy(packet.value, value, sizeof(uint8_t)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_SET_REQUEST;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_set_request message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param cmd_id Command ID
|
||||
* @param value Value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t cmd_id,const uint8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, cmd_id);
|
||||
_mav_put_uint8_t_array(buf, 3, value, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_gopro_set_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.cmd_id = cmd_id;
|
||||
mav_array_memcpy(packet.value, value, sizeof(uint8_t)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_SET_REQUEST;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_set_request struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_set_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gopro_set_request_t* gopro_set_request)
|
||||
{
|
||||
return mavlink_msg_gopro_set_request_pack(system_id, component_id, msg, gopro_set_request->target_system, gopro_set_request->target_component, gopro_set_request->cmd_id, gopro_set_request->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_set_request struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_set_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gopro_set_request_t* gopro_set_request)
|
||||
{
|
||||
return mavlink_msg_gopro_set_request_pack_chan(system_id, component_id, chan, msg, gopro_set_request->target_system, gopro_set_request->target_component, gopro_set_request->cmd_id, gopro_set_request->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_set_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param cmd_id Command ID
|
||||
* @param value Value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gopro_set_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t cmd_id, const uint8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, cmd_id);
|
||||
_mav_put_uint8_t_array(buf, 3, value, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_REQUEST, buf, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_CRC);
|
||||
#else
|
||||
mavlink_gopro_set_request_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.cmd_id = cmd_id;
|
||||
mav_array_memcpy(packet.value, value, sizeof(uint8_t)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_set_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_set_request_send_struct(mavlink_channel_t chan, const mavlink_gopro_set_request_t* gopro_set_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gopro_set_request_send(chan, gopro_set_request->target_system, gopro_set_request->target_component, gopro_set_request->cmd_id, gopro_set_request->value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_REQUEST, (const char *)gopro_set_request, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_set_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t cmd_id, const uint8_t *value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, cmd_id);
|
||||
_mav_put_uint8_t_array(buf, 3, value, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_REQUEST, buf, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_CRC);
|
||||
#else
|
||||
mavlink_gopro_set_request_t *packet = (mavlink_gopro_set_request_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->cmd_id = cmd_id;
|
||||
mav_array_memcpy(packet->value, value, sizeof(uint8_t)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_REQUEST, (const char *)packet, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GOPRO_SET_REQUEST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from gopro_set_request message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_set_request_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from gopro_set_request message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_set_request_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cmd_id from gopro_set_request message
|
||||
*
|
||||
* @return Command ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_set_request_get_cmd_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field value from gopro_set_request message
|
||||
*
|
||||
* @return Value
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_request_get_value(const mavlink_message_t* msg, uint8_t *value)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, value, 4, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gopro_set_request message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gopro_set_request C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_set_request_decode(const mavlink_message_t* msg, mavlink_gopro_set_request_t* gopro_set_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gopro_set_request->target_system = mavlink_msg_gopro_set_request_get_target_system(msg);
|
||||
gopro_set_request->target_component = mavlink_msg_gopro_set_request_get_target_component(msg);
|
||||
gopro_set_request->cmd_id = mavlink_msg_gopro_set_request_get_cmd_id(msg);
|
||||
mavlink_msg_gopro_set_request_get_value(msg, gopro_set_request->value);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN? msg->len : MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN;
|
||||
memset(gopro_set_request, 0, MAVLINK_MSG_ID_GOPRO_SET_REQUEST_LEN);
|
||||
memcpy(gopro_set_request, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GOPRO_SET_RESPONSE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_SET_RESPONSE 219
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gopro_set_response_t {
|
||||
uint8_t cmd_id; /*< Command ID*/
|
||||
uint8_t status; /*< Status*/
|
||||
}) mavlink_gopro_set_response_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN 2
|
||||
#define MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_219_LEN 2
|
||||
#define MAVLINK_MSG_ID_219_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_CRC 162
|
||||
#define MAVLINK_MSG_ID_219_CRC 162
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_SET_RESPONSE { \
|
||||
219, \
|
||||
"GOPRO_SET_RESPONSE", \
|
||||
2, \
|
||||
{ { "cmd_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_set_response_t, cmd_id) }, \
|
||||
{ "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_set_response_t, status) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GOPRO_SET_RESPONSE { \
|
||||
"GOPRO_SET_RESPONSE", \
|
||||
2, \
|
||||
{ { "cmd_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gopro_set_response_t, cmd_id) }, \
|
||||
{ "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gopro_set_response_t, status) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_set_response 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 cmd_id Command ID
|
||||
* @param status Status
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_response_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t cmd_id, uint8_t status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, cmd_id);
|
||||
_mav_put_uint8_t(buf, 1, status);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN);
|
||||
#else
|
||||
mavlink_gopro_set_response_t packet;
|
||||
packet.cmd_id = cmd_id;
|
||||
packet.status = status;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gopro_set_response message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param cmd_id Command ID
|
||||
* @param status Status
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_response_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t cmd_id,uint8_t status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, cmd_id);
|
||||
_mav_put_uint8_t(buf, 1, status);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN);
|
||||
#else
|
||||
mavlink_gopro_set_response_t packet;
|
||||
packet.cmd_id = cmd_id;
|
||||
packet.status = status;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_set_response struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_set_response C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_response_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gopro_set_response_t* gopro_set_response)
|
||||
{
|
||||
return mavlink_msg_gopro_set_response_pack(system_id, component_id, msg, gopro_set_response->cmd_id, gopro_set_response->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gopro_set_response struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gopro_set_response C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gopro_set_response_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gopro_set_response_t* gopro_set_response)
|
||||
{
|
||||
return mavlink_msg_gopro_set_response_pack_chan(system_id, component_id, chan, msg, gopro_set_response->cmd_id, gopro_set_response->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_set_response message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param cmd_id Command ID
|
||||
* @param status Status
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gopro_set_response_send(mavlink_channel_t chan, uint8_t cmd_id, uint8_t status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, cmd_id);
|
||||
_mav_put_uint8_t(buf, 1, status);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE, buf, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_CRC);
|
||||
#else
|
||||
mavlink_gopro_set_response_t packet;
|
||||
packet.cmd_id = cmd_id;
|
||||
packet.status = status;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE, (const char *)&packet, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gopro_set_response message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_set_response_send_struct(mavlink_channel_t chan, const mavlink_gopro_set_response_t* gopro_set_response)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gopro_set_response_send(chan, gopro_set_response->cmd_id, gopro_set_response->status);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE, (const char *)gopro_set_response, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_set_response_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t cmd_id, uint8_t status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, cmd_id);
|
||||
_mav_put_uint8_t(buf, 1, status);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE, buf, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_CRC);
|
||||
#else
|
||||
mavlink_gopro_set_response_t *packet = (mavlink_gopro_set_response_t *)msgbuf;
|
||||
packet->cmd_id = cmd_id;
|
||||
packet->status = status;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE, (const char *)packet, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GOPRO_SET_RESPONSE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field cmd_id from gopro_set_response message
|
||||
*
|
||||
* @return Command ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_set_response_get_cmd_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field status from gopro_set_response message
|
||||
*
|
||||
* @return Status
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gopro_set_response_get_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gopro_set_response message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gopro_set_response C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gopro_set_response_decode(const mavlink_message_t* msg, mavlink_gopro_set_response_t* gopro_set_response)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gopro_set_response->cmd_id = mavlink_msg_gopro_set_response_get_cmd_id(msg);
|
||||
gopro_set_response->status = mavlink_msg_gopro_set_response_get_status(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN? msg->len : MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN;
|
||||
memset(gopro_set_response, 0, MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_LEN);
|
||||
memcpy(gopro_set_response, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE HWSTATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_HWSTATUS 165
|
||||
|
||||
MAVPACKED(
|
||||
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_HWSTATUS_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_165_LEN 3
|
||||
#define MAVLINK_MSG_ID_165_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_HWSTATUS_CRC 21
|
||||
#define MAVLINK_MSG_ID_165_CRC 21
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_HWSTATUS { \
|
||||
165, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_HWSTATUS_LEN];
|
||||
_mav_put_uint16_t(buf, 0, Vcc);
|
||||
_mav_put_uint8_t(buf, 2, I2Cerr);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HWSTATUS_LEN);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HWSTATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HWSTATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HWSTATUS_MIN_LEN, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_HWSTATUS_LEN];
|
||||
_mav_put_uint16_t(buf, 0, Vcc);
|
||||
_mav_put_uint8_t(buf, 2, I2Cerr);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HWSTATUS_LEN);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HWSTATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_HWSTATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HWSTATUS_MIN_LEN, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a hwstatus struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a hwstatus struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param hwstatus C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_hwstatus_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hwstatus_t* hwstatus)
|
||||
{
|
||||
return mavlink_msg_hwstatus_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_HWSTATUS_LEN];
|
||||
_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, MAVLINK_MSG_ID_HWSTATUS_MIN_LEN, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC);
|
||||
#else
|
||||
mavlink_hwstatus_t packet;
|
||||
packet.Vcc = Vcc;
|
||||
packet.I2Cerr = I2Cerr;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, MAVLINK_MSG_ID_HWSTATUS_MIN_LEN, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a hwstatus message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_hwstatus_send_struct(mavlink_channel_t chan, const mavlink_hwstatus_t* hwstatus)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_hwstatus_send(chan, hwstatus->Vcc, hwstatus->I2Cerr);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)hwstatus, MAVLINK_MSG_ID_HWSTATUS_MIN_LEN, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_HWSTATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_hwstatus_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t Vcc, uint8_t I2Cerr)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_HWSTATUS_MIN_LEN, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC);
|
||||
#else
|
||||
mavlink_hwstatus_t *packet = (mavlink_hwstatus_t *)msgbuf;
|
||||
packet->Vcc = Vcc;
|
||||
packet->I2Cerr = I2Cerr;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)packet, MAVLINK_MSG_ID_HWSTATUS_MIN_LEN, MAVLINK_MSG_ID_HWSTATUS_LEN, MAVLINK_MSG_ID_HWSTATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
hwstatus->Vcc = mavlink_msg_hwstatus_get_Vcc(msg);
|
||||
hwstatus->I2Cerr = mavlink_msg_hwstatus_get_I2Cerr(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_HWSTATUS_LEN? msg->len : MAVLINK_MSG_ID_HWSTATUS_LEN;
|
||||
memset(hwstatus, 0, MAVLINK_MSG_ID_HWSTATUS_LEN);
|
||||
memcpy(hwstatus, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-330
@@ -1,330 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE LED_CONTROL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LED_CONTROL 186
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_led_control_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t instance; /*< Instance (LED instance to control or 255 for all LEDs)*/
|
||||
uint8_t pattern; /*< Pattern (see LED_PATTERN_ENUM)*/
|
||||
uint8_t custom_len; /*< Custom Byte Length*/
|
||||
uint8_t custom_bytes[24]; /*< Custom Bytes*/
|
||||
}) mavlink_led_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_LED_CONTROL_LEN 29
|
||||
#define MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN 29
|
||||
#define MAVLINK_MSG_ID_186_LEN 29
|
||||
#define MAVLINK_MSG_ID_186_MIN_LEN 29
|
||||
|
||||
#define MAVLINK_MSG_ID_LED_CONTROL_CRC 72
|
||||
#define MAVLINK_MSG_ID_186_CRC 72
|
||||
|
||||
#define MAVLINK_MSG_LED_CONTROL_FIELD_CUSTOM_BYTES_LEN 24
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LED_CONTROL { \
|
||||
186, \
|
||||
"LED_CONTROL", \
|
||||
6, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_led_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_led_control_t, target_component) }, \
|
||||
{ "instance", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_led_control_t, instance) }, \
|
||||
{ "pattern", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_led_control_t, pattern) }, \
|
||||
{ "custom_len", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_led_control_t, custom_len) }, \
|
||||
{ "custom_bytes", NULL, MAVLINK_TYPE_UINT8_T, 24, 5, offsetof(mavlink_led_control_t, custom_bytes) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_LED_CONTROL { \
|
||||
"LED_CONTROL", \
|
||||
6, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_led_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_led_control_t, target_component) }, \
|
||||
{ "instance", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_led_control_t, instance) }, \
|
||||
{ "pattern", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_led_control_t, pattern) }, \
|
||||
{ "custom_len", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_led_control_t, custom_len) }, \
|
||||
{ "custom_bytes", NULL, MAVLINK_TYPE_UINT8_T, 24, 5, offsetof(mavlink_led_control_t, custom_bytes) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a led_control message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param instance Instance (LED instance to control or 255 for all LEDs)
|
||||
* @param pattern Pattern (see LED_PATTERN_ENUM)
|
||||
* @param custom_len Custom Byte Length
|
||||
* @param custom_bytes Custom Bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_led_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t instance, uint8_t pattern, uint8_t custom_len, const uint8_t *custom_bytes)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LED_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, instance);
|
||||
_mav_put_uint8_t(buf, 3, pattern);
|
||||
_mav_put_uint8_t(buf, 4, custom_len);
|
||||
_mav_put_uint8_t_array(buf, 5, custom_bytes, 24);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LED_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_led_control_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.instance = instance;
|
||||
packet.pattern = pattern;
|
||||
packet.custom_len = custom_len;
|
||||
mav_array_memcpy(packet.custom_bytes, custom_bytes, sizeof(uint8_t)*24);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LED_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LED_CONTROL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN, MAVLINK_MSG_ID_LED_CONTROL_LEN, MAVLINK_MSG_ID_LED_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a led_control message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param instance Instance (LED instance to control or 255 for all LEDs)
|
||||
* @param pattern Pattern (see LED_PATTERN_ENUM)
|
||||
* @param custom_len Custom Byte Length
|
||||
* @param custom_bytes Custom Bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_led_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t instance,uint8_t pattern,uint8_t custom_len,const uint8_t *custom_bytes)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LED_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, instance);
|
||||
_mav_put_uint8_t(buf, 3, pattern);
|
||||
_mav_put_uint8_t(buf, 4, custom_len);
|
||||
_mav_put_uint8_t_array(buf, 5, custom_bytes, 24);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LED_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_led_control_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.instance = instance;
|
||||
packet.pattern = pattern;
|
||||
packet.custom_len = custom_len;
|
||||
mav_array_memcpy(packet.custom_bytes, custom_bytes, sizeof(uint8_t)*24);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LED_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LED_CONTROL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN, MAVLINK_MSG_ID_LED_CONTROL_LEN, MAVLINK_MSG_ID_LED_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a led_control struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param led_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_led_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_led_control_t* led_control)
|
||||
{
|
||||
return mavlink_msg_led_control_pack(system_id, component_id, msg, led_control->target_system, led_control->target_component, led_control->instance, led_control->pattern, led_control->custom_len, led_control->custom_bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a led_control struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param led_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_led_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_led_control_t* led_control)
|
||||
{
|
||||
return mavlink_msg_led_control_pack_chan(system_id, component_id, chan, msg, led_control->target_system, led_control->target_component, led_control->instance, led_control->pattern, led_control->custom_len, led_control->custom_bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a led_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param instance Instance (LED instance to control or 255 for all LEDs)
|
||||
* @param pattern Pattern (see LED_PATTERN_ENUM)
|
||||
* @param custom_len Custom Byte Length
|
||||
* @param custom_bytes Custom Bytes
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_led_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t instance, uint8_t pattern, uint8_t custom_len, const uint8_t *custom_bytes)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_LED_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, instance);
|
||||
_mav_put_uint8_t(buf, 3, pattern);
|
||||
_mav_put_uint8_t(buf, 4, custom_len);
|
||||
_mav_put_uint8_t_array(buf, 5, custom_bytes, 24);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LED_CONTROL, buf, MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN, MAVLINK_MSG_ID_LED_CONTROL_LEN, MAVLINK_MSG_ID_LED_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_led_control_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.instance = instance;
|
||||
packet.pattern = pattern;
|
||||
packet.custom_len = custom_len;
|
||||
mav_array_memcpy(packet.custom_bytes, custom_bytes, sizeof(uint8_t)*24);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LED_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN, MAVLINK_MSG_ID_LED_CONTROL_LEN, MAVLINK_MSG_ID_LED_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a led_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_led_control_send_struct(mavlink_channel_t chan, const mavlink_led_control_t* led_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_led_control_send(chan, led_control->target_system, led_control->target_component, led_control->instance, led_control->pattern, led_control->custom_len, led_control->custom_bytes);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LED_CONTROL, (const char *)led_control, MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN, MAVLINK_MSG_ID_LED_CONTROL_LEN, MAVLINK_MSG_ID_LED_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LED_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_led_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t instance, uint8_t pattern, uint8_t custom_len, const uint8_t *custom_bytes)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, instance);
|
||||
_mav_put_uint8_t(buf, 3, pattern);
|
||||
_mav_put_uint8_t(buf, 4, custom_len);
|
||||
_mav_put_uint8_t_array(buf, 5, custom_bytes, 24);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LED_CONTROL, buf, MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN, MAVLINK_MSG_ID_LED_CONTROL_LEN, MAVLINK_MSG_ID_LED_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_led_control_t *packet = (mavlink_led_control_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->instance = instance;
|
||||
packet->pattern = pattern;
|
||||
packet->custom_len = custom_len;
|
||||
mav_array_memcpy(packet->custom_bytes, custom_bytes, sizeof(uint8_t)*24);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LED_CONTROL, (const char *)packet, MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN, MAVLINK_MSG_ID_LED_CONTROL_LEN, MAVLINK_MSG_ID_LED_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE LED_CONTROL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from led_control message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_led_control_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from led_control message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_led_control_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field instance from led_control message
|
||||
*
|
||||
* @return Instance (LED instance to control or 255 for all LEDs)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_led_control_get_instance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pattern from led_control message
|
||||
*
|
||||
* @return Pattern (see LED_PATTERN_ENUM)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_led_control_get_pattern(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom_len from led_control message
|
||||
*
|
||||
* @return Custom Byte Length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_led_control_get_custom_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom_bytes from led_control message
|
||||
*
|
||||
* @return Custom Bytes
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_led_control_get_custom_bytes(const mavlink_message_t* msg, uint8_t *custom_bytes)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, custom_bytes, 24, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a led_control message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param led_control C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_led_control_decode(const mavlink_message_t* msg, mavlink_led_control_t* led_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
led_control->target_system = mavlink_msg_led_control_get_target_system(msg);
|
||||
led_control->target_component = mavlink_msg_led_control_get_target_component(msg);
|
||||
led_control->instance = mavlink_msg_led_control_get_instance(msg);
|
||||
led_control->pattern = mavlink_msg_led_control_get_pattern(msg);
|
||||
led_control->custom_len = mavlink_msg_led_control_get_custom_len(msg);
|
||||
mavlink_msg_led_control_get_custom_bytes(msg, led_control->custom_bytes);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LED_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_LED_CONTROL_LEN;
|
||||
memset(led_control, 0, MAVLINK_MSG_ID_LED_CONTROL_LEN);
|
||||
memcpy(led_control, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-413
@@ -1,413 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE LIMITS_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_LIMITS_STATUS 167
|
||||
|
||||
MAVPACKED(
|
||||
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_LIMITS_STATUS_MIN_LEN 22
|
||||
#define MAVLINK_MSG_ID_167_LEN 22
|
||||
#define MAVLINK_MSG_ID_167_MIN_LEN 22
|
||||
|
||||
#define MAVLINK_MSG_ID_LIMITS_STATUS_CRC 144
|
||||
#define MAVLINK_MSG_ID_167_CRC 144
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_LIMITS_STATUS { \
|
||||
167, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_LIMITS_STATUS_LEN];
|
||||
_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, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
|
||||
#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, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_LIMITS_STATUS_LEN];
|
||||
_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, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
|
||||
#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, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a limits_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a limits_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param limits_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_limits_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_limits_status_t* limits_status)
|
||||
{
|
||||
return mavlink_msg_limits_status_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_LIMITS_STATUS_LEN];
|
||||
_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, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
|
||||
#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, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a limits_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_limits_status_send_struct(mavlink_channel_t chan, const mavlink_limits_status_t* limits_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_limits_status_send(chan, 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);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)limits_status, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_LIMITS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_limits_status_send_buf(mavlink_message_t *msgbuf, 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 = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
|
||||
#else
|
||||
mavlink_limits_status_t *packet = (mavlink_limits_status_t *)msgbuf;
|
||||
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, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_LIMITS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_LIMITS_STATUS_LEN;
|
||||
memset(limits_status, 0, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
|
||||
memcpy(limits_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-405
@@ -1,405 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE MAG_CAL_PROGRESS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MAG_CAL_PROGRESS 191
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mag_cal_progress_t {
|
||||
float direction_x; /*< Body frame direction vector for display*/
|
||||
float direction_y; /*< Body frame direction vector for display*/
|
||||
float direction_z; /*< Body frame direction vector for display*/
|
||||
uint8_t compass_id; /*< Compass being calibrated*/
|
||||
uint8_t cal_mask; /*< Bitmask of compasses being calibrated*/
|
||||
uint8_t cal_status; /*< Status (see MAG_CAL_STATUS enum)*/
|
||||
uint8_t attempt; /*< Attempt number*/
|
||||
uint8_t completion_pct; /*< Completion percentage*/
|
||||
uint8_t completion_mask[10]; /*< Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid)*/
|
||||
}) mavlink_mag_cal_progress_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN 27
|
||||
#define MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN 27
|
||||
#define MAVLINK_MSG_ID_191_LEN 27
|
||||
#define MAVLINK_MSG_ID_191_MIN_LEN 27
|
||||
|
||||
#define MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC 92
|
||||
#define MAVLINK_MSG_ID_191_CRC 92
|
||||
|
||||
#define MAVLINK_MSG_MAG_CAL_PROGRESS_FIELD_COMPLETION_MASK_LEN 10
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MAG_CAL_PROGRESS { \
|
||||
191, \
|
||||
"MAG_CAL_PROGRESS", \
|
||||
9, \
|
||||
{ { "direction_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mag_cal_progress_t, direction_x) }, \
|
||||
{ "direction_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mag_cal_progress_t, direction_y) }, \
|
||||
{ "direction_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mag_cal_progress_t, direction_z) }, \
|
||||
{ "compass_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mag_cal_progress_t, compass_id) }, \
|
||||
{ "cal_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mag_cal_progress_t, cal_mask) }, \
|
||||
{ "cal_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mag_cal_progress_t, cal_status) }, \
|
||||
{ "attempt", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_mag_cal_progress_t, attempt) }, \
|
||||
{ "completion_pct", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_mag_cal_progress_t, completion_pct) }, \
|
||||
{ "completion_mask", NULL, MAVLINK_TYPE_UINT8_T, 10, 17, offsetof(mavlink_mag_cal_progress_t, completion_mask) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MAG_CAL_PROGRESS { \
|
||||
"MAG_CAL_PROGRESS", \
|
||||
9, \
|
||||
{ { "direction_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mag_cal_progress_t, direction_x) }, \
|
||||
{ "direction_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mag_cal_progress_t, direction_y) }, \
|
||||
{ "direction_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mag_cal_progress_t, direction_z) }, \
|
||||
{ "compass_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mag_cal_progress_t, compass_id) }, \
|
||||
{ "cal_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mag_cal_progress_t, cal_mask) }, \
|
||||
{ "cal_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mag_cal_progress_t, cal_status) }, \
|
||||
{ "attempt", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_mag_cal_progress_t, attempt) }, \
|
||||
{ "completion_pct", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_mag_cal_progress_t, completion_pct) }, \
|
||||
{ "completion_mask", NULL, MAVLINK_TYPE_UINT8_T, 10, 17, offsetof(mavlink_mag_cal_progress_t, completion_mask) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mag_cal_progress 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 compass_id Compass being calibrated
|
||||
* @param cal_mask Bitmask of compasses being calibrated
|
||||
* @param cal_status Status (see MAG_CAL_STATUS enum)
|
||||
* @param attempt Attempt number
|
||||
* @param completion_pct Completion percentage
|
||||
* @param completion_mask Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid)
|
||||
* @param direction_x Body frame direction vector for display
|
||||
* @param direction_y Body frame direction vector for display
|
||||
* @param direction_z Body frame direction vector for display
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_progress_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t attempt, uint8_t completion_pct, const uint8_t *completion_mask, float direction_x, float direction_y, float direction_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN];
|
||||
_mav_put_float(buf, 0, direction_x);
|
||||
_mav_put_float(buf, 4, direction_y);
|
||||
_mav_put_float(buf, 8, direction_z);
|
||||
_mav_put_uint8_t(buf, 12, compass_id);
|
||||
_mav_put_uint8_t(buf, 13, cal_mask);
|
||||
_mav_put_uint8_t(buf, 14, cal_status);
|
||||
_mav_put_uint8_t(buf, 15, attempt);
|
||||
_mav_put_uint8_t(buf, 16, completion_pct);
|
||||
_mav_put_uint8_t_array(buf, 17, completion_mask, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
|
||||
#else
|
||||
mavlink_mag_cal_progress_t packet;
|
||||
packet.direction_x = direction_x;
|
||||
packet.direction_y = direction_y;
|
||||
packet.direction_z = direction_z;
|
||||
packet.compass_id = compass_id;
|
||||
packet.cal_mask = cal_mask;
|
||||
packet.cal_status = cal_status;
|
||||
packet.attempt = attempt;
|
||||
packet.completion_pct = completion_pct;
|
||||
mav_array_memcpy(packet.completion_mask, completion_mask, sizeof(uint8_t)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mag_cal_progress message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param compass_id Compass being calibrated
|
||||
* @param cal_mask Bitmask of compasses being calibrated
|
||||
* @param cal_status Status (see MAG_CAL_STATUS enum)
|
||||
* @param attempt Attempt number
|
||||
* @param completion_pct Completion percentage
|
||||
* @param completion_mask Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid)
|
||||
* @param direction_x Body frame direction vector for display
|
||||
* @param direction_y Body frame direction vector for display
|
||||
* @param direction_z Body frame direction vector for display
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_progress_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t compass_id,uint8_t cal_mask,uint8_t cal_status,uint8_t attempt,uint8_t completion_pct,const uint8_t *completion_mask,float direction_x,float direction_y,float direction_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN];
|
||||
_mav_put_float(buf, 0, direction_x);
|
||||
_mav_put_float(buf, 4, direction_y);
|
||||
_mav_put_float(buf, 8, direction_z);
|
||||
_mav_put_uint8_t(buf, 12, compass_id);
|
||||
_mav_put_uint8_t(buf, 13, cal_mask);
|
||||
_mav_put_uint8_t(buf, 14, cal_status);
|
||||
_mav_put_uint8_t(buf, 15, attempt);
|
||||
_mav_put_uint8_t(buf, 16, completion_pct);
|
||||
_mav_put_uint8_t_array(buf, 17, completion_mask, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
|
||||
#else
|
||||
mavlink_mag_cal_progress_t packet;
|
||||
packet.direction_x = direction_x;
|
||||
packet.direction_y = direction_y;
|
||||
packet.direction_z = direction_z;
|
||||
packet.compass_id = compass_id;
|
||||
packet.cal_mask = cal_mask;
|
||||
packet.cal_status = cal_status;
|
||||
packet.attempt = attempt;
|
||||
packet.completion_pct = completion_pct;
|
||||
mav_array_memcpy(packet.completion_mask, completion_mask, sizeof(uint8_t)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mag_cal_progress struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mag_cal_progress C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_progress_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mag_cal_progress_t* mag_cal_progress)
|
||||
{
|
||||
return mavlink_msg_mag_cal_progress_pack(system_id, component_id, msg, mag_cal_progress->compass_id, mag_cal_progress->cal_mask, mag_cal_progress->cal_status, mag_cal_progress->attempt, mag_cal_progress->completion_pct, mag_cal_progress->completion_mask, mag_cal_progress->direction_x, mag_cal_progress->direction_y, mag_cal_progress->direction_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mag_cal_progress struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mag_cal_progress C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_progress_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mag_cal_progress_t* mag_cal_progress)
|
||||
{
|
||||
return mavlink_msg_mag_cal_progress_pack_chan(system_id, component_id, chan, msg, mag_cal_progress->compass_id, mag_cal_progress->cal_mask, mag_cal_progress->cal_status, mag_cal_progress->attempt, mag_cal_progress->completion_pct, mag_cal_progress->completion_mask, mag_cal_progress->direction_x, mag_cal_progress->direction_y, mag_cal_progress->direction_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mag_cal_progress message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param compass_id Compass being calibrated
|
||||
* @param cal_mask Bitmask of compasses being calibrated
|
||||
* @param cal_status Status (see MAG_CAL_STATUS enum)
|
||||
* @param attempt Attempt number
|
||||
* @param completion_pct Completion percentage
|
||||
* @param completion_mask Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid)
|
||||
* @param direction_x Body frame direction vector for display
|
||||
* @param direction_y Body frame direction vector for display
|
||||
* @param direction_z Body frame direction vector for display
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mag_cal_progress_send(mavlink_channel_t chan, uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t attempt, uint8_t completion_pct, const uint8_t *completion_mask, float direction_x, float direction_y, float direction_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN];
|
||||
_mav_put_float(buf, 0, direction_x);
|
||||
_mav_put_float(buf, 4, direction_y);
|
||||
_mav_put_float(buf, 8, direction_z);
|
||||
_mav_put_uint8_t(buf, 12, compass_id);
|
||||
_mav_put_uint8_t(buf, 13, cal_mask);
|
||||
_mav_put_uint8_t(buf, 14, cal_status);
|
||||
_mav_put_uint8_t(buf, 15, attempt);
|
||||
_mav_put_uint8_t(buf, 16, completion_pct);
|
||||
_mav_put_uint8_t_array(buf, 17, completion_mask, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, buf, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
|
||||
#else
|
||||
mavlink_mag_cal_progress_t packet;
|
||||
packet.direction_x = direction_x;
|
||||
packet.direction_y = direction_y;
|
||||
packet.direction_z = direction_z;
|
||||
packet.compass_id = compass_id;
|
||||
packet.cal_mask = cal_mask;
|
||||
packet.cal_status = cal_status;
|
||||
packet.attempt = attempt;
|
||||
packet.completion_pct = completion_pct;
|
||||
mav_array_memcpy(packet.completion_mask, completion_mask, sizeof(uint8_t)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, (const char *)&packet, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mag_cal_progress message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mag_cal_progress_send_struct(mavlink_channel_t chan, const mavlink_mag_cal_progress_t* mag_cal_progress)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mag_cal_progress_send(chan, mag_cal_progress->compass_id, mag_cal_progress->cal_mask, mag_cal_progress->cal_status, mag_cal_progress->attempt, mag_cal_progress->completion_pct, mag_cal_progress->completion_mask, mag_cal_progress->direction_x, mag_cal_progress->direction_y, mag_cal_progress->direction_z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, (const char *)mag_cal_progress, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mag_cal_progress_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t attempt, uint8_t completion_pct, const uint8_t *completion_mask, float direction_x, float direction_y, float direction_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, direction_x);
|
||||
_mav_put_float(buf, 4, direction_y);
|
||||
_mav_put_float(buf, 8, direction_z);
|
||||
_mav_put_uint8_t(buf, 12, compass_id);
|
||||
_mav_put_uint8_t(buf, 13, cal_mask);
|
||||
_mav_put_uint8_t(buf, 14, cal_status);
|
||||
_mav_put_uint8_t(buf, 15, attempt);
|
||||
_mav_put_uint8_t(buf, 16, completion_pct);
|
||||
_mav_put_uint8_t_array(buf, 17, completion_mask, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, buf, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
|
||||
#else
|
||||
mavlink_mag_cal_progress_t *packet = (mavlink_mag_cal_progress_t *)msgbuf;
|
||||
packet->direction_x = direction_x;
|
||||
packet->direction_y = direction_y;
|
||||
packet->direction_z = direction_z;
|
||||
packet->compass_id = compass_id;
|
||||
packet->cal_mask = cal_mask;
|
||||
packet->cal_status = cal_status;
|
||||
packet->attempt = attempt;
|
||||
packet->completion_pct = completion_pct;
|
||||
mav_array_memcpy(packet->completion_mask, completion_mask, sizeof(uint8_t)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, (const char *)packet, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MAG_CAL_PROGRESS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field compass_id from mag_cal_progress message
|
||||
*
|
||||
* @return Compass being calibrated
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_progress_get_compass_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cal_mask from mag_cal_progress message
|
||||
*
|
||||
* @return Bitmask of compasses being calibrated
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_progress_get_cal_mask(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cal_status from mag_cal_progress message
|
||||
*
|
||||
* @return Status (see MAG_CAL_STATUS enum)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_progress_get_cal_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field attempt from mag_cal_progress message
|
||||
*
|
||||
* @return Attempt number
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_progress_get_attempt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 15);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field completion_pct from mag_cal_progress message
|
||||
*
|
||||
* @return Completion percentage
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_progress_get_completion_pct(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field completion_mask from mag_cal_progress message
|
||||
*
|
||||
* @return Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_progress_get_completion_mask(const mavlink_message_t* msg, uint8_t *completion_mask)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, completion_mask, 10, 17);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field direction_x from mag_cal_progress message
|
||||
*
|
||||
* @return Body frame direction vector for display
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_progress_get_direction_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field direction_y from mag_cal_progress message
|
||||
*
|
||||
* @return Body frame direction vector for display
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_progress_get_direction_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field direction_z from mag_cal_progress message
|
||||
*
|
||||
* @return Body frame direction vector for display
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_progress_get_direction_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mag_cal_progress message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mag_cal_progress C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mag_cal_progress_decode(const mavlink_message_t* msg, mavlink_mag_cal_progress_t* mag_cal_progress)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mag_cal_progress->direction_x = mavlink_msg_mag_cal_progress_get_direction_x(msg);
|
||||
mag_cal_progress->direction_y = mavlink_msg_mag_cal_progress_get_direction_y(msg);
|
||||
mag_cal_progress->direction_z = mavlink_msg_mag_cal_progress_get_direction_z(msg);
|
||||
mag_cal_progress->compass_id = mavlink_msg_mag_cal_progress_get_compass_id(msg);
|
||||
mag_cal_progress->cal_mask = mavlink_msg_mag_cal_progress_get_cal_mask(msg);
|
||||
mag_cal_progress->cal_status = mavlink_msg_mag_cal_progress_get_cal_status(msg);
|
||||
mag_cal_progress->attempt = mavlink_msg_mag_cal_progress_get_attempt(msg);
|
||||
mag_cal_progress->completion_pct = mavlink_msg_mag_cal_progress_get_completion_pct(msg);
|
||||
mavlink_msg_mag_cal_progress_get_completion_mask(msg, mag_cal_progress->completion_mask);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN? msg->len : MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN;
|
||||
memset(mag_cal_progress, 0, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
|
||||
memcpy(mag_cal_progress, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-538
@@ -1,538 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE MAG_CAL_REPORT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MAG_CAL_REPORT 192
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mag_cal_report_t {
|
||||
float fitness; /*< RMS milligauss residuals*/
|
||||
float ofs_x; /*< X offset*/
|
||||
float ofs_y; /*< Y offset*/
|
||||
float ofs_z; /*< Z offset*/
|
||||
float diag_x; /*< X diagonal (matrix 11)*/
|
||||
float diag_y; /*< Y diagonal (matrix 22)*/
|
||||
float diag_z; /*< Z diagonal (matrix 33)*/
|
||||
float offdiag_x; /*< X off-diagonal (matrix 12 and 21)*/
|
||||
float offdiag_y; /*< Y off-diagonal (matrix 13 and 31)*/
|
||||
float offdiag_z; /*< Z off-diagonal (matrix 32 and 23)*/
|
||||
uint8_t compass_id; /*< Compass being calibrated*/
|
||||
uint8_t cal_mask; /*< Bitmask of compasses being calibrated*/
|
||||
uint8_t cal_status; /*< Status (see MAG_CAL_STATUS enum)*/
|
||||
uint8_t autosaved; /*< 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters*/
|
||||
}) mavlink_mag_cal_report_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN 44
|
||||
#define MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN 44
|
||||
#define MAVLINK_MSG_ID_192_LEN 44
|
||||
#define MAVLINK_MSG_ID_192_MIN_LEN 44
|
||||
|
||||
#define MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC 36
|
||||
#define MAVLINK_MSG_ID_192_CRC 36
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MAG_CAL_REPORT { \
|
||||
192, \
|
||||
"MAG_CAL_REPORT", \
|
||||
14, \
|
||||
{ { "fitness", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mag_cal_report_t, fitness) }, \
|
||||
{ "ofs_x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mag_cal_report_t, ofs_x) }, \
|
||||
{ "ofs_y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mag_cal_report_t, ofs_y) }, \
|
||||
{ "ofs_z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mag_cal_report_t, ofs_z) }, \
|
||||
{ "diag_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mag_cal_report_t, diag_x) }, \
|
||||
{ "diag_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mag_cal_report_t, diag_y) }, \
|
||||
{ "diag_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mag_cal_report_t, diag_z) }, \
|
||||
{ "offdiag_x", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_mag_cal_report_t, offdiag_x) }, \
|
||||
{ "offdiag_y", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_mag_cal_report_t, offdiag_y) }, \
|
||||
{ "offdiag_z", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_mag_cal_report_t, offdiag_z) }, \
|
||||
{ "compass_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_mag_cal_report_t, compass_id) }, \
|
||||
{ "cal_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_mag_cal_report_t, cal_mask) }, \
|
||||
{ "cal_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_mag_cal_report_t, cal_status) }, \
|
||||
{ "autosaved", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_mag_cal_report_t, autosaved) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MAG_CAL_REPORT { \
|
||||
"MAG_CAL_REPORT", \
|
||||
14, \
|
||||
{ { "fitness", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mag_cal_report_t, fitness) }, \
|
||||
{ "ofs_x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mag_cal_report_t, ofs_x) }, \
|
||||
{ "ofs_y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mag_cal_report_t, ofs_y) }, \
|
||||
{ "ofs_z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mag_cal_report_t, ofs_z) }, \
|
||||
{ "diag_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mag_cal_report_t, diag_x) }, \
|
||||
{ "diag_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mag_cal_report_t, diag_y) }, \
|
||||
{ "diag_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mag_cal_report_t, diag_z) }, \
|
||||
{ "offdiag_x", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_mag_cal_report_t, offdiag_x) }, \
|
||||
{ "offdiag_y", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_mag_cal_report_t, offdiag_y) }, \
|
||||
{ "offdiag_z", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_mag_cal_report_t, offdiag_z) }, \
|
||||
{ "compass_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_mag_cal_report_t, compass_id) }, \
|
||||
{ "cal_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_mag_cal_report_t, cal_mask) }, \
|
||||
{ "cal_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_mag_cal_report_t, cal_status) }, \
|
||||
{ "autosaved", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_mag_cal_report_t, autosaved) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mag_cal_report 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 compass_id Compass being calibrated
|
||||
* @param cal_mask Bitmask of compasses being calibrated
|
||||
* @param cal_status Status (see MAG_CAL_STATUS enum)
|
||||
* @param autosaved 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters
|
||||
* @param fitness RMS milligauss residuals
|
||||
* @param ofs_x X offset
|
||||
* @param ofs_y Y offset
|
||||
* @param ofs_z Z offset
|
||||
* @param diag_x X diagonal (matrix 11)
|
||||
* @param diag_y Y diagonal (matrix 22)
|
||||
* @param diag_z Z diagonal (matrix 33)
|
||||
* @param offdiag_x X off-diagonal (matrix 12 and 21)
|
||||
* @param offdiag_y Y off-diagonal (matrix 13 and 31)
|
||||
* @param offdiag_z Z off-diagonal (matrix 32 and 23)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t autosaved, float fitness, float ofs_x, float ofs_y, float ofs_z, float diag_x, float diag_y, float diag_z, float offdiag_x, float offdiag_y, float offdiag_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, fitness);
|
||||
_mav_put_float(buf, 4, ofs_x);
|
||||
_mav_put_float(buf, 8, ofs_y);
|
||||
_mav_put_float(buf, 12, ofs_z);
|
||||
_mav_put_float(buf, 16, diag_x);
|
||||
_mav_put_float(buf, 20, diag_y);
|
||||
_mav_put_float(buf, 24, diag_z);
|
||||
_mav_put_float(buf, 28, offdiag_x);
|
||||
_mav_put_float(buf, 32, offdiag_y);
|
||||
_mav_put_float(buf, 36, offdiag_z);
|
||||
_mav_put_uint8_t(buf, 40, compass_id);
|
||||
_mav_put_uint8_t(buf, 41, cal_mask);
|
||||
_mav_put_uint8_t(buf, 42, cal_status);
|
||||
_mav_put_uint8_t(buf, 43, autosaved);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
|
||||
#else
|
||||
mavlink_mag_cal_report_t packet;
|
||||
packet.fitness = fitness;
|
||||
packet.ofs_x = ofs_x;
|
||||
packet.ofs_y = ofs_y;
|
||||
packet.ofs_z = ofs_z;
|
||||
packet.diag_x = diag_x;
|
||||
packet.diag_y = diag_y;
|
||||
packet.diag_z = diag_z;
|
||||
packet.offdiag_x = offdiag_x;
|
||||
packet.offdiag_y = offdiag_y;
|
||||
packet.offdiag_z = offdiag_z;
|
||||
packet.compass_id = compass_id;
|
||||
packet.cal_mask = cal_mask;
|
||||
packet.cal_status = cal_status;
|
||||
packet.autosaved = autosaved;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mag_cal_report message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param compass_id Compass being calibrated
|
||||
* @param cal_mask Bitmask of compasses being calibrated
|
||||
* @param cal_status Status (see MAG_CAL_STATUS enum)
|
||||
* @param autosaved 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters
|
||||
* @param fitness RMS milligauss residuals
|
||||
* @param ofs_x X offset
|
||||
* @param ofs_y Y offset
|
||||
* @param ofs_z Z offset
|
||||
* @param diag_x X diagonal (matrix 11)
|
||||
* @param diag_y Y diagonal (matrix 22)
|
||||
* @param diag_z Z diagonal (matrix 33)
|
||||
* @param offdiag_x X off-diagonal (matrix 12 and 21)
|
||||
* @param offdiag_y Y off-diagonal (matrix 13 and 31)
|
||||
* @param offdiag_z Z off-diagonal (matrix 32 and 23)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t compass_id,uint8_t cal_mask,uint8_t cal_status,uint8_t autosaved,float fitness,float ofs_x,float ofs_y,float ofs_z,float diag_x,float diag_y,float diag_z,float offdiag_x,float offdiag_y,float offdiag_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, fitness);
|
||||
_mav_put_float(buf, 4, ofs_x);
|
||||
_mav_put_float(buf, 8, ofs_y);
|
||||
_mav_put_float(buf, 12, ofs_z);
|
||||
_mav_put_float(buf, 16, diag_x);
|
||||
_mav_put_float(buf, 20, diag_y);
|
||||
_mav_put_float(buf, 24, diag_z);
|
||||
_mav_put_float(buf, 28, offdiag_x);
|
||||
_mav_put_float(buf, 32, offdiag_y);
|
||||
_mav_put_float(buf, 36, offdiag_z);
|
||||
_mav_put_uint8_t(buf, 40, compass_id);
|
||||
_mav_put_uint8_t(buf, 41, cal_mask);
|
||||
_mav_put_uint8_t(buf, 42, cal_status);
|
||||
_mav_put_uint8_t(buf, 43, autosaved);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
|
||||
#else
|
||||
mavlink_mag_cal_report_t packet;
|
||||
packet.fitness = fitness;
|
||||
packet.ofs_x = ofs_x;
|
||||
packet.ofs_y = ofs_y;
|
||||
packet.ofs_z = ofs_z;
|
||||
packet.diag_x = diag_x;
|
||||
packet.diag_y = diag_y;
|
||||
packet.diag_z = diag_z;
|
||||
packet.offdiag_x = offdiag_x;
|
||||
packet.offdiag_y = offdiag_y;
|
||||
packet.offdiag_z = offdiag_z;
|
||||
packet.compass_id = compass_id;
|
||||
packet.cal_mask = cal_mask;
|
||||
packet.cal_status = cal_status;
|
||||
packet.autosaved = autosaved;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mag_cal_report struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mag_cal_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mag_cal_report_t* mag_cal_report)
|
||||
{
|
||||
return mavlink_msg_mag_cal_report_pack(system_id, component_id, msg, mag_cal_report->compass_id, mag_cal_report->cal_mask, mag_cal_report->cal_status, mag_cal_report->autosaved, mag_cal_report->fitness, mag_cal_report->ofs_x, mag_cal_report->ofs_y, mag_cal_report->ofs_z, mag_cal_report->diag_x, mag_cal_report->diag_y, mag_cal_report->diag_z, mag_cal_report->offdiag_x, mag_cal_report->offdiag_y, mag_cal_report->offdiag_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mag_cal_report struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mag_cal_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mag_cal_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mag_cal_report_t* mag_cal_report)
|
||||
{
|
||||
return mavlink_msg_mag_cal_report_pack_chan(system_id, component_id, chan, msg, mag_cal_report->compass_id, mag_cal_report->cal_mask, mag_cal_report->cal_status, mag_cal_report->autosaved, mag_cal_report->fitness, mag_cal_report->ofs_x, mag_cal_report->ofs_y, mag_cal_report->ofs_z, mag_cal_report->diag_x, mag_cal_report->diag_y, mag_cal_report->diag_z, mag_cal_report->offdiag_x, mag_cal_report->offdiag_y, mag_cal_report->offdiag_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mag_cal_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param compass_id Compass being calibrated
|
||||
* @param cal_mask Bitmask of compasses being calibrated
|
||||
* @param cal_status Status (see MAG_CAL_STATUS enum)
|
||||
* @param autosaved 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters
|
||||
* @param fitness RMS milligauss residuals
|
||||
* @param ofs_x X offset
|
||||
* @param ofs_y Y offset
|
||||
* @param ofs_z Z offset
|
||||
* @param diag_x X diagonal (matrix 11)
|
||||
* @param diag_y Y diagonal (matrix 22)
|
||||
* @param diag_z Z diagonal (matrix 33)
|
||||
* @param offdiag_x X off-diagonal (matrix 12 and 21)
|
||||
* @param offdiag_y Y off-diagonal (matrix 13 and 31)
|
||||
* @param offdiag_z Z off-diagonal (matrix 32 and 23)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mag_cal_report_send(mavlink_channel_t chan, uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t autosaved, float fitness, float ofs_x, float ofs_y, float ofs_z, float diag_x, float diag_y, float diag_z, float offdiag_x, float offdiag_y, float offdiag_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN];
|
||||
_mav_put_float(buf, 0, fitness);
|
||||
_mav_put_float(buf, 4, ofs_x);
|
||||
_mav_put_float(buf, 8, ofs_y);
|
||||
_mav_put_float(buf, 12, ofs_z);
|
||||
_mav_put_float(buf, 16, diag_x);
|
||||
_mav_put_float(buf, 20, diag_y);
|
||||
_mav_put_float(buf, 24, diag_z);
|
||||
_mav_put_float(buf, 28, offdiag_x);
|
||||
_mav_put_float(buf, 32, offdiag_y);
|
||||
_mav_put_float(buf, 36, offdiag_z);
|
||||
_mav_put_uint8_t(buf, 40, compass_id);
|
||||
_mav_put_uint8_t(buf, 41, cal_mask);
|
||||
_mav_put_uint8_t(buf, 42, cal_status);
|
||||
_mav_put_uint8_t(buf, 43, autosaved);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, buf, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
|
||||
#else
|
||||
mavlink_mag_cal_report_t packet;
|
||||
packet.fitness = fitness;
|
||||
packet.ofs_x = ofs_x;
|
||||
packet.ofs_y = ofs_y;
|
||||
packet.ofs_z = ofs_z;
|
||||
packet.diag_x = diag_x;
|
||||
packet.diag_y = diag_y;
|
||||
packet.diag_z = diag_z;
|
||||
packet.offdiag_x = offdiag_x;
|
||||
packet.offdiag_y = offdiag_y;
|
||||
packet.offdiag_z = offdiag_z;
|
||||
packet.compass_id = compass_id;
|
||||
packet.cal_mask = cal_mask;
|
||||
packet.cal_status = cal_status;
|
||||
packet.autosaved = autosaved;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, (const char *)&packet, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mag_cal_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mag_cal_report_send_struct(mavlink_channel_t chan, const mavlink_mag_cal_report_t* mag_cal_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mag_cal_report_send(chan, mag_cal_report->compass_id, mag_cal_report->cal_mask, mag_cal_report->cal_status, mag_cal_report->autosaved, mag_cal_report->fitness, mag_cal_report->ofs_x, mag_cal_report->ofs_y, mag_cal_report->ofs_z, mag_cal_report->diag_x, mag_cal_report->diag_y, mag_cal_report->diag_z, mag_cal_report->offdiag_x, mag_cal_report->offdiag_y, mag_cal_report->offdiag_z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, (const char *)mag_cal_report, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mag_cal_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t autosaved, float fitness, float ofs_x, float ofs_y, float ofs_z, float diag_x, float diag_y, float diag_z, float offdiag_x, float offdiag_y, float offdiag_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, fitness);
|
||||
_mav_put_float(buf, 4, ofs_x);
|
||||
_mav_put_float(buf, 8, ofs_y);
|
||||
_mav_put_float(buf, 12, ofs_z);
|
||||
_mav_put_float(buf, 16, diag_x);
|
||||
_mav_put_float(buf, 20, diag_y);
|
||||
_mav_put_float(buf, 24, diag_z);
|
||||
_mav_put_float(buf, 28, offdiag_x);
|
||||
_mav_put_float(buf, 32, offdiag_y);
|
||||
_mav_put_float(buf, 36, offdiag_z);
|
||||
_mav_put_uint8_t(buf, 40, compass_id);
|
||||
_mav_put_uint8_t(buf, 41, cal_mask);
|
||||
_mav_put_uint8_t(buf, 42, cal_status);
|
||||
_mav_put_uint8_t(buf, 43, autosaved);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, buf, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
|
||||
#else
|
||||
mavlink_mag_cal_report_t *packet = (mavlink_mag_cal_report_t *)msgbuf;
|
||||
packet->fitness = fitness;
|
||||
packet->ofs_x = ofs_x;
|
||||
packet->ofs_y = ofs_y;
|
||||
packet->ofs_z = ofs_z;
|
||||
packet->diag_x = diag_x;
|
||||
packet->diag_y = diag_y;
|
||||
packet->diag_z = diag_z;
|
||||
packet->offdiag_x = offdiag_x;
|
||||
packet->offdiag_y = offdiag_y;
|
||||
packet->offdiag_z = offdiag_z;
|
||||
packet->compass_id = compass_id;
|
||||
packet->cal_mask = cal_mask;
|
||||
packet->cal_status = cal_status;
|
||||
packet->autosaved = autosaved;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, (const char *)packet, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MAG_CAL_REPORT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field compass_id from mag_cal_report message
|
||||
*
|
||||
* @return Compass being calibrated
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_report_get_compass_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cal_mask from mag_cal_report message
|
||||
*
|
||||
* @return Bitmask of compasses being calibrated
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_report_get_cal_mask(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 41);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cal_status from mag_cal_report message
|
||||
*
|
||||
* @return Status (see MAG_CAL_STATUS enum)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_report_get_cal_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field autosaved from mag_cal_report message
|
||||
*
|
||||
* @return 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mag_cal_report_get_autosaved(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 43);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fitness from mag_cal_report message
|
||||
*
|
||||
* @return RMS milligauss residuals
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_fitness(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ofs_x from mag_cal_report message
|
||||
*
|
||||
* @return X offset
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_ofs_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ofs_y from mag_cal_report message
|
||||
*
|
||||
* @return Y offset
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_ofs_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ofs_z from mag_cal_report message
|
||||
*
|
||||
* @return Z offset
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_ofs_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diag_x from mag_cal_report message
|
||||
*
|
||||
* @return X diagonal (matrix 11)
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_diag_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diag_y from mag_cal_report message
|
||||
*
|
||||
* @return Y diagonal (matrix 22)
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_diag_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field diag_z from mag_cal_report message
|
||||
*
|
||||
* @return Z diagonal (matrix 33)
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_diag_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field offdiag_x from mag_cal_report message
|
||||
*
|
||||
* @return X off-diagonal (matrix 12 and 21)
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_offdiag_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field offdiag_y from mag_cal_report message
|
||||
*
|
||||
* @return Y off-diagonal (matrix 13 and 31)
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_offdiag_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field offdiag_z from mag_cal_report message
|
||||
*
|
||||
* @return Z off-diagonal (matrix 32 and 23)
|
||||
*/
|
||||
static inline float mavlink_msg_mag_cal_report_get_offdiag_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mag_cal_report message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mag_cal_report C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mag_cal_report_decode(const mavlink_message_t* msg, mavlink_mag_cal_report_t* mag_cal_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mag_cal_report->fitness = mavlink_msg_mag_cal_report_get_fitness(msg);
|
||||
mag_cal_report->ofs_x = mavlink_msg_mag_cal_report_get_ofs_x(msg);
|
||||
mag_cal_report->ofs_y = mavlink_msg_mag_cal_report_get_ofs_y(msg);
|
||||
mag_cal_report->ofs_z = mavlink_msg_mag_cal_report_get_ofs_z(msg);
|
||||
mag_cal_report->diag_x = mavlink_msg_mag_cal_report_get_diag_x(msg);
|
||||
mag_cal_report->diag_y = mavlink_msg_mag_cal_report_get_diag_y(msg);
|
||||
mag_cal_report->diag_z = mavlink_msg_mag_cal_report_get_diag_z(msg);
|
||||
mag_cal_report->offdiag_x = mavlink_msg_mag_cal_report_get_offdiag_x(msg);
|
||||
mag_cal_report->offdiag_y = mavlink_msg_mag_cal_report_get_offdiag_y(msg);
|
||||
mag_cal_report->offdiag_z = mavlink_msg_mag_cal_report_get_offdiag_z(msg);
|
||||
mag_cal_report->compass_id = mavlink_msg_mag_cal_report_get_compass_id(msg);
|
||||
mag_cal_report->cal_mask = mavlink_msg_mag_cal_report_get_cal_mask(msg);
|
||||
mag_cal_report->cal_status = mavlink_msg_mag_cal_report_get_cal_status(msg);
|
||||
mag_cal_report->autosaved = mavlink_msg_mag_cal_report_get_autosaved(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN? msg->len : MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN;
|
||||
memset(mag_cal_report, 0, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
|
||||
memcpy(mag_cal_report, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE MEMINFO PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MEMINFO 152
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_meminfo_t {
|
||||
uint16_t brkval; /*< heap top*/
|
||||
uint16_t freemem; /*< free memory*/
|
||||
}) mavlink_meminfo_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MEMINFO_LEN 4
|
||||
#define MAVLINK_MSG_ID_MEMINFO_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_152_LEN 4
|
||||
#define MAVLINK_MSG_ID_152_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_MEMINFO_CRC 208
|
||||
#define MAVLINK_MSG_ID_152_CRC 208
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MEMINFO { \
|
||||
152, \
|
||||
"MEMINFO", \
|
||||
2, \
|
||||
{ { "brkval", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_meminfo_t, brkval) }, \
|
||||
{ "freemem", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_meminfo_t, freemem) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MEMINFO { \
|
||||
"MEMINFO", \
|
||||
2, \
|
||||
{ { "brkval", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_meminfo_t, brkval) }, \
|
||||
{ "freemem", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_meminfo_t, freemem) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a meminfo 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 brkval heap top
|
||||
* @param freemem free memory
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t brkval, uint16_t freemem)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MEMINFO_LEN];
|
||||
_mav_put_uint16_t(buf, 0, brkval);
|
||||
_mav_put_uint16_t(buf, 2, freemem);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMINFO_LEN);
|
||||
#else
|
||||
mavlink_meminfo_t packet;
|
||||
packet.brkval = brkval;
|
||||
packet.freemem = freemem;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMINFO_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMINFO;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MEMINFO_MIN_LEN, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a meminfo message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param brkval heap top
|
||||
* @param freemem free memory
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t brkval,uint16_t freemem)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MEMINFO_LEN];
|
||||
_mav_put_uint16_t(buf, 0, brkval);
|
||||
_mav_put_uint16_t(buf, 2, freemem);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MEMINFO_LEN);
|
||||
#else
|
||||
mavlink_meminfo_t packet;
|
||||
packet.brkval = brkval;
|
||||
packet.freemem = freemem;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MEMINFO_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MEMINFO;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MEMINFO_MIN_LEN, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a meminfo struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param meminfo C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_meminfo_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_meminfo_t* meminfo)
|
||||
{
|
||||
return mavlink_msg_meminfo_pack(system_id, component_id, msg, meminfo->brkval, meminfo->freemem);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a meminfo struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param meminfo C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_meminfo_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_meminfo_t* meminfo)
|
||||
{
|
||||
return mavlink_msg_meminfo_pack_chan(system_id, component_id, chan, msg, meminfo->brkval, meminfo->freemem);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a meminfo message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param brkval heap top
|
||||
* @param freemem free memory
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_meminfo_send(mavlink_channel_t chan, uint16_t brkval, uint16_t freemem)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MEMINFO_LEN];
|
||||
_mav_put_uint16_t(buf, 0, brkval);
|
||||
_mav_put_uint16_t(buf, 2, freemem);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, MAVLINK_MSG_ID_MEMINFO_MIN_LEN, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC);
|
||||
#else
|
||||
mavlink_meminfo_t packet;
|
||||
packet.brkval = brkval;
|
||||
packet.freemem = freemem;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)&packet, MAVLINK_MSG_ID_MEMINFO_MIN_LEN, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a meminfo message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_meminfo_send_struct(mavlink_channel_t chan, const mavlink_meminfo_t* meminfo)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_meminfo_send(chan, meminfo->brkval, meminfo->freemem);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)meminfo, MAVLINK_MSG_ID_MEMINFO_MIN_LEN, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MEMINFO_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_meminfo_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t brkval, uint16_t freemem)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, brkval);
|
||||
_mav_put_uint16_t(buf, 2, freemem);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, MAVLINK_MSG_ID_MEMINFO_MIN_LEN, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC);
|
||||
#else
|
||||
mavlink_meminfo_t *packet = (mavlink_meminfo_t *)msgbuf;
|
||||
packet->brkval = brkval;
|
||||
packet->freemem = freemem;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)packet, MAVLINK_MSG_ID_MEMINFO_MIN_LEN, MAVLINK_MSG_ID_MEMINFO_LEN, MAVLINK_MSG_ID_MEMINFO_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MEMINFO UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field brkval from meminfo message
|
||||
*
|
||||
* @return heap top
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_meminfo_get_brkval(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field freemem from meminfo message
|
||||
*
|
||||
* @return free memory
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_meminfo_get_freemem(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a meminfo message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param meminfo C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_meminfo_decode(const mavlink_message_t* msg, mavlink_meminfo_t* meminfo)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
meminfo->brkval = mavlink_msg_meminfo_get_brkval(msg);
|
||||
meminfo->freemem = mavlink_msg_meminfo_get_freemem(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MEMINFO_LEN? msg->len : MAVLINK_MSG_ID_MEMINFO_LEN;
|
||||
memset(meminfo, 0, MAVLINK_MSG_ID_MEMINFO_LEN);
|
||||
memcpy(meminfo, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-338
@@ -1,338 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE MOUNT_CONFIGURE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE 156
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mount_configure_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t mount_mode; /*< mount operating mode (see MAV_MOUNT_MODE enum)*/
|
||||
uint8_t stab_roll; /*< (1 = yes, 0 = no)*/
|
||||
uint8_t stab_pitch; /*< (1 = yes, 0 = no)*/
|
||||
uint8_t stab_yaw; /*< (1 = yes, 0 = no)*/
|
||||
}) mavlink_mount_configure_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN 6
|
||||
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN 6
|
||||
#define MAVLINK_MSG_ID_156_LEN 6
|
||||
#define MAVLINK_MSG_ID_156_MIN_LEN 6
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC 19
|
||||
#define MAVLINK_MSG_ID_156_CRC 19
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \
|
||||
156, \
|
||||
"MOUNT_CONFIGURE", \
|
||||
6, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \
|
||||
{ "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \
|
||||
{ "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \
|
||||
{ "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \
|
||||
{ "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \
|
||||
"MOUNT_CONFIGURE", \
|
||||
6, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \
|
||||
{ "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \
|
||||
{ "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \
|
||||
{ "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \
|
||||
{ "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mount_configure message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
|
||||
* @param stab_roll (1 = yes, 0 = no)
|
||||
* @param stab_pitch (1 = yes, 0 = no)
|
||||
* @param stab_yaw (1 = yes, 0 = no)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mount_mode);
|
||||
_mav_put_uint8_t(buf, 3, stab_roll);
|
||||
_mav_put_uint8_t(buf, 4, stab_pitch);
|
||||
_mav_put_uint8_t(buf, 5, stab_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
|
||||
#else
|
||||
mavlink_mount_configure_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mount_mode = mount_mode;
|
||||
packet.stab_roll = stab_roll;
|
||||
packet.stab_pitch = stab_pitch;
|
||||
packet.stab_yaw = stab_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mount_configure message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
|
||||
* @param stab_roll (1 = yes, 0 = no)
|
||||
* @param stab_pitch (1 = yes, 0 = no)
|
||||
* @param stab_yaw (1 = yes, 0 = no)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t mount_mode,uint8_t stab_roll,uint8_t stab_pitch,uint8_t stab_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mount_mode);
|
||||
_mav_put_uint8_t(buf, 3, stab_roll);
|
||||
_mav_put_uint8_t(buf, 4, stab_pitch);
|
||||
_mav_put_uint8_t(buf, 5, stab_yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
|
||||
#else
|
||||
mavlink_mount_configure_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mount_mode = mount_mode;
|
||||
packet.stab_roll = stab_roll;
|
||||
packet.stab_pitch = stab_pitch;
|
||||
packet.stab_yaw = stab_yaw;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mount_configure struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mount_configure C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure)
|
||||
{
|
||||
return mavlink_msg_mount_configure_pack(system_id, component_id, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mount_configure struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mount_configure C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_configure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure)
|
||||
{
|
||||
return mavlink_msg_mount_configure_pack_chan(system_id, component_id, chan, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mount_configure message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
|
||||
* @param stab_roll (1 = yes, 0 = no)
|
||||
* @param stab_pitch (1 = yes, 0 = no)
|
||||
* @param stab_yaw (1 = yes, 0 = no)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mount_mode);
|
||||
_mav_put_uint8_t(buf, 3, stab_roll);
|
||||
_mav_put_uint8_t(buf, 4, stab_pitch);
|
||||
_mav_put_uint8_t(buf, 5, stab_yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
|
||||
#else
|
||||
mavlink_mount_configure_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.mount_mode = mount_mode;
|
||||
packet.stab_roll = stab_roll;
|
||||
packet.stab_pitch = stab_pitch;
|
||||
packet.stab_yaw = stab_yaw;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mount_configure message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mount_configure_send_struct(mavlink_channel_t chan, const mavlink_mount_configure_t* mount_configure)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mount_configure_send(chan, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)mount_configure, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mount_configure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, mount_mode);
|
||||
_mav_put_uint8_t(buf, 3, stab_roll);
|
||||
_mav_put_uint8_t(buf, 4, stab_pitch);
|
||||
_mav_put_uint8_t(buf, 5, stab_yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
|
||||
#else
|
||||
mavlink_mount_configure_t *packet = (mavlink_mount_configure_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->mount_mode = mount_mode;
|
||||
packet->stab_roll = stab_roll;
|
||||
packet->stab_pitch = stab_pitch;
|
||||
packet->stab_yaw = stab_yaw;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MOUNT_CONFIGURE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mount_configure message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_configure_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mount_configure message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_configure_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mount_mode from mount_configure message
|
||||
*
|
||||
* @return mount operating mode (see MAV_MOUNT_MODE enum)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_configure_get_mount_mode(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field stab_roll from mount_configure message
|
||||
*
|
||||
* @return (1 = yes, 0 = no)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_configure_get_stab_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field stab_pitch from mount_configure message
|
||||
*
|
||||
* @return (1 = yes, 0 = no)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_configure_get_stab_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field stab_yaw from mount_configure message
|
||||
*
|
||||
* @return (1 = yes, 0 = no)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_configure_get_stab_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mount_configure message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mount_configure C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mount_configure_decode(const mavlink_message_t* msg, mavlink_mount_configure_t* mount_configure)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mount_configure->target_system = mavlink_msg_mount_configure_get_target_system(msg);
|
||||
mount_configure->target_component = mavlink_msg_mount_configure_get_target_component(msg);
|
||||
mount_configure->mount_mode = mavlink_msg_mount_configure_get_mount_mode(msg);
|
||||
mount_configure->stab_roll = mavlink_msg_mount_configure_get_stab_roll(msg);
|
||||
mount_configure->stab_pitch = mavlink_msg_mount_configure_get_stab_pitch(msg);
|
||||
mount_configure->stab_yaw = mavlink_msg_mount_configure_get_stab_yaw(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN? msg->len : MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN;
|
||||
memset(mount_configure, 0, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
|
||||
memcpy(mount_configure, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-338
@@ -1,338 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE MOUNT_CONTROL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_CONTROL 157
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mount_control_t {
|
||||
int32_t input_a; /*< pitch(deg*100) or lat, depending on mount mode*/
|
||||
int32_t input_b; /*< roll(deg*100) or lon depending on mount mode*/
|
||||
int32_t input_c; /*< yaw(deg*100) or alt (in cm) depending on mount mode*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t save_position; /*< if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)*/
|
||||
}) mavlink_mount_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_CONTROL_LEN 15
|
||||
#define MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN 15
|
||||
#define MAVLINK_MSG_ID_157_LEN 15
|
||||
#define MAVLINK_MSG_ID_157_MIN_LEN 15
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_CONTROL_CRC 21
|
||||
#define MAVLINK_MSG_ID_157_CRC 21
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MOUNT_CONTROL { \
|
||||
157, \
|
||||
"MOUNT_CONTROL", \
|
||||
6, \
|
||||
{ { "input_a", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_mount_control_t, input_a) }, \
|
||||
{ "input_b", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_mount_control_t, input_b) }, \
|
||||
{ "input_c", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mount_control_t, input_c) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mount_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mount_control_t, target_component) }, \
|
||||
{ "save_position", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mount_control_t, save_position) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MOUNT_CONTROL { \
|
||||
"MOUNT_CONTROL", \
|
||||
6, \
|
||||
{ { "input_a", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_mount_control_t, input_a) }, \
|
||||
{ "input_b", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_mount_control_t, input_b) }, \
|
||||
{ "input_c", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mount_control_t, input_c) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mount_control_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mount_control_t, target_component) }, \
|
||||
{ "save_position", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mount_control_t, save_position) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mount_control message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param input_a pitch(deg*100) or lat, depending on mount mode
|
||||
* @param input_b roll(deg*100) or lon depending on mount mode
|
||||
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
|
||||
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_CONTROL_LEN];
|
||||
_mav_put_int32_t(buf, 0, input_a);
|
||||
_mav_put_int32_t(buf, 4, input_b);
|
||||
_mav_put_int32_t(buf, 8, input_c);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
_mav_put_uint8_t(buf, 14, save_position);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_mount_control_t packet;
|
||||
packet.input_a = input_a;
|
||||
packet.input_b = input_b;
|
||||
packet.input_c = input_c;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.save_position = save_position;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mount_control message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param input_a pitch(deg*100) or lat, depending on mount mode
|
||||
* @param input_b roll(deg*100) or lon depending on mount mode
|
||||
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
|
||||
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,int32_t input_a,int32_t input_b,int32_t input_c,uint8_t save_position)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_CONTROL_LEN];
|
||||
_mav_put_int32_t(buf, 0, input_a);
|
||||
_mav_put_int32_t(buf, 4, input_b);
|
||||
_mav_put_int32_t(buf, 8, input_c);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
_mav_put_uint8_t(buf, 14, save_position);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN);
|
||||
#else
|
||||
mavlink_mount_control_t packet;
|
||||
packet.input_a = input_a;
|
||||
packet.input_b = input_b;
|
||||
packet.input_c = input_c;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.save_position = save_position;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mount_control struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mount_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_control_t* mount_control)
|
||||
{
|
||||
return mavlink_msg_mount_control_pack(system_id, component_id, msg, mount_control->target_system, mount_control->target_component, mount_control->input_a, mount_control->input_b, mount_control->input_c, mount_control->save_position);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mount_control struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mount_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mount_control_t* mount_control)
|
||||
{
|
||||
return mavlink_msg_mount_control_pack_chan(system_id, component_id, chan, msg, mount_control->target_system, mount_control->target_component, mount_control->input_a, mount_control->input_b, mount_control->input_c, mount_control->save_position);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mount_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param input_a pitch(deg*100) or lat, depending on mount mode
|
||||
* @param input_b roll(deg*100) or lon depending on mount mode
|
||||
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
|
||||
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mount_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_CONTROL_LEN];
|
||||
_mav_put_int32_t(buf, 0, input_a);
|
||||
_mav_put_int32_t(buf, 4, input_b);
|
||||
_mav_put_int32_t(buf, 8, input_c);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
_mav_put_uint8_t(buf, 14, save_position);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, buf, MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_mount_control_t packet;
|
||||
packet.input_a = input_a;
|
||||
packet.input_b = input_b;
|
||||
packet.input_c = input_c;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.save_position = save_position;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mount_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mount_control_send_struct(mavlink_channel_t chan, const mavlink_mount_control_t* mount_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mount_control_send(chan, mount_control->target_system, mount_control->target_component, mount_control->input_a, mount_control->input_b, mount_control->input_c, mount_control->save_position);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)mount_control, MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MOUNT_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mount_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, input_a);
|
||||
_mav_put_int32_t(buf, 4, input_b);
|
||||
_mav_put_int32_t(buf, 8, input_c);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
_mav_put_uint8_t(buf, 14, save_position);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, buf, MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_mount_control_t *packet = (mavlink_mount_control_t *)msgbuf;
|
||||
packet->input_a = input_a;
|
||||
packet->input_b = input_b;
|
||||
packet->input_c = input_c;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->save_position = save_position;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)packet, MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN, MAVLINK_MSG_ID_MOUNT_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MOUNT_CONTROL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mount_control message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_control_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mount_control message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_control_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field input_a from mount_control message
|
||||
*
|
||||
* @return pitch(deg*100) or lat, depending on mount mode
|
||||
*/
|
||||
static inline int32_t mavlink_msg_mount_control_get_input_a(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field input_b from mount_control message
|
||||
*
|
||||
* @return roll(deg*100) or lon depending on mount mode
|
||||
*/
|
||||
static inline int32_t mavlink_msg_mount_control_get_input_b(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field input_c from mount_control message
|
||||
*
|
||||
* @return yaw(deg*100) or alt (in cm) depending on mount mode
|
||||
*/
|
||||
static inline int32_t mavlink_msg_mount_control_get_input_c(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field save_position from mount_control message
|
||||
*
|
||||
* @return if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_control_get_save_position(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mount_control message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mount_control C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mount_control_decode(const mavlink_message_t* msg, mavlink_mount_control_t* mount_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mount_control->input_a = mavlink_msg_mount_control_get_input_a(msg);
|
||||
mount_control->input_b = mavlink_msg_mount_control_get_input_b(msg);
|
||||
mount_control->input_c = mavlink_msg_mount_control_get_input_c(msg);
|
||||
mount_control->target_system = mavlink_msg_mount_control_get_target_system(msg);
|
||||
mount_control->target_component = mavlink_msg_mount_control_get_target_component(msg);
|
||||
mount_control->save_position = mavlink_msg_mount_control_get_save_position(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MOUNT_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_MOUNT_CONTROL_LEN;
|
||||
memset(mount_control, 0, MAVLINK_MSG_ID_MOUNT_CONTROL_LEN);
|
||||
memcpy(mount_control, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-313
@@ -1,313 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE MOUNT_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_STATUS 158
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_mount_status_t {
|
||||
int32_t pointing_a; /*< pitch(deg*100)*/
|
||||
int32_t pointing_b; /*< roll(deg*100)*/
|
||||
int32_t pointing_c; /*< yaw(deg*100)*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_mount_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_STATUS_LEN 14
|
||||
#define MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN 14
|
||||
#define MAVLINK_MSG_ID_158_LEN 14
|
||||
#define MAVLINK_MSG_ID_158_MIN_LEN 14
|
||||
|
||||
#define MAVLINK_MSG_ID_MOUNT_STATUS_CRC 134
|
||||
#define MAVLINK_MSG_ID_158_CRC 134
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_MOUNT_STATUS { \
|
||||
158, \
|
||||
"MOUNT_STATUS", \
|
||||
5, \
|
||||
{ { "pointing_a", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_mount_status_t, pointing_a) }, \
|
||||
{ "pointing_b", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_mount_status_t, pointing_b) }, \
|
||||
{ "pointing_c", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mount_status_t, pointing_c) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mount_status_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mount_status_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_MOUNT_STATUS { \
|
||||
"MOUNT_STATUS", \
|
||||
5, \
|
||||
{ { "pointing_a", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_mount_status_t, pointing_a) }, \
|
||||
{ "pointing_b", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_mount_status_t, pointing_b) }, \
|
||||
{ "pointing_c", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mount_status_t, pointing_c) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mount_status_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mount_status_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a mount_status message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param pointing_a pitch(deg*100)
|
||||
* @param pointing_b roll(deg*100)
|
||||
* @param pointing_c yaw(deg*100)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, pointing_a);
|
||||
_mav_put_int32_t(buf, 4, pointing_b);
|
||||
_mav_put_int32_t(buf, 8, pointing_c);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_STATUS_LEN);
|
||||
#else
|
||||
mavlink_mount_status_t packet;
|
||||
packet.pointing_a = pointing_a;
|
||||
packet.pointing_b = pointing_b;
|
||||
packet.pointing_c = pointing_c;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a mount_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param pointing_a pitch(deg*100)
|
||||
* @param pointing_b roll(deg*100)
|
||||
* @param pointing_c yaw(deg*100)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,int32_t pointing_a,int32_t pointing_b,int32_t pointing_c)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, pointing_a);
|
||||
_mav_put_int32_t(buf, 4, pointing_b);
|
||||
_mav_put_int32_t(buf, 8, pointing_c);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_STATUS_LEN);
|
||||
#else
|
||||
mavlink_mount_status_t packet;
|
||||
packet.pointing_a = pointing_a;
|
||||
packet.pointing_b = pointing_b;
|
||||
packet.pointing_c = pointing_c;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mount_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mount_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_status_t* mount_status)
|
||||
{
|
||||
return mavlink_msg_mount_status_pack(system_id, component_id, msg, mount_status->target_system, mount_status->target_component, mount_status->pointing_a, mount_status->pointing_b, mount_status->pointing_c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a mount_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mount_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_mount_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mount_status_t* mount_status)
|
||||
{
|
||||
return mavlink_msg_mount_status_pack_chan(system_id, component_id, chan, msg, mount_status->target_system, mount_status->target_component, mount_status->pointing_a, mount_status->pointing_b, mount_status->pointing_c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mount_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param pointing_a pitch(deg*100)
|
||||
* @param pointing_b roll(deg*100)
|
||||
* @param pointing_c yaw(deg*100)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_mount_status_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_MOUNT_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, pointing_a);
|
||||
_mav_put_int32_t(buf, 4, pointing_b);
|
||||
_mav_put_int32_t(buf, 8, pointing_c);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, buf, MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC);
|
||||
#else
|
||||
mavlink_mount_status_t packet;
|
||||
packet.pointing_a = pointing_a;
|
||||
packet.pointing_b = pointing_b;
|
||||
packet.pointing_c = pointing_c;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a mount_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_mount_status_send_struct(mavlink_channel_t chan, const mavlink_mount_status_t* mount_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_mount_status_send(chan, mount_status->target_system, mount_status->target_component, mount_status->pointing_a, mount_status->pointing_b, mount_status->pointing_c);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)mount_status, MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_MOUNT_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_mount_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, pointing_a);
|
||||
_mav_put_int32_t(buf, 4, pointing_b);
|
||||
_mav_put_int32_t(buf, 8, pointing_c);
|
||||
_mav_put_uint8_t(buf, 12, target_system);
|
||||
_mav_put_uint8_t(buf, 13, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, buf, MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC);
|
||||
#else
|
||||
mavlink_mount_status_t *packet = (mavlink_mount_status_t *)msgbuf;
|
||||
packet->pointing_a = pointing_a;
|
||||
packet->pointing_b = pointing_b;
|
||||
packet->pointing_c = pointing_c;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)packet, MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_LEN, MAVLINK_MSG_ID_MOUNT_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE MOUNT_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from mount_status message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_status_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from mount_status message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_mount_status_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pointing_a from mount_status message
|
||||
*
|
||||
* @return pitch(deg*100)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_mount_status_get_pointing_a(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pointing_b from mount_status message
|
||||
*
|
||||
* @return roll(deg*100)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_mount_status_get_pointing_b(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pointing_c from mount_status message
|
||||
*
|
||||
* @return yaw(deg*100)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_mount_status_get_pointing_c(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a mount_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param mount_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_mount_status_decode(const mavlink_message_t* msg, mavlink_mount_status_t* mount_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mount_status->pointing_a = mavlink_msg_mount_status_get_pointing_a(msg);
|
||||
mount_status->pointing_b = mavlink_msg_mount_status_get_pointing_b(msg);
|
||||
mount_status->pointing_c = mavlink_msg_mount_status_get_pointing_c(msg);
|
||||
mount_status->target_system = mavlink_msg_mount_status_get_target_system(msg);
|
||||
mount_status->target_component = mavlink_msg_mount_status_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_MOUNT_STATUS_LEN? msg->len : MAVLINK_MSG_ID_MOUNT_STATUS_LEN;
|
||||
memset(mount_status, 0, MAVLINK_MSG_ID_MOUNT_STATUS_LEN);
|
||||
memcpy(mount_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-363
@@ -1,363 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE PID_TUNING PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_PID_TUNING 194
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_pid_tuning_t {
|
||||
float desired; /*< desired rate (degrees/s)*/
|
||||
float achieved; /*< achieved rate (degrees/s)*/
|
||||
float FF; /*< FF component*/
|
||||
float P; /*< P component*/
|
||||
float I; /*< I component*/
|
||||
float D; /*< D component*/
|
||||
uint8_t axis; /*< axis*/
|
||||
}) mavlink_pid_tuning_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_PID_TUNING_LEN 25
|
||||
#define MAVLINK_MSG_ID_PID_TUNING_MIN_LEN 25
|
||||
#define MAVLINK_MSG_ID_194_LEN 25
|
||||
#define MAVLINK_MSG_ID_194_MIN_LEN 25
|
||||
|
||||
#define MAVLINK_MSG_ID_PID_TUNING_CRC 98
|
||||
#define MAVLINK_MSG_ID_194_CRC 98
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_PID_TUNING { \
|
||||
194, \
|
||||
"PID_TUNING", \
|
||||
7, \
|
||||
{ { "desired", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_pid_tuning_t, desired) }, \
|
||||
{ "achieved", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_pid_tuning_t, achieved) }, \
|
||||
{ "FF", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_pid_tuning_t, FF) }, \
|
||||
{ "P", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_pid_tuning_t, P) }, \
|
||||
{ "I", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_pid_tuning_t, I) }, \
|
||||
{ "D", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_pid_tuning_t, D) }, \
|
||||
{ "axis", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_pid_tuning_t, axis) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_PID_TUNING { \
|
||||
"PID_TUNING", \
|
||||
7, \
|
||||
{ { "desired", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_pid_tuning_t, desired) }, \
|
||||
{ "achieved", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_pid_tuning_t, achieved) }, \
|
||||
{ "FF", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_pid_tuning_t, FF) }, \
|
||||
{ "P", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_pid_tuning_t, P) }, \
|
||||
{ "I", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_pid_tuning_t, I) }, \
|
||||
{ "D", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_pid_tuning_t, D) }, \
|
||||
{ "axis", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_pid_tuning_t, axis) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a pid_tuning 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 axis axis
|
||||
* @param desired desired rate (degrees/s)
|
||||
* @param achieved achieved rate (degrees/s)
|
||||
* @param FF FF component
|
||||
* @param P P component
|
||||
* @param I I component
|
||||
* @param D D component
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_pid_tuning_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t axis, float desired, float achieved, float FF, float P, float I, float D)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_PID_TUNING_LEN];
|
||||
_mav_put_float(buf, 0, desired);
|
||||
_mav_put_float(buf, 4, achieved);
|
||||
_mav_put_float(buf, 8, FF);
|
||||
_mav_put_float(buf, 12, P);
|
||||
_mav_put_float(buf, 16, I);
|
||||
_mav_put_float(buf, 20, D);
|
||||
_mav_put_uint8_t(buf, 24, axis);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PID_TUNING_LEN);
|
||||
#else
|
||||
mavlink_pid_tuning_t packet;
|
||||
packet.desired = desired;
|
||||
packet.achieved = achieved;
|
||||
packet.FF = FF;
|
||||
packet.P = P;
|
||||
packet.I = I;
|
||||
packet.D = D;
|
||||
packet.axis = axis;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PID_TUNING_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PID_TUNING;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PID_TUNING_MIN_LEN, MAVLINK_MSG_ID_PID_TUNING_LEN, MAVLINK_MSG_ID_PID_TUNING_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a pid_tuning message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param axis axis
|
||||
* @param desired desired rate (degrees/s)
|
||||
* @param achieved achieved rate (degrees/s)
|
||||
* @param FF FF component
|
||||
* @param P P component
|
||||
* @param I I component
|
||||
* @param D D component
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_pid_tuning_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t axis,float desired,float achieved,float FF,float P,float I,float D)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_PID_TUNING_LEN];
|
||||
_mav_put_float(buf, 0, desired);
|
||||
_mav_put_float(buf, 4, achieved);
|
||||
_mav_put_float(buf, 8, FF);
|
||||
_mav_put_float(buf, 12, P);
|
||||
_mav_put_float(buf, 16, I);
|
||||
_mav_put_float(buf, 20, D);
|
||||
_mav_put_uint8_t(buf, 24, axis);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PID_TUNING_LEN);
|
||||
#else
|
||||
mavlink_pid_tuning_t packet;
|
||||
packet.desired = desired;
|
||||
packet.achieved = achieved;
|
||||
packet.FF = FF;
|
||||
packet.P = P;
|
||||
packet.I = I;
|
||||
packet.D = D;
|
||||
packet.axis = axis;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PID_TUNING_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_PID_TUNING;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PID_TUNING_MIN_LEN, MAVLINK_MSG_ID_PID_TUNING_LEN, MAVLINK_MSG_ID_PID_TUNING_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a pid_tuning struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param pid_tuning C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_pid_tuning_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_pid_tuning_t* pid_tuning)
|
||||
{
|
||||
return mavlink_msg_pid_tuning_pack(system_id, component_id, msg, pid_tuning->axis, pid_tuning->desired, pid_tuning->achieved, pid_tuning->FF, pid_tuning->P, pid_tuning->I, pid_tuning->D);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a pid_tuning struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param pid_tuning C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_pid_tuning_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_pid_tuning_t* pid_tuning)
|
||||
{
|
||||
return mavlink_msg_pid_tuning_pack_chan(system_id, component_id, chan, msg, pid_tuning->axis, pid_tuning->desired, pid_tuning->achieved, pid_tuning->FF, pid_tuning->P, pid_tuning->I, pid_tuning->D);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a pid_tuning message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param axis axis
|
||||
* @param desired desired rate (degrees/s)
|
||||
* @param achieved achieved rate (degrees/s)
|
||||
* @param FF FF component
|
||||
* @param P P component
|
||||
* @param I I component
|
||||
* @param D D component
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_pid_tuning_send(mavlink_channel_t chan, uint8_t axis, float desired, float achieved, float FF, float P, float I, float D)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_PID_TUNING_LEN];
|
||||
_mav_put_float(buf, 0, desired);
|
||||
_mav_put_float(buf, 4, achieved);
|
||||
_mav_put_float(buf, 8, FF);
|
||||
_mav_put_float(buf, 12, P);
|
||||
_mav_put_float(buf, 16, I);
|
||||
_mav_put_float(buf, 20, D);
|
||||
_mav_put_uint8_t(buf, 24, axis);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PID_TUNING, buf, MAVLINK_MSG_ID_PID_TUNING_MIN_LEN, MAVLINK_MSG_ID_PID_TUNING_LEN, MAVLINK_MSG_ID_PID_TUNING_CRC);
|
||||
#else
|
||||
mavlink_pid_tuning_t packet;
|
||||
packet.desired = desired;
|
||||
packet.achieved = achieved;
|
||||
packet.FF = FF;
|
||||
packet.P = P;
|
||||
packet.I = I;
|
||||
packet.D = D;
|
||||
packet.axis = axis;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PID_TUNING, (const char *)&packet, MAVLINK_MSG_ID_PID_TUNING_MIN_LEN, MAVLINK_MSG_ID_PID_TUNING_LEN, MAVLINK_MSG_ID_PID_TUNING_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a pid_tuning message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_pid_tuning_send_struct(mavlink_channel_t chan, const mavlink_pid_tuning_t* pid_tuning)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_pid_tuning_send(chan, pid_tuning->axis, pid_tuning->desired, pid_tuning->achieved, pid_tuning->FF, pid_tuning->P, pid_tuning->I, pid_tuning->D);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PID_TUNING, (const char *)pid_tuning, MAVLINK_MSG_ID_PID_TUNING_MIN_LEN, MAVLINK_MSG_ID_PID_TUNING_LEN, MAVLINK_MSG_ID_PID_TUNING_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_PID_TUNING_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_pid_tuning_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t axis, float desired, float achieved, float FF, float P, float I, float D)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, desired);
|
||||
_mav_put_float(buf, 4, achieved);
|
||||
_mav_put_float(buf, 8, FF);
|
||||
_mav_put_float(buf, 12, P);
|
||||
_mav_put_float(buf, 16, I);
|
||||
_mav_put_float(buf, 20, D);
|
||||
_mav_put_uint8_t(buf, 24, axis);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PID_TUNING, buf, MAVLINK_MSG_ID_PID_TUNING_MIN_LEN, MAVLINK_MSG_ID_PID_TUNING_LEN, MAVLINK_MSG_ID_PID_TUNING_CRC);
|
||||
#else
|
||||
mavlink_pid_tuning_t *packet = (mavlink_pid_tuning_t *)msgbuf;
|
||||
packet->desired = desired;
|
||||
packet->achieved = achieved;
|
||||
packet->FF = FF;
|
||||
packet->P = P;
|
||||
packet->I = I;
|
||||
packet->D = D;
|
||||
packet->axis = axis;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PID_TUNING, (const char *)packet, MAVLINK_MSG_ID_PID_TUNING_MIN_LEN, MAVLINK_MSG_ID_PID_TUNING_LEN, MAVLINK_MSG_ID_PID_TUNING_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE PID_TUNING UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field axis from pid_tuning message
|
||||
*
|
||||
* @return axis
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_pid_tuning_get_axis(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field desired from pid_tuning message
|
||||
*
|
||||
* @return desired rate (degrees/s)
|
||||
*/
|
||||
static inline float mavlink_msg_pid_tuning_get_desired(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field achieved from pid_tuning message
|
||||
*
|
||||
* @return achieved rate (degrees/s)
|
||||
*/
|
||||
static inline float mavlink_msg_pid_tuning_get_achieved(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field FF from pid_tuning message
|
||||
*
|
||||
* @return FF component
|
||||
*/
|
||||
static inline float mavlink_msg_pid_tuning_get_FF(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field P from pid_tuning message
|
||||
*
|
||||
* @return P component
|
||||
*/
|
||||
static inline float mavlink_msg_pid_tuning_get_P(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field I from pid_tuning message
|
||||
*
|
||||
* @return I component
|
||||
*/
|
||||
static inline float mavlink_msg_pid_tuning_get_I(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field D from pid_tuning message
|
||||
*
|
||||
* @return D component
|
||||
*/
|
||||
static inline float mavlink_msg_pid_tuning_get_D(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a pid_tuning message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param pid_tuning C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_pid_tuning_decode(const mavlink_message_t* msg, mavlink_pid_tuning_t* pid_tuning)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
pid_tuning->desired = mavlink_msg_pid_tuning_get_desired(msg);
|
||||
pid_tuning->achieved = mavlink_msg_pid_tuning_get_achieved(msg);
|
||||
pid_tuning->FF = mavlink_msg_pid_tuning_get_FF(msg);
|
||||
pid_tuning->P = mavlink_msg_pid_tuning_get_P(msg);
|
||||
pid_tuning->I = mavlink_msg_pid_tuning_get_I(msg);
|
||||
pid_tuning->D = mavlink_msg_pid_tuning_get_D(msg);
|
||||
pid_tuning->axis = mavlink_msg_pid_tuning_get_axis(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_PID_TUNING_LEN? msg->len : MAVLINK_MSG_ID_PID_TUNING_LEN;
|
||||
memset(pid_tuning, 0, MAVLINK_MSG_ID_PID_TUNING_LEN);
|
||||
memcpy(pid_tuning, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-363
@@ -1,363 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE RADIO PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RADIO 166
|
||||
|
||||
MAVPACKED(
|
||||
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_RADIO_MIN_LEN 9
|
||||
#define MAVLINK_MSG_ID_166_LEN 9
|
||||
#define MAVLINK_MSG_ID_166_MIN_LEN 9
|
||||
|
||||
#define MAVLINK_MSG_ID_RADIO_CRC 21
|
||||
#define MAVLINK_MSG_ID_166_CRC 21
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_RADIO { \
|
||||
166, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_RADIO_LEN];
|
||||
_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, MAVLINK_MSG_ID_RADIO_LEN);
|
||||
#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, MAVLINK_MSG_ID_RADIO_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RADIO;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_RADIO_LEN];
|
||||
_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, MAVLINK_MSG_ID_RADIO_LEN);
|
||||
#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, MAVLINK_MSG_ID_RADIO_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RADIO;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a radio struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a radio struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param radio C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_radio_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_radio_t* radio)
|
||||
{
|
||||
return mavlink_msg_radio_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_RADIO_LEN];
|
||||
_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, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
|
||||
#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, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a radio message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_radio_send_struct(mavlink_channel_t chan, const mavlink_radio_t* radio)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_radio_send(chan, radio->rssi, radio->remrssi, radio->txbuf, radio->noise, radio->remnoise, radio->rxerrors, radio->fixed);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (const char *)radio, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_RADIO_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_radio_send_buf(mavlink_message_t *msgbuf, 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 = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
|
||||
#else
|
||||
mavlink_radio_t *packet = (mavlink_radio_t *)msgbuf;
|
||||
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, MAVLINK_MSG_ID_RADIO_MIN_LEN, MAVLINK_MSG_ID_RADIO_LEN, MAVLINK_MSG_ID_RADIO_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_RADIO_LEN? msg->len : MAVLINK_MSG_ID_RADIO_LEN;
|
||||
memset(radio, 0, MAVLINK_MSG_ID_RADIO_LEN);
|
||||
memcpy(radio, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-263
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE RALLY_FETCH_POINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_FETCH_POINT 176
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_rally_fetch_point_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t idx; /*< point index (first point is 0)*/
|
||||
}) mavlink_rally_fetch_point_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN 3
|
||||
#define MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_176_LEN 3
|
||||
#define MAVLINK_MSG_ID_176_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC 234
|
||||
#define MAVLINK_MSG_ID_176_CRC 234
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_RALLY_FETCH_POINT { \
|
||||
176, \
|
||||
"RALLY_FETCH_POINT", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_rally_fetch_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_rally_fetch_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_rally_fetch_point_t, idx) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_RALLY_FETCH_POINT { \
|
||||
"RALLY_FETCH_POINT", \
|
||||
3, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_rally_fetch_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_rally_fetch_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_rally_fetch_point_t, idx) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a rally_fetch_point message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#else
|
||||
mavlink_rally_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a rally_fetch_point message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#else
|
||||
mavlink_rally_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rally_fetch_point struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rally_fetch_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rally_fetch_point_t* rally_fetch_point)
|
||||
{
|
||||
return mavlink_msg_rally_fetch_point_pack(system_id, component_id, msg, rally_fetch_point->target_system, rally_fetch_point->target_component, rally_fetch_point->idx);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rally_fetch_point struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rally_fetch_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_fetch_point_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rally_fetch_point_t* rally_fetch_point)
|
||||
{
|
||||
return mavlink_msg_rally_fetch_point_pack_chan(system_id, component_id, chan, msg, rally_fetch_point->target_system, rally_fetch_point->target_component, rally_fetch_point->idx);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rally_fetch_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_rally_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#else
|
||||
mavlink_rally_fetch_point_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, (const char *)&packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rally_fetch_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_rally_fetch_point_send_struct(mavlink_channel_t chan, const mavlink_rally_fetch_point_t* rally_fetch_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_rally_fetch_point_send(chan, rally_fetch_point->target_system, rally_fetch_point->target_component, rally_fetch_point->idx);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, (const char *)rally_fetch_point, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_rally_fetch_point_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, idx);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, buf, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#else
|
||||
mavlink_rally_fetch_point_t *packet = (mavlink_rally_fetch_point_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->idx = idx;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_FETCH_POINT, (const char *)packet, MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN, MAVLINK_MSG_ID_RALLY_FETCH_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RALLY_FETCH_POINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from rally_fetch_point message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_fetch_point_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from rally_fetch_point message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_fetch_point_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field idx from rally_fetch_point message
|
||||
*
|
||||
* @return point index (first point is 0)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_fetch_point_get_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a rally_fetch_point message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param rally_fetch_point C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_rally_fetch_point_decode(const mavlink_message_t* msg, mavlink_rally_fetch_point_t* rally_fetch_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
rally_fetch_point->target_system = mavlink_msg_rally_fetch_point_get_target_system(msg);
|
||||
rally_fetch_point->target_component = mavlink_msg_rally_fetch_point_get_target_component(msg);
|
||||
rally_fetch_point->idx = mavlink_msg_rally_fetch_point_get_idx(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN? msg->len : MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN;
|
||||
memset(rally_fetch_point, 0, MAVLINK_MSG_ID_RALLY_FETCH_POINT_LEN);
|
||||
memcpy(rally_fetch_point, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-438
@@ -1,438 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE RALLY_POINT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_POINT 175
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_rally_point_t {
|
||||
int32_t lat; /*< Latitude of point in degrees * 1E7*/
|
||||
int32_t lng; /*< Longitude of point in degrees * 1E7*/
|
||||
int16_t alt; /*< Transit / loiter altitude in meters relative to home*/
|
||||
int16_t break_alt; /*< Break altitude in meters relative to home*/
|
||||
uint16_t land_dir; /*< Heading to aim for when landing. In centi-degrees.*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t idx; /*< point index (first point is 0)*/
|
||||
uint8_t count; /*< total number of points (for sanity checking)*/
|
||||
uint8_t flags; /*< See RALLY_FLAGS enum for definition of the bitmask.*/
|
||||
}) mavlink_rally_point_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_POINT_LEN 19
|
||||
#define MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN 19
|
||||
#define MAVLINK_MSG_ID_175_LEN 19
|
||||
#define MAVLINK_MSG_ID_175_MIN_LEN 19
|
||||
|
||||
#define MAVLINK_MSG_ID_RALLY_POINT_CRC 138
|
||||
#define MAVLINK_MSG_ID_175_CRC 138
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_RALLY_POINT { \
|
||||
175, \
|
||||
"RALLY_POINT", \
|
||||
10, \
|
||||
{ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_rally_point_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_rally_point_t, lng) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rally_point_t, alt) }, \
|
||||
{ "break_alt", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rally_point_t, break_alt) }, \
|
||||
{ "land_dir", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rally_point_t, land_dir) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_rally_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_rally_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rally_point_t, idx) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rally_point_t, count) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_rally_point_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_RALLY_POINT { \
|
||||
"RALLY_POINT", \
|
||||
10, \
|
||||
{ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_rally_point_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_rally_point_t, lng) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rally_point_t, alt) }, \
|
||||
{ "break_alt", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rally_point_t, break_alt) }, \
|
||||
{ "land_dir", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rally_point_t, land_dir) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_rally_point_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_rally_point_t, target_component) }, \
|
||||
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rally_point_t, idx) }, \
|
||||
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rally_point_t, count) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_rally_point_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a rally_point message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point in degrees * 1E7
|
||||
* @param lng Longitude of point in degrees * 1E7
|
||||
* @param alt Transit / loiter altitude in meters relative to home
|
||||
* @param break_alt Break altitude in meters relative to home
|
||||
* @param land_dir Heading to aim for when landing. In centi-degrees.
|
||||
* @param flags See RALLY_FLAGS enum for definition of the bitmask.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, int32_t lat, int32_t lng, int16_t alt, int16_t break_alt, uint16_t land_dir, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lng);
|
||||
_mav_put_int16_t(buf, 8, alt);
|
||||
_mav_put_int16_t(buf, 10, break_alt);
|
||||
_mav_put_uint16_t(buf, 12, land_dir);
|
||||
_mav_put_uint8_t(buf, 14, target_system);
|
||||
_mav_put_uint8_t(buf, 15, target_component);
|
||||
_mav_put_uint8_t(buf, 16, idx);
|
||||
_mav_put_uint8_t(buf, 17, count);
|
||||
_mav_put_uint8_t(buf, 18, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#else
|
||||
mavlink_rally_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt = alt;
|
||||
packet.break_alt = break_alt;
|
||||
packet.land_dir = land_dir;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RALLY_POINT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a rally_point message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point in degrees * 1E7
|
||||
* @param lng Longitude of point in degrees * 1E7
|
||||
* @param alt Transit / loiter altitude in meters relative to home
|
||||
* @param break_alt Break altitude in meters relative to home
|
||||
* @param land_dir Heading to aim for when landing. In centi-degrees.
|
||||
* @param flags See RALLY_FLAGS enum for definition of the bitmask.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t idx,uint8_t count,int32_t lat,int32_t lng,int16_t alt,int16_t break_alt,uint16_t land_dir,uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lng);
|
||||
_mav_put_int16_t(buf, 8, alt);
|
||||
_mav_put_int16_t(buf, 10, break_alt);
|
||||
_mav_put_uint16_t(buf, 12, land_dir);
|
||||
_mav_put_uint8_t(buf, 14, target_system);
|
||||
_mav_put_uint8_t(buf, 15, target_component);
|
||||
_mav_put_uint8_t(buf, 16, idx);
|
||||
_mav_put_uint8_t(buf, 17, count);
|
||||
_mav_put_uint8_t(buf, 18, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#else
|
||||
mavlink_rally_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt = alt;
|
||||
packet.break_alt = break_alt;
|
||||
packet.land_dir = land_dir;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RALLY_POINT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rally_point struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rally_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rally_point_t* rally_point)
|
||||
{
|
||||
return mavlink_msg_rally_point_pack(system_id, component_id, msg, rally_point->target_system, rally_point->target_component, rally_point->idx, rally_point->count, rally_point->lat, rally_point->lng, rally_point->alt, rally_point->break_alt, rally_point->land_dir, rally_point->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rally_point struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rally_point C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rally_point_t* rally_point)
|
||||
{
|
||||
return mavlink_msg_rally_point_pack_chan(system_id, component_id, chan, msg, rally_point->target_system, rally_point->target_component, rally_point->idx, rally_point->count, rally_point->lat, rally_point->lng, rally_point->alt, rally_point->break_alt, rally_point->land_dir, rally_point->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rally_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param idx point index (first point is 0)
|
||||
* @param count total number of points (for sanity checking)
|
||||
* @param lat Latitude of point in degrees * 1E7
|
||||
* @param lng Longitude of point in degrees * 1E7
|
||||
* @param alt Transit / loiter altitude in meters relative to home
|
||||
* @param break_alt Break altitude in meters relative to home
|
||||
* @param land_dir Heading to aim for when landing. In centi-degrees.
|
||||
* @param flags See RALLY_FLAGS enum for definition of the bitmask.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_rally_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, int32_t lat, int32_t lng, int16_t alt, int16_t break_alt, uint16_t land_dir, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lng);
|
||||
_mav_put_int16_t(buf, 8, alt);
|
||||
_mav_put_int16_t(buf, 10, break_alt);
|
||||
_mav_put_uint16_t(buf, 12, land_dir);
|
||||
_mav_put_uint8_t(buf, 14, target_system);
|
||||
_mav_put_uint8_t(buf, 15, target_component);
|
||||
_mav_put_uint8_t(buf, 16, idx);
|
||||
_mav_put_uint8_t(buf, 17, count);
|
||||
_mav_put_uint8_t(buf, 18, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, buf, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#else
|
||||
mavlink_rally_point_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lng = lng;
|
||||
packet.alt = alt;
|
||||
packet.break_alt = break_alt;
|
||||
packet.land_dir = land_dir;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.idx = idx;
|
||||
packet.count = count;
|
||||
packet.flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, (const char *)&packet, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rally_point message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_rally_point_send_struct(mavlink_channel_t chan, const mavlink_rally_point_t* rally_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_rally_point_send(chan, rally_point->target_system, rally_point->target_component, rally_point->idx, rally_point->count, rally_point->lat, rally_point->lng, rally_point->alt, rally_point->break_alt, rally_point->land_dir, rally_point->flags);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, (const char *)rally_point, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_RALLY_POINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_rally_point_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, int32_t lat, int32_t lng, int16_t alt, int16_t break_alt, uint16_t land_dir, uint8_t flags)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lng);
|
||||
_mav_put_int16_t(buf, 8, alt);
|
||||
_mav_put_int16_t(buf, 10, break_alt);
|
||||
_mav_put_uint16_t(buf, 12, land_dir);
|
||||
_mav_put_uint8_t(buf, 14, target_system);
|
||||
_mav_put_uint8_t(buf, 15, target_component);
|
||||
_mav_put_uint8_t(buf, 16, idx);
|
||||
_mav_put_uint8_t(buf, 17, count);
|
||||
_mav_put_uint8_t(buf, 18, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, buf, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#else
|
||||
mavlink_rally_point_t *packet = (mavlink_rally_point_t *)msgbuf;
|
||||
packet->lat = lat;
|
||||
packet->lng = lng;
|
||||
packet->alt = alt;
|
||||
packet->break_alt = break_alt;
|
||||
packet->land_dir = land_dir;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->idx = idx;
|
||||
packet->count = count;
|
||||
packet->flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, (const char *)packet, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RALLY_POINT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from rally_point message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from rally_point message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 15);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field idx from rally_point message
|
||||
*
|
||||
* @return point index (first point is 0)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_idx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field count from rally_point message
|
||||
*
|
||||
* @return total number of points (for sanity checking)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_count(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 17);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from rally_point message
|
||||
*
|
||||
* @return Latitude of point in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_rally_point_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from rally_point message
|
||||
*
|
||||
* @return Longitude of point in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_rally_point_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from rally_point message
|
||||
*
|
||||
* @return Transit / loiter altitude in meters relative to home
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rally_point_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field break_alt from rally_point message
|
||||
*
|
||||
* @return Break altitude in meters relative to home
|
||||
*/
|
||||
static inline int16_t mavlink_msg_rally_point_get_break_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field land_dir from rally_point message
|
||||
*
|
||||
* @return Heading to aim for when landing. In centi-degrees.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rally_point_get_land_dir(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from rally_point message
|
||||
*
|
||||
* @return See RALLY_FLAGS enum for definition of the bitmask.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_rally_point_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a rally_point message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param rally_point C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_rally_point_decode(const mavlink_message_t* msg, mavlink_rally_point_t* rally_point)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
rally_point->lat = mavlink_msg_rally_point_get_lat(msg);
|
||||
rally_point->lng = mavlink_msg_rally_point_get_lng(msg);
|
||||
rally_point->alt = mavlink_msg_rally_point_get_alt(msg);
|
||||
rally_point->break_alt = mavlink_msg_rally_point_get_break_alt(msg);
|
||||
rally_point->land_dir = mavlink_msg_rally_point_get_land_dir(msg);
|
||||
rally_point->target_system = mavlink_msg_rally_point_get_target_system(msg);
|
||||
rally_point->target_component = mavlink_msg_rally_point_get_target_component(msg);
|
||||
rally_point->idx = mavlink_msg_rally_point_get_idx(msg);
|
||||
rally_point->count = mavlink_msg_rally_point_get_count(msg);
|
||||
rally_point->flags = mavlink_msg_rally_point_get_flags(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_RALLY_POINT_LEN? msg->len : MAVLINK_MSG_ID_RALLY_POINT_LEN;
|
||||
memset(rally_point, 0, MAVLINK_MSG_ID_RALLY_POINT_LEN);
|
||||
memcpy(rally_point, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE RANGEFINDER PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RANGEFINDER 173
|
||||
|
||||
MAVPACKED(
|
||||
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_RANGEFINDER_MIN_LEN 8
|
||||
#define MAVLINK_MSG_ID_173_LEN 8
|
||||
#define MAVLINK_MSG_ID_173_MIN_LEN 8
|
||||
|
||||
#define MAVLINK_MSG_ID_RANGEFINDER_CRC 83
|
||||
#define MAVLINK_MSG_ID_173_CRC 83
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_RANGEFINDER { \
|
||||
173, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_RANGEFINDER_LEN];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RANGEFINDER_LEN);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RANGEFINDER_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RANGEFINDER;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_RANGEFINDER_LEN];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RANGEFINDER_LEN);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RANGEFINDER_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RANGEFINDER;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rangefinder struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a rangefinder struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rangefinder C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rangefinder_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rangefinder_t* rangefinder)
|
||||
{
|
||||
return mavlink_msg_rangefinder_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_RANGEFINDER_LEN];
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, buf, MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC);
|
||||
#else
|
||||
mavlink_rangefinder_t packet;
|
||||
packet.distance = distance;
|
||||
packet.voltage = voltage;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, (const char *)&packet, MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rangefinder message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_rangefinder_send_struct(mavlink_channel_t chan, const mavlink_rangefinder_t* rangefinder)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_rangefinder_send(chan, rangefinder->distance, rangefinder->voltage);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, (const char *)rangefinder, MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_RANGEFINDER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_rangefinder_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float distance, float voltage)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, distance);
|
||||
_mav_put_float(buf, 4, voltage);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, buf, MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC);
|
||||
#else
|
||||
mavlink_rangefinder_t *packet = (mavlink_rangefinder_t *)msgbuf;
|
||||
packet->distance = distance;
|
||||
packet->voltage = voltage;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RANGEFINDER, (const char *)packet, MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN, MAVLINK_MSG_ID_RANGEFINDER_LEN, MAVLINK_MSG_ID_RANGEFINDER_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
rangefinder->distance = mavlink_msg_rangefinder_get_distance(msg);
|
||||
rangefinder->voltage = mavlink_msg_rangefinder_get_voltage(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_RANGEFINDER_LEN? msg->len : MAVLINK_MSG_ID_RANGEFINDER_LEN;
|
||||
memset(rangefinder, 0, MAVLINK_MSG_ID_RANGEFINDER_LEN);
|
||||
memcpy(rangefinder, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-288
@@ -1,288 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE REMOTE_LOG_BLOCK_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS 185
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_remote_log_block_status_t {
|
||||
uint32_t seqno; /*< log data block sequence number*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t status; /*< log data block status*/
|
||||
}) mavlink_remote_log_block_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN 7
|
||||
#define MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN 7
|
||||
#define MAVLINK_MSG_ID_185_LEN 7
|
||||
#define MAVLINK_MSG_ID_185_MIN_LEN 7
|
||||
|
||||
#define MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_CRC 186
|
||||
#define MAVLINK_MSG_ID_185_CRC 186
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_REMOTE_LOG_BLOCK_STATUS { \
|
||||
185, \
|
||||
"REMOTE_LOG_BLOCK_STATUS", \
|
||||
4, \
|
||||
{ { "seqno", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_remote_log_block_status_t, seqno) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_remote_log_block_status_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_remote_log_block_status_t, target_component) }, \
|
||||
{ "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_remote_log_block_status_t, status) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_REMOTE_LOG_BLOCK_STATUS { \
|
||||
"REMOTE_LOG_BLOCK_STATUS", \
|
||||
4, \
|
||||
{ { "seqno", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_remote_log_block_status_t, seqno) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_remote_log_block_status_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_remote_log_block_status_t, target_component) }, \
|
||||
{ "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_remote_log_block_status_t, status) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a remote_log_block_status message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seqno log data block sequence number
|
||||
* @param status log data block status
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_block_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint32_t seqno, uint8_t status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, seqno);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, status);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN);
|
||||
#else
|
||||
mavlink_remote_log_block_status_t packet;
|
||||
packet.seqno = seqno;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.status = status;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a remote_log_block_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seqno log data block sequence number
|
||||
* @param status log data block status
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_block_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint32_t seqno,uint8_t status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, seqno);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, status);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN);
|
||||
#else
|
||||
mavlink_remote_log_block_status_t packet;
|
||||
packet.seqno = seqno;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.status = status;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a remote_log_block_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param remote_log_block_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_block_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_remote_log_block_status_t* remote_log_block_status)
|
||||
{
|
||||
return mavlink_msg_remote_log_block_status_pack(system_id, component_id, msg, remote_log_block_status->target_system, remote_log_block_status->target_component, remote_log_block_status->seqno, remote_log_block_status->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a remote_log_block_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param remote_log_block_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_block_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_remote_log_block_status_t* remote_log_block_status)
|
||||
{
|
||||
return mavlink_msg_remote_log_block_status_pack_chan(system_id, component_id, chan, msg, remote_log_block_status->target_system, remote_log_block_status->target_component, remote_log_block_status->seqno, remote_log_block_status->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a remote_log_block_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seqno log data block sequence number
|
||||
* @param status log data block status
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_remote_log_block_status_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t seqno, uint8_t status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN];
|
||||
_mav_put_uint32_t(buf, 0, seqno);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, status);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS, buf, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_CRC);
|
||||
#else
|
||||
mavlink_remote_log_block_status_t packet;
|
||||
packet.seqno = seqno;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.status = status;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS, (const char *)&packet, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a remote_log_block_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_remote_log_block_status_send_struct(mavlink_channel_t chan, const mavlink_remote_log_block_status_t* remote_log_block_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_remote_log_block_status_send(chan, remote_log_block_status->target_system, remote_log_block_status->target_component, remote_log_block_status->seqno, remote_log_block_status->status);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS, (const char *)remote_log_block_status, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_remote_log_block_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t seqno, uint8_t status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, seqno);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t(buf, 6, status);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS, buf, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_CRC);
|
||||
#else
|
||||
mavlink_remote_log_block_status_t *packet = (mavlink_remote_log_block_status_t *)msgbuf;
|
||||
packet->seqno = seqno;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->status = status;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS, (const char *)packet, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE REMOTE_LOG_BLOCK_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from remote_log_block_status message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_remote_log_block_status_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from remote_log_block_status message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_remote_log_block_status_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seqno from remote_log_block_status message
|
||||
*
|
||||
* @return log data block sequence number
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_remote_log_block_status_get_seqno(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field status from remote_log_block_status message
|
||||
*
|
||||
* @return log data block status
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_remote_log_block_status_get_status(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a remote_log_block_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param remote_log_block_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_remote_log_block_status_decode(const mavlink_message_t* msg, mavlink_remote_log_block_status_t* remote_log_block_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
remote_log_block_status->seqno = mavlink_msg_remote_log_block_status_get_seqno(msg);
|
||||
remote_log_block_status->target_system = mavlink_msg_remote_log_block_status_get_target_system(msg);
|
||||
remote_log_block_status->target_component = mavlink_msg_remote_log_block_status_get_target_component(msg);
|
||||
remote_log_block_status->status = mavlink_msg_remote_log_block_status_get_status(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN? msg->len : MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN;
|
||||
memset(remote_log_block_status, 0, MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_LEN);
|
||||
memcpy(remote_log_block_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-280
@@ -1,280 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE REMOTE_LOG_DATA_BLOCK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK 184
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_remote_log_data_block_t {
|
||||
uint32_t seqno; /*< log data block sequence number*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t data[200]; /*< log data block*/
|
||||
}) mavlink_remote_log_data_block_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN 206
|
||||
#define MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN 206
|
||||
#define MAVLINK_MSG_ID_184_LEN 206
|
||||
#define MAVLINK_MSG_ID_184_MIN_LEN 206
|
||||
|
||||
#define MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_CRC 159
|
||||
#define MAVLINK_MSG_ID_184_CRC 159
|
||||
|
||||
#define MAVLINK_MSG_REMOTE_LOG_DATA_BLOCK_FIELD_DATA_LEN 200
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_REMOTE_LOG_DATA_BLOCK { \
|
||||
184, \
|
||||
"REMOTE_LOG_DATA_BLOCK", \
|
||||
4, \
|
||||
{ { "seqno", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_remote_log_data_block_t, seqno) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_remote_log_data_block_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_remote_log_data_block_t, target_component) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 200, 6, offsetof(mavlink_remote_log_data_block_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_REMOTE_LOG_DATA_BLOCK { \
|
||||
"REMOTE_LOG_DATA_BLOCK", \
|
||||
4, \
|
||||
{ { "seqno", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_remote_log_data_block_t, seqno) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_remote_log_data_block_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_remote_log_data_block_t, target_component) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 200, 6, offsetof(mavlink_remote_log_data_block_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a remote_log_data_block message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seqno log data block sequence number
|
||||
* @param data log data block
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_data_block_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint32_t seqno, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, seqno);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 200);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN);
|
||||
#else
|
||||
mavlink_remote_log_data_block_t packet;
|
||||
packet.seqno = seqno;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*200);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a remote_log_data_block message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seqno log data block sequence number
|
||||
* @param data log data block
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_data_block_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint32_t seqno,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, seqno);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 200);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN);
|
||||
#else
|
||||
mavlink_remote_log_data_block_t packet;
|
||||
packet.seqno = seqno;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*200);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a remote_log_data_block struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param remote_log_data_block C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_data_block_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_remote_log_data_block_t* remote_log_data_block)
|
||||
{
|
||||
return mavlink_msg_remote_log_data_block_pack(system_id, component_id, msg, remote_log_data_block->target_system, remote_log_data_block->target_component, remote_log_data_block->seqno, remote_log_data_block->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a remote_log_data_block struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param remote_log_data_block C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_data_block_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_remote_log_data_block_t* remote_log_data_block)
|
||||
{
|
||||
return mavlink_msg_remote_log_data_block_pack_chan(system_id, component_id, chan, msg, remote_log_data_block->target_system, remote_log_data_block->target_component, remote_log_data_block->seqno, remote_log_data_block->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a remote_log_data_block message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param seqno log data block sequence number
|
||||
* @param data log data block
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_remote_log_data_block_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t seqno, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, seqno);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 200);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK, buf, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_CRC);
|
||||
#else
|
||||
mavlink_remote_log_data_block_t packet;
|
||||
packet.seqno = seqno;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*200);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK, (const char *)&packet, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a remote_log_data_block message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_remote_log_data_block_send_struct(mavlink_channel_t chan, const mavlink_remote_log_data_block_t* remote_log_data_block)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_remote_log_data_block_send(chan, remote_log_data_block->target_system, remote_log_data_block->target_component, remote_log_data_block->seqno, remote_log_data_block->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK, (const char *)remote_log_data_block, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_remote_log_data_block_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t seqno, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, seqno);
|
||||
_mav_put_uint8_t(buf, 4, target_system);
|
||||
_mav_put_uint8_t(buf, 5, target_component);
|
||||
_mav_put_uint8_t_array(buf, 6, data, 200);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK, buf, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_CRC);
|
||||
#else
|
||||
mavlink_remote_log_data_block_t *packet = (mavlink_remote_log_data_block_t *)msgbuf;
|
||||
packet->seqno = seqno;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*200);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK, (const char *)packet, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE REMOTE_LOG_DATA_BLOCK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from remote_log_data_block message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_remote_log_data_block_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from remote_log_data_block message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_remote_log_data_block_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seqno from remote_log_data_block message
|
||||
*
|
||||
* @return log data block sequence number
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_remote_log_data_block_get_seqno(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from remote_log_data_block message
|
||||
*
|
||||
* @return log data block
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_remote_log_data_block_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 200, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a remote_log_data_block message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param remote_log_data_block C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_remote_log_data_block_decode(const mavlink_message_t* msg, mavlink_remote_log_data_block_t* remote_log_data_block)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
remote_log_data_block->seqno = mavlink_msg_remote_log_data_block_get_seqno(msg);
|
||||
remote_log_data_block->target_system = mavlink_msg_remote_log_data_block_get_target_system(msg);
|
||||
remote_log_data_block->target_component = mavlink_msg_remote_log_data_block_get_target_component(msg);
|
||||
mavlink_msg_remote_log_data_block_get_data(msg, remote_log_data_block->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN? msg->len : MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN;
|
||||
memset(remote_log_data_block, 0, MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_LEN);
|
||||
memcpy(remote_log_data_block, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE RPM PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_RPM 226
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_rpm_t {
|
||||
float rpm1; /*< RPM Sensor1*/
|
||||
float rpm2; /*< RPM Sensor2*/
|
||||
}) mavlink_rpm_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_RPM_LEN 8
|
||||
#define MAVLINK_MSG_ID_RPM_MIN_LEN 8
|
||||
#define MAVLINK_MSG_ID_226_LEN 8
|
||||
#define MAVLINK_MSG_ID_226_MIN_LEN 8
|
||||
|
||||
#define MAVLINK_MSG_ID_RPM_CRC 207
|
||||
#define MAVLINK_MSG_ID_226_CRC 207
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_RPM { \
|
||||
226, \
|
||||
"RPM", \
|
||||
2, \
|
||||
{ { "rpm1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_rpm_t, rpm1) }, \
|
||||
{ "rpm2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_rpm_t, rpm2) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_RPM { \
|
||||
"RPM", \
|
||||
2, \
|
||||
{ { "rpm1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_rpm_t, rpm1) }, \
|
||||
{ "rpm2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_rpm_t, rpm2) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a rpm 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 rpm1 RPM Sensor1
|
||||
* @param rpm2 RPM Sensor2
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rpm_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
float rpm1, float rpm2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RPM_LEN];
|
||||
_mav_put_float(buf, 0, rpm1);
|
||||
_mav_put_float(buf, 4, rpm2);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RPM_LEN);
|
||||
#else
|
||||
mavlink_rpm_t packet;
|
||||
packet.rpm1 = rpm1;
|
||||
packet.rpm2 = rpm2;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RPM_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RPM;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RPM_MIN_LEN, MAVLINK_MSG_ID_RPM_LEN, MAVLINK_MSG_ID_RPM_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a rpm message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rpm1 RPM Sensor1
|
||||
* @param rpm2 RPM Sensor2
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rpm_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
float rpm1,float rpm2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RPM_LEN];
|
||||
_mav_put_float(buf, 0, rpm1);
|
||||
_mav_put_float(buf, 4, rpm2);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RPM_LEN);
|
||||
#else
|
||||
mavlink_rpm_t packet;
|
||||
packet.rpm1 = rpm1;
|
||||
packet.rpm2 = rpm2;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RPM_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_RPM;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RPM_MIN_LEN, MAVLINK_MSG_ID_RPM_LEN, MAVLINK_MSG_ID_RPM_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rpm struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rpm C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rpm_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rpm_t* rpm)
|
||||
{
|
||||
return mavlink_msg_rpm_pack(system_id, component_id, msg, rpm->rpm1, rpm->rpm2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a rpm struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param rpm C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_rpm_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rpm_t* rpm)
|
||||
{
|
||||
return mavlink_msg_rpm_pack_chan(system_id, component_id, chan, msg, rpm->rpm1, rpm->rpm2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rpm message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param rpm1 RPM Sensor1
|
||||
* @param rpm2 RPM Sensor2
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_rpm_send(mavlink_channel_t chan, float rpm1, float rpm2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_RPM_LEN];
|
||||
_mav_put_float(buf, 0, rpm1);
|
||||
_mav_put_float(buf, 4, rpm2);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RPM, buf, MAVLINK_MSG_ID_RPM_MIN_LEN, MAVLINK_MSG_ID_RPM_LEN, MAVLINK_MSG_ID_RPM_CRC);
|
||||
#else
|
||||
mavlink_rpm_t packet;
|
||||
packet.rpm1 = rpm1;
|
||||
packet.rpm2 = rpm2;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RPM, (const char *)&packet, MAVLINK_MSG_ID_RPM_MIN_LEN, MAVLINK_MSG_ID_RPM_LEN, MAVLINK_MSG_ID_RPM_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a rpm message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_rpm_send_struct(mavlink_channel_t chan, const mavlink_rpm_t* rpm)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_rpm_send(chan, rpm->rpm1, rpm->rpm2);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RPM, (const char *)rpm, MAVLINK_MSG_ID_RPM_MIN_LEN, MAVLINK_MSG_ID_RPM_LEN, MAVLINK_MSG_ID_RPM_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_RPM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_rpm_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float rpm1, float rpm2)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, rpm1);
|
||||
_mav_put_float(buf, 4, rpm2);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RPM, buf, MAVLINK_MSG_ID_RPM_MIN_LEN, MAVLINK_MSG_ID_RPM_LEN, MAVLINK_MSG_ID_RPM_CRC);
|
||||
#else
|
||||
mavlink_rpm_t *packet = (mavlink_rpm_t *)msgbuf;
|
||||
packet->rpm1 = rpm1;
|
||||
packet->rpm2 = rpm2;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RPM, (const char *)packet, MAVLINK_MSG_ID_RPM_MIN_LEN, MAVLINK_MSG_ID_RPM_LEN, MAVLINK_MSG_ID_RPM_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE RPM UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field rpm1 from rpm message
|
||||
*
|
||||
* @return RPM Sensor1
|
||||
*/
|
||||
static inline float mavlink_msg_rpm_get_rpm1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rpm2 from rpm message
|
||||
*
|
||||
* @return RPM Sensor2
|
||||
*/
|
||||
static inline float mavlink_msg_rpm_get_rpm2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a rpm message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param rpm C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_rpm_decode(const mavlink_message_t* msg, mavlink_rpm_t* rpm)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
rpm->rpm1 = mavlink_msg_rpm_get_rpm1(msg);
|
||||
rpm->rpm2 = mavlink_msg_rpm_get_rpm2(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_RPM_LEN? msg->len : MAVLINK_MSG_ID_RPM_LEN;
|
||||
memset(rpm, 0, MAVLINK_MSG_ID_RPM_LEN);
|
||||
memcpy(rpm, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-488
@@ -1,488 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE SENSOR_OFFSETS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_OFFSETS 150
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_sensor_offsets_t {
|
||||
float mag_declination; /*< magnetic declination (radians)*/
|
||||
int32_t raw_press; /*< raw pressure from barometer*/
|
||||
int32_t raw_temp; /*< raw temperature from barometer*/
|
||||
float gyro_cal_x; /*< gyro X calibration*/
|
||||
float gyro_cal_y; /*< gyro Y calibration*/
|
||||
float gyro_cal_z; /*< gyro Z calibration*/
|
||||
float accel_cal_x; /*< accel X calibration*/
|
||||
float accel_cal_y; /*< accel Y calibration*/
|
||||
float accel_cal_z; /*< accel Z calibration*/
|
||||
int16_t mag_ofs_x; /*< magnetometer X offset*/
|
||||
int16_t mag_ofs_y; /*< magnetometer Y offset*/
|
||||
int16_t mag_ofs_z; /*< magnetometer Z offset*/
|
||||
}) mavlink_sensor_offsets_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN 42
|
||||
#define MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN 42
|
||||
#define MAVLINK_MSG_ID_150_LEN 42
|
||||
#define MAVLINK_MSG_ID_150_MIN_LEN 42
|
||||
|
||||
#define MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC 134
|
||||
#define MAVLINK_MSG_ID_150_CRC 134
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \
|
||||
150, \
|
||||
"SENSOR_OFFSETS", \
|
||||
12, \
|
||||
{ { "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \
|
||||
{ "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_sensor_offsets_t, raw_press) }, \
|
||||
{ "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \
|
||||
{ "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \
|
||||
{ "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \
|
||||
{ "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \
|
||||
{ "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \
|
||||
{ "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \
|
||||
{ "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \
|
||||
{ "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \
|
||||
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \
|
||||
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \
|
||||
"SENSOR_OFFSETS", \
|
||||
12, \
|
||||
{ { "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \
|
||||
{ "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_sensor_offsets_t, raw_press) }, \
|
||||
{ "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \
|
||||
{ "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \
|
||||
{ "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \
|
||||
{ "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \
|
||||
{ "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \
|
||||
{ "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \
|
||||
{ "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \
|
||||
{ "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \
|
||||
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \
|
||||
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a sensor_offsets 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 mag_ofs_x magnetometer X offset
|
||||
* @param mag_ofs_y magnetometer Y offset
|
||||
* @param mag_ofs_z magnetometer Z offset
|
||||
* @param mag_declination magnetic declination (radians)
|
||||
* @param raw_press raw pressure from barometer
|
||||
* @param raw_temp raw temperature from barometer
|
||||
* @param gyro_cal_x gyro X calibration
|
||||
* @param gyro_cal_y gyro Y calibration
|
||||
* @param gyro_cal_z gyro Z calibration
|
||||
* @param accel_cal_x accel X calibration
|
||||
* @param accel_cal_y accel Y calibration
|
||||
* @param accel_cal_z accel Z calibration
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
|
||||
_mav_put_float(buf, 0, mag_declination);
|
||||
_mav_put_int32_t(buf, 4, raw_press);
|
||||
_mav_put_int32_t(buf, 8, raw_temp);
|
||||
_mav_put_float(buf, 12, gyro_cal_x);
|
||||
_mav_put_float(buf, 16, gyro_cal_y);
|
||||
_mav_put_float(buf, 20, gyro_cal_z);
|
||||
_mav_put_float(buf, 24, accel_cal_x);
|
||||
_mav_put_float(buf, 28, accel_cal_y);
|
||||
_mav_put_float(buf, 32, accel_cal_z);
|
||||
_mav_put_int16_t(buf, 36, mag_ofs_x);
|
||||
_mav_put_int16_t(buf, 38, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 40, mag_ofs_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
|
||||
#else
|
||||
mavlink_sensor_offsets_t packet;
|
||||
packet.mag_declination = mag_declination;
|
||||
packet.raw_press = raw_press;
|
||||
packet.raw_temp = raw_temp;
|
||||
packet.gyro_cal_x = gyro_cal_x;
|
||||
packet.gyro_cal_y = gyro_cal_y;
|
||||
packet.gyro_cal_z = gyro_cal_z;
|
||||
packet.accel_cal_x = accel_cal_x;
|
||||
packet.accel_cal_y = accel_cal_y;
|
||||
packet.accel_cal_z = accel_cal_z;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a sensor_offsets message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param mag_ofs_x magnetometer X offset
|
||||
* @param mag_ofs_y magnetometer Y offset
|
||||
* @param mag_ofs_z magnetometer Z offset
|
||||
* @param mag_declination magnetic declination (radians)
|
||||
* @param raw_press raw pressure from barometer
|
||||
* @param raw_temp raw temperature from barometer
|
||||
* @param gyro_cal_x gyro X calibration
|
||||
* @param gyro_cal_y gyro Y calibration
|
||||
* @param gyro_cal_z gyro Z calibration
|
||||
* @param accel_cal_x accel X calibration
|
||||
* @param accel_cal_y accel Y calibration
|
||||
* @param accel_cal_z accel Z calibration
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z,float mag_declination,int32_t raw_press,int32_t raw_temp,float gyro_cal_x,float gyro_cal_y,float gyro_cal_z,float accel_cal_x,float accel_cal_y,float accel_cal_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
|
||||
_mav_put_float(buf, 0, mag_declination);
|
||||
_mav_put_int32_t(buf, 4, raw_press);
|
||||
_mav_put_int32_t(buf, 8, raw_temp);
|
||||
_mav_put_float(buf, 12, gyro_cal_x);
|
||||
_mav_put_float(buf, 16, gyro_cal_y);
|
||||
_mav_put_float(buf, 20, gyro_cal_z);
|
||||
_mav_put_float(buf, 24, accel_cal_x);
|
||||
_mav_put_float(buf, 28, accel_cal_y);
|
||||
_mav_put_float(buf, 32, accel_cal_z);
|
||||
_mav_put_int16_t(buf, 36, mag_ofs_x);
|
||||
_mav_put_int16_t(buf, 38, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 40, mag_ofs_z);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
|
||||
#else
|
||||
mavlink_sensor_offsets_t packet;
|
||||
packet.mag_declination = mag_declination;
|
||||
packet.raw_press = raw_press;
|
||||
packet.raw_temp = raw_temp;
|
||||
packet.gyro_cal_x = gyro_cal_x;
|
||||
packet.gyro_cal_y = gyro_cal_y;
|
||||
packet.gyro_cal_z = gyro_cal_z;
|
||||
packet.accel_cal_x = accel_cal_x;
|
||||
packet.accel_cal_y = accel_cal_y;
|
||||
packet.accel_cal_z = accel_cal_z;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a sensor_offsets struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param sensor_offsets C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sensor_offsets_t* sensor_offsets)
|
||||
{
|
||||
return mavlink_msg_sensor_offsets_pack(system_id, component_id, msg, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a sensor_offsets struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param sensor_offsets C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_sensor_offsets_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sensor_offsets_t* sensor_offsets)
|
||||
{
|
||||
return mavlink_msg_sensor_offsets_pack_chan(system_id, component_id, chan, msg, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a sensor_offsets message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param mag_ofs_x magnetometer X offset
|
||||
* @param mag_ofs_y magnetometer Y offset
|
||||
* @param mag_ofs_z magnetometer Z offset
|
||||
* @param mag_declination magnetic declination (radians)
|
||||
* @param raw_press raw pressure from barometer
|
||||
* @param raw_temp raw temperature from barometer
|
||||
* @param gyro_cal_x gyro X calibration
|
||||
* @param gyro_cal_y gyro Y calibration
|
||||
* @param gyro_cal_z gyro Z calibration
|
||||
* @param accel_cal_x accel X calibration
|
||||
* @param accel_cal_y accel Y calibration
|
||||
* @param accel_cal_z accel Z calibration
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
|
||||
_mav_put_float(buf, 0, mag_declination);
|
||||
_mav_put_int32_t(buf, 4, raw_press);
|
||||
_mav_put_int32_t(buf, 8, raw_temp);
|
||||
_mav_put_float(buf, 12, gyro_cal_x);
|
||||
_mav_put_float(buf, 16, gyro_cal_y);
|
||||
_mav_put_float(buf, 20, gyro_cal_z);
|
||||
_mav_put_float(buf, 24, accel_cal_x);
|
||||
_mav_put_float(buf, 28, accel_cal_y);
|
||||
_mav_put_float(buf, 32, accel_cal_z);
|
||||
_mav_put_int16_t(buf, 36, mag_ofs_x);
|
||||
_mav_put_int16_t(buf, 38, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 40, mag_ofs_z);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
|
||||
#else
|
||||
mavlink_sensor_offsets_t packet;
|
||||
packet.mag_declination = mag_declination;
|
||||
packet.raw_press = raw_press;
|
||||
packet.raw_temp = raw_temp;
|
||||
packet.gyro_cal_x = gyro_cal_x;
|
||||
packet.gyro_cal_y = gyro_cal_y;
|
||||
packet.gyro_cal_z = gyro_cal_z;
|
||||
packet.accel_cal_x = accel_cal_x;
|
||||
packet.accel_cal_y = accel_cal_y;
|
||||
packet.accel_cal_z = accel_cal_z;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)&packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a sensor_offsets message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_sensor_offsets_send_struct(mavlink_channel_t chan, const mavlink_sensor_offsets_t* sensor_offsets)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_sensor_offsets_send(chan, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)sensor_offsets, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_sensor_offsets_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, mag_declination);
|
||||
_mav_put_int32_t(buf, 4, raw_press);
|
||||
_mav_put_int32_t(buf, 8, raw_temp);
|
||||
_mav_put_float(buf, 12, gyro_cal_x);
|
||||
_mav_put_float(buf, 16, gyro_cal_y);
|
||||
_mav_put_float(buf, 20, gyro_cal_z);
|
||||
_mav_put_float(buf, 24, accel_cal_x);
|
||||
_mav_put_float(buf, 28, accel_cal_y);
|
||||
_mav_put_float(buf, 32, accel_cal_z);
|
||||
_mav_put_int16_t(buf, 36, mag_ofs_x);
|
||||
_mav_put_int16_t(buf, 38, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 40, mag_ofs_z);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
|
||||
#else
|
||||
mavlink_sensor_offsets_t *packet = (mavlink_sensor_offsets_t *)msgbuf;
|
||||
packet->mag_declination = mag_declination;
|
||||
packet->raw_press = raw_press;
|
||||
packet->raw_temp = raw_temp;
|
||||
packet->gyro_cal_x = gyro_cal_x;
|
||||
packet->gyro_cal_y = gyro_cal_y;
|
||||
packet->gyro_cal_z = gyro_cal_z;
|
||||
packet->accel_cal_x = accel_cal_x;
|
||||
packet->accel_cal_y = accel_cal_y;
|
||||
packet->accel_cal_z = accel_cal_z;
|
||||
packet->mag_ofs_x = mag_ofs_x;
|
||||
packet->mag_ofs_y = mag_ofs_y;
|
||||
packet->mag_ofs_z = mag_ofs_z;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SENSOR_OFFSETS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field mag_ofs_x from sensor_offsets message
|
||||
*
|
||||
* @return magnetometer X offset
|
||||
*/
|
||||
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mag_ofs_y from sensor_offsets message
|
||||
*
|
||||
* @return magnetometer Y offset
|
||||
*/
|
||||
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 38);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mag_ofs_z from sensor_offsets message
|
||||
*
|
||||
* @return magnetometer Z offset
|
||||
*/
|
||||
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mag_declination from sensor_offsets message
|
||||
*
|
||||
* @return magnetic declination (radians)
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_offsets_get_mag_declination(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field raw_press from sensor_offsets message
|
||||
*
|
||||
* @return raw pressure from barometer
|
||||
*/
|
||||
static inline int32_t mavlink_msg_sensor_offsets_get_raw_press(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field raw_temp from sensor_offsets message
|
||||
*
|
||||
* @return raw temperature from barometer
|
||||
*/
|
||||
static inline int32_t mavlink_msg_sensor_offsets_get_raw_temp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gyro_cal_x from sensor_offsets message
|
||||
*
|
||||
* @return gyro X calibration
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gyro_cal_y from sensor_offsets message
|
||||
*
|
||||
* @return gyro Y calibration
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gyro_cal_z from sensor_offsets message
|
||||
*
|
||||
* @return gyro Z calibration
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accel_cal_x from sensor_offsets message
|
||||
*
|
||||
* @return accel X calibration
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_offsets_get_accel_cal_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accel_cal_y from sensor_offsets message
|
||||
*
|
||||
* @return accel Y calibration
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_offsets_get_accel_cal_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accel_cal_z from sensor_offsets message
|
||||
*
|
||||
* @return accel Z calibration
|
||||
*/
|
||||
static inline float mavlink_msg_sensor_offsets_get_accel_cal_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a sensor_offsets message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param sensor_offsets C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_sensor_offsets_decode(const mavlink_message_t* msg, mavlink_sensor_offsets_t* sensor_offsets)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
sensor_offsets->mag_declination = mavlink_msg_sensor_offsets_get_mag_declination(msg);
|
||||
sensor_offsets->raw_press = mavlink_msg_sensor_offsets_get_raw_press(msg);
|
||||
sensor_offsets->raw_temp = mavlink_msg_sensor_offsets_get_raw_temp(msg);
|
||||
sensor_offsets->gyro_cal_x = mavlink_msg_sensor_offsets_get_gyro_cal_x(msg);
|
||||
sensor_offsets->gyro_cal_y = mavlink_msg_sensor_offsets_get_gyro_cal_y(msg);
|
||||
sensor_offsets->gyro_cal_z = mavlink_msg_sensor_offsets_get_gyro_cal_z(msg);
|
||||
sensor_offsets->accel_cal_x = mavlink_msg_sensor_offsets_get_accel_cal_x(msg);
|
||||
sensor_offsets->accel_cal_y = mavlink_msg_sensor_offsets_get_accel_cal_y(msg);
|
||||
sensor_offsets->accel_cal_z = mavlink_msg_sensor_offsets_get_accel_cal_z(msg);
|
||||
sensor_offsets->mag_ofs_x = mavlink_msg_sensor_offsets_get_mag_ofs_x(msg);
|
||||
sensor_offsets->mag_ofs_y = mavlink_msg_sensor_offsets_get_mag_ofs_y(msg);
|
||||
sensor_offsets->mag_ofs_z = mavlink_msg_sensor_offsets_get_mag_ofs_z(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN? msg->len : MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN;
|
||||
memset(sensor_offsets, 0, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
|
||||
memcpy(sensor_offsets, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-313
@@ -1,313 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE SET_MAG_OFFSETS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS 151
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_set_mag_offsets_t {
|
||||
int16_t mag_ofs_x; /*< magnetometer X offset*/
|
||||
int16_t mag_ofs_y; /*< magnetometer Y offset*/
|
||||
int16_t mag_ofs_z; /*< magnetometer Z offset*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
}) mavlink_set_mag_offsets_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN 8
|
||||
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN 8
|
||||
#define MAVLINK_MSG_ID_151_LEN 8
|
||||
#define MAVLINK_MSG_ID_151_MIN_LEN 8
|
||||
|
||||
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC 219
|
||||
#define MAVLINK_MSG_ID_151_CRC 219
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS { \
|
||||
151, \
|
||||
"SET_MAG_OFFSETS", \
|
||||
5, \
|
||||
{ { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_set_mag_offsets_t, mag_ofs_x) }, \
|
||||
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_mag_offsets_t, mag_ofs_y) }, \
|
||||
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_mag_offsets_t, mag_ofs_z) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_set_mag_offsets_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_set_mag_offsets_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS { \
|
||||
"SET_MAG_OFFSETS", \
|
||||
5, \
|
||||
{ { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_set_mag_offsets_t, mag_ofs_x) }, \
|
||||
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_mag_offsets_t, mag_ofs_y) }, \
|
||||
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_mag_offsets_t, mag_ofs_z) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_set_mag_offsets_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_set_mag_offsets_t, target_component) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a set_mag_offsets message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mag_ofs_x magnetometer X offset
|
||||
* @param mag_ofs_y magnetometer Y offset
|
||||
* @param mag_ofs_z magnetometer Z offset
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN];
|
||||
_mav_put_int16_t(buf, 0, mag_ofs_x);
|
||||
_mav_put_int16_t(buf, 2, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 4, mag_ofs_z);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN);
|
||||
#else
|
||||
mavlink_set_mag_offsets_t packet;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a set_mag_offsets message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mag_ofs_x magnetometer X offset
|
||||
* @param mag_ofs_y magnetometer Y offset
|
||||
* @param mag_ofs_z magnetometer Z offset
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN];
|
||||
_mav_put_int16_t(buf, 0, mag_ofs_x);
|
||||
_mav_put_int16_t(buf, 2, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 4, mag_ofs_z);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN);
|
||||
#else
|
||||
mavlink_set_mag_offsets_t packet;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a set_mag_offsets struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param set_mag_offsets C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_mag_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_mag_offsets_t* set_mag_offsets)
|
||||
{
|
||||
return mavlink_msg_set_mag_offsets_pack(system_id, component_id, msg, set_mag_offsets->target_system, set_mag_offsets->target_component, set_mag_offsets->mag_ofs_x, set_mag_offsets->mag_ofs_y, set_mag_offsets->mag_ofs_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a set_mag_offsets struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param set_mag_offsets C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_set_mag_offsets_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_mag_offsets_t* set_mag_offsets)
|
||||
{
|
||||
return mavlink_msg_set_mag_offsets_pack_chan(system_id, component_id, chan, msg, set_mag_offsets->target_system, set_mag_offsets->target_component, set_mag_offsets->mag_ofs_x, set_mag_offsets->mag_ofs_y, set_mag_offsets->mag_ofs_z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a set_mag_offsets message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param mag_ofs_x magnetometer X offset
|
||||
* @param mag_ofs_y magnetometer Y offset
|
||||
* @param mag_ofs_z magnetometer Z offset
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_set_mag_offsets_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN];
|
||||
_mav_put_int16_t(buf, 0, mag_ofs_x);
|
||||
_mav_put_int16_t(buf, 2, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 4, mag_ofs_z);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, buf, MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC);
|
||||
#else
|
||||
mavlink_set_mag_offsets_t packet;
|
||||
packet.mag_ofs_x = mag_ofs_x;
|
||||
packet.mag_ofs_y = mag_ofs_y;
|
||||
packet.mag_ofs_z = mag_ofs_z;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)&packet, MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a set_mag_offsets message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_set_mag_offsets_send_struct(mavlink_channel_t chan, const mavlink_set_mag_offsets_t* set_mag_offsets)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_set_mag_offsets_send(chan, set_mag_offsets->target_system, set_mag_offsets->target_component, set_mag_offsets->mag_ofs_x, set_mag_offsets->mag_ofs_y, set_mag_offsets->mag_ofs_z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)set_mag_offsets, MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_set_mag_offsets_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int16_t(buf, 0, mag_ofs_x);
|
||||
_mav_put_int16_t(buf, 2, mag_ofs_y);
|
||||
_mav_put_int16_t(buf, 4, mag_ofs_z);
|
||||
_mav_put_uint8_t(buf, 6, target_system);
|
||||
_mav_put_uint8_t(buf, 7, target_component);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, buf, MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC);
|
||||
#else
|
||||
mavlink_set_mag_offsets_t *packet = (mavlink_set_mag_offsets_t *)msgbuf;
|
||||
packet->mag_ofs_x = mag_ofs_x;
|
||||
packet->mag_ofs_y = mag_ofs_y;
|
||||
packet->mag_ofs_z = mag_ofs_z;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)packet, MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN, MAVLINK_MSG_ID_SET_MAG_OFFSETS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE SET_MAG_OFFSETS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from set_mag_offsets message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_set_mag_offsets_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from set_mag_offsets message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_set_mag_offsets_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mag_ofs_x from set_mag_offsets message
|
||||
*
|
||||
* @return magnetometer X offset
|
||||
*/
|
||||
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mag_ofs_y from set_mag_offsets message
|
||||
*
|
||||
* @return magnetometer Y offset
|
||||
*/
|
||||
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mag_ofs_z from set_mag_offsets message
|
||||
*
|
||||
* @return magnetometer Z offset
|
||||
*/
|
||||
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a set_mag_offsets message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param set_mag_offsets C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_set_mag_offsets_decode(const mavlink_message_t* msg, mavlink_set_mag_offsets_t* set_mag_offsets)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
set_mag_offsets->mag_ofs_x = mavlink_msg_set_mag_offsets_get_mag_ofs_x(msg);
|
||||
set_mag_offsets->mag_ofs_y = mavlink_msg_set_mag_offsets_get_mag_ofs_y(msg);
|
||||
set_mag_offsets->mag_ofs_z = mavlink_msg_set_mag_offsets_get_mag_ofs_z(msg);
|
||||
set_mag_offsets->target_system = mavlink_msg_set_mag_offsets_get_target_system(msg);
|
||||
set_mag_offsets->target_component = mavlink_msg_set_mag_offsets_get_target_component(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN? msg->len : MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN;
|
||||
memset(set_mag_offsets, 0, MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN);
|
||||
memcpy(set_mag_offsets, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-463
@@ -1,463 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE SIMSTATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_SIMSTATE 164
|
||||
|
||||
MAVPACKED(
|
||||
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*/
|
||||
int32_t lat; /*< Latitude in degrees * 1E7*/
|
||||
int32_t lng; /*< Longitude in degrees * 1E7*/
|
||||
}) mavlink_simstate_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_SIMSTATE_LEN 44
|
||||
#define MAVLINK_MSG_ID_SIMSTATE_MIN_LEN 44
|
||||
#define MAVLINK_MSG_ID_164_LEN 44
|
||||
#define MAVLINK_MSG_ID_164_MIN_LEN 44
|
||||
|
||||
#define MAVLINK_MSG_ID_SIMSTATE_CRC 154
|
||||
#define MAVLINK_MSG_ID_164_CRC 154
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_SIMSTATE { \
|
||||
164, \
|
||||
"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_INT32_T, 0, 36, offsetof(mavlink_simstate_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_simstate_t, lng) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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_INT32_T, 0, 36, offsetof(mavlink_simstate_t, lat) }, \
|
||||
{ "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 40, offsetof(mavlink_simstate_t, lng) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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 * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
* @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, int32_t lat, int32_t lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SIMSTATE_LEN];
|
||||
_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_int32_t(buf, 36, lat);
|
||||
_mav_put_int32_t(buf, 40, lng);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIMSTATE_LEN);
|
||||
#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, MAVLINK_MSG_ID_SIMSTATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SIMSTATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SIMSTATE_MIN_LEN, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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 * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
* @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,int32_t lat,int32_t lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SIMSTATE_LEN];
|
||||
_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_int32_t(buf, 36, lat);
|
||||
_mav_put_int32_t(buf, 40, lng);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SIMSTATE_LEN);
|
||||
#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, MAVLINK_MSG_ID_SIMSTATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_SIMSTATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SIMSTATE_MIN_LEN, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a simstate struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a simstate struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param simstate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_simstate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_simstate_t* simstate)
|
||||
{
|
||||
return mavlink_msg_simstate_pack_chan(system_id, component_id, chan, 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 * 1E7
|
||||
* @param lng Longitude in degrees * 1E7
|
||||
*/
|
||||
#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, int32_t lat, int32_t lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_SIMSTATE_LEN];
|
||||
_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_int32_t(buf, 36, lat);
|
||||
_mav_put_int32_t(buf, 40, lng);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, buf, MAVLINK_MSG_ID_SIMSTATE_MIN_LEN, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC);
|
||||
#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, MAVLINK_MSG_ID_SIMSTATE_MIN_LEN, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a simstate message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_simstate_send_struct(mavlink_channel_t chan, const mavlink_simstate_t* simstate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_simstate_send(chan, simstate->roll, simstate->pitch, simstate->yaw, simstate->xacc, simstate->yacc, simstate->zacc, simstate->xgyro, simstate->ygyro, simstate->zgyro, simstate->lat, simstate->lng);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, (const char *)simstate, MAVLINK_MSG_ID_SIMSTATE_MIN_LEN, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_SIMSTATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_simstate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, int32_t lat, int32_t lng)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, roll);
|
||||
_mav_put_float(buf, 4, pitch);
|
||||
_mav_put_float(buf, 8, yaw);
|
||||
_mav_put_float(buf, 12, 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_int32_t(buf, 36, lat);
|
||||
_mav_put_int32_t(buf, 40, lng);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, buf, MAVLINK_MSG_ID_SIMSTATE_MIN_LEN, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC);
|
||||
#else
|
||||
mavlink_simstate_t *packet = (mavlink_simstate_t *)msgbuf;
|
||||
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, MAVLINK_MSG_ID_SIMSTATE_MIN_LEN, MAVLINK_MSG_ID_SIMSTATE_LEN, MAVLINK_MSG_ID_SIMSTATE_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_simstate_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lng from simstate message
|
||||
*
|
||||
* @return Longitude in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_simstate_get_lng(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_SIMSTATE_LEN? msg->len : MAVLINK_MSG_ID_SIMSTATE_LEN;
|
||||
memset(simstate, 0, MAVLINK_MSG_ID_SIMSTATE_LEN);
|
||||
memcpy(simstate, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-263
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE WIND PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_WIND 168
|
||||
|
||||
MAVPACKED(
|
||||
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_WIND_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_168_LEN 12
|
||||
#define MAVLINK_MSG_ID_168_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_WIND_CRC 1
|
||||
#define MAVLINK_MSG_ID_168_CRC 1
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_WIND { \
|
||||
168, \
|
||||
"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) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#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) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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[MAVLINK_MSG_ID_WIND_LEN];
|
||||
_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, MAVLINK_MSG_ID_WIND_LEN);
|
||||
#else
|
||||
mavlink_wind_t packet;
|
||||
packet.direction = direction;
|
||||
packet.speed = speed;
|
||||
packet.speed_z = speed_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_WIND;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_MIN_LEN, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be 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[MAVLINK_MSG_ID_WIND_LEN];
|
||||
_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, MAVLINK_MSG_ID_WIND_LEN);
|
||||
#else
|
||||
mavlink_wind_t packet;
|
||||
packet.direction = direction;
|
||||
packet.speed = speed;
|
||||
packet.speed_z = speed_z;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_WIND;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_MIN_LEN, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a wind struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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 Encode a wind struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param wind C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_wind_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_wind_t* wind)
|
||||
{
|
||||
return mavlink_msg_wind_pack_chan(system_id, component_id, chan, 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[MAVLINK_MSG_ID_WIND_LEN];
|
||||
_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, MAVLINK_MSG_ID_WIND_MIN_LEN, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
|
||||
#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, MAVLINK_MSG_ID_WIND_MIN_LEN, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a wind message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_wind_send_struct(mavlink_channel_t chan, const mavlink_wind_t* wind)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_wind_send(chan, wind->direction, wind->speed, wind->speed_z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)wind, MAVLINK_MSG_ID_WIND_MIN_LEN, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_WIND_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_wind_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float direction, float speed, float speed_z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_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, MAVLINK_MSG_ID_WIND_MIN_LEN, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
|
||||
#else
|
||||
mavlink_wind_t *packet = (mavlink_wind_t *)msgbuf;
|
||||
packet->direction = direction;
|
||||
packet->speed = speed;
|
||||
packet->speed_z = speed_z;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)packet, MAVLINK_MSG_ID_WIND_MIN_LEN, MAVLINK_MSG_ID_WIND_LEN, MAVLINK_MSG_ID_WIND_CRC);
|
||||
#endif
|
||||
}
|
||||
#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 || !MAVLINK_ALIGNED_FIELDS
|
||||
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
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_WIND_LEN? msg->len : MAVLINK_MSG_ID_WIND_LEN;
|
||||
memset(wind, 0, MAVLINK_MSG_ID_WIND_LEN);
|
||||
memcpy(wind, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
/** @file
|
||||
* @brief MAVLink comm protocol built from ardupilotmega.xml
|
||||
* @see http://mavlink.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Wed Mar 01 2017"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
#endif // MAVLINK_VERSION_H
|
||||
@@ -1,96 +0,0 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _CHECKSUM_H_
|
||||
#define _CHECKSUM_H_
|
||||
|
||||
// Visual Studio versions before 2010 don't have stdint.h, so we just error out.
|
||||
#if (defined _MSC_VER) && (_MSC_VER < 1600)
|
||||
#error "The C-MAVLink implementation requires Visual Studio 2010 or greater"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
*
|
||||
* CALCULATE THE CHECKSUM
|
||||
*
|
||||
*/
|
||||
|
||||
#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.
|
||||
*
|
||||
* The checksum function adds the hash of one char at a time to the
|
||||
* 16 bit checksum (uint16_t).
|
||||
*
|
||||
* @param data new char to hash
|
||||
* @param crcAccum the already accumulated checksum
|
||||
**/
|
||||
static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum)
|
||||
{
|
||||
/*Accumulate one byte of data into the CRC*/
|
||||
uint8_t tmp;
|
||||
|
||||
tmp = data ^ (uint8_t)(*crcAccum &0xff);
|
||||
tmp ^= (tmp<<4);
|
||||
*crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initiliaze the buffer for the X.25 CRC
|
||||
*
|
||||
* @param crcAccum the 16 bit X.25 CRC
|
||||
*/
|
||||
static inline void crc_init(uint16_t* crcAccum)
|
||||
{
|
||||
*crcAccum = X25_INIT_CRC;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Calculates the X.25 checksum on a byte buffer
|
||||
*
|
||||
* @param pBuffer buffer containing the byte array to hash
|
||||
* @param length length of the byte array
|
||||
* @return the checksum over the buffer bytes
|
||||
**/
|
||||
static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length)
|
||||
{
|
||||
uint16_t crcTmp;
|
||||
crc_init(&crcTmp);
|
||||
while (length--) {
|
||||
crc_accumulate(*pBuffer++, &crcTmp);
|
||||
}
|
||||
return crcTmp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Accumulate the X.25 CRC by adding an array of bytes
|
||||
*
|
||||
* The checksum function adds the hash of one char at a time to the
|
||||
* 16 bit checksum (uint16_t).
|
||||
*
|
||||
* @param data new bytes to hash
|
||||
* @param crcAccum the already accumulated checksum
|
||||
**/
|
||||
static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint16_t length)
|
||||
{
|
||||
const uint8_t *p = (const uint8_t *)pBuffer;
|
||||
while (length--) {
|
||||
crc_accumulate(*p++, crcAccum);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _CHECKSUM_H_ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
File diff suppressed because one or more lines are too long
@@ -1,34 +0,0 @@
|
||||
/** @file
|
||||
* @brief MAVLink comm protocol built from common.xml
|
||||
* @see http://mavlink.org
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef MAVLINK_H
|
||||
#define MAVLINK_H
|
||||
|
||||
#define MAVLINK_PRIMARY_XML_IDX 1
|
||||
|
||||
#ifndef MAVLINK_STX
|
||||
#define MAVLINK_STX 254
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_ENDIAN
|
||||
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_ALIGNED_FIELDS
|
||||
#define MAVLINK_ALIGNED_FIELDS 1
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_CRC_EXTRA
|
||||
#define MAVLINK_CRC_EXTRA 1
|
||||
#endif
|
||||
|
||||
#ifndef MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_COMMAND_24BIT 0
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "common.h"
|
||||
|
||||
#endif // MAVLINK_H
|
||||
-255
@@ -1,255 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ACTUATOR_CONTROL_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET 140
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_actuator_control_target_t {
|
||||
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
|
||||
float controls[8]; /*< Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.*/
|
||||
uint8_t group_mlx; /*< Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.*/
|
||||
}) mavlink_actuator_control_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN 41
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN 41
|
||||
#define MAVLINK_MSG_ID_140_LEN 41
|
||||
#define MAVLINK_MSG_ID_140_MIN_LEN 41
|
||||
|
||||
#define MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC 181
|
||||
#define MAVLINK_MSG_ID_140_CRC 181
|
||||
|
||||
#define MAVLINK_MSG_ACTUATOR_CONTROL_TARGET_FIELD_CONTROLS_LEN 8
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \
|
||||
140, \
|
||||
"ACTUATOR_CONTROL_TARGET", \
|
||||
3, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
|
||||
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
|
||||
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET { \
|
||||
"ACTUATOR_CONTROL_TARGET", \
|
||||
3, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_actuator_control_target_t, time_usec) }, \
|
||||
{ "controls", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_actuator_control_target_t, controls) }, \
|
||||
{ "group_mlx", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_actuator_control_target_t, group_mlx) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a actuator_control_target 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 (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a actuator_control_target message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t group_mlx,const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a actuator_control_target struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param actuator_control_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
return mavlink_msg_actuator_control_target_pack(system_id, component_id, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a actuator_control_target struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param actuator_control_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
return mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, chan, msg, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a actuator_control_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param group_mlx Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
* @param controls Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_actuator_control_target_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
mavlink_actuator_control_target_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet.controls, controls, sizeof(float)*8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a actuator_control_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_actuator_control_target_send_struct(mavlink_channel_t chan, const mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_actuator_control_target_send(chan, actuator_control_target->time_usec, actuator_control_target->group_mlx, actuator_control_target->controls);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)actuator_control_target, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_actuator_control_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t group_mlx, const float *controls)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint8_t(buf, 40, group_mlx);
|
||||
_mav_put_float_array(buf, 8, controls, 8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, buf, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#else
|
||||
mavlink_actuator_control_target_t *packet = (mavlink_actuator_control_target_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->group_mlx = group_mlx;
|
||||
mav_array_memcpy(packet->controls, controls, sizeof(float)*8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET, (const char *)packet, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ACTUATOR_CONTROL_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from actuator_control_target message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_actuator_control_target_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field group_mlx from actuator_control_target message
|
||||
*
|
||||
* @return Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_actuator_control_target_get_group_mlx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field controls from actuator_control_target message
|
||||
*
|
||||
* @return Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_actuator_control_target_get_controls(const mavlink_message_t* msg, float *controls)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, controls, 8, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a actuator_control_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param actuator_control_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_actuator_control_target_decode(const mavlink_message_t* msg, mavlink_actuator_control_target_t* actuator_control_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
actuator_control_target->time_usec = mavlink_msg_actuator_control_target_get_time_usec(msg);
|
||||
mavlink_msg_actuator_control_target_get_controls(msg, actuator_control_target->controls);
|
||||
actuator_control_target->group_mlx = mavlink_msg_actuator_control_target_get_group_mlx(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN? msg->len : MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN;
|
||||
memset(actuator_control_target, 0, MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_LEN);
|
||||
memcpy(actuator_control_target, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-505
@@ -1,505 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ADSB_VEHICLE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ADSB_VEHICLE 246
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_adsb_vehicle_t {
|
||||
uint32_t ICAO_address; /*< ICAO address*/
|
||||
int32_t lat; /*< Latitude, expressed as degrees * 1E7*/
|
||||
int32_t lon; /*< Longitude, expressed as degrees * 1E7*/
|
||||
int32_t altitude; /*< Altitude(ASL) in millimeters*/
|
||||
uint16_t heading; /*< Course over ground in centidegrees*/
|
||||
uint16_t hor_velocity; /*< The horizontal velocity in centimeters/second*/
|
||||
int16_t ver_velocity; /*< The vertical velocity in centimeters/second, positive is up*/
|
||||
uint16_t flags; /*< Flags to indicate various statuses including valid data fields*/
|
||||
uint16_t squawk; /*< Squawk code*/
|
||||
uint8_t altitude_type; /*< Type from ADSB_ALTITUDE_TYPE enum*/
|
||||
char callsign[9]; /*< The callsign, 8+null*/
|
||||
uint8_t emitter_type; /*< Type from ADSB_EMITTER_TYPE enum*/
|
||||
uint8_t tslc; /*< Time since last communication in seconds*/
|
||||
}) mavlink_adsb_vehicle_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ADSB_VEHICLE_LEN 38
|
||||
#define MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN 38
|
||||
#define MAVLINK_MSG_ID_246_LEN 38
|
||||
#define MAVLINK_MSG_ID_246_MIN_LEN 38
|
||||
|
||||
#define MAVLINK_MSG_ID_ADSB_VEHICLE_CRC 184
|
||||
#define MAVLINK_MSG_ID_246_CRC 184
|
||||
|
||||
#define MAVLINK_MSG_ADSB_VEHICLE_FIELD_CALLSIGN_LEN 9
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \
|
||||
246, \
|
||||
"ADSB_VEHICLE", \
|
||||
13, \
|
||||
{ { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \
|
||||
{ "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \
|
||||
{ "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \
|
||||
{ "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \
|
||||
{ "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \
|
||||
{ "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \
|
||||
{ "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \
|
||||
{ "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \
|
||||
{ "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \
|
||||
"ADSB_VEHICLE", \
|
||||
13, \
|
||||
{ { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \
|
||||
{ "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \
|
||||
{ "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \
|
||||
{ "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \
|
||||
{ "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \
|
||||
{ "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \
|
||||
{ "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \
|
||||
{ "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \
|
||||
{ "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a adsb_vehicle 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 ICAO_address ICAO address
|
||||
* @param lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
|
||||
* @param altitude Altitude(ASL) in millimeters
|
||||
* @param heading Course over ground in centidegrees
|
||||
* @param hor_velocity The horizontal velocity in centimeters/second
|
||||
* @param ver_velocity The vertical velocity in centimeters/second, positive is up
|
||||
* @param callsign The callsign, 8+null
|
||||
* @param emitter_type Type from ADSB_EMITTER_TYPE enum
|
||||
* @param tslc Time since last communication in seconds
|
||||
* @param flags Flags to indicate various statuses including valid data fields
|
||||
* @param squawk Squawk code
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ICAO_address);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, altitude);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_uint16_t(buf, 18, hor_velocity);
|
||||
_mav_put_int16_t(buf, 20, ver_velocity);
|
||||
_mav_put_uint16_t(buf, 22, flags);
|
||||
_mav_put_uint16_t(buf, 24, squawk);
|
||||
_mav_put_uint8_t(buf, 26, altitude_type);
|
||||
_mav_put_uint8_t(buf, 36, emitter_type);
|
||||
_mav_put_uint8_t(buf, 37, tslc);
|
||||
_mav_put_char_array(buf, 27, callsign, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
#else
|
||||
mavlink_adsb_vehicle_t packet;
|
||||
packet.ICAO_address = ICAO_address;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.altitude = altitude;
|
||||
packet.heading = heading;
|
||||
packet.hor_velocity = hor_velocity;
|
||||
packet.ver_velocity = ver_velocity;
|
||||
packet.flags = flags;
|
||||
packet.squawk = squawk;
|
||||
packet.altitude_type = altitude_type;
|
||||
packet.emitter_type = emitter_type;
|
||||
packet.tslc = tslc;
|
||||
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a adsb_vehicle message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param ICAO_address ICAO address
|
||||
* @param lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
|
||||
* @param altitude Altitude(ASL) in millimeters
|
||||
* @param heading Course over ground in centidegrees
|
||||
* @param hor_velocity The horizontal velocity in centimeters/second
|
||||
* @param ver_velocity The vertical velocity in centimeters/second, positive is up
|
||||
* @param callsign The callsign, 8+null
|
||||
* @param emitter_type Type from ADSB_EMITTER_TYPE enum
|
||||
* @param tslc Time since last communication in seconds
|
||||
* @param flags Flags to indicate various statuses including valid data fields
|
||||
* @param squawk Squawk code
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t ICAO_address,int32_t lat,int32_t lon,uint8_t altitude_type,int32_t altitude,uint16_t heading,uint16_t hor_velocity,int16_t ver_velocity,const char *callsign,uint8_t emitter_type,uint8_t tslc,uint16_t flags,uint16_t squawk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ICAO_address);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, altitude);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_uint16_t(buf, 18, hor_velocity);
|
||||
_mav_put_int16_t(buf, 20, ver_velocity);
|
||||
_mav_put_uint16_t(buf, 22, flags);
|
||||
_mav_put_uint16_t(buf, 24, squawk);
|
||||
_mav_put_uint8_t(buf, 26, altitude_type);
|
||||
_mav_put_uint8_t(buf, 36, emitter_type);
|
||||
_mav_put_uint8_t(buf, 37, tslc);
|
||||
_mav_put_char_array(buf, 27, callsign, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
#else
|
||||
mavlink_adsb_vehicle_t packet;
|
||||
packet.ICAO_address = ICAO_address;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.altitude = altitude;
|
||||
packet.heading = heading;
|
||||
packet.hor_velocity = hor_velocity;
|
||||
packet.ver_velocity = ver_velocity;
|
||||
packet.flags = flags;
|
||||
packet.squawk = squawk;
|
||||
packet.altitude_type = altitude_type;
|
||||
packet.emitter_type = emitter_type;
|
||||
packet.tslc = tslc;
|
||||
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a adsb_vehicle struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param adsb_vehicle C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle)
|
||||
{
|
||||
return mavlink_msg_adsb_vehicle_pack(system_id, component_id, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a adsb_vehicle struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param adsb_vehicle C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle)
|
||||
{
|
||||
return mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, chan, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a adsb_vehicle message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param ICAO_address ICAO address
|
||||
* @param lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param altitude_type Type from ADSB_ALTITUDE_TYPE enum
|
||||
* @param altitude Altitude(ASL) in millimeters
|
||||
* @param heading Course over ground in centidegrees
|
||||
* @param hor_velocity The horizontal velocity in centimeters/second
|
||||
* @param ver_velocity The vertical velocity in centimeters/second, positive is up
|
||||
* @param callsign The callsign, 8+null
|
||||
* @param emitter_type Type from ADSB_EMITTER_TYPE enum
|
||||
* @param tslc Time since last communication in seconds
|
||||
* @param flags Flags to indicate various statuses including valid data fields
|
||||
* @param squawk Squawk code
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, ICAO_address);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, altitude);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_uint16_t(buf, 18, hor_velocity);
|
||||
_mav_put_int16_t(buf, 20, ver_velocity);
|
||||
_mav_put_uint16_t(buf, 22, flags);
|
||||
_mav_put_uint16_t(buf, 24, squawk);
|
||||
_mav_put_uint8_t(buf, 26, altitude_type);
|
||||
_mav_put_uint8_t(buf, 36, emitter_type);
|
||||
_mav_put_uint8_t(buf, 37, tslc);
|
||||
_mav_put_char_array(buf, 27, callsign, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#else
|
||||
mavlink_adsb_vehicle_t packet;
|
||||
packet.ICAO_address = ICAO_address;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.altitude = altitude;
|
||||
packet.heading = heading;
|
||||
packet.hor_velocity = hor_velocity;
|
||||
packet.ver_velocity = ver_velocity;
|
||||
packet.flags = flags;
|
||||
packet.squawk = squawk;
|
||||
packet.altitude_type = altitude_type;
|
||||
packet.emitter_type = emitter_type;
|
||||
packet.tslc = tslc;
|
||||
mav_array_memcpy(packet.callsign, callsign, sizeof(char)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)&packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a adsb_vehicle message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_adsb_vehicle_send_struct(mavlink_channel_t chan, const mavlink_adsb_vehicle_t* adsb_vehicle)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_adsb_vehicle_send(chan, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)adsb_vehicle, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ADSB_VEHICLE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, ICAO_address);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, altitude);
|
||||
_mav_put_uint16_t(buf, 16, heading);
|
||||
_mav_put_uint16_t(buf, 18, hor_velocity);
|
||||
_mav_put_int16_t(buf, 20, ver_velocity);
|
||||
_mav_put_uint16_t(buf, 22, flags);
|
||||
_mav_put_uint16_t(buf, 24, squawk);
|
||||
_mav_put_uint8_t(buf, 26, altitude_type);
|
||||
_mav_put_uint8_t(buf, 36, emitter_type);
|
||||
_mav_put_uint8_t(buf, 37, tslc);
|
||||
_mav_put_char_array(buf, 27, callsign, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#else
|
||||
mavlink_adsb_vehicle_t *packet = (mavlink_adsb_vehicle_t *)msgbuf;
|
||||
packet->ICAO_address = ICAO_address;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->altitude = altitude;
|
||||
packet->heading = heading;
|
||||
packet->hor_velocity = hor_velocity;
|
||||
packet->ver_velocity = ver_velocity;
|
||||
packet->flags = flags;
|
||||
packet->squawk = squawk;
|
||||
packet->altitude_type = altitude_type;
|
||||
packet->emitter_type = emitter_type;
|
||||
packet->tslc = tslc;
|
||||
mav_array_memcpy(packet->callsign, callsign, sizeof(char)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (const char *)packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ADSB_VEHICLE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field ICAO_address from adsb_vehicle message
|
||||
*
|
||||
* @return ICAO address
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from adsb_vehicle message
|
||||
*
|
||||
* @return Latitude, expressed as degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_adsb_vehicle_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from adsb_vehicle message
|
||||
*
|
||||
* @return Longitude, expressed as degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_type from adsb_vehicle message
|
||||
*
|
||||
* @return Type from ADSB_ALTITUDE_TYPE enum
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from adsb_vehicle message
|
||||
*
|
||||
* @return Altitude(ASL) in millimeters
|
||||
*/
|
||||
static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field heading from adsb_vehicle message
|
||||
*
|
||||
* @return Course over ground in centidegrees
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hor_velocity from adsb_vehicle message
|
||||
*
|
||||
* @return The horizontal velocity in centimeters/second
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ver_velocity from adsb_vehicle message
|
||||
*
|
||||
* @return The vertical velocity in centimeters/second, positive is up
|
||||
*/
|
||||
static inline int16_t mavlink_msg_adsb_vehicle_get_ver_velocity(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field callsign from adsb_vehicle message
|
||||
*
|
||||
* @return The callsign, 8+null
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_message_t* msg, char *callsign)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, callsign, 9, 27);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field emitter_type from adsb_vehicle message
|
||||
*
|
||||
* @return Type from ADSB_EMITTER_TYPE enum
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tslc from adsb_vehicle message
|
||||
*
|
||||
* @return Time since last communication in seconds
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 37);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from adsb_vehicle message
|
||||
*
|
||||
* @return Flags to indicate various statuses including valid data fields
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field squawk from adsb_vehicle message
|
||||
*
|
||||
* @return Squawk code
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_adsb_vehicle_get_squawk(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a adsb_vehicle message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param adsb_vehicle C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_adsb_vehicle_decode(const mavlink_message_t* msg, mavlink_adsb_vehicle_t* adsb_vehicle)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
adsb_vehicle->ICAO_address = mavlink_msg_adsb_vehicle_get_ICAO_address(msg);
|
||||
adsb_vehicle->lat = mavlink_msg_adsb_vehicle_get_lat(msg);
|
||||
adsb_vehicle->lon = mavlink_msg_adsb_vehicle_get_lon(msg);
|
||||
adsb_vehicle->altitude = mavlink_msg_adsb_vehicle_get_altitude(msg);
|
||||
adsb_vehicle->heading = mavlink_msg_adsb_vehicle_get_heading(msg);
|
||||
adsb_vehicle->hor_velocity = mavlink_msg_adsb_vehicle_get_hor_velocity(msg);
|
||||
adsb_vehicle->ver_velocity = mavlink_msg_adsb_vehicle_get_ver_velocity(msg);
|
||||
adsb_vehicle->flags = mavlink_msg_adsb_vehicle_get_flags(msg);
|
||||
adsb_vehicle->squawk = mavlink_msg_adsb_vehicle_get_squawk(msg);
|
||||
adsb_vehicle->altitude_type = mavlink_msg_adsb_vehicle_get_altitude_type(msg);
|
||||
mavlink_msg_adsb_vehicle_get_callsign(msg, adsb_vehicle->callsign);
|
||||
adsb_vehicle->emitter_type = mavlink_msg_adsb_vehicle_get_emitter_type(msg);
|
||||
adsb_vehicle->tslc = mavlink_msg_adsb_vehicle_get_tslc(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ADSB_VEHICLE_LEN? msg->len : MAVLINK_MSG_ID_ADSB_VEHICLE_LEN;
|
||||
memset(adsb_vehicle, 0, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
|
||||
memcpy(adsb_vehicle, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -1,363 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ALTITUDE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ALTITUDE 141
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_altitude_t {
|
||||
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
|
||||
float altitude_monotonic; /*< This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.*/
|
||||
float altitude_amsl; /*< This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.*/
|
||||
float altitude_local; /*< This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.*/
|
||||
float altitude_relative; /*< This is the altitude above the home position. It resets on each change of the current home position.*/
|
||||
float altitude_terrain; /*< This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.*/
|
||||
float bottom_clearance; /*< This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.*/
|
||||
}) mavlink_altitude_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ALTITUDE_LEN 32
|
||||
#define MAVLINK_MSG_ID_ALTITUDE_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_141_LEN 32
|
||||
#define MAVLINK_MSG_ID_141_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_ALTITUDE_CRC 47
|
||||
#define MAVLINK_MSG_ID_141_CRC 47
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ALTITUDE { \
|
||||
141, \
|
||||
"ALTITUDE", \
|
||||
7, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \
|
||||
{ "altitude_monotonic", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_altitude_t, altitude_monotonic) }, \
|
||||
{ "altitude_amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_altitude_t, altitude_amsl) }, \
|
||||
{ "altitude_local", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_altitude_t, altitude_local) }, \
|
||||
{ "altitude_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_altitude_t, altitude_relative) }, \
|
||||
{ "altitude_terrain", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_altitude_t, altitude_terrain) }, \
|
||||
{ "bottom_clearance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_altitude_t, bottom_clearance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ALTITUDE { \
|
||||
"ALTITUDE", \
|
||||
7, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_altitude_t, time_usec) }, \
|
||||
{ "altitude_monotonic", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_altitude_t, altitude_monotonic) }, \
|
||||
{ "altitude_amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_altitude_t, altitude_amsl) }, \
|
||||
{ "altitude_local", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_altitude_t, altitude_local) }, \
|
||||
{ "altitude_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_altitude_t, altitude_relative) }, \
|
||||
{ "altitude_terrain", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_altitude_t, altitude_terrain) }, \
|
||||
{ "bottom_clearance", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_altitude_t, bottom_clearance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a altitude 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 (micros since boot or Unix epoch)
|
||||
* @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
|
||||
* @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
|
||||
* @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
|
||||
* @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position.
|
||||
* @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
|
||||
* @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_altitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, altitude_monotonic);
|
||||
_mav_put_float(buf, 12, altitude_amsl);
|
||||
_mav_put_float(buf, 16, altitude_local);
|
||||
_mav_put_float(buf, 20, altitude_relative);
|
||||
_mav_put_float(buf, 24, altitude_terrain);
|
||||
_mav_put_float(buf, 28, bottom_clearance);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
#else
|
||||
mavlink_altitude_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.altitude_monotonic = altitude_monotonic;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_local = altitude_local;
|
||||
packet.altitude_relative = altitude_relative;
|
||||
packet.altitude_terrain = altitude_terrain;
|
||||
packet.bottom_clearance = bottom_clearance;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ALTITUDE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a altitude message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
|
||||
* @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
|
||||
* @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
|
||||
* @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position.
|
||||
* @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
|
||||
* @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_altitude_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float altitude_monotonic,float altitude_amsl,float altitude_local,float altitude_relative,float altitude_terrain,float bottom_clearance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, altitude_monotonic);
|
||||
_mav_put_float(buf, 12, altitude_amsl);
|
||||
_mav_put_float(buf, 16, altitude_local);
|
||||
_mav_put_float(buf, 20, altitude_relative);
|
||||
_mav_put_float(buf, 24, altitude_terrain);
|
||||
_mav_put_float(buf, 28, bottom_clearance);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
#else
|
||||
mavlink_altitude_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.altitude_monotonic = altitude_monotonic;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_local = altitude_local;
|
||||
packet.altitude_relative = altitude_relative;
|
||||
packet.altitude_terrain = altitude_terrain;
|
||||
packet.bottom_clearance = bottom_clearance;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ALTITUDE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a altitude struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param altitude C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_altitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_altitude_t* altitude)
|
||||
{
|
||||
return mavlink_msg_altitude_pack(system_id, component_id, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a altitude struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param altitude C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_altitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_altitude_t* altitude)
|
||||
{
|
||||
return mavlink_msg_altitude_pack_chan(system_id, component_id, chan, msg, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a altitude message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param altitude_monotonic This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
|
||||
* @param altitude_amsl This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
|
||||
* @param altitude_local This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
|
||||
* @param altitude_relative This is the altitude above the home position. It resets on each change of the current home position.
|
||||
* @param altitude_terrain This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
|
||||
* @param bottom_clearance This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_altitude_send(mavlink_channel_t chan, uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ALTITUDE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, altitude_monotonic);
|
||||
_mav_put_float(buf, 12, altitude_amsl);
|
||||
_mav_put_float(buf, 16, altitude_local);
|
||||
_mav_put_float(buf, 20, altitude_relative);
|
||||
_mav_put_float(buf, 24, altitude_terrain);
|
||||
_mav_put_float(buf, 28, bottom_clearance);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#else
|
||||
mavlink_altitude_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.altitude_monotonic = altitude_monotonic;
|
||||
packet.altitude_amsl = altitude_amsl;
|
||||
packet.altitude_local = altitude_local;
|
||||
packet.altitude_relative = altitude_relative;
|
||||
packet.altitude_terrain = altitude_terrain;
|
||||
packet.bottom_clearance = bottom_clearance;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a altitude message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_altitude_send_struct(mavlink_channel_t chan, const mavlink_altitude_t* altitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_altitude_send(chan, altitude->time_usec, altitude->altitude_monotonic, altitude->altitude_amsl, altitude->altitude_local, altitude->altitude_relative, altitude->altitude_terrain, altitude->bottom_clearance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)altitude, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ALTITUDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_altitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, altitude_monotonic);
|
||||
_mav_put_float(buf, 12, altitude_amsl);
|
||||
_mav_put_float(buf, 16, altitude_local);
|
||||
_mav_put_float(buf, 20, altitude_relative);
|
||||
_mav_put_float(buf, 24, altitude_terrain);
|
||||
_mav_put_float(buf, 28, bottom_clearance);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, buf, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#else
|
||||
mavlink_altitude_t *packet = (mavlink_altitude_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->altitude_monotonic = altitude_monotonic;
|
||||
packet->altitude_amsl = altitude_amsl;
|
||||
packet->altitude_local = altitude_local;
|
||||
packet->altitude_relative = altitude_relative;
|
||||
packet->altitude_terrain = altitude_terrain;
|
||||
packet->bottom_clearance = bottom_clearance;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ALTITUDE, (const char *)packet, MAVLINK_MSG_ID_ALTITUDE_MIN_LEN, MAVLINK_MSG_ID_ALTITUDE_LEN, MAVLINK_MSG_ID_ALTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ALTITUDE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from altitude message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_altitude_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_monotonic from altitude message
|
||||
*
|
||||
* @return This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_monotonic(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_amsl from altitude message
|
||||
*
|
||||
* @return This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output AMSL by default and not the WGS84 altitude.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_amsl(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_local from altitude message
|
||||
*
|
||||
* @return This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_local(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_relative from altitude message
|
||||
*
|
||||
* @return This is the altitude above the home position. It resets on each change of the current home position.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_relative(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_terrain from altitude message
|
||||
*
|
||||
* @return This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_altitude_terrain(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field bottom_clearance from altitude message
|
||||
*
|
||||
* @return This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
|
||||
*/
|
||||
static inline float mavlink_msg_altitude_get_bottom_clearance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a altitude message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param altitude C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_altitude_decode(const mavlink_message_t* msg, mavlink_altitude_t* altitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
altitude->time_usec = mavlink_msg_altitude_get_time_usec(msg);
|
||||
altitude->altitude_monotonic = mavlink_msg_altitude_get_altitude_monotonic(msg);
|
||||
altitude->altitude_amsl = mavlink_msg_altitude_get_altitude_amsl(msg);
|
||||
altitude->altitude_local = mavlink_msg_altitude_get_altitude_local(msg);
|
||||
altitude->altitude_relative = mavlink_msg_altitude_get_altitude_relative(msg);
|
||||
altitude->altitude_terrain = mavlink_msg_altitude_get_altitude_terrain(msg);
|
||||
altitude->bottom_clearance = mavlink_msg_altitude_get_bottom_clearance(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ALTITUDE_LEN? msg->len : MAVLINK_MSG_ID_ALTITUDE_LEN;
|
||||
memset(altitude, 0, MAVLINK_MSG_ID_ALTITUDE_LEN);
|
||||
memcpy(altitude, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-305
@@ -1,305 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ATT_POS_MOCAP PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP 138
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_att_pos_mocap_t {
|
||||
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
|
||||
float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
|
||||
float x; /*< X position in meters (NED)*/
|
||||
float y; /*< Y position in meters (NED)*/
|
||||
float z; /*< Z position in meters (NED)*/
|
||||
}) mavlink_att_pos_mocap_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN 36
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN 36
|
||||
#define MAVLINK_MSG_ID_138_LEN 36
|
||||
#define MAVLINK_MSG_ID_138_MIN_LEN 36
|
||||
|
||||
#define MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC 109
|
||||
#define MAVLINK_MSG_ID_138_CRC 109
|
||||
|
||||
#define MAVLINK_MSG_ATT_POS_MOCAP_FIELD_Q_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \
|
||||
138, \
|
||||
"ATT_POS_MOCAP", \
|
||||
5, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP { \
|
||||
"ATT_POS_MOCAP", \
|
||||
5, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_att_pos_mocap_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_att_pos_mocap_t, q) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_att_pos_mocap_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_att_pos_mocap_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_att_pos_mocap_t, z) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a att_pos_mocap 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 (micros since boot or Unix epoch)
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x X position in meters (NED)
|
||||
* @param y Y position in meters (NED)
|
||||
* @param z Z position in meters (NED)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, const float *q, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a att_pos_mocap message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x X position in meters (NED)
|
||||
* @param y Y position in meters (NED)
|
||||
* @param z Z position in meters (NED)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,const float *q,float x,float y,float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a att_pos_mocap struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param att_pos_mocap C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
return mavlink_msg_att_pos_mocap_pack(system_id, component_id, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a att_pos_mocap struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param att_pos_mocap C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
return mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, chan, msg, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a att_pos_mocap message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param x X position in meters (NED)
|
||||
* @param y Y position in meters (NED)
|
||||
* @param z Z position in meters (NED)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_att_pos_mocap_send(mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)&packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a att_pos_mocap message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_att_pos_mocap_send_struct(mavlink_channel_t chan, const mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_att_pos_mocap_send(chan, att_pos_mocap->time_usec, att_pos_mocap->q, att_pos_mocap->x, att_pos_mocap->y, att_pos_mocap->z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)att_pos_mocap, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_att_pos_mocap_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *q, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, x);
|
||||
_mav_put_float(buf, 28, y);
|
||||
_mav_put_float(buf, 32, z);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, buf, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#else
|
||||
mavlink_att_pos_mocap_t *packet = (mavlink_att_pos_mocap_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATT_POS_MOCAP, (const char *)packet, MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN, MAVLINK_MSG_ID_ATT_POS_MOCAP_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATT_POS_MOCAP UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from att_pos_mocap message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_att_pos_mocap_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from att_pos_mocap message
|
||||
*
|
||||
* @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_att_pos_mocap_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from att_pos_mocap message
|
||||
*
|
||||
* @return X position in meters (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from att_pos_mocap message
|
||||
*
|
||||
* @return Y position in meters (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from att_pos_mocap message
|
||||
*
|
||||
* @return Z position in meters (NED)
|
||||
*/
|
||||
static inline float mavlink_msg_att_pos_mocap_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a att_pos_mocap message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param att_pos_mocap C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_att_pos_mocap_decode(const mavlink_message_t* msg, mavlink_att_pos_mocap_t* att_pos_mocap)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
att_pos_mocap->time_usec = mavlink_msg_att_pos_mocap_get_time_usec(msg);
|
||||
mavlink_msg_att_pos_mocap_get_q(msg, att_pos_mocap->q);
|
||||
att_pos_mocap->x = mavlink_msg_att_pos_mocap_get_x(msg);
|
||||
att_pos_mocap->y = mavlink_msg_att_pos_mocap_get_y(msg);
|
||||
att_pos_mocap->z = mavlink_msg_att_pos_mocap_get_z(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN? msg->len : MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN;
|
||||
memset(att_pos_mocap, 0, MAVLINK_MSG_ID_ATT_POS_MOCAP_LEN);
|
||||
memcpy(att_pos_mocap, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -1,363 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ATTITUDE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE 30
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_attitude_t {
|
||||
uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
|
||||
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)*/
|
||||
}) mavlink_attitude_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_LEN 28
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_30_LEN 28
|
||||
#define MAVLINK_MSG_ID_30_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_CRC 39
|
||||
#define MAVLINK_MSG_ID_30_CRC 39
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE { \
|
||||
30, \
|
||||
"ATTITUDE", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, yaw) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, yawspeed) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE { \
|
||||
"ATTITUDE", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_t, time_boot_ms) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_t, yaw) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_t, yawspeed) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude 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 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)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_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 rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
|
||||
_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, rollspeed);
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
#else
|
||||
mavlink_attitude_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @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)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_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 rollspeed,float pitchspeed,float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
|
||||
_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, rollspeed);
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
#else
|
||||
mavlink_attitude_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_t* attitude)
|
||||
{
|
||||
return mavlink_msg_attitude_pack(system_id, component_id, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_t* attitude)
|
||||
{
|
||||
return mavlink_msg_attitude_pack_chan(system_id, component_id, chan, msg, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @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)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_LEN];
|
||||
_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, rollspeed);
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#else
|
||||
mavlink_attitude_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.roll = roll;
|
||||
packet.pitch = pitch;
|
||||
packet.yaw = yaw;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_send_struct(mavlink_channel_t chan, const mavlink_attitude_t* attitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_attitude_send(chan, attitude->time_boot_ms, attitude->roll, attitude->pitch, attitude->yaw, attitude->rollspeed, attitude->pitchspeed, attitude->yawspeed);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)attitude, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATTITUDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_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, rollspeed);
|
||||
_mav_put_float(buf, 20, pitchspeed);
|
||||
_mav_put_float(buf, 24, yawspeed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#else
|
||||
mavlink_attitude_t *packet = (mavlink_attitude_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->roll = roll;
|
||||
packet->pitch = pitch;
|
||||
packet->yaw = yaw;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_LEN, MAVLINK_MSG_ID_ATTITUDE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATTITUDE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from attitude message
|
||||
*
|
||||
* @return Timestamp (milliseconds since system boot)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from attitude message
|
||||
*
|
||||
* @return Roll angle (rad, -pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from attitude message
|
||||
*
|
||||
* @return Pitch angle (rad, -pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from attitude message
|
||||
*
|
||||
* @return Yaw angle (rad, -pi..+pi)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from attitude message
|
||||
*
|
||||
* @return Roll angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from attitude message
|
||||
*
|
||||
* @return Pitch angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from attitude message
|
||||
*
|
||||
* @return Yaw angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a attitude message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param attitude C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_decode(const mavlink_message_t* msg, mavlink_attitude_t* attitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
attitude->time_boot_ms = mavlink_msg_attitude_get_time_boot_ms(msg);
|
||||
attitude->roll = mavlink_msg_attitude_get_roll(msg);
|
||||
attitude->pitch = mavlink_msg_attitude_get_pitch(msg);
|
||||
attitude->yaw = mavlink_msg_attitude_get_yaw(msg);
|
||||
attitude->rollspeed = mavlink_msg_attitude_get_rollspeed(msg);
|
||||
attitude->pitchspeed = mavlink_msg_attitude_get_pitchspeed(msg);
|
||||
attitude->yawspeed = mavlink_msg_attitude_get_yawspeed(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_LEN;
|
||||
memset(attitude, 0, MAVLINK_MSG_ID_ATTITUDE_LEN);
|
||||
memcpy(attitude, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-388
@@ -1,388 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ATTITUDE_QUATERNION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION 31
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_attitude_quaternion_t {
|
||||
uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
|
||||
float q1; /*< Quaternion component 1, w (1 in null-rotation)*/
|
||||
float q2; /*< Quaternion component 2, x (0 in null-rotation)*/
|
||||
float q3; /*< Quaternion component 3, y (0 in null-rotation)*/
|
||||
float q4; /*< Quaternion component 4, z (0 in null-rotation)*/
|
||||
float rollspeed; /*< Roll angular speed (rad/s)*/
|
||||
float pitchspeed; /*< Pitch angular speed (rad/s)*/
|
||||
float yawspeed; /*< Yaw angular speed (rad/s)*/
|
||||
}) mavlink_attitude_quaternion_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN 32
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_31_LEN 32
|
||||
#define MAVLINK_MSG_ID_31_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC 246
|
||||
#define MAVLINK_MSG_ID_31_CRC 246
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \
|
||||
31, \
|
||||
"ATTITUDE_QUATERNION", \
|
||||
8, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \
|
||||
{ "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_quaternion_t, q1) }, \
|
||||
{ "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_quaternion_t, q2) }, \
|
||||
{ "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_quaternion_t, q3) }, \
|
||||
{ "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_quaternion_t, q4) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_t, yawspeed) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION { \
|
||||
"ATTITUDE_QUATERNION", \
|
||||
8, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_quaternion_t, time_boot_ms) }, \
|
||||
{ "q1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_quaternion_t, q1) }, \
|
||||
{ "q2", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_quaternion_t, q2) }, \
|
||||
{ "q3", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_quaternion_t, q3) }, \
|
||||
{ "q4", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_quaternion_t, q4) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_quaternion_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_t, yawspeed) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_quaternion 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 q1 Quaternion component 1, w (1 in null-rotation)
|
||||
* @param q2 Quaternion component 2, x (0 in null-rotation)
|
||||
* @param q3 Quaternion component 3, y (0 in null-rotation)
|
||||
* @param q4 Quaternion component 4, z (0 in null-rotation)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, q1);
|
||||
_mav_put_float(buf, 8, q2);
|
||||
_mav_put_float(buf, 12, q3);
|
||||
_mav_put_float(buf, 16, q4);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.q1 = q1;
|
||||
packet.q2 = q2;
|
||||
packet.q3 = q3;
|
||||
packet.q4 = q4;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_quaternion message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param q1 Quaternion component 1, w (1 in null-rotation)
|
||||
* @param q2 Quaternion component 2, x (0 in null-rotation)
|
||||
* @param q3 Quaternion component 3, y (0 in null-rotation)
|
||||
* @param q4 Quaternion component 4, z (0 in null-rotation)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,float q1,float q2,float q3,float q4,float rollspeed,float pitchspeed,float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, q1);
|
||||
_mav_put_float(buf, 8, q2);
|
||||
_mav_put_float(buf, 12, q3);
|
||||
_mav_put_float(buf, 16, q4);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.q1 = q1;
|
||||
packet.q2 = q2;
|
||||
packet.q3 = q3;
|
||||
packet.q4 = q4;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_quaternion struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_quaternion C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_quaternion_t* attitude_quaternion)
|
||||
{
|
||||
return mavlink_msg_attitude_quaternion_pack(system_id, component_id, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_quaternion struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_quaternion C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_quaternion_t* attitude_quaternion)
|
||||
{
|
||||
return mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, chan, msg, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_quaternion message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param q1 Quaternion component 1, w (1 in null-rotation)
|
||||
* @param q2 Quaternion component 2, x (0 in null-rotation)
|
||||
* @param q3 Quaternion component 3, y (0 in null-rotation)
|
||||
* @param q4 Quaternion component 4, z (0 in null-rotation)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_attitude_quaternion_send(mavlink_channel_t chan, uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, q1);
|
||||
_mav_put_float(buf, 8, q2);
|
||||
_mav_put_float(buf, 12, q3);
|
||||
_mav_put_float(buf, 16, q4);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.q1 = q1;
|
||||
packet.q2 = q2;
|
||||
packet.q3 = q3;
|
||||
packet.q4 = q4;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_quaternion message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_send_struct(mavlink_channel_t chan, const mavlink_attitude_quaternion_t* attitude_quaternion)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_attitude_quaternion_send(chan, attitude_quaternion->time_boot_ms, attitude_quaternion->q1, attitude_quaternion->q2, attitude_quaternion->q3, attitude_quaternion->q4, attitude_quaternion->rollspeed, attitude_quaternion->pitchspeed, attitude_quaternion->yawspeed);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)attitude_quaternion, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, q1);
|
||||
_mav_put_float(buf, 8, q2);
|
||||
_mav_put_float(buf, 12, q3);
|
||||
_mav_put_float(buf, 16, q4);
|
||||
_mav_put_float(buf, 20, rollspeed);
|
||||
_mav_put_float(buf, 24, pitchspeed);
|
||||
_mav_put_float(buf, 28, yawspeed);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#else
|
||||
mavlink_attitude_quaternion_t *packet = (mavlink_attitude_quaternion_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->q1 = q1;
|
||||
packet->q2 = q2;
|
||||
packet->q3 = q3;
|
||||
packet->q4 = q4;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATTITUDE_QUATERNION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from attitude_quaternion message
|
||||
*
|
||||
* @return Timestamp (milliseconds since system boot)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_attitude_quaternion_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q1 from attitude_quaternion message
|
||||
*
|
||||
* @return Quaternion component 1, w (1 in null-rotation)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_q1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q2 from attitude_quaternion message
|
||||
*
|
||||
* @return Quaternion component 2, x (0 in null-rotation)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_q2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q3 from attitude_quaternion message
|
||||
*
|
||||
* @return Quaternion component 3, y (0 in null-rotation)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_q3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q4 from attitude_quaternion message
|
||||
*
|
||||
* @return Quaternion component 4, z (0 in null-rotation)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_q4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from attitude_quaternion message
|
||||
*
|
||||
* @return Roll angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from attitude_quaternion message
|
||||
*
|
||||
* @return Pitch angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from attitude_quaternion message
|
||||
*
|
||||
* @return Yaw angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a attitude_quaternion message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param attitude_quaternion C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_decode(const mavlink_message_t* msg, mavlink_attitude_quaternion_t* attitude_quaternion)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
attitude_quaternion->time_boot_ms = mavlink_msg_attitude_quaternion_get_time_boot_ms(msg);
|
||||
attitude_quaternion->q1 = mavlink_msg_attitude_quaternion_get_q1(msg);
|
||||
attitude_quaternion->q2 = mavlink_msg_attitude_quaternion_get_q2(msg);
|
||||
attitude_quaternion->q3 = mavlink_msg_attitude_quaternion_get_q3(msg);
|
||||
attitude_quaternion->q4 = mavlink_msg_attitude_quaternion_get_q4(msg);
|
||||
attitude_quaternion->rollspeed = mavlink_msg_attitude_quaternion_get_rollspeed(msg);
|
||||
attitude_quaternion->pitchspeed = mavlink_msg_attitude_quaternion_get_pitchspeed(msg);
|
||||
attitude_quaternion->yawspeed = mavlink_msg_attitude_quaternion_get_yawspeed(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN;
|
||||
memset(attitude_quaternion, 0, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_LEN);
|
||||
memcpy(attitude_quaternion, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-331
@@ -1,331 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ATTITUDE_QUATERNION_COV PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV 61
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_attitude_quaternion_cov_t {
|
||||
uint64_t time_usec; /*< Timestamp (microseconds since system boot or since UNIX epoch)*/
|
||||
float q[4]; /*< Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)*/
|
||||
float rollspeed; /*< Roll angular speed (rad/s)*/
|
||||
float pitchspeed; /*< Pitch angular speed (rad/s)*/
|
||||
float yawspeed; /*< Yaw angular speed (rad/s)*/
|
||||
float covariance[9]; /*< Attitude covariance*/
|
||||
}) mavlink_attitude_quaternion_cov_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN 72
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN 72
|
||||
#define MAVLINK_MSG_ID_61_LEN 72
|
||||
#define MAVLINK_MSG_ID_61_MIN_LEN 72
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC 167
|
||||
#define MAVLINK_MSG_ID_61_CRC 167
|
||||
|
||||
#define MAVLINK_MSG_ATTITUDE_QUATERNION_COV_FIELD_Q_LEN 4
|
||||
#define MAVLINK_MSG_ATTITUDE_QUATERNION_COV_FIELD_COVARIANCE_LEN 9
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV { \
|
||||
61, \
|
||||
"ATTITUDE_QUATERNION_COV", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_attitude_quaternion_cov_t, q) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_cov_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_cov_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_quaternion_cov_t, yawspeed) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 36, offsetof(mavlink_attitude_quaternion_cov_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV { \
|
||||
"ATTITUDE_QUATERNION_COV", \
|
||||
6, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_quaternion_cov_t, time_usec) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 8, offsetof(mavlink_attitude_quaternion_cov_t, q) }, \
|
||||
{ "rollspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_quaternion_cov_t, rollspeed) }, \
|
||||
{ "pitchspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_quaternion_cov_t, pitchspeed) }, \
|
||||
{ "yawspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_quaternion_cov_t, yawspeed) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 9, 36, offsetof(mavlink_attitude_quaternion_cov_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_quaternion_cov 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 since system boot or since UNIX epoch)
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
* @param covariance Attitude covariance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
#else
|
||||
mavlink_attitude_quaternion_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_quaternion_cov message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (microseconds since system boot or since UNIX epoch)
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
* @param covariance Attitude covariance
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,const float *q,float rollspeed,float pitchspeed,float yawspeed,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
#else
|
||||
mavlink_attitude_quaternion_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_quaternion_cov struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_quaternion_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
|
||||
{
|
||||
return mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, msg, attitude_quaternion_cov->time_usec, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_quaternion_cov struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_quaternion_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
|
||||
{
|
||||
return mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, chan, msg, attitude_quaternion_cov->time_usec, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_quaternion_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (microseconds since system boot or since UNIX epoch)
|
||||
* @param q Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
* @param rollspeed Roll angular speed (rad/s)
|
||||
* @param pitchspeed Pitch angular speed (rad/s)
|
||||
* @param yawspeed Yaw angular speed (rad/s)
|
||||
* @param covariance Attitude covariance
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_attitude_quaternion_cov_send(mavlink_channel_t chan, uint64_t time_usec, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#else
|
||||
mavlink_attitude_quaternion_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.rollspeed = rollspeed;
|
||||
packet.pitchspeed = pitchspeed;
|
||||
packet.yawspeed = yawspeed;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_quaternion_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_cov_send_struct(mavlink_channel_t chan, const mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_attitude_quaternion_cov_send(chan, attitude_quaternion_cov->time_usec, attitude_quaternion_cov->q, attitude_quaternion_cov->rollspeed, attitude_quaternion_cov->pitchspeed, attitude_quaternion_cov->yawspeed, attitude_quaternion_cov->covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)attitude_quaternion_cov, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, const float *q, float rollspeed, float pitchspeed, float yawspeed, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 24, rollspeed);
|
||||
_mav_put_float(buf, 28, pitchspeed);
|
||||
_mav_put_float(buf, 32, yawspeed);
|
||||
_mav_put_float_array(buf, 8, q, 4);
|
||||
_mav_put_float_array(buf, 36, covariance, 9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, buf, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#else
|
||||
mavlink_attitude_quaternion_cov_t *packet = (mavlink_attitude_quaternion_cov_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->rollspeed = rollspeed;
|
||||
packet->pitchspeed = pitchspeed;
|
||||
packet->yawspeed = yawspeed;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet->covariance, covariance, sizeof(float)*9);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATTITUDE_QUATERNION_COV UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from attitude_quaternion_cov message
|
||||
*
|
||||
* @return Timestamp (microseconds since system boot or since UNIX epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_attitude_quaternion_cov_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from attitude_quaternion_cov message
|
||||
*
|
||||
* @return Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rollspeed from attitude_quaternion_cov message
|
||||
*
|
||||
* @return Roll angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_cov_get_rollspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitchspeed from attitude_quaternion_cov message
|
||||
*
|
||||
* @return Pitch angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_cov_get_pitchspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yawspeed from attitude_quaternion_cov message
|
||||
*
|
||||
* @return Yaw angular speed (rad/s)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_quaternion_cov_get_yawspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from attitude_quaternion_cov message
|
||||
*
|
||||
* @return Attitude covariance
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_quaternion_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 9, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a attitude_quaternion_cov message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param attitude_quaternion_cov C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_quaternion_cov_decode(const mavlink_message_t* msg, mavlink_attitude_quaternion_cov_t* attitude_quaternion_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
attitude_quaternion_cov->time_usec = mavlink_msg_attitude_quaternion_cov_get_time_usec(msg);
|
||||
mavlink_msg_attitude_quaternion_cov_get_q(msg, attitude_quaternion_cov->q);
|
||||
attitude_quaternion_cov->rollspeed = mavlink_msg_attitude_quaternion_cov_get_rollspeed(msg);
|
||||
attitude_quaternion_cov->pitchspeed = mavlink_msg_attitude_quaternion_cov_get_pitchspeed(msg);
|
||||
attitude_quaternion_cov->yawspeed = mavlink_msg_attitude_quaternion_cov_get_yawspeed(msg);
|
||||
mavlink_msg_attitude_quaternion_cov_get_covariance(msg, attitude_quaternion_cov->covariance);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN;
|
||||
memset(attitude_quaternion_cov, 0, MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_LEN);
|
||||
memcpy(attitude_quaternion_cov, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-355
@@ -1,355 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ATTITUDE_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_TARGET 83
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_attitude_target_t {
|
||||
uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
|
||||
float q[4]; /*< Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
|
||||
float body_roll_rate; /*< Body roll rate in radians per second*/
|
||||
float body_pitch_rate; /*< Body roll rate in radians per second*/
|
||||
float body_yaw_rate; /*< Body roll rate in radians per second*/
|
||||
float thrust; /*< Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)*/
|
||||
uint8_t type_mask; /*< Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude*/
|
||||
}) mavlink_attitude_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN 37
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN 37
|
||||
#define MAVLINK_MSG_ID_83_LEN 37
|
||||
#define MAVLINK_MSG_ID_83_MIN_LEN 37
|
||||
|
||||
#define MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC 22
|
||||
#define MAVLINK_MSG_ID_83_CRC 22
|
||||
|
||||
#define MAVLINK_MSG_ATTITUDE_TARGET_FIELD_Q_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET { \
|
||||
83, \
|
||||
"ATTITUDE_TARGET", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \
|
||||
{ "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \
|
||||
{ "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \
|
||||
{ "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \
|
||||
{ "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET { \
|
||||
"ATTITUDE_TARGET", \
|
||||
7, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_attitude_target_t, time_boot_ms) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 4, offsetof(mavlink_attitude_target_t, q) }, \
|
||||
{ "body_roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_target_t, body_roll_rate) }, \
|
||||
{ "body_pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_target_t, body_pitch_rate) }, \
|
||||
{ "body_yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_target_t, body_yaw_rate) }, \
|
||||
{ "thrust", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_target_t, thrust) }, \
|
||||
{ "type_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_attitude_target_t, type_mask) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_target 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 type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param body_roll_rate Body roll rate in radians per second
|
||||
* @param body_pitch_rate Body roll rate in radians per second
|
||||
* @param body_yaw_rate Body roll rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 20, body_roll_rate);
|
||||
_mav_put_float(buf, 24, body_pitch_rate);
|
||||
_mav_put_float(buf, 28, body_yaw_rate);
|
||||
_mav_put_float(buf, 32, thrust);
|
||||
_mav_put_uint8_t(buf, 36, type_mask);
|
||||
_mav_put_float_array(buf, 4, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
#else
|
||||
mavlink_attitude_target_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.body_roll_rate = body_roll_rate;
|
||||
packet.body_pitch_rate = body_pitch_rate;
|
||||
packet.body_yaw_rate = body_yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
packet.type_mask = type_mask;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a attitude_target message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp in milliseconds since system boot
|
||||
* @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param body_roll_rate Body roll rate in radians per second
|
||||
* @param body_pitch_rate Body roll rate in radians per second
|
||||
* @param body_yaw_rate Body roll rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint8_t type_mask,const float *q,float body_roll_rate,float body_pitch_rate,float body_yaw_rate,float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 20, body_roll_rate);
|
||||
_mav_put_float(buf, 24, body_pitch_rate);
|
||||
_mav_put_float(buf, 28, body_yaw_rate);
|
||||
_mav_put_float(buf, 32, thrust);
|
||||
_mav_put_uint8_t(buf, 36, type_mask);
|
||||
_mav_put_float_array(buf, 4, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
#else
|
||||
mavlink_attitude_target_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.body_roll_rate = body_roll_rate;
|
||||
packet.body_pitch_rate = body_pitch_rate;
|
||||
packet.body_yaw_rate = body_yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
packet.type_mask = type_mask;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_target struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_target_t* attitude_target)
|
||||
{
|
||||
return mavlink_msg_attitude_target_pack(system_id, component_id, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a attitude_target struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param attitude_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_target_t* attitude_target)
|
||||
{
|
||||
return mavlink_msg_attitude_target_pack_chan(system_id, component_id, chan, msg, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp in milliseconds since system boot
|
||||
* @param type_mask Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
|
||||
* @param q Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
* @param body_roll_rate Body roll rate in radians per second
|
||||
* @param body_pitch_rate Body roll rate in radians per second
|
||||
* @param body_yaw_rate Body roll rate in radians per second
|
||||
* @param thrust Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_attitude_target_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 20, body_roll_rate);
|
||||
_mav_put_float(buf, 24, body_pitch_rate);
|
||||
_mav_put_float(buf, 28, body_yaw_rate);
|
||||
_mav_put_float(buf, 32, thrust);
|
||||
_mav_put_uint8_t(buf, 36, type_mask);
|
||||
_mav_put_float_array(buf, 4, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#else
|
||||
mavlink_attitude_target_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.body_roll_rate = body_roll_rate;
|
||||
packet.body_pitch_rate = body_pitch_rate;
|
||||
packet.body_yaw_rate = body_yaw_rate;
|
||||
packet.thrust = thrust;
|
||||
packet.type_mask = type_mask;
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a attitude_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_target_send_struct(mavlink_channel_t chan, const mavlink_attitude_target_t* attitude_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_attitude_target_send(chan, attitude_target->time_boot_ms, attitude_target->type_mask, attitude_target->q, attitude_target->body_roll_rate, attitude_target->body_pitch_rate, attitude_target->body_yaw_rate, attitude_target->thrust);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)attitude_target, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t type_mask, const float *q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 20, body_roll_rate);
|
||||
_mav_put_float(buf, 24, body_pitch_rate);
|
||||
_mav_put_float(buf, 28, body_yaw_rate);
|
||||
_mav_put_float(buf, 32, thrust);
|
||||
_mav_put_uint8_t(buf, 36, type_mask);
|
||||
_mav_put_float_array(buf, 4, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, buf, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#else
|
||||
mavlink_attitude_target_t *packet = (mavlink_attitude_target_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->body_roll_rate = body_roll_rate;
|
||||
packet->body_pitch_rate = body_pitch_rate;
|
||||
packet->body_yaw_rate = body_yaw_rate;
|
||||
packet->thrust = thrust;
|
||||
packet->type_mask = type_mask;
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_TARGET, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN, MAVLINK_MSG_ID_ATTITUDE_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ATTITUDE_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from attitude_target message
|
||||
*
|
||||
* @return Timestamp in milliseconds since system boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_attitude_target_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type_mask from attitude_target message
|
||||
*
|
||||
* @return Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_attitude_target_get_type_mask(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from attitude_target message
|
||||
*
|
||||
* @return Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_attitude_target_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field body_roll_rate from attitude_target message
|
||||
*
|
||||
* @return Body roll rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_target_get_body_roll_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field body_pitch_rate from attitude_target message
|
||||
*
|
||||
* @return Body roll rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_target_get_body_pitch_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field body_yaw_rate from attitude_target message
|
||||
*
|
||||
* @return Body roll rate in radians per second
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_target_get_body_yaw_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field thrust from attitude_target message
|
||||
*
|
||||
* @return Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
|
||||
*/
|
||||
static inline float mavlink_msg_attitude_target_get_thrust(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a attitude_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param attitude_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_attitude_target_decode(const mavlink_message_t* msg, mavlink_attitude_target_t* attitude_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
attitude_target->time_boot_ms = mavlink_msg_attitude_target_get_time_boot_ms(msg);
|
||||
mavlink_msg_attitude_target_get_q(msg, attitude_target->q);
|
||||
attitude_target->body_roll_rate = mavlink_msg_attitude_target_get_body_roll_rate(msg);
|
||||
attitude_target->body_pitch_rate = mavlink_msg_attitude_target_get_body_pitch_rate(msg);
|
||||
attitude_target->body_yaw_rate = mavlink_msg_attitude_target_get_body_yaw_rate(msg);
|
||||
attitude_target->thrust = mavlink_msg_attitude_target_get_thrust(msg);
|
||||
attitude_target->type_mask = mavlink_msg_attitude_target_get_type_mask(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN;
|
||||
memset(attitude_target, 0, MAVLINK_MSG_ID_ATTITUDE_TARGET_LEN);
|
||||
memcpy(attitude_target, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -1,213 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE AUTH_KEY PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTH_KEY 7
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_auth_key_t {
|
||||
char key[32]; /*< key*/
|
||||
}) mavlink_auth_key_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTH_KEY_LEN 32
|
||||
#define MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_7_LEN 32
|
||||
#define MAVLINK_MSG_ID_7_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTH_KEY_CRC 119
|
||||
#define MAVLINK_MSG_ID_7_CRC 119
|
||||
|
||||
#define MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN 32
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AUTH_KEY { \
|
||||
7, \
|
||||
"AUTH_KEY", \
|
||||
1, \
|
||||
{ { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AUTH_KEY { \
|
||||
"AUTH_KEY", \
|
||||
1, \
|
||||
{ { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a auth_key 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 key key
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
const char *key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
#else
|
||||
mavlink_auth_key_t packet;
|
||||
|
||||
mav_array_memcpy(packet.key, key, sizeof(char)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a auth_key message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param key key
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
const char *key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
#else
|
||||
mavlink_auth_key_t packet;
|
||||
|
||||
mav_array_memcpy(packet.key, key, sizeof(char)*32);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a auth_key struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param auth_key C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key)
|
||||
{
|
||||
return mavlink_msg_auth_key_pack(system_id, component_id, msg, auth_key->key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a auth_key struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param auth_key C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key)
|
||||
{
|
||||
return mavlink_msg_auth_key_pack_chan(system_id, component_id, chan, msg, auth_key->key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a auth_key message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param key key
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char *key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#else
|
||||
mavlink_auth_key_t packet;
|
||||
|
||||
mav_array_memcpy(packet.key, key, sizeof(char)*32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a auth_key message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_auth_key_send_struct(mavlink_channel_t chan, const mavlink_auth_key_t* auth_key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_auth_key_send(chan, auth_key->key);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)auth_key, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AUTH_KEY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_auth_key_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
|
||||
_mav_put_char_array(buf, 0, key, 32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#else
|
||||
mavlink_auth_key_t *packet = (mavlink_auth_key_t *)msgbuf;
|
||||
|
||||
mav_array_memcpy(packet->key, key, sizeof(char)*32);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)packet, MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AUTH_KEY UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field key from auth_key message
|
||||
*
|
||||
* @return key
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg, char *key)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, key, 32, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a auth_key message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param auth_key C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_auth_key_decode(const mavlink_message_t* msg, mavlink_auth_key_t* auth_key)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_auth_key_get_key(msg, auth_key->key);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AUTH_KEY_LEN? msg->len : MAVLINK_MSG_ID_AUTH_KEY_LEN;
|
||||
memset(auth_key, 0, MAVLINK_MSG_ID_AUTH_KEY_LEN);
|
||||
memcpy(auth_key, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-457
@@ -1,457 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE AUTOPILOT_VERSION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_autopilot_version_t {
|
||||
uint64_t capabilities; /*< bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)*/
|
||||
uint64_t uid; /*< UID if provided by hardware*/
|
||||
uint32_t flight_sw_version; /*< Firmware version number*/
|
||||
uint32_t middleware_sw_version; /*< Middleware version number*/
|
||||
uint32_t os_sw_version; /*< Operating system version number*/
|
||||
uint32_t board_version; /*< HW / board version (last 8 bytes should be silicon ID, if any)*/
|
||||
uint16_t vendor_id; /*< ID of the board vendor*/
|
||||
uint16_t product_id; /*< ID of the product*/
|
||||
uint8_t flight_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
|
||||
uint8_t middleware_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
|
||||
uint8_t os_custom_version[8]; /*< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.*/
|
||||
}) mavlink_autopilot_version_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 60
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN 60
|
||||
#define MAVLINK_MSG_ID_148_LEN 60
|
||||
#define MAVLINK_MSG_ID_148_MIN_LEN 60
|
||||
|
||||
#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC 178
|
||||
#define MAVLINK_MSG_ID_148_CRC 178
|
||||
|
||||
#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_FLIGHT_CUSTOM_VERSION_LEN 8
|
||||
#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_MIDDLEWARE_CUSTOM_VERSION_LEN 8
|
||||
#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_OS_CUSTOM_VERSION_LEN 8
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
|
||||
148, \
|
||||
"AUTOPILOT_VERSION", \
|
||||
11, \
|
||||
{ { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
|
||||
{ "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
|
||||
{ "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
|
||||
{ "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
|
||||
{ "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
|
||||
{ "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
|
||||
{ "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
|
||||
{ "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
|
||||
{ "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
|
||||
{ "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
|
||||
{ "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
|
||||
"AUTOPILOT_VERSION", \
|
||||
11, \
|
||||
{ { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
|
||||
{ "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
|
||||
{ "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
|
||||
{ "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
|
||||
{ "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
|
||||
{ "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
|
||||
{ "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
|
||||
{ "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
|
||||
{ "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
|
||||
{ "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
|
||||
{ "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a autopilot_version 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 capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
|
||||
* @param flight_sw_version Firmware version number
|
||||
* @param middleware_sw_version Middleware version number
|
||||
* @param os_sw_version Operating system version number
|
||||
* @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
|
||||
* @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param vendor_id ID of the board vendor
|
||||
* @param product_id ID of the product
|
||||
* @param uid UID if provided by hardware
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, capabilities);
|
||||
_mav_put_uint64_t(buf, 8, uid);
|
||||
_mav_put_uint32_t(buf, 16, flight_sw_version);
|
||||
_mav_put_uint32_t(buf, 20, middleware_sw_version);
|
||||
_mav_put_uint32_t(buf, 24, os_sw_version);
|
||||
_mav_put_uint32_t(buf, 28, board_version);
|
||||
_mav_put_uint16_t(buf, 32, vendor_id);
|
||||
_mav_put_uint16_t(buf, 34, product_id);
|
||||
_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
#else
|
||||
mavlink_autopilot_version_t packet;
|
||||
packet.capabilities = capabilities;
|
||||
packet.uid = uid;
|
||||
packet.flight_sw_version = flight_sw_version;
|
||||
packet.middleware_sw_version = middleware_sw_version;
|
||||
packet.os_sw_version = os_sw_version;
|
||||
packet.board_version = board_version;
|
||||
packet.vendor_id = vendor_id;
|
||||
packet.product_id = product_id;
|
||||
mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a autopilot_version message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
|
||||
* @param flight_sw_version Firmware version number
|
||||
* @param middleware_sw_version Middleware version number
|
||||
* @param os_sw_version Operating system version number
|
||||
* @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
|
||||
* @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param vendor_id ID of the board vendor
|
||||
* @param product_id ID of the product
|
||||
* @param uid UID if provided by hardware
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t capabilities,uint32_t flight_sw_version,uint32_t middleware_sw_version,uint32_t os_sw_version,uint32_t board_version,const uint8_t *flight_custom_version,const uint8_t *middleware_custom_version,const uint8_t *os_custom_version,uint16_t vendor_id,uint16_t product_id,uint64_t uid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, capabilities);
|
||||
_mav_put_uint64_t(buf, 8, uid);
|
||||
_mav_put_uint32_t(buf, 16, flight_sw_version);
|
||||
_mav_put_uint32_t(buf, 20, middleware_sw_version);
|
||||
_mav_put_uint32_t(buf, 24, os_sw_version);
|
||||
_mav_put_uint32_t(buf, 28, board_version);
|
||||
_mav_put_uint16_t(buf, 32, vendor_id);
|
||||
_mav_put_uint16_t(buf, 34, product_id);
|
||||
_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
#else
|
||||
mavlink_autopilot_version_t packet;
|
||||
packet.capabilities = capabilities;
|
||||
packet.uid = uid;
|
||||
packet.flight_sw_version = flight_sw_version;
|
||||
packet.middleware_sw_version = middleware_sw_version;
|
||||
packet.os_sw_version = os_sw_version;
|
||||
packet.board_version = board_version;
|
||||
packet.vendor_id = vendor_id;
|
||||
packet.product_id = product_id;
|
||||
mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a autopilot_version struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param autopilot_version C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_autopilot_version_t* autopilot_version)
|
||||
{
|
||||
return mavlink_msg_autopilot_version_pack(system_id, component_id, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a autopilot_version struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param autopilot_version C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_autopilot_version_t* autopilot_version)
|
||||
{
|
||||
return mavlink_msg_autopilot_version_pack_chan(system_id, component_id, chan, msg, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a autopilot_version message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
|
||||
* @param flight_sw_version Firmware version number
|
||||
* @param middleware_sw_version Middleware version number
|
||||
* @param os_sw_version Operating system version number
|
||||
* @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
|
||||
* @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
* @param vendor_id ID of the board vendor
|
||||
* @param product_id ID of the product
|
||||
* @param uid UID if provided by hardware
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_autopilot_version_send(mavlink_channel_t chan, uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
|
||||
_mav_put_uint64_t(buf, 0, capabilities);
|
||||
_mav_put_uint64_t(buf, 8, uid);
|
||||
_mav_put_uint32_t(buf, 16, flight_sw_version);
|
||||
_mav_put_uint32_t(buf, 20, middleware_sw_version);
|
||||
_mav_put_uint32_t(buf, 24, os_sw_version);
|
||||
_mav_put_uint32_t(buf, 28, board_version);
|
||||
_mav_put_uint16_t(buf, 32, vendor_id);
|
||||
_mav_put_uint16_t(buf, 34, product_id);
|
||||
_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#else
|
||||
mavlink_autopilot_version_t packet;
|
||||
packet.capabilities = capabilities;
|
||||
packet.uid = uid;
|
||||
packet.flight_sw_version = flight_sw_version;
|
||||
packet.middleware_sw_version = middleware_sw_version;
|
||||
packet.os_sw_version = os_sw_version;
|
||||
packet.board_version = board_version;
|
||||
packet.vendor_id = vendor_id;
|
||||
packet.product_id = product_id;
|
||||
mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)&packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a autopilot_version message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_send_struct(mavlink_channel_t chan, const mavlink_autopilot_version_t* autopilot_version)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_autopilot_version_send(chan, autopilot_version->capabilities, autopilot_version->flight_sw_version, autopilot_version->middleware_sw_version, autopilot_version->os_sw_version, autopilot_version->board_version, autopilot_version->flight_custom_version, autopilot_version->middleware_custom_version, autopilot_version->os_custom_version, autopilot_version->vendor_id, autopilot_version->product_id, autopilot_version->uid);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)autopilot_version, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t capabilities, uint32_t flight_sw_version, uint32_t middleware_sw_version, uint32_t os_sw_version, uint32_t board_version, const uint8_t *flight_custom_version, const uint8_t *middleware_custom_version, const uint8_t *os_custom_version, uint16_t vendor_id, uint16_t product_id, uint64_t uid)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, capabilities);
|
||||
_mav_put_uint64_t(buf, 8, uid);
|
||||
_mav_put_uint32_t(buf, 16, flight_sw_version);
|
||||
_mav_put_uint32_t(buf, 20, middleware_sw_version);
|
||||
_mav_put_uint32_t(buf, 24, os_sw_version);
|
||||
_mav_put_uint32_t(buf, 28, board_version);
|
||||
_mav_put_uint16_t(buf, 32, vendor_id);
|
||||
_mav_put_uint16_t(buf, 34, product_id);
|
||||
_mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
|
||||
_mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#else
|
||||
mavlink_autopilot_version_t *packet = (mavlink_autopilot_version_t *)msgbuf;
|
||||
packet->capabilities = capabilities;
|
||||
packet->uid = uid;
|
||||
packet->flight_sw_version = flight_sw_version;
|
||||
packet->middleware_sw_version = middleware_sw_version;
|
||||
packet->os_sw_version = os_sw_version;
|
||||
packet->board_version = board_version;
|
||||
packet->vendor_id = vendor_id;
|
||||
packet->product_id = product_id;
|
||||
mav_array_memcpy(packet->flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet->middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
|
||||
mav_array_memcpy(packet->os_custom_version, os_custom_version, sizeof(uint8_t)*8);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTOPILOT_VERSION, (const char *)packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE AUTOPILOT_VERSION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field capabilities from autopilot_version message
|
||||
*
|
||||
* @return bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flight_sw_version from autopilot_version message
|
||||
*
|
||||
* @return Firmware version number
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field middleware_sw_version from autopilot_version message
|
||||
*
|
||||
* @return Middleware version number
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field os_sw_version from autopilot_version message
|
||||
*
|
||||
* @return Operating system version number
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field board_version from autopilot_version message
|
||||
*
|
||||
* @return HW / board version (last 8 bytes should be silicon ID, if any)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flight_custom_version from autopilot_version message
|
||||
*
|
||||
* @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t* msg, uint8_t *flight_custom_version)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, flight_custom_version, 8, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field middleware_custom_version from autopilot_version message
|
||||
*
|
||||
* @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t* msg, uint8_t *middleware_custom_version)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, middleware_custom_version, 8, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field os_custom_version from autopilot_version message
|
||||
*
|
||||
* @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t* msg, uint8_t *os_custom_version)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, os_custom_version, 8, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vendor_id from autopilot_version message
|
||||
*
|
||||
* @return ID of the board vendor
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field product_id from autopilot_version message
|
||||
*
|
||||
* @return ID of the product
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field uid from autopilot_version message
|
||||
*
|
||||
* @return UID if provided by hardware
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a autopilot_version message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param autopilot_version C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_autopilot_version_decode(const mavlink_message_t* msg, mavlink_autopilot_version_t* autopilot_version)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
autopilot_version->capabilities = mavlink_msg_autopilot_version_get_capabilities(msg);
|
||||
autopilot_version->uid = mavlink_msg_autopilot_version_get_uid(msg);
|
||||
autopilot_version->flight_sw_version = mavlink_msg_autopilot_version_get_flight_sw_version(msg);
|
||||
autopilot_version->middleware_sw_version = mavlink_msg_autopilot_version_get_middleware_sw_version(msg);
|
||||
autopilot_version->os_sw_version = mavlink_msg_autopilot_version_get_os_sw_version(msg);
|
||||
autopilot_version->board_version = mavlink_msg_autopilot_version_get_board_version(msg);
|
||||
autopilot_version->vendor_id = mavlink_msg_autopilot_version_get_vendor_id(msg);
|
||||
autopilot_version->product_id = mavlink_msg_autopilot_version_get_product_id(msg);
|
||||
mavlink_msg_autopilot_version_get_flight_custom_version(msg, autopilot_version->flight_custom_version);
|
||||
mavlink_msg_autopilot_version_get_middleware_custom_version(msg, autopilot_version->middleware_custom_version);
|
||||
mavlink_msg_autopilot_version_get_os_custom_version(msg, autopilot_version->os_custom_version);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN? msg->len : MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN;
|
||||
memset(autopilot_version, 0, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
|
||||
memcpy(autopilot_version, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-405
@@ -1,405 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE BATTERY_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS 147
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_battery_status_t {
|
||||
int32_t current_consumed; /*< Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate*/
|
||||
int32_t energy_consumed; /*< Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate*/
|
||||
int16_t temperature; /*< Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.*/
|
||||
uint16_t voltages[10]; /*< Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.*/
|
||||
int16_t current_battery; /*< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current*/
|
||||
uint8_t id; /*< Battery ID*/
|
||||
uint8_t battery_function; /*< Function of the battery*/
|
||||
uint8_t type; /*< Type (chemistry) of the battery*/
|
||||
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 36
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN 36
|
||||
#define MAVLINK_MSG_ID_147_LEN 36
|
||||
#define MAVLINK_MSG_ID_147_MIN_LEN 36
|
||||
|
||||
#define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 154
|
||||
#define MAVLINK_MSG_ID_147_CRC 154
|
||||
|
||||
#define MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN 10
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
|
||||
147, \
|
||||
"BATTERY_STATUS", \
|
||||
9, \
|
||||
{ { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
|
||||
{ "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \
|
||||
{ "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \
|
||||
{ "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
|
||||
"BATTERY_STATUS", \
|
||||
9, \
|
||||
{ { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
|
||||
{ "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
|
||||
{ "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \
|
||||
{ "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \
|
||||
{ "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \
|
||||
{ "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \
|
||||
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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 id Battery ID
|
||||
* @param battery_function Function of the battery
|
||||
* @param type Type (chemistry) of the battery
|
||||
* @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.
|
||||
* @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
* @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
* @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 id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_int16_t(buf, 8, temperature);
|
||||
_mav_put_int16_t(buf, 30, current_battery);
|
||||
_mav_put_uint8_t(buf, 32, id);
|
||||
_mav_put_uint8_t(buf, 33, battery_function);
|
||||
_mav_put_uint8_t(buf, 34, type);
|
||||
_mav_put_int8_t(buf, 35, battery_remaining);
|
||||
_mav_put_uint16_t_array(buf, 10, voltages, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.temperature = temperature;
|
||||
packet.current_battery = current_battery;
|
||||
packet.id = id;
|
||||
packet.battery_function = battery_function;
|
||||
packet.type = type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param id Battery ID
|
||||
* @param battery_function Function of the battery
|
||||
* @param type Type (chemistry) of the battery
|
||||
* @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.
|
||||
* @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
* @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
* @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 id,uint8_t battery_function,uint8_t type,int16_t temperature,const uint16_t *voltages,int16_t current_battery,int32_t current_consumed,int32_t energy_consumed,int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_int16_t(buf, 8, temperature);
|
||||
_mav_put_int16_t(buf, 30, current_battery);
|
||||
_mav_put_uint8_t(buf, 32, id);
|
||||
_mav_put_uint8_t(buf, 33, battery_function);
|
||||
_mav_put_uint8_t(buf, 34, type);
|
||||
_mav_put_int8_t(buf, 35, battery_remaining);
|
||||
_mav_put_uint16_t_array(buf, 10, voltages, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.temperature = temperature;
|
||||
packet.current_battery = current_battery;
|
||||
packet.id = id;
|
||||
packet.battery_function = battery_function;
|
||||
packet.type = type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a battery_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a battery_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param battery_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a battery_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param id Battery ID
|
||||
* @param battery_function Function of the battery
|
||||
* @param type Type (chemistry) of the battery
|
||||
* @param temperature Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.
|
||||
* @param voltages Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.
|
||||
* @param current_battery Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current
|
||||
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
* @param energy_consumed Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
* @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 id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_int16_t(buf, 8, temperature);
|
||||
_mav_put_int16_t(buf, 30, current_battery);
|
||||
_mav_put_uint8_t(buf, 32, id);
|
||||
_mav_put_uint8_t(buf, 33, battery_function);
|
||||
_mav_put_uint8_t(buf, 34, type);
|
||||
_mav_put_int8_t(buf, 35, battery_remaining);
|
||||
_mav_put_uint16_t_array(buf, 10, voltages, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#else
|
||||
mavlink_battery_status_t packet;
|
||||
packet.current_consumed = current_consumed;
|
||||
packet.energy_consumed = energy_consumed;
|
||||
packet.temperature = temperature;
|
||||
packet.current_battery = current_battery;
|
||||
packet.id = id;
|
||||
packet.battery_function = battery_function;
|
||||
packet.type = type;
|
||||
packet.battery_remaining = battery_remaining;
|
||||
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a battery_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_battery_status_send_struct(mavlink_channel_t chan, const mavlink_battery_status_t* battery_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_battery_status_send(chan, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)battery_status, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_BATTERY_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, current_consumed);
|
||||
_mav_put_int32_t(buf, 4, energy_consumed);
|
||||
_mav_put_int16_t(buf, 8, temperature);
|
||||
_mav_put_int16_t(buf, 30, current_battery);
|
||||
_mav_put_uint8_t(buf, 32, id);
|
||||
_mav_put_uint8_t(buf, 33, battery_function);
|
||||
_mav_put_uint8_t(buf, 34, type);
|
||||
_mav_put_int8_t(buf, 35, battery_remaining);
|
||||
_mav_put_uint16_t_array(buf, 10, voltages, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#else
|
||||
mavlink_battery_status_t *packet = (mavlink_battery_status_t *)msgbuf;
|
||||
packet->current_consumed = current_consumed;
|
||||
packet->energy_consumed = energy_consumed;
|
||||
packet->temperature = temperature;
|
||||
packet->current_battery = current_battery;
|
||||
packet->id = id;
|
||||
packet->battery_function = battery_function;
|
||||
packet->type = type;
|
||||
packet->battery_remaining = battery_remaining;
|
||||
mav_array_memcpy(packet->voltages, voltages, sizeof(uint16_t)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE BATTERY_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field id from battery_status message
|
||||
*
|
||||
* @return Battery ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field battery_function from battery_status message
|
||||
*
|
||||
* @return Function of the battery
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_battery_function(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type from battery_status message
|
||||
*
|
||||
* @return Type (chemistry) of the battery
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_battery_status_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field temperature from battery_status message
|
||||
*
|
||||
* @return Temperature of the battery in centi-degrees celsius. INT16_MAX for unknown temperature.
|
||||
*/
|
||||
static inline int16_t mavlink_msg_battery_status_get_temperature(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field voltages from battery_status message
|
||||
*
|
||||
* @return Battery voltage of cells, in millivolts (1 = 1 millivolt). Cells above the valid cell count for this battery should have the UINT16_MAX value.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_battery_status_get_voltages(const mavlink_message_t* msg, uint16_t *voltages)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t_array(msg, voltages, 10, 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, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current_consumed from battery_status message
|
||||
*
|
||||
* @return Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
|
||||
*/
|
||||
static inline int32_t mavlink_msg_battery_status_get_current_consumed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field energy_consumed from battery_status message
|
||||
*
|
||||
* @return Consumed energy, in 100*Joules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
|
||||
*/
|
||||
static inline int32_t mavlink_msg_battery_status_get_energy_consumed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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, 35);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 || !MAVLINK_ALIGNED_FIELDS
|
||||
battery_status->current_consumed = mavlink_msg_battery_status_get_current_consumed(msg);
|
||||
battery_status->energy_consumed = mavlink_msg_battery_status_get_energy_consumed(msg);
|
||||
battery_status->temperature = mavlink_msg_battery_status_get_temperature(msg);
|
||||
mavlink_msg_battery_status_get_voltages(msg, battery_status->voltages);
|
||||
battery_status->current_battery = mavlink_msg_battery_status_get_current_battery(msg);
|
||||
battery_status->id = mavlink_msg_battery_status_get_id(msg);
|
||||
battery_status->battery_function = mavlink_msg_battery_status_get_battery_function(msg);
|
||||
battery_status->type = mavlink_msg_battery_status_get_type(msg);
|
||||
battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_BATTERY_STATUS_LEN? msg->len : MAVLINK_MSG_ID_BATTERY_STATUS_LEN;
|
||||
memset(battery_status, 0, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
|
||||
memcpy(battery_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE CAMERA_TRIGGER PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_TRIGGER 112
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_camera_trigger_t {
|
||||
uint64_t time_usec; /*< Timestamp for the image frame in microseconds*/
|
||||
uint32_t seq; /*< Image frame sequence*/
|
||||
}) mavlink_camera_trigger_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN 12
|
||||
#define MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_112_LEN 12
|
||||
#define MAVLINK_MSG_ID_112_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC 174
|
||||
#define MAVLINK_MSG_ID_112_CRC 174
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \
|
||||
112, \
|
||||
"CAMERA_TRIGGER", \
|
||||
2, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \
|
||||
"CAMERA_TRIGGER", \
|
||||
2, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \
|
||||
{ "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_trigger 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 for the image frame in microseconds
|
||||
* @param seq Image frame sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint32_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
#else
|
||||
mavlink_camera_trigger_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a camera_trigger message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp for the image frame in microseconds
|
||||
* @param seq Image frame sequence
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_trigger_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint32_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, seq);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
#else
|
||||
mavlink_camera_trigger_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.seq = seq;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_trigger struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_trigger C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_trigger_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_trigger_t* camera_trigger)
|
||||
{
|
||||
return mavlink_msg_camera_trigger_pack(system_id, component_id, msg, camera_trigger->time_usec, camera_trigger->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a camera_trigger struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param camera_trigger C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_camera_trigger_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_trigger_t* camera_trigger)
|
||||
{
|
||||
return mavlink_msg_camera_trigger_pack_chan(system_id, component_id, chan, msg, camera_trigger->time_usec, camera_trigger->seq);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_trigger message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp for the image frame in microseconds
|
||||
* @param seq Image frame sequence
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_camera_trigger_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, seq);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#else
|
||||
mavlink_camera_trigger_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.seq = seq;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a camera_trigger message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_camera_trigger_send_struct(mavlink_channel_t chan, const mavlink_camera_trigger_t* camera_trigger)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_camera_trigger_send(chan, camera_trigger->time_usec, camera_trigger->seq);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)camera_trigger, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_camera_trigger_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint32_t seq)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, seq);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, buf, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#else
|
||||
mavlink_camera_trigger_t *packet = (mavlink_camera_trigger_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->seq = seq;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_TRIGGER, (const char *)packet, MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CAMERA_TRIGGER UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from camera_trigger message
|
||||
*
|
||||
* @return Timestamp for the image frame in microseconds
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field seq from camera_trigger message
|
||||
*
|
||||
* @return Image frame sequence
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_camera_trigger_get_seq(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a camera_trigger message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param camera_trigger C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_camera_trigger_decode(const mavlink_message_t* msg, mavlink_camera_trigger_t* camera_trigger)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
camera_trigger->time_usec = mavlink_msg_camera_trigger_get_time_usec(msg);
|
||||
camera_trigger->seq = mavlink_msg_camera_trigger_get_seq(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN;
|
||||
memset(camera_trigger, 0, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN);
|
||||
memcpy(camera_trigger, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-280
@@ -1,280 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE CHANGE_OPERATOR_CONTROL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL 5
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_change_operator_control_t {
|
||||
uint8_t target_system; /*< System the GCS requests control for*/
|
||||
uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/
|
||||
uint8_t version; /*< 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.*/
|
||||
char passkey[25]; /*< Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"*/
|
||||
}) mavlink_change_operator_control_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN 28
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_5_LEN 28
|
||||
#define MAVLINK_MSG_ID_5_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC 217
|
||||
#define MAVLINK_MSG_ID_5_CRC 217
|
||||
|
||||
#define MAVLINK_MSG_CHANGE_OPERATOR_CONTROL_FIELD_PASSKEY_LEN 25
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \
|
||||
5, \
|
||||
"CHANGE_OPERATOR_CONTROL", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \
|
||||
{ "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \
|
||||
{ "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \
|
||||
{ "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL { \
|
||||
"CHANGE_OPERATOR_CONTROL", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_t, target_system) }, \
|
||||
{ "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_t, control_request) }, \
|
||||
{ "version", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_t, version) }, \
|
||||
{ "passkey", NULL, MAVLINK_TYPE_CHAR, 25, 3, offsetof(mavlink_change_operator_control_t, passkey) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a change_operator_control message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System the GCS requests control for
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
|
||||
* @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_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_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
#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_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a change_operator_control message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System the GCS requests control for
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
|
||||
* @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t control_request,uint8_t version,const char *passkey)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_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_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
#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_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a change_operator_control struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param change_operator_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control)
|
||||
{
|
||||
return mavlink_msg_change_operator_control_pack(system_id, component_id, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a change_operator_control struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param change_operator_control C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_change_operator_control_t* change_operator_control)
|
||||
{
|
||||
return mavlink_msg_change_operator_control_pack_chan(system_id, component_id, chan, msg, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a change_operator_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System the GCS requests control for
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param version 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
|
||||
* @param passkey Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, version);
|
||||
_mav_put_char_array(buf, 3, passkey, 25);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#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);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a change_operator_control message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_send_struct(mavlink_channel_t chan, const mavlink_change_operator_control_t* change_operator_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_change_operator_control_send(chan, change_operator_control->target_system, change_operator_control->control_request, change_operator_control->version, change_operator_control->passkey);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)change_operator_control, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, version);
|
||||
_mav_put_char_array(buf, 3, passkey, 25);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#else
|
||||
mavlink_change_operator_control_t *packet = (mavlink_change_operator_control_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->control_request = control_request;
|
||||
packet->version = version;
|
||||
mav_array_memcpy(packet->passkey, passkey, sizeof(char)*25);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CHANGE_OPERATOR_CONTROL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from change_operator_control message
|
||||
*
|
||||
* @return System the GCS requests control for
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field control_request from change_operator_control message
|
||||
*
|
||||
* @return 0: request control of this MAV, 1: Release control of this MAV
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_get_control_request(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field version from change_operator_control message
|
||||
*
|
||||
* @return 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field passkey from change_operator_control message
|
||||
*
|
||||
* @return Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_get_passkey(const mavlink_message_t* msg, char *passkey)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, passkey, 25, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a change_operator_control message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param change_operator_control C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_decode(const mavlink_message_t* msg, mavlink_change_operator_control_t* change_operator_control)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
change_operator_control->target_system = mavlink_msg_change_operator_control_get_target_system(msg);
|
||||
change_operator_control->control_request = mavlink_msg_change_operator_control_get_control_request(msg);
|
||||
change_operator_control->version = mavlink_msg_change_operator_control_get_version(msg);
|
||||
mavlink_msg_change_operator_control_get_passkey(msg, change_operator_control->passkey);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN? msg->len : MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN;
|
||||
memset(change_operator_control, 0, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_LEN);
|
||||
memcpy(change_operator_control, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-263
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE CHANGE_OPERATOR_CONTROL_ACK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK 6
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_change_operator_control_ack_t {
|
||||
uint8_t gcs_system_id; /*< ID of the GCS this message */
|
||||
uint8_t control_request; /*< 0: request control of this MAV, 1: Release control of this MAV*/
|
||||
uint8_t ack; /*< 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control*/
|
||||
}) mavlink_change_operator_control_ack_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN 3
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_6_LEN 3
|
||||
#define MAVLINK_MSG_ID_6_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC 104
|
||||
#define MAVLINK_MSG_ID_6_CRC 104
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \
|
||||
6, \
|
||||
"CHANGE_OPERATOR_CONTROL_ACK", \
|
||||
3, \
|
||||
{ { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \
|
||||
{ "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \
|
||||
{ "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK { \
|
||||
"CHANGE_OPERATOR_CONTROL_ACK", \
|
||||
3, \
|
||||
{ { "gcs_system_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_change_operator_control_ack_t, gcs_system_id) }, \
|
||||
{ "control_request", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_change_operator_control_ack_t, control_request) }, \
|
||||
{ "ack", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_change_operator_control_ack_t, ack) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a change_operator_control_ack 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 gcs_system_id ID of the GCS this message
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, gcs_system_id);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
#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_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a change_operator_control_ack message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gcs_system_id ID of the GCS this message
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t gcs_system_id,uint8_t control_request,uint8_t ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, gcs_system_id);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
#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_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a change_operator_control_ack struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param change_operator_control_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
|
||||
{
|
||||
return mavlink_msg_change_operator_control_ack_pack(system_id, component_id, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a change_operator_control_ack struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param change_operator_control_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_change_operator_control_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
|
||||
{
|
||||
return mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, chan, msg, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a change_operator_control_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param gcs_system_id ID of the GCS this message
|
||||
* @param control_request 0: request control of this MAV, 1: Release control of this MAV
|
||||
* @param ack 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN];
|
||||
_mav_put_uint8_t(buf, 0, gcs_system_id);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#else
|
||||
mavlink_change_operator_control_ack_t packet;
|
||||
packet.gcs_system_id = gcs_system_id;
|
||||
packet.control_request = control_request;
|
||||
packet.ack = ack;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a change_operator_control_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_ack_send_struct(mavlink_channel_t chan, const mavlink_change_operator_control_ack_t* change_operator_control_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_change_operator_control_ack_send(chan, change_operator_control_ack->gcs_system_id, change_operator_control_ack->control_request, change_operator_control_ack->ack);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)change_operator_control_ack, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, gcs_system_id);
|
||||
_mav_put_uint8_t(buf, 1, control_request);
|
||||
_mav_put_uint8_t(buf, 2, ack);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#else
|
||||
mavlink_change_operator_control_ack_t *packet = (mavlink_change_operator_control_ack_t *)msgbuf;
|
||||
packet->gcs_system_id = gcs_system_id;
|
||||
packet->control_request = control_request;
|
||||
packet->ack = ack;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)packet, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CHANGE_OPERATOR_CONTROL_ACK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field gcs_system_id from change_operator_control_ack message
|
||||
*
|
||||
* @return ID of the GCS this message
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field control_request from change_operator_control_ack message
|
||||
*
|
||||
* @return 0: request control of this MAV, 1: Release control of this MAV
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_request(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ack from change_operator_control_ack message
|
||||
*
|
||||
* @return 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_change_operator_control_ack_get_ack(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a change_operator_control_ack message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param change_operator_control_ack C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_change_operator_control_ack_decode(const mavlink_message_t* msg, mavlink_change_operator_control_ack_t* change_operator_control_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
change_operator_control_ack->gcs_system_id = mavlink_msg_change_operator_control_ack_get_gcs_system_id(msg);
|
||||
change_operator_control_ack->control_request = mavlink_msg_change_operator_control_ack_get_control_request(msg);
|
||||
change_operator_control_ack->ack = mavlink_msg_change_operator_control_ack_get_ack(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN? msg->len : MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN;
|
||||
memset(change_operator_control_ack, 0, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_LEN);
|
||||
memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-363
@@ -1,363 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE COLLISION PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COLLISION 247
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_collision_t {
|
||||
uint32_t id; /*< Unique identifier, domain based on src field*/
|
||||
float time_to_minimum_delta; /*< Estimated time until collision occurs (seconds)*/
|
||||
float altitude_minimum_delta; /*< Closest vertical distance in meters between vehicle and object*/
|
||||
float horizontal_minimum_delta; /*< Closest horizontal distance in meteres between vehicle and object*/
|
||||
uint8_t src; /*< Collision data source*/
|
||||
uint8_t action; /*< Action that is being taken to avoid this collision*/
|
||||
uint8_t threat_level; /*< How concerned the aircraft is about this collision*/
|
||||
}) mavlink_collision_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COLLISION_LEN 19
|
||||
#define MAVLINK_MSG_ID_COLLISION_MIN_LEN 19
|
||||
#define MAVLINK_MSG_ID_247_LEN 19
|
||||
#define MAVLINK_MSG_ID_247_MIN_LEN 19
|
||||
|
||||
#define MAVLINK_MSG_ID_COLLISION_CRC 81
|
||||
#define MAVLINK_MSG_ID_247_CRC 81
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COLLISION { \
|
||||
247, \
|
||||
"COLLISION", \
|
||||
7, \
|
||||
{ { "id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_collision_t, id) }, \
|
||||
{ "time_to_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_collision_t, time_to_minimum_delta) }, \
|
||||
{ "altitude_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_collision_t, altitude_minimum_delta) }, \
|
||||
{ "horizontal_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_collision_t, horizontal_minimum_delta) }, \
|
||||
{ "src", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_collision_t, src) }, \
|
||||
{ "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_collision_t, action) }, \
|
||||
{ "threat_level", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_collision_t, threat_level) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COLLISION { \
|
||||
"COLLISION", \
|
||||
7, \
|
||||
{ { "id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_collision_t, id) }, \
|
||||
{ "time_to_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_collision_t, time_to_minimum_delta) }, \
|
||||
{ "altitude_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_collision_t, altitude_minimum_delta) }, \
|
||||
{ "horizontal_minimum_delta", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_collision_t, horizontal_minimum_delta) }, \
|
||||
{ "src", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_collision_t, src) }, \
|
||||
{ "action", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_collision_t, action) }, \
|
||||
{ "threat_level", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_collision_t, threat_level) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a collision 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 src Collision data source
|
||||
* @param id Unique identifier, domain based on src field
|
||||
* @param action Action that is being taken to avoid this collision
|
||||
* @param threat_level How concerned the aircraft is about this collision
|
||||
* @param time_to_minimum_delta Estimated time until collision occurs (seconds)
|
||||
* @param altitude_minimum_delta Closest vertical distance in meters between vehicle and object
|
||||
* @param horizontal_minimum_delta Closest horizontal distance in meteres between vehicle and object
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_collision_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t src, uint32_t id, uint8_t action, uint8_t threat_level, float time_to_minimum_delta, float altitude_minimum_delta, float horizontal_minimum_delta)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COLLISION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, id);
|
||||
_mav_put_float(buf, 4, time_to_minimum_delta);
|
||||
_mav_put_float(buf, 8, altitude_minimum_delta);
|
||||
_mav_put_float(buf, 12, horizontal_minimum_delta);
|
||||
_mav_put_uint8_t(buf, 16, src);
|
||||
_mav_put_uint8_t(buf, 17, action);
|
||||
_mav_put_uint8_t(buf, 18, threat_level);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
#else
|
||||
mavlink_collision_t packet;
|
||||
packet.id = id;
|
||||
packet.time_to_minimum_delta = time_to_minimum_delta;
|
||||
packet.altitude_minimum_delta = altitude_minimum_delta;
|
||||
packet.horizontal_minimum_delta = horizontal_minimum_delta;
|
||||
packet.src = src;
|
||||
packet.action = action;
|
||||
packet.threat_level = threat_level;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COLLISION;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a collision message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param src Collision data source
|
||||
* @param id Unique identifier, domain based on src field
|
||||
* @param action Action that is being taken to avoid this collision
|
||||
* @param threat_level How concerned the aircraft is about this collision
|
||||
* @param time_to_minimum_delta Estimated time until collision occurs (seconds)
|
||||
* @param altitude_minimum_delta Closest vertical distance in meters between vehicle and object
|
||||
* @param horizontal_minimum_delta Closest horizontal distance in meteres between vehicle and object
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_collision_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t src,uint32_t id,uint8_t action,uint8_t threat_level,float time_to_minimum_delta,float altitude_minimum_delta,float horizontal_minimum_delta)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COLLISION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, id);
|
||||
_mav_put_float(buf, 4, time_to_minimum_delta);
|
||||
_mav_put_float(buf, 8, altitude_minimum_delta);
|
||||
_mav_put_float(buf, 12, horizontal_minimum_delta);
|
||||
_mav_put_uint8_t(buf, 16, src);
|
||||
_mav_put_uint8_t(buf, 17, action);
|
||||
_mav_put_uint8_t(buf, 18, threat_level);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
#else
|
||||
mavlink_collision_t packet;
|
||||
packet.id = id;
|
||||
packet.time_to_minimum_delta = time_to_minimum_delta;
|
||||
packet.altitude_minimum_delta = altitude_minimum_delta;
|
||||
packet.horizontal_minimum_delta = horizontal_minimum_delta;
|
||||
packet.src = src;
|
||||
packet.action = action;
|
||||
packet.threat_level = threat_level;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COLLISION;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a collision struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param collision C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_collision_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_collision_t* collision)
|
||||
{
|
||||
return mavlink_msg_collision_pack(system_id, component_id, msg, collision->src, collision->id, collision->action, collision->threat_level, collision->time_to_minimum_delta, collision->altitude_minimum_delta, collision->horizontal_minimum_delta);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a collision struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param collision C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_collision_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_collision_t* collision)
|
||||
{
|
||||
return mavlink_msg_collision_pack_chan(system_id, component_id, chan, msg, collision->src, collision->id, collision->action, collision->threat_level, collision->time_to_minimum_delta, collision->altitude_minimum_delta, collision->horizontal_minimum_delta);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a collision message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param src Collision data source
|
||||
* @param id Unique identifier, domain based on src field
|
||||
* @param action Action that is being taken to avoid this collision
|
||||
* @param threat_level How concerned the aircraft is about this collision
|
||||
* @param time_to_minimum_delta Estimated time until collision occurs (seconds)
|
||||
* @param altitude_minimum_delta Closest vertical distance in meters between vehicle and object
|
||||
* @param horizontal_minimum_delta Closest horizontal distance in meteres between vehicle and object
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_collision_send(mavlink_channel_t chan, uint8_t src, uint32_t id, uint8_t action, uint8_t threat_level, float time_to_minimum_delta, float altitude_minimum_delta, float horizontal_minimum_delta)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COLLISION_LEN];
|
||||
_mav_put_uint32_t(buf, 0, id);
|
||||
_mav_put_float(buf, 4, time_to_minimum_delta);
|
||||
_mav_put_float(buf, 8, altitude_minimum_delta);
|
||||
_mav_put_float(buf, 12, horizontal_minimum_delta);
|
||||
_mav_put_uint8_t(buf, 16, src);
|
||||
_mav_put_uint8_t(buf, 17, action);
|
||||
_mav_put_uint8_t(buf, 18, threat_level);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, buf, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#else
|
||||
mavlink_collision_t packet;
|
||||
packet.id = id;
|
||||
packet.time_to_minimum_delta = time_to_minimum_delta;
|
||||
packet.altitude_minimum_delta = altitude_minimum_delta;
|
||||
packet.horizontal_minimum_delta = horizontal_minimum_delta;
|
||||
packet.src = src;
|
||||
packet.action = action;
|
||||
packet.threat_level = threat_level;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, (const char *)&packet, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a collision message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_collision_send_struct(mavlink_channel_t chan, const mavlink_collision_t* collision)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_collision_send(chan, collision->src, collision->id, collision->action, collision->threat_level, collision->time_to_minimum_delta, collision->altitude_minimum_delta, collision->horizontal_minimum_delta);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, (const char *)collision, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COLLISION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_collision_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t src, uint32_t id, uint8_t action, uint8_t threat_level, float time_to_minimum_delta, float altitude_minimum_delta, float horizontal_minimum_delta)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, id);
|
||||
_mav_put_float(buf, 4, time_to_minimum_delta);
|
||||
_mav_put_float(buf, 8, altitude_minimum_delta);
|
||||
_mav_put_float(buf, 12, horizontal_minimum_delta);
|
||||
_mav_put_uint8_t(buf, 16, src);
|
||||
_mav_put_uint8_t(buf, 17, action);
|
||||
_mav_put_uint8_t(buf, 18, threat_level);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, buf, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#else
|
||||
mavlink_collision_t *packet = (mavlink_collision_t *)msgbuf;
|
||||
packet->id = id;
|
||||
packet->time_to_minimum_delta = time_to_minimum_delta;
|
||||
packet->altitude_minimum_delta = altitude_minimum_delta;
|
||||
packet->horizontal_minimum_delta = horizontal_minimum_delta;
|
||||
packet->src = src;
|
||||
packet->action = action;
|
||||
packet->threat_level = threat_level;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COLLISION, (const char *)packet, MAVLINK_MSG_ID_COLLISION_MIN_LEN, MAVLINK_MSG_ID_COLLISION_LEN, MAVLINK_MSG_ID_COLLISION_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COLLISION UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field src from collision message
|
||||
*
|
||||
* @return Collision data source
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_collision_get_src(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field id from collision message
|
||||
*
|
||||
* @return Unique identifier, domain based on src field
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_collision_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field action from collision message
|
||||
*
|
||||
* @return Action that is being taken to avoid this collision
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_collision_get_action(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 17);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field threat_level from collision message
|
||||
*
|
||||
* @return How concerned the aircraft is about this collision
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_collision_get_threat_level(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 18);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_to_minimum_delta from collision message
|
||||
*
|
||||
* @return Estimated time until collision occurs (seconds)
|
||||
*/
|
||||
static inline float mavlink_msg_collision_get_time_to_minimum_delta(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude_minimum_delta from collision message
|
||||
*
|
||||
* @return Closest vertical distance in meters between vehicle and object
|
||||
*/
|
||||
static inline float mavlink_msg_collision_get_altitude_minimum_delta(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field horizontal_minimum_delta from collision message
|
||||
*
|
||||
* @return Closest horizontal distance in meteres between vehicle and object
|
||||
*/
|
||||
static inline float mavlink_msg_collision_get_horizontal_minimum_delta(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a collision message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param collision C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_collision_decode(const mavlink_message_t* msg, mavlink_collision_t* collision)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
collision->id = mavlink_msg_collision_get_id(msg);
|
||||
collision->time_to_minimum_delta = mavlink_msg_collision_get_time_to_minimum_delta(msg);
|
||||
collision->altitude_minimum_delta = mavlink_msg_collision_get_altitude_minimum_delta(msg);
|
||||
collision->horizontal_minimum_delta = mavlink_msg_collision_get_horizontal_minimum_delta(msg);
|
||||
collision->src = mavlink_msg_collision_get_src(msg);
|
||||
collision->action = mavlink_msg_collision_get_action(msg);
|
||||
collision->threat_level = mavlink_msg_collision_get_threat_level(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COLLISION_LEN? msg->len : MAVLINK_MSG_ID_COLLISION_LEN;
|
||||
memset(collision, 0, MAVLINK_MSG_ID_COLLISION_LEN);
|
||||
memcpy(collision, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE COMMAND_ACK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_ACK 77
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_command_ack_t {
|
||||
uint16_t command; /*< Command ID, as defined by MAV_CMD enum.*/
|
||||
uint8_t result; /*< See MAV_RESULT enum*/
|
||||
}) mavlink_command_ack_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_ACK_LEN 3
|
||||
#define MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN 3
|
||||
#define MAVLINK_MSG_ID_77_LEN 3
|
||||
#define MAVLINK_MSG_ID_77_MIN_LEN 3
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_ACK_CRC 143
|
||||
#define MAVLINK_MSG_ID_77_CRC 143
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \
|
||||
77, \
|
||||
"COMMAND_ACK", \
|
||||
2, \
|
||||
{ { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \
|
||||
{ "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \
|
||||
"COMMAND_ACK", \
|
||||
2, \
|
||||
{ { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \
|
||||
{ "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a command_ack message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param command Command ID, as defined by MAV_CMD enum.
|
||||
* @param result See MAV_RESULT enum
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t command, uint8_t result)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
#else
|
||||
mavlink_command_ack_t packet;
|
||||
packet.command = command;
|
||||
packet.result = result;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a command_ack message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command Command ID, as defined by MAV_CMD enum.
|
||||
* @param result See MAV_RESULT enum
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t command,uint8_t result)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
#else
|
||||
mavlink_command_ack_t packet;
|
||||
packet.command = command;
|
||||
packet.result = result;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_ack struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack)
|
||||
{
|
||||
return mavlink_msg_command_ack_pack(system_id, component_id, msg, command_ack->command, command_ack->result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_ack struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_ack C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack)
|
||||
{
|
||||
return mavlink_msg_command_ack_pack_chan(system_id, component_id, chan, msg, command_ack->command, command_ack->result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param command Command ID, as defined by MAV_CMD enum.
|
||||
* @param result See MAV_RESULT enum
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, uint16_t command, uint8_t result)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_ACK_LEN];
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#else
|
||||
mavlink_command_ack_t packet;
|
||||
packet.command = command;
|
||||
packet.result = result;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_ack message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_command_ack_send_struct(mavlink_channel_t chan, const mavlink_command_ack_t* command_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_command_ack_send(chan, command_ack->command, command_ack->result);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)command_ack, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COMMAND_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_command_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t command, uint8_t result)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, command);
|
||||
_mav_put_uint8_t(buf, 2, result);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#else
|
||||
mavlink_command_ack_t *packet = (mavlink_command_ack_t *)msgbuf;
|
||||
packet->command = command;
|
||||
packet->result = result;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)packet, MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN, MAVLINK_MSG_ID_COMMAND_ACK_LEN, MAVLINK_MSG_ID_COMMAND_ACK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COMMAND_ACK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field command from command_ack message
|
||||
*
|
||||
* @return Command ID, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field result from command_ack message
|
||||
*
|
||||
* @return See MAV_RESULT enum
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_ack_get_result(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a command_ack message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param command_ack C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg, mavlink_command_ack_t* command_ack)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
command_ack->command = mavlink_msg_command_ack_get_command(msg);
|
||||
command_ack->result = mavlink_msg_command_ack_get_result(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_ACK_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_ACK_LEN;
|
||||
memset(command_ack, 0, MAVLINK_MSG_ID_COMMAND_ACK_LEN);
|
||||
memcpy(command_ack, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-513
@@ -1,513 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE COMMAND_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_INT 75
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_command_int_t {
|
||||
float param1; /*< PARAM1, see MAV_CMD enum*/
|
||||
float param2; /*< PARAM2, see MAV_CMD enum*/
|
||||
float param3; /*< PARAM3, see MAV_CMD enum*/
|
||||
float param4; /*< PARAM4, see MAV_CMD enum*/
|
||||
int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/
|
||||
int32_t y; /*< PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7*/
|
||||
float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.*/
|
||||
uint16_t command; /*< The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs*/
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t frame; /*< The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h*/
|
||||
uint8_t current; /*< false:0, true:1*/
|
||||
uint8_t autocontinue; /*< autocontinue to next wp*/
|
||||
}) mavlink_command_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_INT_LEN 35
|
||||
#define MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN 35
|
||||
#define MAVLINK_MSG_ID_75_LEN 35
|
||||
#define MAVLINK_MSG_ID_75_MIN_LEN 35
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_INT_CRC 158
|
||||
#define MAVLINK_MSG_ID_75_CRC 158
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
|
||||
75, \
|
||||
"COMMAND_INT", \
|
||||
13, \
|
||||
{ { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
|
||||
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
|
||||
{ "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
|
||||
"COMMAND_INT", \
|
||||
13, \
|
||||
{ { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
|
||||
{ "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
|
||||
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
|
||||
{ "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a command_int message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
|
||||
* @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, frame);
|
||||
_mav_put_uint8_t(buf, 33, current);
|
||||
_mav_put_uint8_t(buf, 34, autocontinue);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
#else
|
||||
mavlink_command_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a command_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
|
||||
* @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, frame);
|
||||
_mav_put_uint8_t(buf, 33, current);
|
||||
_mav_put_uint8_t(buf, 34, autocontinue);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
#else
|
||||
mavlink_command_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
|
||||
{
|
||||
return mavlink_msg_command_int_pack(system_id, component_id, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
|
||||
{
|
||||
return mavlink_msg_command_int_pack_chan(system_id, component_id, chan, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
|
||||
* @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
|
||||
* @param current false:0, true:1
|
||||
* @param autocontinue autocontinue to next wp
|
||||
* @param param1 PARAM1, see MAV_CMD enum
|
||||
* @param param2 PARAM2, see MAV_CMD enum
|
||||
* @param param3 PARAM3, see MAV_CMD enum
|
||||
* @param param4 PARAM4, see MAV_CMD enum
|
||||
* @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
* @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
|
||||
* @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_command_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, frame);
|
||||
_mav_put_uint8_t(buf, 33, current);
|
||||
_mav_put_uint8_t(buf, 34, autocontinue);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#else
|
||||
mavlink_command_int_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.frame = frame;
|
||||
packet.current = current;
|
||||
packet.autocontinue = autocontinue;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_command_int_send_struct(mavlink_channel_t chan, const mavlink_command_int_t* command_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_command_int_send(chan, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)command_int, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COMMAND_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_command_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_int32_t(buf, 16, x);
|
||||
_mav_put_int32_t(buf, 20, y);
|
||||
_mav_put_float(buf, 24, z);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, frame);
|
||||
_mav_put_uint8_t(buf, 33, current);
|
||||
_mav_put_uint8_t(buf, 34, autocontinue);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#else
|
||||
mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf;
|
||||
packet->param1 = param1;
|
||||
packet->param2 = param2;
|
||||
packet->param3 = param3;
|
||||
packet->param4 = param4;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
packet->command = command;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->frame = frame;
|
||||
packet->current = current;
|
||||
packet->autocontinue = autocontinue;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COMMAND_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from command_int message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from command_int message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field frame from command_int message
|
||||
*
|
||||
* @return The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field command from command_int message
|
||||
*
|
||||
* @return The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current from command_int message
|
||||
*
|
||||
* @return false:0, true:1
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field autocontinue from command_int message
|
||||
*
|
||||
* @return autocontinue to next wp
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param1 from command_int message
|
||||
*
|
||||
* @return PARAM1, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param2 from command_int message
|
||||
*
|
||||
* @return PARAM2, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param3 from command_int message
|
||||
*
|
||||
* @return PARAM3, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param4 from command_int message
|
||||
*
|
||||
* @return PARAM4, see MAV_CMD enum
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from command_int message
|
||||
*
|
||||
* @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from command_int message
|
||||
*
|
||||
* @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from command_int message
|
||||
*
|
||||
* @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
|
||||
*/
|
||||
static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a command_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param command_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_command_int_decode(const mavlink_message_t* msg, mavlink_command_int_t* command_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
command_int->param1 = mavlink_msg_command_int_get_param1(msg);
|
||||
command_int->param2 = mavlink_msg_command_int_get_param2(msg);
|
||||
command_int->param3 = mavlink_msg_command_int_get_param3(msg);
|
||||
command_int->param4 = mavlink_msg_command_int_get_param4(msg);
|
||||
command_int->x = mavlink_msg_command_int_get_x(msg);
|
||||
command_int->y = mavlink_msg_command_int_get_y(msg);
|
||||
command_int->z = mavlink_msg_command_int_get_z(msg);
|
||||
command_int->command = mavlink_msg_command_int_get_command(msg);
|
||||
command_int->target_system = mavlink_msg_command_int_get_target_system(msg);
|
||||
command_int->target_component = mavlink_msg_command_int_get_target_component(msg);
|
||||
command_int->frame = mavlink_msg_command_int_get_frame(msg);
|
||||
command_int->current = mavlink_msg_command_int_get_current(msg);
|
||||
command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_INT_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_INT_LEN;
|
||||
memset(command_int, 0, MAVLINK_MSG_ID_COMMAND_INT_LEN);
|
||||
memcpy(command_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-463
@@ -1,463 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE COMMAND_LONG PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_LONG 76
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_command_long_t {
|
||||
float param1; /*< Parameter 1, as defined by MAV_CMD enum.*/
|
||||
float param2; /*< Parameter 2, as defined by MAV_CMD enum.*/
|
||||
float param3; /*< Parameter 3, as defined by MAV_CMD enum.*/
|
||||
float param4; /*< Parameter 4, as defined by MAV_CMD enum.*/
|
||||
float param5; /*< Parameter 5, as defined by MAV_CMD enum.*/
|
||||
float param6; /*< Parameter 6, as defined by MAV_CMD enum.*/
|
||||
float param7; /*< Parameter 7, as defined by MAV_CMD enum.*/
|
||||
uint16_t command; /*< Command ID, as defined by MAV_CMD enum.*/
|
||||
uint8_t target_system; /*< System which should execute the command*/
|
||||
uint8_t target_component; /*< Component which should execute the command, 0 for all components*/
|
||||
uint8_t confirmation; /*< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)*/
|
||||
}) mavlink_command_long_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_LONG_LEN 33
|
||||
#define MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN 33
|
||||
#define MAVLINK_MSG_ID_76_LEN 33
|
||||
#define MAVLINK_MSG_ID_76_MIN_LEN 33
|
||||
|
||||
#define MAVLINK_MSG_ID_COMMAND_LONG_CRC 152
|
||||
#define MAVLINK_MSG_ID_76_CRC 152
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \
|
||||
76, \
|
||||
"COMMAND_LONG", \
|
||||
11, \
|
||||
{ { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \
|
||||
{ "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \
|
||||
{ "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \
|
||||
{ "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \
|
||||
{ "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \
|
||||
"COMMAND_LONG", \
|
||||
11, \
|
||||
{ { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \
|
||||
{ "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \
|
||||
{ "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \
|
||||
{ "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \
|
||||
{ "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \
|
||||
{ "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \
|
||||
{ "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \
|
||||
{ "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \
|
||||
{ "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a command_long message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System which should execute the command
|
||||
* @param target_component Component which should execute the command, 0 for all components
|
||||
* @param command Command ID, as defined by MAV_CMD enum.
|
||||
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
||||
* @param param1 Parameter 1, as defined by MAV_CMD enum.
|
||||
* @param param2 Parameter 2, as defined by MAV_CMD enum.
|
||||
* @param param3 Parameter 3, as defined by MAV_CMD enum.
|
||||
* @param param4 Parameter 4, as defined by MAV_CMD enum.
|
||||
* @param param5 Parameter 5, as defined by MAV_CMD enum.
|
||||
* @param param6 Parameter 6, as defined by MAV_CMD enum.
|
||||
* @param param7 Parameter 7, as defined by MAV_CMD enum.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, param5);
|
||||
_mav_put_float(buf, 20, param6);
|
||||
_mav_put_float(buf, 24, param7);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
#else
|
||||
mavlink_command_long_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.param5 = param5;
|
||||
packet.param6 = param6;
|
||||
packet.param7 = param7;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.confirmation = confirmation;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a command_long message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System which should execute the command
|
||||
* @param target_component Component which should execute the command, 0 for all components
|
||||
* @param command Command ID, as defined by MAV_CMD enum.
|
||||
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
||||
* @param param1 Parameter 1, as defined by MAV_CMD enum.
|
||||
* @param param2 Parameter 2, as defined by MAV_CMD enum.
|
||||
* @param param3 Parameter 3, as defined by MAV_CMD enum.
|
||||
* @param param4 Parameter 4, as defined by MAV_CMD enum.
|
||||
* @param param5 Parameter 5, as defined by MAV_CMD enum.
|
||||
* @param param6 Parameter 6, as defined by MAV_CMD enum.
|
||||
* @param param7 Parameter 7, as defined by MAV_CMD enum.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint16_t command,uint8_t confirmation,float param1,float param2,float param3,float param4,float param5,float param6,float param7)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, param5);
|
||||
_mav_put_float(buf, 20, param6);
|
||||
_mav_put_float(buf, 24, param7);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
#else
|
||||
mavlink_command_long_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.param5 = param5;
|
||||
packet.param6 = param6;
|
||||
packet.param7 = param7;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.confirmation = confirmation;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_long struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_long C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_long_t* command_long)
|
||||
{
|
||||
return mavlink_msg_command_long_pack(system_id, component_id, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a command_long struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param command_long C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_long_t* command_long)
|
||||
{
|
||||
return mavlink_msg_command_long_pack_chan(system_id, component_id, chan, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_long message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System which should execute the command
|
||||
* @param target_component Component which should execute the command, 0 for all components
|
||||
* @param command Command ID, as defined by MAV_CMD enum.
|
||||
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
||||
* @param param1 Parameter 1, as defined by MAV_CMD enum.
|
||||
* @param param2 Parameter 2, as defined by MAV_CMD enum.
|
||||
* @param param3 Parameter 3, as defined by MAV_CMD enum.
|
||||
* @param param4 Parameter 4, as defined by MAV_CMD enum.
|
||||
* @param param5 Parameter 5, as defined by MAV_CMD enum.
|
||||
* @param param6 Parameter 6, as defined by MAV_CMD enum.
|
||||
* @param param7 Parameter 7, as defined by MAV_CMD enum.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, param5);
|
||||
_mav_put_float(buf, 20, param6);
|
||||
_mav_put_float(buf, 24, param7);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#else
|
||||
mavlink_command_long_t packet;
|
||||
packet.param1 = param1;
|
||||
packet.param2 = param2;
|
||||
packet.param3 = param3;
|
||||
packet.param4 = param4;
|
||||
packet.param5 = param5;
|
||||
packet.param6 = param6;
|
||||
packet.param7 = param7;
|
||||
packet.command = command;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.confirmation = confirmation;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a command_long message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_command_long_send_struct(mavlink_channel_t chan, const mavlink_command_long_t* command_long)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_command_long_send(chan, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)command_long, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_COMMAND_LONG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_command_long_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_float(buf, 0, param1);
|
||||
_mav_put_float(buf, 4, param2);
|
||||
_mav_put_float(buf, 8, param3);
|
||||
_mav_put_float(buf, 12, param4);
|
||||
_mav_put_float(buf, 16, param5);
|
||||
_mav_put_float(buf, 20, param6);
|
||||
_mav_put_float(buf, 24, param7);
|
||||
_mav_put_uint16_t(buf, 28, command);
|
||||
_mav_put_uint8_t(buf, 30, target_system);
|
||||
_mav_put_uint8_t(buf, 31, target_component);
|
||||
_mav_put_uint8_t(buf, 32, confirmation);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#else
|
||||
mavlink_command_long_t *packet = (mavlink_command_long_t *)msgbuf;
|
||||
packet->param1 = param1;
|
||||
packet->param2 = param2;
|
||||
packet->param3 = param3;
|
||||
packet->param4 = param4;
|
||||
packet->param5 = param5;
|
||||
packet->param6 = param6;
|
||||
packet->param7 = param7;
|
||||
packet->command = command;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->confirmation = confirmation;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE COMMAND_LONG UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from command_long message
|
||||
*
|
||||
* @return System which should execute the command
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from command_long message
|
||||
*
|
||||
* @return Component which should execute the command, 0 for all components
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field command from command_long message
|
||||
*
|
||||
* @return Command ID, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_command_long_get_command(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field confirmation from command_long message
|
||||
*
|
||||
* @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param1 from command_long message
|
||||
*
|
||||
* @return Parameter 1, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param2 from command_long message
|
||||
*
|
||||
* @return Parameter 2, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param3 from command_long message
|
||||
*
|
||||
* @return Parameter 3, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param4 from command_long message
|
||||
*
|
||||
* @return Parameter 4, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param5 from command_long message
|
||||
*
|
||||
* @return Parameter 5, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param6 from command_long message
|
||||
*
|
||||
* @return Parameter 6, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field param7 from command_long message
|
||||
*
|
||||
* @return Parameter 7, as defined by MAV_CMD enum.
|
||||
*/
|
||||
static inline float mavlink_msg_command_long_get_param7(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a command_long message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param command_long C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_command_long_decode(const mavlink_message_t* msg, mavlink_command_long_t* command_long)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
command_long->param1 = mavlink_msg_command_long_get_param1(msg);
|
||||
command_long->param2 = mavlink_msg_command_long_get_param2(msg);
|
||||
command_long->param3 = mavlink_msg_command_long_get_param3(msg);
|
||||
command_long->param4 = mavlink_msg_command_long_get_param4(msg);
|
||||
command_long->param5 = mavlink_msg_command_long_get_param5(msg);
|
||||
command_long->param6 = mavlink_msg_command_long_get_param6(msg);
|
||||
command_long->param7 = mavlink_msg_command_long_get_param7(msg);
|
||||
command_long->command = mavlink_msg_command_long_get_command(msg);
|
||||
command_long->target_system = mavlink_msg_command_long_get_target_system(msg);
|
||||
command_long->target_component = mavlink_msg_command_long_get_target_component(msg);
|
||||
command_long->confirmation = mavlink_msg_command_long_get_confirmation(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_LONG_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_LONG_LEN;
|
||||
memset(command_long, 0, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
|
||||
memcpy(command_long, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-607
@@ -1,607 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE CONTROL_SYSTEM_STATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE 146
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_control_system_state_t {
|
||||
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
|
||||
float x_acc; /*< X acceleration in body frame*/
|
||||
float y_acc; /*< Y acceleration in body frame*/
|
||||
float z_acc; /*< Z acceleration in body frame*/
|
||||
float x_vel; /*< X velocity in body frame*/
|
||||
float y_vel; /*< Y velocity in body frame*/
|
||||
float z_vel; /*< Z velocity in body frame*/
|
||||
float x_pos; /*< X position in local frame*/
|
||||
float y_pos; /*< Y position in local frame*/
|
||||
float z_pos; /*< Z position in local frame*/
|
||||
float airspeed; /*< Airspeed, set to -1 if unknown*/
|
||||
float vel_variance[3]; /*< Variance of body velocity estimate*/
|
||||
float pos_variance[3]; /*< Variance in local position*/
|
||||
float q[4]; /*< The attitude, represented as Quaternion*/
|
||||
float roll_rate; /*< Angular rate in roll axis*/
|
||||
float pitch_rate; /*< Angular rate in pitch axis*/
|
||||
float yaw_rate; /*< Angular rate in yaw axis*/
|
||||
}) mavlink_control_system_state_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN 100
|
||||
#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN 100
|
||||
#define MAVLINK_MSG_ID_146_LEN 100
|
||||
#define MAVLINK_MSG_ID_146_MIN_LEN 100
|
||||
|
||||
#define MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC 103
|
||||
#define MAVLINK_MSG_ID_146_CRC 103
|
||||
|
||||
#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_VEL_VARIANCE_LEN 3
|
||||
#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_POS_VARIANCE_LEN 3
|
||||
#define MAVLINK_MSG_CONTROL_SYSTEM_STATE_FIELD_Q_LEN 4
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE { \
|
||||
146, \
|
||||
"CONTROL_SYSTEM_STATE", \
|
||||
17, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \
|
||||
{ "x_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_control_system_state_t, x_acc) }, \
|
||||
{ "y_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_control_system_state_t, y_acc) }, \
|
||||
{ "z_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_control_system_state_t, z_acc) }, \
|
||||
{ "x_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_control_system_state_t, x_vel) }, \
|
||||
{ "y_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_control_system_state_t, y_vel) }, \
|
||||
{ "z_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_control_system_state_t, z_vel) }, \
|
||||
{ "x_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_control_system_state_t, x_pos) }, \
|
||||
{ "y_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_control_system_state_t, y_pos) }, \
|
||||
{ "z_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_control_system_state_t, z_pos) }, \
|
||||
{ "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_control_system_state_t, airspeed) }, \
|
||||
{ "vel_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 48, offsetof(mavlink_control_system_state_t, vel_variance) }, \
|
||||
{ "pos_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 60, offsetof(mavlink_control_system_state_t, pos_variance) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 72, offsetof(mavlink_control_system_state_t, q) }, \
|
||||
{ "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_control_system_state_t, roll_rate) }, \
|
||||
{ "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_control_system_state_t, pitch_rate) }, \
|
||||
{ "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_control_system_state_t, yaw_rate) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE { \
|
||||
"CONTROL_SYSTEM_STATE", \
|
||||
17, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_control_system_state_t, time_usec) }, \
|
||||
{ "x_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_control_system_state_t, x_acc) }, \
|
||||
{ "y_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_control_system_state_t, y_acc) }, \
|
||||
{ "z_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_control_system_state_t, z_acc) }, \
|
||||
{ "x_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_control_system_state_t, x_vel) }, \
|
||||
{ "y_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_control_system_state_t, y_vel) }, \
|
||||
{ "z_vel", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_control_system_state_t, z_vel) }, \
|
||||
{ "x_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_control_system_state_t, x_pos) }, \
|
||||
{ "y_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_control_system_state_t, y_pos) }, \
|
||||
{ "z_pos", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_control_system_state_t, z_pos) }, \
|
||||
{ "airspeed", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_control_system_state_t, airspeed) }, \
|
||||
{ "vel_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 48, offsetof(mavlink_control_system_state_t, vel_variance) }, \
|
||||
{ "pos_variance", NULL, MAVLINK_TYPE_FLOAT, 3, 60, offsetof(mavlink_control_system_state_t, pos_variance) }, \
|
||||
{ "q", NULL, MAVLINK_TYPE_FLOAT, 4, 72, offsetof(mavlink_control_system_state_t, q) }, \
|
||||
{ "roll_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_control_system_state_t, roll_rate) }, \
|
||||
{ "pitch_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_control_system_state_t, pitch_rate) }, \
|
||||
{ "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_control_system_state_t, yaw_rate) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a control_system_state 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 (micros since boot or Unix epoch)
|
||||
* @param x_acc X acceleration in body frame
|
||||
* @param y_acc Y acceleration in body frame
|
||||
* @param z_acc Z acceleration in body frame
|
||||
* @param x_vel X velocity in body frame
|
||||
* @param y_vel Y velocity in body frame
|
||||
* @param z_vel Z velocity in body frame
|
||||
* @param x_pos X position in local frame
|
||||
* @param y_pos Y position in local frame
|
||||
* @param z_pos Z position in local frame
|
||||
* @param airspeed Airspeed, set to -1 if unknown
|
||||
* @param vel_variance Variance of body velocity estimate
|
||||
* @param pos_variance Variance in local position
|
||||
* @param q The attitude, represented as Quaternion
|
||||
* @param roll_rate Angular rate in roll axis
|
||||
* @param pitch_rate Angular rate in pitch axis
|
||||
* @param yaw_rate Angular rate in yaw axis
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x_acc);
|
||||
_mav_put_float(buf, 12, y_acc);
|
||||
_mav_put_float(buf, 16, z_acc);
|
||||
_mav_put_float(buf, 20, x_vel);
|
||||
_mav_put_float(buf, 24, y_vel);
|
||||
_mav_put_float(buf, 28, z_vel);
|
||||
_mav_put_float(buf, 32, x_pos);
|
||||
_mav_put_float(buf, 36, y_pos);
|
||||
_mav_put_float(buf, 40, z_pos);
|
||||
_mav_put_float(buf, 44, airspeed);
|
||||
_mav_put_float(buf, 88, roll_rate);
|
||||
_mav_put_float(buf, 92, pitch_rate);
|
||||
_mav_put_float(buf, 96, yaw_rate);
|
||||
_mav_put_float_array(buf, 48, vel_variance, 3);
|
||||
_mav_put_float_array(buf, 60, pos_variance, 3);
|
||||
_mav_put_float_array(buf, 72, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
#else
|
||||
mavlink_control_system_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x_acc = x_acc;
|
||||
packet.y_acc = y_acc;
|
||||
packet.z_acc = z_acc;
|
||||
packet.x_vel = x_vel;
|
||||
packet.y_vel = y_vel;
|
||||
packet.z_vel = z_vel;
|
||||
packet.x_pos = x_pos;
|
||||
packet.y_pos = y_pos;
|
||||
packet.z_pos = z_pos;
|
||||
packet.airspeed = airspeed;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a control_system_state message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param x_acc X acceleration in body frame
|
||||
* @param y_acc Y acceleration in body frame
|
||||
* @param z_acc Z acceleration in body frame
|
||||
* @param x_vel X velocity in body frame
|
||||
* @param y_vel Y velocity in body frame
|
||||
* @param z_vel Z velocity in body frame
|
||||
* @param x_pos X position in local frame
|
||||
* @param y_pos Y position in local frame
|
||||
* @param z_pos Z position in local frame
|
||||
* @param airspeed Airspeed, set to -1 if unknown
|
||||
* @param vel_variance Variance of body velocity estimate
|
||||
* @param pos_variance Variance in local position
|
||||
* @param q The attitude, represented as Quaternion
|
||||
* @param roll_rate Angular rate in roll axis
|
||||
* @param pitch_rate Angular rate in pitch axis
|
||||
* @param yaw_rate Angular rate in yaw axis
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,float x_acc,float y_acc,float z_acc,float x_vel,float y_vel,float z_vel,float x_pos,float y_pos,float z_pos,float airspeed,const float *vel_variance,const float *pos_variance,const float *q,float roll_rate,float pitch_rate,float yaw_rate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x_acc);
|
||||
_mav_put_float(buf, 12, y_acc);
|
||||
_mav_put_float(buf, 16, z_acc);
|
||||
_mav_put_float(buf, 20, x_vel);
|
||||
_mav_put_float(buf, 24, y_vel);
|
||||
_mav_put_float(buf, 28, z_vel);
|
||||
_mav_put_float(buf, 32, x_pos);
|
||||
_mav_put_float(buf, 36, y_pos);
|
||||
_mav_put_float(buf, 40, z_pos);
|
||||
_mav_put_float(buf, 44, airspeed);
|
||||
_mav_put_float(buf, 88, roll_rate);
|
||||
_mav_put_float(buf, 92, pitch_rate);
|
||||
_mav_put_float(buf, 96, yaw_rate);
|
||||
_mav_put_float_array(buf, 48, vel_variance, 3);
|
||||
_mav_put_float_array(buf, 60, pos_variance, 3);
|
||||
_mav_put_float_array(buf, 72, q, 4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
#else
|
||||
mavlink_control_system_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x_acc = x_acc;
|
||||
packet.y_acc = y_acc;
|
||||
packet.z_acc = z_acc;
|
||||
packet.x_vel = x_vel;
|
||||
packet.y_vel = y_vel;
|
||||
packet.z_vel = z_vel;
|
||||
packet.x_pos = x_pos;
|
||||
packet.y_pos = y_pos;
|
||||
packet.z_pos = z_pos;
|
||||
packet.airspeed = airspeed;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a control_system_state struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param control_system_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_control_system_state_t* control_system_state)
|
||||
{
|
||||
return mavlink_msg_control_system_state_pack(system_id, component_id, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a control_system_state struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param control_system_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_control_system_state_t* control_system_state)
|
||||
{
|
||||
return mavlink_msg_control_system_state_pack_chan(system_id, component_id, chan, msg, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a control_system_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param x_acc X acceleration in body frame
|
||||
* @param y_acc Y acceleration in body frame
|
||||
* @param z_acc Z acceleration in body frame
|
||||
* @param x_vel X velocity in body frame
|
||||
* @param y_vel Y velocity in body frame
|
||||
* @param z_vel Z velocity in body frame
|
||||
* @param x_pos X position in local frame
|
||||
* @param y_pos Y position in local frame
|
||||
* @param z_pos Z position in local frame
|
||||
* @param airspeed Airspeed, set to -1 if unknown
|
||||
* @param vel_variance Variance of body velocity estimate
|
||||
* @param pos_variance Variance in local position
|
||||
* @param q The attitude, represented as Quaternion
|
||||
* @param roll_rate Angular rate in roll axis
|
||||
* @param pitch_rate Angular rate in pitch axis
|
||||
* @param yaw_rate Angular rate in yaw axis
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_control_system_state_send(mavlink_channel_t chan, uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x_acc);
|
||||
_mav_put_float(buf, 12, y_acc);
|
||||
_mav_put_float(buf, 16, z_acc);
|
||||
_mav_put_float(buf, 20, x_vel);
|
||||
_mav_put_float(buf, 24, y_vel);
|
||||
_mav_put_float(buf, 28, z_vel);
|
||||
_mav_put_float(buf, 32, x_pos);
|
||||
_mav_put_float(buf, 36, y_pos);
|
||||
_mav_put_float(buf, 40, z_pos);
|
||||
_mav_put_float(buf, 44, airspeed);
|
||||
_mav_put_float(buf, 88, roll_rate);
|
||||
_mav_put_float(buf, 92, pitch_rate);
|
||||
_mav_put_float(buf, 96, yaw_rate);
|
||||
_mav_put_float_array(buf, 48, vel_variance, 3);
|
||||
_mav_put_float_array(buf, 60, pos_variance, 3);
|
||||
_mav_put_float_array(buf, 72, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#else
|
||||
mavlink_control_system_state_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x_acc = x_acc;
|
||||
packet.y_acc = y_acc;
|
||||
packet.z_acc = z_acc;
|
||||
packet.x_vel = x_vel;
|
||||
packet.y_vel = y_vel;
|
||||
packet.z_vel = z_vel;
|
||||
packet.x_pos = x_pos;
|
||||
packet.y_pos = y_pos;
|
||||
packet.z_pos = z_pos;
|
||||
packet.airspeed = airspeed;
|
||||
packet.roll_rate = roll_rate;
|
||||
packet.pitch_rate = pitch_rate;
|
||||
packet.yaw_rate = yaw_rate;
|
||||
mav_array_memcpy(packet.vel_variance, vel_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.pos_variance, pos_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)&packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a control_system_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_control_system_state_send_struct(mavlink_channel_t chan, const mavlink_control_system_state_t* control_system_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_control_system_state_send(chan, control_system_state->time_usec, control_system_state->x_acc, control_system_state->y_acc, control_system_state->z_acc, control_system_state->x_vel, control_system_state->y_vel, control_system_state->z_vel, control_system_state->x_pos, control_system_state->y_pos, control_system_state->z_pos, control_system_state->airspeed, control_system_state->vel_variance, control_system_state->pos_variance, control_system_state->q, control_system_state->roll_rate, control_system_state->pitch_rate, control_system_state->yaw_rate);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)control_system_state, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_control_system_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, const float *vel_variance, const float *pos_variance, const float *q, float roll_rate, float pitch_rate, float yaw_rate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x_acc);
|
||||
_mav_put_float(buf, 12, y_acc);
|
||||
_mav_put_float(buf, 16, z_acc);
|
||||
_mav_put_float(buf, 20, x_vel);
|
||||
_mav_put_float(buf, 24, y_vel);
|
||||
_mav_put_float(buf, 28, z_vel);
|
||||
_mav_put_float(buf, 32, x_pos);
|
||||
_mav_put_float(buf, 36, y_pos);
|
||||
_mav_put_float(buf, 40, z_pos);
|
||||
_mav_put_float(buf, 44, airspeed);
|
||||
_mav_put_float(buf, 88, roll_rate);
|
||||
_mav_put_float(buf, 92, pitch_rate);
|
||||
_mav_put_float(buf, 96, yaw_rate);
|
||||
_mav_put_float_array(buf, 48, vel_variance, 3);
|
||||
_mav_put_float_array(buf, 60, pos_variance, 3);
|
||||
_mav_put_float_array(buf, 72, q, 4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, buf, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#else
|
||||
mavlink_control_system_state_t *packet = (mavlink_control_system_state_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x_acc = x_acc;
|
||||
packet->y_acc = y_acc;
|
||||
packet->z_acc = z_acc;
|
||||
packet->x_vel = x_vel;
|
||||
packet->y_vel = y_vel;
|
||||
packet->z_vel = z_vel;
|
||||
packet->x_pos = x_pos;
|
||||
packet->y_pos = y_pos;
|
||||
packet->z_pos = z_pos;
|
||||
packet->airspeed = airspeed;
|
||||
packet->roll_rate = roll_rate;
|
||||
packet->pitch_rate = pitch_rate;
|
||||
packet->yaw_rate = yaw_rate;
|
||||
mav_array_memcpy(packet->vel_variance, vel_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->pos_variance, pos_variance, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->q, q, sizeof(float)*4);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE, (const char *)packet, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE CONTROL_SYSTEM_STATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from control_system_state message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_control_system_state_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x_acc from control_system_state message
|
||||
*
|
||||
* @return X acceleration in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_x_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y_acc from control_system_state message
|
||||
*
|
||||
* @return Y acceleration in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_y_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z_acc from control_system_state message
|
||||
*
|
||||
* @return Z acceleration in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_z_acc(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x_vel from control_system_state message
|
||||
*
|
||||
* @return X velocity in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_x_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y_vel from control_system_state message
|
||||
*
|
||||
* @return Y velocity in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_y_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z_vel from control_system_state message
|
||||
*
|
||||
* @return Z velocity in body frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_z_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x_pos from control_system_state message
|
||||
*
|
||||
* @return X position in local frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_x_pos(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y_pos from control_system_state message
|
||||
*
|
||||
* @return Y position in local frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_y_pos(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z_pos from control_system_state message
|
||||
*
|
||||
* @return Z position in local frame
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_z_pos(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field airspeed from control_system_state message
|
||||
*
|
||||
* @return Airspeed, set to -1 if unknown
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_airspeed(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel_variance from control_system_state message
|
||||
*
|
||||
* @return Variance of body velocity estimate
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_get_vel_variance(const mavlink_message_t* msg, float *vel_variance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, vel_variance, 3, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_variance from control_system_state message
|
||||
*
|
||||
* @return Variance in local position
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_get_pos_variance(const mavlink_message_t* msg, float *pos_variance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, pos_variance, 3, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field q from control_system_state message
|
||||
*
|
||||
* @return The attitude, represented as Quaternion
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_control_system_state_get_q(const mavlink_message_t* msg, float *q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, q, 4, 72);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll_rate from control_system_state message
|
||||
*
|
||||
* @return Angular rate in roll axis
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_roll_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 88);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch_rate from control_system_state message
|
||||
*
|
||||
* @return Angular rate in pitch axis
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_pitch_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 92);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw_rate from control_system_state message
|
||||
*
|
||||
* @return Angular rate in yaw axis
|
||||
*/
|
||||
static inline float mavlink_msg_control_system_state_get_yaw_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 96);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a control_system_state message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param control_system_state C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_control_system_state_decode(const mavlink_message_t* msg, mavlink_control_system_state_t* control_system_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
control_system_state->time_usec = mavlink_msg_control_system_state_get_time_usec(msg);
|
||||
control_system_state->x_acc = mavlink_msg_control_system_state_get_x_acc(msg);
|
||||
control_system_state->y_acc = mavlink_msg_control_system_state_get_y_acc(msg);
|
||||
control_system_state->z_acc = mavlink_msg_control_system_state_get_z_acc(msg);
|
||||
control_system_state->x_vel = mavlink_msg_control_system_state_get_x_vel(msg);
|
||||
control_system_state->y_vel = mavlink_msg_control_system_state_get_y_vel(msg);
|
||||
control_system_state->z_vel = mavlink_msg_control_system_state_get_z_vel(msg);
|
||||
control_system_state->x_pos = mavlink_msg_control_system_state_get_x_pos(msg);
|
||||
control_system_state->y_pos = mavlink_msg_control_system_state_get_y_pos(msg);
|
||||
control_system_state->z_pos = mavlink_msg_control_system_state_get_z_pos(msg);
|
||||
control_system_state->airspeed = mavlink_msg_control_system_state_get_airspeed(msg);
|
||||
mavlink_msg_control_system_state_get_vel_variance(msg, control_system_state->vel_variance);
|
||||
mavlink_msg_control_system_state_get_pos_variance(msg, control_system_state->pos_variance);
|
||||
mavlink_msg_control_system_state_get_q(msg, control_system_state->q);
|
||||
control_system_state->roll_rate = mavlink_msg_control_system_state_get_roll_rate(msg);
|
||||
control_system_state->pitch_rate = mavlink_msg_control_system_state_get_pitch_rate(msg);
|
||||
control_system_state->yaw_rate = mavlink_msg_control_system_state_get_yaw_rate(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN? msg->len : MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN;
|
||||
memset(control_system_state, 0, MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_LEN);
|
||||
memcpy(control_system_state, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-263
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA_STREAM PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_STREAM 67
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_data_stream_t {
|
||||
uint16_t message_rate; /*< The message rate*/
|
||||
uint8_t stream_id; /*< The ID of the requested data stream*/
|
||||
uint8_t on_off; /*< 1 stream is enabled, 0 stream is stopped.*/
|
||||
}) mavlink_data_stream_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_STREAM_LEN 4
|
||||
#define MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN 4
|
||||
#define MAVLINK_MSG_ID_67_LEN 4
|
||||
#define MAVLINK_MSG_ID_67_MIN_LEN 4
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_STREAM_CRC 21
|
||||
#define MAVLINK_MSG_ID_67_CRC 21
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_STREAM { \
|
||||
67, \
|
||||
"DATA_STREAM", \
|
||||
3, \
|
||||
{ { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \
|
||||
{ "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \
|
||||
{ "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_STREAM { \
|
||||
"DATA_STREAM", \
|
||||
3, \
|
||||
{ { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \
|
||||
{ "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \
|
||||
{ "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a data_stream 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 stream_id The ID of the requested data stream
|
||||
* @param message_rate The message rate
|
||||
* @param on_off 1 stream is enabled, 0 stream is stopped.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
|
||||
_mav_put_uint16_t(buf, 0, message_rate);
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
#else
|
||||
mavlink_data_stream_t packet;
|
||||
packet.message_rate = message_rate;
|
||||
packet.stream_id = stream_id;
|
||||
packet.on_off = on_off;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data_stream message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param stream_id The ID of the requested data stream
|
||||
* @param message_rate The message rate
|
||||
* @param on_off 1 stream is enabled, 0 stream is stopped.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t stream_id,uint16_t message_rate,uint8_t on_off)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
|
||||
_mav_put_uint16_t(buf, 0, message_rate);
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
#else
|
||||
mavlink_data_stream_t packet;
|
||||
packet.message_rate = message_rate;
|
||||
packet.stream_id = stream_id;
|
||||
packet.on_off = on_off;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_stream struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data_stream C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream)
|
||||
{
|
||||
return mavlink_msg_data_stream_pack(system_id, component_id, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_stream struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data_stream C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream)
|
||||
{
|
||||
return mavlink_msg_data_stream_pack_chan(system_id, component_id, chan, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_stream message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param stream_id The ID of the requested data stream
|
||||
* @param message_rate The message rate
|
||||
* @param on_off 1 stream is enabled, 0 stream is stopped.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
|
||||
_mav_put_uint16_t(buf, 0, message_rate);
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#else
|
||||
mavlink_data_stream_t packet;
|
||||
packet.message_rate = message_rate;
|
||||
packet.stream_id = stream_id;
|
||||
packet.on_off = on_off;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_stream message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data_stream_send_struct(mavlink_channel_t chan, const mavlink_data_stream_t* data_stream)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data_stream_send(chan, data_stream->stream_id, data_stream->message_rate, data_stream->on_off);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)data_stream, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA_STREAM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_data_stream_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, message_rate);
|
||||
_mav_put_uint8_t(buf, 2, stream_id);
|
||||
_mav_put_uint8_t(buf, 3, on_off);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#else
|
||||
mavlink_data_stream_t *packet = (mavlink_data_stream_t *)msgbuf;
|
||||
packet->message_rate = message_rate;
|
||||
packet->stream_id = stream_id;
|
||||
packet->on_off = on_off;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)packet, MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA_STREAM UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field stream_id from data_stream message
|
||||
*
|
||||
* @return The ID of the requested data stream
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field message_rate from data_stream message
|
||||
*
|
||||
* @return The message rate
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field on_off from data_stream message
|
||||
*
|
||||
* @return 1 stream is enabled, 0 stream is stopped.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_stream_get_on_off(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data_stream message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data_stream C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data_stream_decode(const mavlink_message_t* msg, mavlink_data_stream_t* data_stream)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
data_stream->message_rate = mavlink_msg_data_stream_get_message_rate(msg);
|
||||
data_stream->stream_id = mavlink_msg_data_stream_get_stream_id(msg);
|
||||
data_stream->on_off = mavlink_msg_data_stream_get_on_off(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_STREAM_LEN? msg->len : MAVLINK_MSG_ID_DATA_STREAM_LEN;
|
||||
memset(data_stream, 0, MAVLINK_MSG_ID_DATA_STREAM_LEN);
|
||||
memcpy(data_stream, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-363
@@ -1,363 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DATA_TRANSMISSION_HANDSHAKE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 130
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_data_transmission_handshake_t {
|
||||
uint32_t size; /*< total data size in bytes (set on ACK only)*/
|
||||
uint16_t width; /*< Width of a matrix or image*/
|
||||
uint16_t height; /*< Height of a matrix or image*/
|
||||
uint16_t packets; /*< number of packets beeing sent (set on ACK only)*/
|
||||
uint8_t type; /*< type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)*/
|
||||
uint8_t payload; /*< payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)*/
|
||||
uint8_t jpg_quality; /*< JPEG quality out of [1,100]*/
|
||||
}) mavlink_data_transmission_handshake_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 13
|
||||
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN 13
|
||||
#define MAVLINK_MSG_ID_130_LEN 13
|
||||
#define MAVLINK_MSG_ID_130_MIN_LEN 13
|
||||
|
||||
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC 29
|
||||
#define MAVLINK_MSG_ID_130_CRC 29
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \
|
||||
130, \
|
||||
"DATA_TRANSMISSION_HANDSHAKE", \
|
||||
7, \
|
||||
{ { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \
|
||||
{ "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \
|
||||
{ "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \
|
||||
{ "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \
|
||||
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \
|
||||
{ "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \
|
||||
"DATA_TRANSMISSION_HANDSHAKE", \
|
||||
7, \
|
||||
{ { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \
|
||||
{ "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \
|
||||
{ "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \
|
||||
{ "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \
|
||||
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \
|
||||
{ "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a data_transmission_handshake 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 type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
|
||||
* @param size total data size in bytes (set on ACK only)
|
||||
* @param width Width of a matrix or image
|
||||
* @param height Height of a matrix or image
|
||||
* @param packets number of packets beeing sent (set on ACK only)
|
||||
* @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
|
||||
* @param jpg_quality JPEG quality out of [1,100]
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, size);
|
||||
_mav_put_uint16_t(buf, 4, width);
|
||||
_mav_put_uint16_t(buf, 6, height);
|
||||
_mav_put_uint16_t(buf, 8, packets);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, payload);
|
||||
_mav_put_uint8_t(buf, 12, jpg_quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
#else
|
||||
mavlink_data_transmission_handshake_t packet;
|
||||
packet.size = size;
|
||||
packet.width = width;
|
||||
packet.height = height;
|
||||
packet.packets = packets;
|
||||
packet.type = type;
|
||||
packet.payload = payload;
|
||||
packet.jpg_quality = jpg_quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a data_transmission_handshake message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
|
||||
* @param size total data size in bytes (set on ACK only)
|
||||
* @param width Width of a matrix or image
|
||||
* @param height Height of a matrix or image
|
||||
* @param packets number of packets beeing sent (set on ACK only)
|
||||
* @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
|
||||
* @param jpg_quality JPEG quality out of [1,100]
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t type,uint32_t size,uint16_t width,uint16_t height,uint16_t packets,uint8_t payload,uint8_t jpg_quality)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, size);
|
||||
_mav_put_uint16_t(buf, 4, width);
|
||||
_mav_put_uint16_t(buf, 6, height);
|
||||
_mav_put_uint16_t(buf, 8, packets);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, payload);
|
||||
_mav_put_uint8_t(buf, 12, jpg_quality);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
#else
|
||||
mavlink_data_transmission_handshake_t packet;
|
||||
packet.size = size;
|
||||
packet.width = width;
|
||||
packet.height = height;
|
||||
packet.packets = packets;
|
||||
packet.type = type;
|
||||
packet.payload = payload;
|
||||
packet.jpg_quality = jpg_quality;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_transmission_handshake struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data_transmission_handshake C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
|
||||
{
|
||||
return mavlink_msg_data_transmission_handshake_pack(system_id, component_id, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a data_transmission_handshake struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param data_transmission_handshake C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
|
||||
{
|
||||
return mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, chan, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_transmission_handshake message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param type type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
|
||||
* @param size total data size in bytes (set on ACK only)
|
||||
* @param width Width of a matrix or image
|
||||
* @param height Height of a matrix or image
|
||||
* @param packets number of packets beeing sent (set on ACK only)
|
||||
* @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
|
||||
* @param jpg_quality JPEG quality out of [1,100]
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN];
|
||||
_mav_put_uint32_t(buf, 0, size);
|
||||
_mav_put_uint16_t(buf, 4, width);
|
||||
_mav_put_uint16_t(buf, 6, height);
|
||||
_mav_put_uint16_t(buf, 8, packets);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, payload);
|
||||
_mav_put_uint8_t(buf, 12, jpg_quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#else
|
||||
mavlink_data_transmission_handshake_t packet;
|
||||
packet.size = size;
|
||||
packet.width = width;
|
||||
packet.height = height;
|
||||
packet.packets = packets;
|
||||
packet.type = type;
|
||||
packet.payload = payload;
|
||||
packet.jpg_quality = jpg_quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)&packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a data_transmission_handshake message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_data_transmission_handshake_send_struct(mavlink_channel_t chan, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_data_transmission_handshake_send(chan, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)data_transmission_handshake, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_data_transmission_handshake_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, size);
|
||||
_mav_put_uint16_t(buf, 4, width);
|
||||
_mav_put_uint16_t(buf, 6, height);
|
||||
_mav_put_uint16_t(buf, 8, packets);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, payload);
|
||||
_mav_put_uint8_t(buf, 12, jpg_quality);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, buf, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#else
|
||||
mavlink_data_transmission_handshake_t *packet = (mavlink_data_transmission_handshake_t *)msgbuf;
|
||||
packet->size = size;
|
||||
packet->width = width;
|
||||
packet->height = height;
|
||||
packet->packets = packets;
|
||||
packet->type = type;
|
||||
packet->payload = payload;
|
||||
packet->jpg_quality = jpg_quality;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DATA_TRANSMISSION_HANDSHAKE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field type from data_transmission_handshake message
|
||||
*
|
||||
* @return type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field size from data_transmission_handshake message
|
||||
*
|
||||
* @return total data size in bytes (set on ACK only)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field width from data_transmission_handshake message
|
||||
*
|
||||
* @return Width of a matrix or image
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_get_width(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field height from data_transmission_handshake message
|
||||
*
|
||||
* @return Height of a matrix or image
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_get_height(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field packets from data_transmission_handshake message
|
||||
*
|
||||
* @return number of packets beeing sent (set on ACK only)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_data_transmission_handshake_get_packets(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field payload from data_transmission_handshake message
|
||||
*
|
||||
* @return payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field jpg_quality from data_transmission_handshake message
|
||||
*
|
||||
* @return JPEG quality out of [1,100]
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_data_transmission_handshake_get_jpg_quality(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a data_transmission_handshake message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param data_transmission_handshake C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_data_transmission_handshake_decode(const mavlink_message_t* msg, mavlink_data_transmission_handshake_t* data_transmission_handshake)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
data_transmission_handshake->size = mavlink_msg_data_transmission_handshake_get_size(msg);
|
||||
data_transmission_handshake->width = mavlink_msg_data_transmission_handshake_get_width(msg);
|
||||
data_transmission_handshake->height = mavlink_msg_data_transmission_handshake_get_height(msg);
|
||||
data_transmission_handshake->packets = mavlink_msg_data_transmission_handshake_get_packets(msg);
|
||||
data_transmission_handshake->type = mavlink_msg_data_transmission_handshake_get_type(msg);
|
||||
data_transmission_handshake->payload = mavlink_msg_data_transmission_handshake_get_payload(msg);
|
||||
data_transmission_handshake->jpg_quality = mavlink_msg_data_transmission_handshake_get_jpg_quality(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN? msg->len : MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN;
|
||||
memset(data_transmission_handshake, 0, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
|
||||
memcpy(data_transmission_handshake, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DEBUG PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG 254
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_debug_t {
|
||||
uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
|
||||
float value; /*< DEBUG value*/
|
||||
uint8_t ind; /*< index of debug variable*/
|
||||
}) mavlink_debug_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_LEN 9
|
||||
#define MAVLINK_MSG_ID_DEBUG_MIN_LEN 9
|
||||
#define MAVLINK_MSG_ID_254_LEN 9
|
||||
#define MAVLINK_MSG_ID_254_MIN_LEN 9
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_CRC 46
|
||||
#define MAVLINK_MSG_ID_254_CRC 46
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DEBUG { \
|
||||
254, \
|
||||
"DEBUG", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \
|
||||
{ "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DEBUG { \
|
||||
"DEBUG", \
|
||||
3, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \
|
||||
{ "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \
|
||||
{ "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a debug 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 ind index of debug variable
|
||||
* @param value DEBUG value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint8_t ind, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
#else
|
||||
mavlink_debug_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
packet.ind = ind;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a debug message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param ind index of debug variable
|
||||
* @param value DEBUG value
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint8_t ind,float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
#else
|
||||
mavlink_debug_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
packet.ind = ind;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a debug struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param debug C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_t* debug)
|
||||
{
|
||||
return mavlink_msg_debug_pack(system_id, component_id, msg, debug->time_boot_ms, debug->ind, debug->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a debug struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param debug C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_t* debug)
|
||||
{
|
||||
return mavlink_msg_debug_pack_chan(system_id, component_id, chan, msg, debug->time_boot_ms, debug->ind, debug->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a debug message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param ind index of debug variable
|
||||
* @param value DEBUG value
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#else
|
||||
mavlink_debug_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.value = value;
|
||||
packet.ind = ind;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a debug message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_debug_send_struct(mavlink_channel_t chan, const mavlink_debug_t* debug)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_debug_send(chan, debug->time_boot_ms, debug->ind, debug->value);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)debug, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DEBUG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_debug_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_float(buf, 4, value);
|
||||
_mav_put_uint8_t(buf, 8, ind);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#else
|
||||
mavlink_debug_t *packet = (mavlink_debug_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->value = value;
|
||||
packet->ind = ind;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)packet, MAVLINK_MSG_ID_DEBUG_MIN_LEN, MAVLINK_MSG_ID_DEBUG_LEN, MAVLINK_MSG_ID_DEBUG_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DEBUG UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from debug message
|
||||
*
|
||||
* @return Timestamp (milliseconds since system boot)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ind from debug message
|
||||
*
|
||||
* @return index of debug variable
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field value from debug message
|
||||
*
|
||||
* @return DEBUG value
|
||||
*/
|
||||
static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a debug message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param debug C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_debug_decode(const mavlink_message_t* msg, mavlink_debug_t* debug)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
debug->time_boot_ms = mavlink_msg_debug_get_time_boot_ms(msg);
|
||||
debug->value = mavlink_msg_debug_get_value(msg);
|
||||
debug->ind = mavlink_msg_debug_get_ind(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DEBUG_LEN? msg->len : MAVLINK_MSG_ID_DEBUG_LEN;
|
||||
memset(debug, 0, MAVLINK_MSG_ID_DEBUG_LEN);
|
||||
memcpy(debug, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-305
@@ -1,305 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DEBUG_VECT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_VECT 250
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_debug_vect_t {
|
||||
uint64_t time_usec; /*< Timestamp*/
|
||||
float x; /*< x*/
|
||||
float y; /*< y*/
|
||||
float z; /*< z*/
|
||||
char name[10]; /*< Name*/
|
||||
}) mavlink_debug_vect_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_VECT_LEN 30
|
||||
#define MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN 30
|
||||
#define MAVLINK_MSG_ID_250_LEN 30
|
||||
#define MAVLINK_MSG_ID_250_MIN_LEN 30
|
||||
|
||||
#define MAVLINK_MSG_ID_DEBUG_VECT_CRC 49
|
||||
#define MAVLINK_MSG_ID_250_CRC 49
|
||||
|
||||
#define MAVLINK_MSG_DEBUG_VECT_FIELD_NAME_LEN 10
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \
|
||||
250, \
|
||||
"DEBUG_VECT", \
|
||||
5, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \
|
||||
{ "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \
|
||||
"DEBUG_VECT", \
|
||||
5, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \
|
||||
{ "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a debug_vect 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 name Name
|
||||
* @param time_usec Timestamp
|
||||
* @param x x
|
||||
* @param y y
|
||||
* @param z z
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
const char *name, uint64_t time_usec, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
#else
|
||||
mavlink_debug_vect_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a debug_vect message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param name Name
|
||||
* @param time_usec Timestamp
|
||||
* @param x x
|
||||
* @param y y
|
||||
* @param z z
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
const char *name,uint64_t time_usec,float x,float y,float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
#else
|
||||
mavlink_debug_vect_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a debug_vect struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param debug_vect C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect)
|
||||
{
|
||||
return mavlink_msg_debug_vect_pack(system_id, component_id, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a debug_vect struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param debug_vect C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect)
|
||||
{
|
||||
return mavlink_msg_debug_vect_pack_chan(system_id, component_id, chan, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a debug_vect message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param name Name
|
||||
* @param time_usec Timestamp
|
||||
* @param x x
|
||||
* @param y y
|
||||
* @param z z
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DEBUG_VECT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#else
|
||||
mavlink_debug_vect_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.x = x;
|
||||
packet.y = y;
|
||||
packet.z = z;
|
||||
mav_array_memcpy(packet.name, name, sizeof(char)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a debug_vect message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_debug_vect_send_struct(mavlink_channel_t chan, const mavlink_debug_vect_t* debug_vect)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_debug_vect_send(chan, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)debug_vect, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DEBUG_VECT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_debug_vect_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_char_array(buf, 20, name, 10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#else
|
||||
mavlink_debug_vect_t *packet = (mavlink_debug_vect_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->x = x;
|
||||
packet->y = y;
|
||||
packet->z = z;
|
||||
mav_array_memcpy(packet->name, name, sizeof(char)*10);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)packet, MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DEBUG_VECT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field name from debug_vect message
|
||||
*
|
||||
* @return Name
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* msg, char *name)
|
||||
{
|
||||
return _MAV_RETURN_char_array(msg, name, 10, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from debug_vect message
|
||||
*
|
||||
* @return Timestamp
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from debug_vect message
|
||||
*
|
||||
* @return x
|
||||
*/
|
||||
static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from debug_vect message
|
||||
*
|
||||
* @return y
|
||||
*/
|
||||
static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from debug_vect message
|
||||
*
|
||||
* @return z
|
||||
*/
|
||||
static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a debug_vect message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param debug_vect C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_debug_vect_decode(const mavlink_message_t* msg, mavlink_debug_vect_t* debug_vect)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
debug_vect->time_usec = mavlink_msg_debug_vect_get_time_usec(msg);
|
||||
debug_vect->x = mavlink_msg_debug_vect_get_x(msg);
|
||||
debug_vect->y = mavlink_msg_debug_vect_get_y(msg);
|
||||
debug_vect->z = mavlink_msg_debug_vect_get_z(msg);
|
||||
mavlink_msg_debug_vect_get_name(msg, debug_vect->name);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DEBUG_VECT_LEN? msg->len : MAVLINK_MSG_ID_DEBUG_VECT_LEN;
|
||||
memset(debug_vect, 0, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
|
||||
memcpy(debug_vect, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-388
@@ -1,388 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE DISTANCE_SENSOR PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_DISTANCE_SENSOR 132
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_distance_sensor_t {
|
||||
uint32_t time_boot_ms; /*< Time since system boot*/
|
||||
uint16_t min_distance; /*< Minimum distance the sensor can measure in centimeters*/
|
||||
uint16_t max_distance; /*< Maximum distance the sensor can measure in centimeters*/
|
||||
uint16_t current_distance; /*< Current distance reading*/
|
||||
uint8_t type; /*< Type from MAV_DISTANCE_SENSOR enum.*/
|
||||
uint8_t id; /*< Onboard ID of the sensor*/
|
||||
uint8_t orientation; /*< Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.*/
|
||||
uint8_t covariance; /*< Measurement covariance in centimeters, 0 for unknown / invalid readings*/
|
||||
}) mavlink_distance_sensor_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 14
|
||||
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN 14
|
||||
#define MAVLINK_MSG_ID_132_LEN 14
|
||||
#define MAVLINK_MSG_ID_132_MIN_LEN 14
|
||||
|
||||
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC 85
|
||||
#define MAVLINK_MSG_ID_132_CRC 85
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
|
||||
132, \
|
||||
"DISTANCE_SENSOR", \
|
||||
8, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \
|
||||
{ "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \
|
||||
{ "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
|
||||
{ "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_distance_sensor_t, type) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \
|
||||
{ "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
|
||||
"DISTANCE_SENSOR", \
|
||||
8, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \
|
||||
{ "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \
|
||||
{ "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
|
||||
{ "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \
|
||||
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_distance_sensor_t, type) }, \
|
||||
{ "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \
|
||||
{ "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a distance_sensor message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param time_boot_ms Time since system boot
|
||||
* @param min_distance Minimum distance the sensor can measure in centimeters
|
||||
* @param max_distance Maximum distance the sensor can measure in centimeters
|
||||
* @param current_distance Current distance reading
|
||||
* @param type Type from MAV_DISTANCE_SENSOR enum.
|
||||
* @param id Onboard ID of the sensor
|
||||
* @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.
|
||||
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint16_t(buf, 4, min_distance);
|
||||
_mav_put_uint16_t(buf, 6, max_distance);
|
||||
_mav_put_uint16_t(buf, 8, current_distance);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, id);
|
||||
_mav_put_uint8_t(buf, 12, orientation);
|
||||
_mav_put_uint8_t(buf, 13, covariance);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
#else
|
||||
mavlink_distance_sensor_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.current_distance = current_distance;
|
||||
packet.type = type;
|
||||
packet.id = id;
|
||||
packet.orientation = orientation;
|
||||
packet.covariance = covariance;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a distance_sensor message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Time since system boot
|
||||
* @param min_distance Minimum distance the sensor can measure in centimeters
|
||||
* @param max_distance Maximum distance the sensor can measure in centimeters
|
||||
* @param current_distance Current distance reading
|
||||
* @param type Type from MAV_DISTANCE_SENSOR enum.
|
||||
* @param id Onboard ID of the sensor
|
||||
* @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.
|
||||
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_boot_ms,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t type,uint8_t id,uint8_t orientation,uint8_t covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint16_t(buf, 4, min_distance);
|
||||
_mav_put_uint16_t(buf, 6, max_distance);
|
||||
_mav_put_uint16_t(buf, 8, current_distance);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, id);
|
||||
_mav_put_uint8_t(buf, 12, orientation);
|
||||
_mav_put_uint8_t(buf, 13, covariance);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
#else
|
||||
mavlink_distance_sensor_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.current_distance = current_distance;
|
||||
packet.type = type;
|
||||
packet.id = id;
|
||||
packet.orientation = orientation;
|
||||
packet.covariance = covariance;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a distance_sensor struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param distance_sensor C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor)
|
||||
{
|
||||
return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a distance_sensor struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param distance_sensor C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_distance_sensor_t* distance_sensor)
|
||||
{
|
||||
return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a distance_sensor message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Time since system boot
|
||||
* @param min_distance Minimum distance the sensor can measure in centimeters
|
||||
* @param max_distance Maximum distance the sensor can measure in centimeters
|
||||
* @param current_distance Current distance reading
|
||||
* @param type Type from MAV_DISTANCE_SENSOR enum.
|
||||
* @param id Onboard ID of the sensor
|
||||
* @param orientation Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.
|
||||
* @param covariance Measurement covariance in centimeters, 0 for unknown / invalid readings
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_distance_sensor_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint16_t(buf, 4, min_distance);
|
||||
_mav_put_uint16_t(buf, 6, max_distance);
|
||||
_mav_put_uint16_t(buf, 8, current_distance);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, id);
|
||||
_mav_put_uint8_t(buf, 12, orientation);
|
||||
_mav_put_uint8_t(buf, 13, covariance);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
#else
|
||||
mavlink_distance_sensor_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.min_distance = min_distance;
|
||||
packet.max_distance = max_distance;
|
||||
packet.current_distance = current_distance;
|
||||
packet.type = type;
|
||||
packet.id = id;
|
||||
packet.orientation = orientation;
|
||||
packet.covariance = covariance;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)&packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a distance_sensor message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_distance_sensor_send_struct(mavlink_channel_t chan, const mavlink_distance_sensor_t* distance_sensor)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_distance_sensor_send(chan, distance_sensor->time_boot_ms, distance_sensor->min_distance, distance_sensor->max_distance, distance_sensor->current_distance, distance_sensor->type, distance_sensor->id, distance_sensor->orientation, distance_sensor->covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)distance_sensor, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t id, uint8_t orientation, uint8_t covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_uint16_t(buf, 4, min_distance);
|
||||
_mav_put_uint16_t(buf, 6, max_distance);
|
||||
_mav_put_uint16_t(buf, 8, current_distance);
|
||||
_mav_put_uint8_t(buf, 10, type);
|
||||
_mav_put_uint8_t(buf, 11, id);
|
||||
_mav_put_uint8_t(buf, 12, orientation);
|
||||
_mav_put_uint8_t(buf, 13, covariance);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, buf, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
#else
|
||||
mavlink_distance_sensor_t *packet = (mavlink_distance_sensor_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->min_distance = min_distance;
|
||||
packet->max_distance = max_distance;
|
||||
packet->current_distance = current_distance;
|
||||
packet->type = type;
|
||||
packet->id = id;
|
||||
packet->orientation = orientation;
|
||||
packet->covariance = covariance;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DISTANCE_SENSOR, (const char *)packet, MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN, MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE DISTANCE_SENSOR UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from distance_sensor message
|
||||
*
|
||||
* @return Time since system boot
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field min_distance from distance_sensor message
|
||||
*
|
||||
* @return Minimum distance the sensor can measure in centimeters
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_get_min_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field max_distance from distance_sensor message
|
||||
*
|
||||
* @return Maximum distance the sensor can measure in centimeters
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_get_max_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field current_distance from distance_sensor message
|
||||
*
|
||||
* @return Current distance reading
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field type from distance_sensor message
|
||||
*
|
||||
* @return Type from MAV_DISTANCE_SENSOR enum.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_distance_sensor_get_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field id from distance_sensor message
|
||||
*
|
||||
* @return Onboard ID of the sensor
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_distance_sensor_get_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field orientation from distance_sensor message
|
||||
*
|
||||
* @return Direction the sensor faces from MAV_SENSOR_ORIENTATION enum.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_distance_sensor_get_orientation(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from distance_sensor message
|
||||
*
|
||||
* @return Measurement covariance in centimeters, 0 for unknown / invalid readings
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_distance_sensor_get_covariance(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 13);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a distance_sensor message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param distance_sensor C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_distance_sensor_decode(const mavlink_message_t* msg, mavlink_distance_sensor_t* distance_sensor)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
distance_sensor->time_boot_ms = mavlink_msg_distance_sensor_get_time_boot_ms(msg);
|
||||
distance_sensor->min_distance = mavlink_msg_distance_sensor_get_min_distance(msg);
|
||||
distance_sensor->max_distance = mavlink_msg_distance_sensor_get_max_distance(msg);
|
||||
distance_sensor->current_distance = mavlink_msg_distance_sensor_get_current_distance(msg);
|
||||
distance_sensor->type = mavlink_msg_distance_sensor_get_type(msg);
|
||||
distance_sensor->id = mavlink_msg_distance_sensor_get_id(msg);
|
||||
distance_sensor->orientation = mavlink_msg_distance_sensor_get_orientation(msg);
|
||||
distance_sensor->covariance = mavlink_msg_distance_sensor_get_covariance(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN? msg->len : MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN;
|
||||
memset(distance_sensor, 0, MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN);
|
||||
memcpy(distance_sensor, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-230
@@ -1,230 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ENCAPSULATED_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA 131
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_encapsulated_data_t {
|
||||
uint16_t seqnr; /*< sequence number (starting with 0 on every transmission)*/
|
||||
uint8_t data[253]; /*< image data bytes*/
|
||||
}) mavlink_encapsulated_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255
|
||||
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN 255
|
||||
#define MAVLINK_MSG_ID_131_LEN 255
|
||||
#define MAVLINK_MSG_ID_131_MIN_LEN 255
|
||||
|
||||
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC 223
|
||||
#define MAVLINK_MSG_ID_131_CRC 223
|
||||
|
||||
#define MAVLINK_MSG_ENCAPSULATED_DATA_FIELD_DATA_LEN 253
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \
|
||||
131, \
|
||||
"ENCAPSULATED_DATA", \
|
||||
2, \
|
||||
{ { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA { \
|
||||
"ENCAPSULATED_DATA", \
|
||||
2, \
|
||||
{ { "seqnr", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_encapsulated_data_t, seqnr) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 253, 2, offsetof(mavlink_encapsulated_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a encapsulated_data 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 seqnr sequence number (starting with 0 on every transmission)
|
||||
* @param data image data bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint16_t seqnr, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seqnr);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 253);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
#else
|
||||
mavlink_encapsulated_data_t packet;
|
||||
packet.seqnr = seqnr;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a encapsulated_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param seqnr sequence number (starting with 0 on every transmission)
|
||||
* @param data image data bytes
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint16_t seqnr,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seqnr);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 253);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
#else
|
||||
mavlink_encapsulated_data_t packet;
|
||||
packet.seqnr = seqnr;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a encapsulated_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param encapsulated_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data)
|
||||
{
|
||||
return mavlink_msg_encapsulated_data_pack(system_id, component_id, msg, encapsulated_data->seqnr, encapsulated_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a encapsulated_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param encapsulated_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_encapsulated_data_t* encapsulated_data)
|
||||
{
|
||||
return mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, chan, msg, encapsulated_data->seqnr, encapsulated_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a encapsulated_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param seqnr sequence number (starting with 0 on every transmission)
|
||||
* @param data image data bytes
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_encapsulated_data_send(mavlink_channel_t chan, uint16_t seqnr, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN];
|
||||
_mav_put_uint16_t(buf, 0, seqnr);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 253);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#else
|
||||
mavlink_encapsulated_data_t packet;
|
||||
packet.seqnr = seqnr;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*253);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)&packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a encapsulated_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_encapsulated_data_send_struct(mavlink_channel_t chan, const mavlink_encapsulated_data_t* encapsulated_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_encapsulated_data_send(chan, encapsulated_data->seqnr, encapsulated_data->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)encapsulated_data, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_encapsulated_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seqnr, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint16_t(buf, 0, seqnr);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 253);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, buf, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#else
|
||||
mavlink_encapsulated_data_t *packet = (mavlink_encapsulated_data_t *)msgbuf;
|
||||
packet->seqnr = seqnr;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*253);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA, (const char *)packet, MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN, MAVLINK_MSG_ID_ENCAPSULATED_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ENCAPSULATED_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field seqnr from encapsulated_data message
|
||||
*
|
||||
* @return sequence number (starting with 0 on every transmission)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_get_seqnr(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from encapsulated_data message
|
||||
*
|
||||
* @return image data bytes
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_encapsulated_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 253, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a encapsulated_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param encapsulated_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_encapsulated_data_decode(const mavlink_message_t* msg, mavlink_encapsulated_data_t* encapsulated_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
encapsulated_data->seqnr = mavlink_msg_encapsulated_data_get_seqnr(msg);
|
||||
mavlink_msg_encapsulated_data_get_data(msg, encapsulated_data->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN? msg->len : MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN;
|
||||
memset(encapsulated_data, 0, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
|
||||
memcpy(encapsulated_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-438
@@ -1,438 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE ESTIMATOR_STATUS PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_ESTIMATOR_STATUS 230
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_estimator_status_t {
|
||||
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
|
||||
float vel_ratio; /*< Velocity innovation test ratio*/
|
||||
float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/
|
||||
float pos_vert_ratio; /*< Vertical position innovation test ratio*/
|
||||
float mag_ratio; /*< Magnetometer innovation test ratio*/
|
||||
float hagl_ratio; /*< Height above terrain innovation test ratio*/
|
||||
float tas_ratio; /*< True airspeed innovation test ratio*/
|
||||
float pos_horiz_accuracy; /*< Horizontal position 1-STD accuracy relative to the EKF local origin (m)*/
|
||||
float pos_vert_accuracy; /*< Vertical position 1-STD accuracy relative to the EKF local origin (m)*/
|
||||
uint16_t flags; /*< Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.*/
|
||||
}) mavlink_estimator_status_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN 42
|
||||
#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN 42
|
||||
#define MAVLINK_MSG_ID_230_LEN 42
|
||||
#define MAVLINK_MSG_ID_230_MIN_LEN 42
|
||||
|
||||
#define MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC 163
|
||||
#define MAVLINK_MSG_ID_230_CRC 163
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
|
||||
230, \
|
||||
"ESTIMATOR_STATUS", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
|
||||
{ "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
|
||||
{ "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
|
||||
{ "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
|
||||
{ "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
|
||||
{ "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
|
||||
{ "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
|
||||
{ "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
|
||||
{ "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
|
||||
"ESTIMATOR_STATUS", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
|
||||
{ "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
|
||||
{ "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
|
||||
{ "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
|
||||
{ "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
|
||||
{ "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
|
||||
{ "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
|
||||
{ "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
|
||||
{ "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
|
||||
{ "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a estimator_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 time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
|
||||
* @param vel_ratio Velocity innovation test ratio
|
||||
* @param pos_horiz_ratio Horizontal position innovation test ratio
|
||||
* @param pos_vert_ratio Vertical position innovation test ratio
|
||||
* @param mag_ratio Magnetometer innovation test ratio
|
||||
* @param hagl_ratio Height above terrain innovation test ratio
|
||||
* @param tas_ratio True airspeed innovation test ratio
|
||||
* @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
|
||||
* @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, vel_ratio);
|
||||
_mav_put_float(buf, 12, pos_horiz_ratio);
|
||||
_mav_put_float(buf, 16, pos_vert_ratio);
|
||||
_mav_put_float(buf, 20, mag_ratio);
|
||||
_mav_put_float(buf, 24, hagl_ratio);
|
||||
_mav_put_float(buf, 28, tas_ratio);
|
||||
_mav_put_float(buf, 32, pos_horiz_accuracy);
|
||||
_mav_put_float(buf, 36, pos_vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 40, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
#else
|
||||
mavlink_estimator_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.vel_ratio = vel_ratio;
|
||||
packet.pos_horiz_ratio = pos_horiz_ratio;
|
||||
packet.pos_vert_ratio = pos_vert_ratio;
|
||||
packet.mag_ratio = mag_ratio;
|
||||
packet.hagl_ratio = hagl_ratio;
|
||||
packet.tas_ratio = tas_ratio;
|
||||
packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
||||
packet.pos_vert_accuracy = pos_vert_accuracy;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a estimator_status message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
|
||||
* @param vel_ratio Velocity innovation test ratio
|
||||
* @param pos_horiz_ratio Horizontal position innovation test ratio
|
||||
* @param pos_vert_ratio Vertical position innovation test ratio
|
||||
* @param mag_ratio Magnetometer innovation test ratio
|
||||
* @param hagl_ratio Height above terrain innovation test ratio
|
||||
* @param tas_ratio True airspeed innovation test ratio
|
||||
* @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
|
||||
* @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint16_t flags,float vel_ratio,float pos_horiz_ratio,float pos_vert_ratio,float mag_ratio,float hagl_ratio,float tas_ratio,float pos_horiz_accuracy,float pos_vert_accuracy)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, vel_ratio);
|
||||
_mav_put_float(buf, 12, pos_horiz_ratio);
|
||||
_mav_put_float(buf, 16, pos_vert_ratio);
|
||||
_mav_put_float(buf, 20, mag_ratio);
|
||||
_mav_put_float(buf, 24, hagl_ratio);
|
||||
_mav_put_float(buf, 28, tas_ratio);
|
||||
_mav_put_float(buf, 32, pos_horiz_accuracy);
|
||||
_mav_put_float(buf, 36, pos_vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 40, flags);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
#else
|
||||
mavlink_estimator_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.vel_ratio = vel_ratio;
|
||||
packet.pos_horiz_ratio = pos_horiz_ratio;
|
||||
packet.pos_vert_ratio = pos_vert_ratio;
|
||||
packet.mag_ratio = mag_ratio;
|
||||
packet.hagl_ratio = hagl_ratio;
|
||||
packet.tas_ratio = tas_ratio;
|
||||
packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
||||
packet.pos_vert_accuracy = pos_vert_accuracy;
|
||||
packet.flags = flags;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a estimator_status struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param estimator_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
|
||||
{
|
||||
return mavlink_msg_estimator_status_pack(system_id, component_id, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a estimator_status struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param estimator_status C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
|
||||
{
|
||||
return mavlink_msg_estimator_status_pack_chan(system_id, component_id, chan, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a estimator_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
|
||||
* @param vel_ratio Velocity innovation test ratio
|
||||
* @param pos_horiz_ratio Horizontal position innovation test ratio
|
||||
* @param pos_vert_ratio Vertical position innovation test ratio
|
||||
* @param mag_ratio Magnetometer innovation test ratio
|
||||
* @param hagl_ratio Height above terrain innovation test ratio
|
||||
* @param tas_ratio True airspeed innovation test ratio
|
||||
* @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
|
||||
* @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_estimator_status_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, vel_ratio);
|
||||
_mav_put_float(buf, 12, pos_horiz_ratio);
|
||||
_mav_put_float(buf, 16, pos_vert_ratio);
|
||||
_mav_put_float(buf, 20, mag_ratio);
|
||||
_mav_put_float(buf, 24, hagl_ratio);
|
||||
_mav_put_float(buf, 28, tas_ratio);
|
||||
_mav_put_float(buf, 32, pos_horiz_accuracy);
|
||||
_mav_put_float(buf, 36, pos_vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 40, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#else
|
||||
mavlink_estimator_status_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.vel_ratio = vel_ratio;
|
||||
packet.pos_horiz_ratio = pos_horiz_ratio;
|
||||
packet.pos_vert_ratio = pos_vert_ratio;
|
||||
packet.mag_ratio = mag_ratio;
|
||||
packet.hagl_ratio = hagl_ratio;
|
||||
packet.tas_ratio = tas_ratio;
|
||||
packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
||||
packet.pos_vert_accuracy = pos_vert_accuracy;
|
||||
packet.flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a estimator_status message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_estimator_status_send_struct(mavlink_channel_t chan, const mavlink_estimator_status_t* estimator_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_estimator_status_send(chan, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)estimator_status, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_estimator_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_float(buf, 8, vel_ratio);
|
||||
_mav_put_float(buf, 12, pos_horiz_ratio);
|
||||
_mav_put_float(buf, 16, pos_vert_ratio);
|
||||
_mav_put_float(buf, 20, mag_ratio);
|
||||
_mav_put_float(buf, 24, hagl_ratio);
|
||||
_mav_put_float(buf, 28, tas_ratio);
|
||||
_mav_put_float(buf, 32, pos_horiz_accuracy);
|
||||
_mav_put_float(buf, 36, pos_vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 40, flags);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#else
|
||||
mavlink_estimator_status_t *packet = (mavlink_estimator_status_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->vel_ratio = vel_ratio;
|
||||
packet->pos_horiz_ratio = pos_horiz_ratio;
|
||||
packet->pos_vert_ratio = pos_vert_ratio;
|
||||
packet->mag_ratio = mag_ratio;
|
||||
packet->hagl_ratio = hagl_ratio;
|
||||
packet->tas_ratio = tas_ratio;
|
||||
packet->pos_horiz_accuracy = pos_horiz_accuracy;
|
||||
packet->pos_vert_accuracy = pos_vert_accuracy;
|
||||
packet->flags = flags;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE ESTIMATOR_STATUS UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from estimator_status message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field flags from estimator_status message
|
||||
*
|
||||
* @return Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel_ratio from estimator_status message
|
||||
*
|
||||
* @return Velocity innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_horiz_ratio from estimator_status message
|
||||
*
|
||||
* @return Horizontal position innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_vert_ratio from estimator_status message
|
||||
*
|
||||
* @return Vertical position innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mag_ratio from estimator_status message
|
||||
*
|
||||
* @return Magnetometer innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hagl_ratio from estimator_status message
|
||||
*
|
||||
* @return Height above terrain innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tas_ratio from estimator_status message
|
||||
*
|
||||
* @return True airspeed innovation test ratio
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_horiz_accuracy from estimator_status message
|
||||
*
|
||||
* @return Horizontal position 1-STD accuracy relative to the EKF local origin (m)
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pos_vert_accuracy from estimator_status message
|
||||
*
|
||||
* @return Vertical position 1-STD accuracy relative to the EKF local origin (m)
|
||||
*/
|
||||
static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a estimator_status message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param estimator_status C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_estimator_status_decode(const mavlink_message_t* msg, mavlink_estimator_status_t* estimator_status)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
estimator_status->time_usec = mavlink_msg_estimator_status_get_time_usec(msg);
|
||||
estimator_status->vel_ratio = mavlink_msg_estimator_status_get_vel_ratio(msg);
|
||||
estimator_status->pos_horiz_ratio = mavlink_msg_estimator_status_get_pos_horiz_ratio(msg);
|
||||
estimator_status->pos_vert_ratio = mavlink_msg_estimator_status_get_pos_vert_ratio(msg);
|
||||
estimator_status->mag_ratio = mavlink_msg_estimator_status_get_mag_ratio(msg);
|
||||
estimator_status->hagl_ratio = mavlink_msg_estimator_status_get_hagl_ratio(msg);
|
||||
estimator_status->tas_ratio = mavlink_msg_estimator_status_get_tas_ratio(msg);
|
||||
estimator_status->pos_horiz_accuracy = mavlink_msg_estimator_status_get_pos_horiz_accuracy(msg);
|
||||
estimator_status->pos_vert_accuracy = mavlink_msg_estimator_status_get_pos_vert_accuracy(msg);
|
||||
estimator_status->flags = mavlink_msg_estimator_status_get_flags(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN;
|
||||
memset(estimator_status, 0, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
||||
memcpy(estimator_status, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE EXTENDED_SYS_STATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE 245
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_extended_sys_state_t {
|
||||
uint8_t vtol_state; /*< The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.*/
|
||||
uint8_t landed_state; /*< The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.*/
|
||||
}) mavlink_extended_sys_state_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN 2
|
||||
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN 2
|
||||
#define MAVLINK_MSG_ID_245_LEN 2
|
||||
#define MAVLINK_MSG_ID_245_MIN_LEN 2
|
||||
|
||||
#define MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC 130
|
||||
#define MAVLINK_MSG_ID_245_CRC 130
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE { \
|
||||
245, \
|
||||
"EXTENDED_SYS_STATE", \
|
||||
2, \
|
||||
{ { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \
|
||||
{ "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_sys_state_t, landed_state) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_EXTENDED_SYS_STATE { \
|
||||
"EXTENDED_SYS_STATE", \
|
||||
2, \
|
||||
{ { "vtol_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_extended_sys_state_t, vtol_state) }, \
|
||||
{ "landed_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_extended_sys_state_t, landed_state) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a extended_sys_state 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 vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_extended_sys_state_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t vtol_state, uint8_t landed_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, vtol_state);
|
||||
_mav_put_uint8_t(buf, 1, landed_state);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
#else
|
||||
mavlink_extended_sys_state_t packet;
|
||||
packet.vtol_state = vtol_state;
|
||||
packet.landed_state = landed_state;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a extended_sys_state message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_extended_sys_state_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t vtol_state,uint8_t landed_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, vtol_state);
|
||||
_mav_put_uint8_t(buf, 1, landed_state);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
#else
|
||||
mavlink_extended_sys_state_t packet;
|
||||
packet.vtol_state = vtol_state;
|
||||
packet.landed_state = landed_state;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a extended_sys_state struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param extended_sys_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_extended_sys_state_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_extended_sys_state_t* extended_sys_state)
|
||||
{
|
||||
return mavlink_msg_extended_sys_state_pack(system_id, component_id, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a extended_sys_state struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param extended_sys_state C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_extended_sys_state_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_extended_sys_state_t* extended_sys_state)
|
||||
{
|
||||
return mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, chan, msg, extended_sys_state->vtol_state, extended_sys_state->landed_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a extended_sys_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param vtol_state The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
|
||||
* @param landed_state The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_extended_sys_state_send(mavlink_channel_t chan, uint8_t vtol_state, uint8_t landed_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN];
|
||||
_mav_put_uint8_t(buf, 0, vtol_state);
|
||||
_mav_put_uint8_t(buf, 1, landed_state);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#else
|
||||
mavlink_extended_sys_state_t packet;
|
||||
packet.vtol_state = vtol_state;
|
||||
packet.landed_state = landed_state;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)&packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a extended_sys_state message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_extended_sys_state_send_struct(mavlink_channel_t chan, const mavlink_extended_sys_state_t* extended_sys_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_extended_sys_state_send(chan, extended_sys_state->vtol_state, extended_sys_state->landed_state);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)extended_sys_state, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_extended_sys_state_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t vtol_state, uint8_t landed_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, vtol_state);
|
||||
_mav_put_uint8_t(buf, 1, landed_state);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, buf, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#else
|
||||
mavlink_extended_sys_state_t *packet = (mavlink_extended_sys_state_t *)msgbuf;
|
||||
packet->vtol_state = vtol_state;
|
||||
packet->landed_state = landed_state;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_SYS_STATE, (const char *)packet, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE EXTENDED_SYS_STATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field vtol_state from extended_sys_state message
|
||||
*
|
||||
* @return The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_extended_sys_state_get_vtol_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field landed_state from extended_sys_state message
|
||||
*
|
||||
* @return The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_extended_sys_state_get_landed_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a extended_sys_state message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param extended_sys_state C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_extended_sys_state_decode(const mavlink_message_t* msg, mavlink_extended_sys_state_t* extended_sys_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
extended_sys_state->vtol_state = mavlink_msg_extended_sys_state_get_vtol_state(msg);
|
||||
extended_sys_state->landed_state = mavlink_msg_extended_sys_state_get_landed_state(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN? msg->len : MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN;
|
||||
memset(extended_sys_state, 0, MAVLINK_MSG_ID_EXTENDED_SYS_STATE_LEN);
|
||||
memcpy(extended_sys_state, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-280
@@ -1,280 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE FILE_TRANSFER_PROTOCOL PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL 110
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_file_transfer_protocol_t {
|
||||
uint8_t target_network; /*< Network ID (0 for broadcast)*/
|
||||
uint8_t target_system; /*< System ID (0 for broadcast)*/
|
||||
uint8_t target_component; /*< Component ID (0 for broadcast)*/
|
||||
uint8_t payload[251]; /*< Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.*/
|
||||
}) mavlink_file_transfer_protocol_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN 254
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN 254
|
||||
#define MAVLINK_MSG_ID_110_LEN 254
|
||||
#define MAVLINK_MSG_ID_110_MIN_LEN 254
|
||||
|
||||
#define MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC 84
|
||||
#define MAVLINK_MSG_ID_110_CRC 84
|
||||
|
||||
#define MAVLINK_MSG_FILE_TRANSFER_PROTOCOL_FIELD_PAYLOAD_LEN 251
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL { \
|
||||
110, \
|
||||
"FILE_TRANSFER_PROTOCOL", \
|
||||
4, \
|
||||
{ { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_file_transfer_protocol_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_file_transfer_protocol_t, target_component) }, \
|
||||
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 251, 3, offsetof(mavlink_file_transfer_protocol_t, payload) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL { \
|
||||
"FILE_TRANSFER_PROTOCOL", \
|
||||
4, \
|
||||
{ { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_file_transfer_protocol_t, target_network) }, \
|
||||
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_file_transfer_protocol_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_file_transfer_protocol_t, target_component) }, \
|
||||
{ "payload", NULL, MAVLINK_TYPE_UINT8_T, 251, 3, offsetof(mavlink_file_transfer_protocol_t, payload) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_protocol message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_network Network ID (0 for broadcast)
|
||||
* @param target_system System ID (0 for broadcast)
|
||||
* @param target_component Component ID (0 for broadcast)
|
||||
* @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_network);
|
||||
_mav_put_uint8_t(buf, 1, target_system);
|
||||
_mav_put_uint8_t(buf, 2, target_component);
|
||||
_mav_put_uint8_t_array(buf, 3, payload, 251);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
#else
|
||||
mavlink_file_transfer_protocol_t packet;
|
||||
packet.target_network = target_network;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a file_transfer_protocol message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_network Network ID (0 for broadcast)
|
||||
* @param target_system System ID (0 for broadcast)
|
||||
* @param target_component Component ID (0 for broadcast)
|
||||
* @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_network,uint8_t target_system,uint8_t target_component,const uint8_t *payload)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_network);
|
||||
_mav_put_uint8_t(buf, 1, target_system);
|
||||
_mav_put_uint8_t(buf, 2, target_component);
|
||||
_mav_put_uint8_t_array(buf, 3, payload, 251);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
#else
|
||||
mavlink_file_transfer_protocol_t packet;
|
||||
packet.target_network = target_network;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a file_transfer_protocol struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param file_transfer_protocol C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
|
||||
{
|
||||
return mavlink_msg_file_transfer_protocol_pack(system_id, component_id, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a file_transfer_protocol struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param file_transfer_protocol C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
|
||||
{
|
||||
return mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, chan, msg, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a file_transfer_protocol message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_network Network ID (0 for broadcast)
|
||||
* @param target_system System ID (0 for broadcast)
|
||||
* @param target_component Component ID (0 for broadcast)
|
||||
* @param payload Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_file_transfer_protocol_send(mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_network);
|
||||
_mav_put_uint8_t(buf, 1, target_system);
|
||||
_mav_put_uint8_t(buf, 2, target_component);
|
||||
_mav_put_uint8_t_array(buf, 3, payload, 251);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#else
|
||||
mavlink_file_transfer_protocol_t packet;
|
||||
packet.target_network = target_network;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*251);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)&packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a file_transfer_protocol message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_protocol_send_struct(mavlink_channel_t chan, const mavlink_file_transfer_protocol_t* file_transfer_protocol)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_file_transfer_protocol_send(chan, file_transfer_protocol->target_network, file_transfer_protocol->target_system, file_transfer_protocol->target_component, file_transfer_protocol->payload);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)file_transfer_protocol, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_protocol_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, const uint8_t *payload)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_network);
|
||||
_mav_put_uint8_t(buf, 1, target_system);
|
||||
_mav_put_uint8_t(buf, 2, target_component);
|
||||
_mav_put_uint8_t_array(buf, 3, payload, 251);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, buf, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#else
|
||||
mavlink_file_transfer_protocol_t *packet = (mavlink_file_transfer_protocol_t *)msgbuf;
|
||||
packet->target_network = target_network;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*251);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL, (const char *)packet, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FILE_TRANSFER_PROTOCOL UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_network from file_transfer_protocol message
|
||||
*
|
||||
* @return Network ID (0 for broadcast)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_network(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from file_transfer_protocol message
|
||||
*
|
||||
* @return System ID (0 for broadcast)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from file_transfer_protocol message
|
||||
*
|
||||
* @return Component ID (0 for broadcast)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_file_transfer_protocol_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field payload from file_transfer_protocol message
|
||||
*
|
||||
* @return Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The entire content of this block is opaque unless you understand any the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the mavlink specification.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_file_transfer_protocol_get_payload(const mavlink_message_t* msg, uint8_t *payload)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, payload, 251, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a file_transfer_protocol message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param file_transfer_protocol C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_file_transfer_protocol_decode(const mavlink_message_t* msg, mavlink_file_transfer_protocol_t* file_transfer_protocol)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
file_transfer_protocol->target_network = mavlink_msg_file_transfer_protocol_get_target_network(msg);
|
||||
file_transfer_protocol->target_system = mavlink_msg_file_transfer_protocol_get_target_system(msg);
|
||||
file_transfer_protocol->target_component = mavlink_msg_file_transfer_protocol_get_target_component(msg);
|
||||
mavlink_msg_file_transfer_protocol_get_payload(msg, file_transfer_protocol->payload);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN? msg->len : MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN;
|
||||
memset(file_transfer_protocol, 0, MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN);
|
||||
memcpy(file_transfer_protocol, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-459
@@ -1,459 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE FOLLOW_TARGET PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET 144
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_follow_target_t {
|
||||
uint64_t timestamp; /*< Timestamp in milliseconds since system boot*/
|
||||
uint64_t custom_state; /*< button states or switches of a tracker device*/
|
||||
int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
|
||||
int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
|
||||
float alt; /*< AMSL, in meters*/
|
||||
float vel[3]; /*< target velocity (0,0,0) for unknown*/
|
||||
float acc[3]; /*< linear target acceleration (0,0,0) for unknown*/
|
||||
float attitude_q[4]; /*< (1 0 0 0 for unknown)*/
|
||||
float rates[3]; /*< (0 0 0 for unknown)*/
|
||||
float position_cov[3]; /*< eph epv*/
|
||||
uint8_t est_capabilities; /*< bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)*/
|
||||
}) mavlink_follow_target_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_LEN 93
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN 93
|
||||
#define MAVLINK_MSG_ID_144_LEN 93
|
||||
#define MAVLINK_MSG_ID_144_MIN_LEN 93
|
||||
|
||||
#define MAVLINK_MSG_ID_FOLLOW_TARGET_CRC 127
|
||||
#define MAVLINK_MSG_ID_144_CRC 127
|
||||
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_VEL_LEN 3
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ACC_LEN 3
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_ATTITUDE_Q_LEN 4
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_RATES_LEN 3
|
||||
#define MAVLINK_MSG_FOLLOW_TARGET_FIELD_POSITION_COV_LEN 3
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
|
||||
144, \
|
||||
"FOLLOW_TARGET", \
|
||||
11, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
|
||||
{ "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
|
||||
{ "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
|
||||
{ "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
|
||||
{ "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
|
||||
{ "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
|
||||
{ "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_FOLLOW_TARGET { \
|
||||
"FOLLOW_TARGET", \
|
||||
11, \
|
||||
{ { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_follow_target_t, timestamp) }, \
|
||||
{ "custom_state", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_follow_target_t, custom_state) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_follow_target_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_follow_target_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_follow_target_t, alt) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_FLOAT, 3, 28, offsetof(mavlink_follow_target_t, vel) }, \
|
||||
{ "acc", NULL, MAVLINK_TYPE_FLOAT, 3, 40, offsetof(mavlink_follow_target_t, acc) }, \
|
||||
{ "attitude_q", NULL, MAVLINK_TYPE_FLOAT, 4, 52, offsetof(mavlink_follow_target_t, attitude_q) }, \
|
||||
{ "rates", NULL, MAVLINK_TYPE_FLOAT, 3, 68, offsetof(mavlink_follow_target_t, rates) }, \
|
||||
{ "position_cov", NULL, MAVLINK_TYPE_FLOAT, 3, 80, offsetof(mavlink_follow_target_t, position_cov) }, \
|
||||
{ "est_capabilities", NULL, MAVLINK_TYPE_UINT8_T, 0, 92, offsetof(mavlink_follow_target_t, est_capabilities) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a follow_target message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param timestamp Timestamp in milliseconds since system boot
|
||||
* @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt AMSL, in meters
|
||||
* @param vel target velocity (0,0,0) for unknown
|
||||
* @param acc linear target acceleration (0,0,0) for unknown
|
||||
* @param attitude_q (1 0 0 0 for unknown)
|
||||
* @param rates (0 0 0 for unknown)
|
||||
* @param position_cov eph epv
|
||||
* @param custom_state button states or switches of a tracker device
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a follow_target message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param timestamp Timestamp in milliseconds since system boot
|
||||
* @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt AMSL, in meters
|
||||
* @param vel target velocity (0,0,0) for unknown
|
||||
* @param acc linear target acceleration (0,0,0) for unknown
|
||||
* @param attitude_q (1 0 0 0 for unknown)
|
||||
* @param rates (0 0 0 for unknown)
|
||||
* @param position_cov eph epv
|
||||
* @param custom_state button states or switches of a tracker device
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t timestamp,uint8_t est_capabilities,int32_t lat,int32_t lon,float alt,const float *vel,const float *acc,const float *attitude_q,const float *rates,const float *position_cov,uint64_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_FOLLOW_TARGET;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a follow_target struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param follow_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
return mavlink_msg_follow_target_pack(system_id, component_id, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a follow_target struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param follow_target C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
return mavlink_msg_follow_target_pack_chan(system_id, component_id, chan, msg, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a follow_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param timestamp Timestamp in milliseconds since system boot
|
||||
* @param est_capabilities bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt AMSL, in meters
|
||||
* @param vel target velocity (0,0,0) for unknown
|
||||
* @param acc linear target acceleration (0,0,0) for unknown
|
||||
* @param attitude_q (1 0 0 0 for unknown)
|
||||
* @param rates (0 0 0 for unknown)
|
||||
* @param position_cov eph epv
|
||||
* @param custom_state button states or switches of a tracker device
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_follow_target_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_FOLLOW_TARGET_LEN];
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#else
|
||||
mavlink_follow_target_t packet;
|
||||
packet.timestamp = timestamp;
|
||||
packet.custom_state = custom_state;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet.vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.acc, acc, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.attitude_q, attitude_q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet.rates, rates, sizeof(float)*3);
|
||||
mav_array_memcpy(packet.position_cov, position_cov, sizeof(float)*3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)&packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a follow_target message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_follow_target_send_struct(mavlink_channel_t chan, const mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_follow_target_send(chan, follow_target->timestamp, follow_target->est_capabilities, follow_target->lat, follow_target->lon, follow_target->alt, follow_target->vel, follow_target->acc, follow_target->attitude_q, follow_target->rates, follow_target->position_cov, follow_target->custom_state);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)follow_target, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_FOLLOW_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_follow_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint8_t est_capabilities, int32_t lat, int32_t lon, float alt, const float *vel, const float *acc, const float *attitude_q, const float *rates, const float *position_cov, uint64_t custom_state)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, timestamp);
|
||||
_mav_put_uint64_t(buf, 8, custom_state);
|
||||
_mav_put_int32_t(buf, 16, lat);
|
||||
_mav_put_int32_t(buf, 20, lon);
|
||||
_mav_put_float(buf, 24, alt);
|
||||
_mav_put_uint8_t(buf, 92, est_capabilities);
|
||||
_mav_put_float_array(buf, 28, vel, 3);
|
||||
_mav_put_float_array(buf, 40, acc, 3);
|
||||
_mav_put_float_array(buf, 52, attitude_q, 4);
|
||||
_mav_put_float_array(buf, 68, rates, 3);
|
||||
_mav_put_float_array(buf, 80, position_cov, 3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, buf, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#else
|
||||
mavlink_follow_target_t *packet = (mavlink_follow_target_t *)msgbuf;
|
||||
packet->timestamp = timestamp;
|
||||
packet->custom_state = custom_state;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->est_capabilities = est_capabilities;
|
||||
mav_array_memcpy(packet->vel, vel, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->acc, acc, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->attitude_q, attitude_q, sizeof(float)*4);
|
||||
mav_array_memcpy(packet->rates, rates, sizeof(float)*3);
|
||||
mav_array_memcpy(packet->position_cov, position_cov, sizeof(float)*3);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FOLLOW_TARGET, (const char *)packet, MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN, MAVLINK_MSG_ID_FOLLOW_TARGET_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE FOLLOW_TARGET UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field timestamp from follow_target message
|
||||
*
|
||||
* @return Timestamp in milliseconds since system boot
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_follow_target_get_timestamp(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field est_capabilities from follow_target message
|
||||
*
|
||||
* @return bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_follow_target_get_est_capabilities(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 92);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from follow_target message
|
||||
*
|
||||
* @return Latitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_follow_target_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from follow_target message
|
||||
*
|
||||
* @return Longitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_follow_target_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from follow_target message
|
||||
*
|
||||
* @return AMSL, in meters
|
||||
*/
|
||||
static inline float mavlink_msg_follow_target_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel from follow_target message
|
||||
*
|
||||
* @return target velocity (0,0,0) for unknown
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_vel(const mavlink_message_t* msg, float *vel)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, vel, 3, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field acc from follow_target message
|
||||
*
|
||||
* @return linear target acceleration (0,0,0) for unknown
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_acc(const mavlink_message_t* msg, float *acc)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, acc, 3, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field attitude_q from follow_target message
|
||||
*
|
||||
* @return (1 0 0 0 for unknown)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_attitude_q(const mavlink_message_t* msg, float *attitude_q)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, attitude_q, 4, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rates from follow_target message
|
||||
*
|
||||
* @return (0 0 0 for unknown)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_rates(const mavlink_message_t* msg, float *rates)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, rates, 3, 68);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field position_cov from follow_target message
|
||||
*
|
||||
* @return eph epv
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_follow_target_get_position_cov(const mavlink_message_t* msg, float *position_cov)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, position_cov, 3, 80);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field custom_state from follow_target message
|
||||
*
|
||||
* @return button states or switches of a tracker device
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_follow_target_get_custom_state(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a follow_target message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param follow_target C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_follow_target_decode(const mavlink_message_t* msg, mavlink_follow_target_t* follow_target)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
follow_target->timestamp = mavlink_msg_follow_target_get_timestamp(msg);
|
||||
follow_target->custom_state = mavlink_msg_follow_target_get_custom_state(msg);
|
||||
follow_target->lat = mavlink_msg_follow_target_get_lat(msg);
|
||||
follow_target->lon = mavlink_msg_follow_target_get_lon(msg);
|
||||
follow_target->alt = mavlink_msg_follow_target_get_alt(msg);
|
||||
mavlink_msg_follow_target_get_vel(msg, follow_target->vel);
|
||||
mavlink_msg_follow_target_get_acc(msg, follow_target->acc);
|
||||
mavlink_msg_follow_target_get_attitude_q(msg, follow_target->attitude_q);
|
||||
mavlink_msg_follow_target_get_rates(msg, follow_target->rates);
|
||||
mavlink_msg_follow_target_get_position_cov(msg, follow_target->position_cov);
|
||||
follow_target->est_capabilities = mavlink_msg_follow_target_get_est_capabilities(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_FOLLOW_TARGET_LEN? msg->len : MAVLINK_MSG_ID_FOLLOW_TARGET_LEN;
|
||||
memset(follow_target, 0, MAVLINK_MSG_ID_FOLLOW_TARGET_LEN);
|
||||
memcpy(follow_target, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-413
@@ -1,413 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GLOBAL_POSITION_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT 33
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_global_position_int_t {
|
||||
uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
|
||||
int32_t lat; /*< Latitude, expressed as degrees * 1E7*/
|
||||
int32_t lon; /*< Longitude, expressed as degrees * 1E7*/
|
||||
int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)*/
|
||||
int32_t relative_alt; /*< Altitude above ground in meters, expressed as * 1000 (millimeters)*/
|
||||
int16_t vx; /*< Ground X Speed (Latitude, positive north), expressed as m/s * 100*/
|
||||
int16_t vy; /*< Ground Y Speed (Longitude, positive east), expressed as m/s * 100*/
|
||||
int16_t vz; /*< Ground Z Speed (Altitude, positive down), expressed as m/s * 100*/
|
||||
uint16_t hdg; /*< Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
|
||||
}) mavlink_global_position_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN 28
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN 28
|
||||
#define MAVLINK_MSG_ID_33_LEN 28
|
||||
#define MAVLINK_MSG_ID_33_MIN_LEN 28
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC 104
|
||||
#define MAVLINK_MSG_ID_33_CRC 104
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \
|
||||
33, \
|
||||
"GLOBAL_POSITION_INT", \
|
||||
9, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_t, relative_alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_global_position_int_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_global_position_int_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_global_position_int_t, vz) }, \
|
||||
{ "hdg", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_global_position_int_t, hdg) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT { \
|
||||
"GLOBAL_POSITION_INT", \
|
||||
9, \
|
||||
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_global_position_int_t, time_boot_ms) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_global_position_int_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_t, relative_alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_global_position_int_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_global_position_int_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_INT16_T, 0, 24, offsetof(mavlink_global_position_int_t, vz) }, \
|
||||
{ "hdg", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_global_position_int_t, hdg) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a global_position_int 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 lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
|
||||
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
|
||||
* @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100
|
||||
* @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100
|
||||
* @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100
|
||||
* @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
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)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, alt);
|
||||
_mav_put_int32_t(buf, 16, relative_alt);
|
||||
_mav_put_int16_t(buf, 20, vx);
|
||||
_mav_put_int16_t(buf, 22, vy);
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
#else
|
||||
mavlink_global_position_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.hdg = hdg;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a global_position_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
|
||||
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
|
||||
* @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100
|
||||
* @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100
|
||||
* @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100
|
||||
* @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
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)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, alt);
|
||||
_mav_put_int32_t(buf, 16, relative_alt);
|
||||
_mav_put_int16_t(buf, 20, vx);
|
||||
_mav_put_int16_t(buf, 22, vy);
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
#else
|
||||
mavlink_global_position_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.hdg = hdg;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_position_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_position_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int)
|
||||
{
|
||||
return mavlink_msg_global_position_int_pack(system_id, component_id, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_position_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_position_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_t* global_position_int)
|
||||
{
|
||||
return mavlink_msg_global_position_int_pack_chan(system_id, component_id, chan, msg, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_position_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_boot_ms Timestamp (milliseconds since system boot)
|
||||
* @param lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param alt Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
|
||||
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
|
||||
* @param vx Ground X Speed (Latitude, positive north), expressed as m/s * 100
|
||||
* @param vy Ground Y Speed (Longitude, positive east), expressed as m/s * 100
|
||||
* @param vz Ground Z Speed (Altitude, positive down), expressed as m/s * 100
|
||||
* @param hdg Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline 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)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, alt);
|
||||
_mav_put_int32_t(buf, 16, relative_alt);
|
||||
_mav_put_int16_t(buf, 20, vx);
|
||||
_mav_put_int16_t(buf, 22, vy);
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#else
|
||||
mavlink_global_position_int_t packet;
|
||||
packet.time_boot_ms = time_boot_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.hdg = hdg;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_position_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_t* global_position_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_global_position_int_send(chan, global_position_int->time_boot_ms, global_position_int->lat, global_position_int->lon, global_position_int->alt, global_position_int->relative_alt, global_position_int->vx, global_position_int->vy, global_position_int->vz, global_position_int->hdg);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)global_position_int, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_send_buf(mavlink_message_t *msgbuf, 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)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
||||
_mav_put_int32_t(buf, 4, lat);
|
||||
_mav_put_int32_t(buf, 8, lon);
|
||||
_mav_put_int32_t(buf, 12, alt);
|
||||
_mav_put_int32_t(buf, 16, relative_alt);
|
||||
_mav_put_int16_t(buf, 20, vx);
|
||||
_mav_put_int16_t(buf, 22, vy);
|
||||
_mav_put_int16_t(buf, 24, vz);
|
||||
_mav_put_uint16_t(buf, 26, hdg);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#else
|
||||
mavlink_global_position_int_t *packet = (mavlink_global_position_int_t *)msgbuf;
|
||||
packet->time_boot_ms = time_boot_ms;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->relative_alt = relative_alt;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->hdg = hdg;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GLOBAL_POSITION_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_boot_ms from global_position_int message
|
||||
*
|
||||
* @return Timestamp (milliseconds since system boot)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from global_position_int message
|
||||
*
|
||||
* @return Latitude, expressed as degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from global_position_int message
|
||||
*
|
||||
* @return Longitude, expressed as degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from global_position_int message
|
||||
*
|
||||
* @return Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field relative_alt from global_position_int message
|
||||
*
|
||||
* @return Altitude above ground in meters, expressed as * 1000 (millimeters)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_get_relative_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from global_position_int message
|
||||
*
|
||||
* @return Ground X Speed (Latitude, positive north), expressed as m/s * 100
|
||||
*/
|
||||
static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from global_position_int message
|
||||
*
|
||||
* @return Ground Y Speed (Longitude, positive east), expressed as m/s * 100
|
||||
*/
|
||||
static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from global_position_int message
|
||||
*
|
||||
* @return Ground Z Speed (Altitude, positive down), expressed as m/s * 100
|
||||
*/
|
||||
static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hdg from global_position_int message
|
||||
*
|
||||
* @return Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_get_hdg(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a global_position_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param global_position_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_decode(const mavlink_message_t* msg, mavlink_global_position_int_t* global_position_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
global_position_int->time_boot_ms = mavlink_msg_global_position_int_get_time_boot_ms(msg);
|
||||
global_position_int->lat = mavlink_msg_global_position_int_get_lat(msg);
|
||||
global_position_int->lon = mavlink_msg_global_position_int_get_lon(msg);
|
||||
global_position_int->alt = mavlink_msg_global_position_int_get_alt(msg);
|
||||
global_position_int->relative_alt = mavlink_msg_global_position_int_get_relative_alt(msg);
|
||||
global_position_int->vx = mavlink_msg_global_position_int_get_vx(msg);
|
||||
global_position_int->vy = mavlink_msg_global_position_int_get_vy(msg);
|
||||
global_position_int->vz = mavlink_msg_global_position_int_get_vz(msg);
|
||||
global_position_int->hdg = mavlink_msg_global_position_int_get_hdg(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN;
|
||||
memset(global_position_int, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_LEN);
|
||||
memcpy(global_position_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-430
@@ -1,430 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GLOBAL_POSITION_INT_COV PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV 63
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_global_position_int_cov_t {
|
||||
uint64_t time_usec; /*< Timestamp (microseconds since system boot or since UNIX epoch)*/
|
||||
int32_t lat; /*< Latitude, expressed as degrees * 1E7*/
|
||||
int32_t lon; /*< Longitude, expressed as degrees * 1E7*/
|
||||
int32_t alt; /*< Altitude in meters, expressed as * 1000 (millimeters), above MSL*/
|
||||
int32_t relative_alt; /*< Altitude above ground in meters, expressed as * 1000 (millimeters)*/
|
||||
float vx; /*< Ground X Speed (Latitude), expressed as m/s*/
|
||||
float vy; /*< Ground Y Speed (Longitude), expressed as m/s*/
|
||||
float vz; /*< Ground Z Speed (Altitude), expressed as m/s*/
|
||||
float covariance[36]; /*< Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)*/
|
||||
uint8_t estimator_type; /*< Class id of the estimator this estimate originated from.*/
|
||||
}) mavlink_global_position_int_cov_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN 181
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN 181
|
||||
#define MAVLINK_MSG_ID_63_LEN 181
|
||||
#define MAVLINK_MSG_ID_63_MIN_LEN 181
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC 119
|
||||
#define MAVLINK_MSG_ID_63_CRC 119
|
||||
|
||||
#define MAVLINK_MSG_GLOBAL_POSITION_INT_COV_FIELD_COVARIANCE_LEN 36
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV { \
|
||||
63, \
|
||||
"GLOBAL_POSITION_INT_COV", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_usec) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_int_cov_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) }, \
|
||||
{ "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV { \
|
||||
"GLOBAL_POSITION_INT_COV", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_int_cov_t, time_usec) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_global_position_int_cov_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_global_position_int_cov_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_global_position_int_cov_t, alt) }, \
|
||||
{ "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_global_position_int_cov_t, relative_alt) }, \
|
||||
{ "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_int_cov_t, vx) }, \
|
||||
{ "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_int_cov_t, vy) }, \
|
||||
{ "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_global_position_int_cov_t, vz) }, \
|
||||
{ "covariance", NULL, MAVLINK_TYPE_FLOAT, 36, 36, offsetof(mavlink_global_position_int_cov_t, covariance) }, \
|
||||
{ "estimator_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 180, offsetof(mavlink_global_position_int_cov_t, estimator_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a global_position_int_cov 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 since system boot or since UNIX epoch)
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
|
||||
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
|
||||
* @param vx Ground X Speed (Latitude), expressed as m/s
|
||||
* @param vy Ground Y Speed (Longitude), expressed as m/s
|
||||
* @param vz Ground Z Speed (Altitude), expressed as m/s
|
||||
* @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_int32_t(buf, 20, relative_alt);
|
||||
_mav_put_float(buf, 24, vx);
|
||||
_mav_put_float(buf, 28, vy);
|
||||
_mav_put_float(buf, 32, vz);
|
||||
_mav_put_uint8_t(buf, 180, estimator_type);
|
||||
_mav_put_float_array(buf, 36, covariance, 36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
#else
|
||||
mavlink_global_position_int_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a global_position_int_cov message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (microseconds since system boot or since UNIX epoch)
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
|
||||
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
|
||||
* @param vx Ground X Speed (Latitude), expressed as m/s
|
||||
* @param vy Ground Y Speed (Longitude), expressed as m/s
|
||||
* @param vz Ground Z Speed (Altitude), expressed as m/s
|
||||
* @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t estimator_type,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,float vx,float vy,float vz,const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_int32_t(buf, 20, relative_alt);
|
||||
_mav_put_float(buf, 24, vx);
|
||||
_mav_put_float(buf, 28, vy);
|
||||
_mav_put_float(buf, 32, vz);
|
||||
_mav_put_uint8_t(buf, 180, estimator_type);
|
||||
_mav_put_float_array(buf, 36, covariance, 36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
#else
|
||||
mavlink_global_position_int_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_position_int_cov struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_position_int_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
|
||||
{
|
||||
return mavlink_msg_global_position_int_cov_pack(system_id, component_id, msg, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_position_int_cov struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_position_int_cov C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_position_int_cov_t* global_position_int_cov)
|
||||
{
|
||||
return mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, chan, msg, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_position_int_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (microseconds since system boot or since UNIX epoch)
|
||||
* @param estimator_type Class id of the estimator this estimate originated from.
|
||||
* @param lat Latitude, expressed as degrees * 1E7
|
||||
* @param lon Longitude, expressed as degrees * 1E7
|
||||
* @param alt Altitude in meters, expressed as * 1000 (millimeters), above MSL
|
||||
* @param relative_alt Altitude above ground in meters, expressed as * 1000 (millimeters)
|
||||
* @param vx Ground X Speed (Latitude), expressed as m/s
|
||||
* @param vy Ground Y Speed (Longitude), expressed as m/s
|
||||
* @param vz Ground Z Speed (Altitude), expressed as m/s
|
||||
* @param covariance Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_global_position_int_cov_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_int32_t(buf, 20, relative_alt);
|
||||
_mav_put_float(buf, 24, vx);
|
||||
_mav_put_float(buf, 28, vy);
|
||||
_mav_put_float(buf, 32, vz);
|
||||
_mav_put_uint8_t(buf, 180, estimator_type);
|
||||
_mav_put_float_array(buf, 36, covariance, 36);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#else
|
||||
mavlink_global_position_int_cov_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.relative_alt = relative_alt;
|
||||
packet.vx = vx;
|
||||
packet.vy = vy;
|
||||
packet.vz = vz;
|
||||
packet.estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet.covariance, covariance, sizeof(float)*36);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_position_int_cov message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_cov_send_struct(mavlink_channel_t chan, const mavlink_global_position_int_cov_t* global_position_int_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_global_position_int_cov_send(chan, global_position_int_cov->time_usec, global_position_int_cov->estimator_type, global_position_int_cov->lat, global_position_int_cov->lon, global_position_int_cov->alt, global_position_int_cov->relative_alt, global_position_int_cov->vx, global_position_int_cov->vy, global_position_int_cov->vz, global_position_int_cov->covariance);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)global_position_int_cov, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t estimator_type, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, float vx, float vy, float vz, const float *covariance)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_int32_t(buf, 20, relative_alt);
|
||||
_mav_put_float(buf, 24, vx);
|
||||
_mav_put_float(buf, 28, vy);
|
||||
_mav_put_float(buf, 32, vz);
|
||||
_mav_put_uint8_t(buf, 180, estimator_type);
|
||||
_mav_put_float_array(buf, 36, covariance, 36);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, buf, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#else
|
||||
mavlink_global_position_int_cov_t *packet = (mavlink_global_position_int_cov_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->relative_alt = relative_alt;
|
||||
packet->vx = vx;
|
||||
packet->vy = vy;
|
||||
packet->vz = vz;
|
||||
packet->estimator_type = estimator_type;
|
||||
mav_array_memcpy(packet->covariance, covariance, sizeof(float)*36);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GLOBAL_POSITION_INT_COV UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from global_position_int_cov message
|
||||
*
|
||||
* @return Timestamp (microseconds since system boot or since UNIX epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_global_position_int_cov_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field estimator_type from global_position_int_cov message
|
||||
*
|
||||
* @return Class id of the estimator this estimate originated from.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_global_position_int_cov_get_estimator_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 180);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from global_position_int_cov message
|
||||
*
|
||||
* @return Latitude, expressed as degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_cov_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from global_position_int_cov message
|
||||
*
|
||||
* @return Longitude, expressed as degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_cov_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from global_position_int_cov message
|
||||
*
|
||||
* @return Altitude in meters, expressed as * 1000 (millimeters), above MSL
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_cov_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field relative_alt from global_position_int_cov message
|
||||
*
|
||||
* @return Altitude above ground in meters, expressed as * 1000 (millimeters)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_global_position_int_cov_get_relative_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vx from global_position_int_cov message
|
||||
*
|
||||
* @return Ground X Speed (Latitude), expressed as m/s
|
||||
*/
|
||||
static inline float mavlink_msg_global_position_int_cov_get_vx(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vy from global_position_int_cov message
|
||||
*
|
||||
* @return Ground Y Speed (Longitude), expressed as m/s
|
||||
*/
|
||||
static inline float mavlink_msg_global_position_int_cov_get_vy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vz from global_position_int_cov message
|
||||
*
|
||||
* @return Ground Z Speed (Altitude), expressed as m/s
|
||||
*/
|
||||
static inline float mavlink_msg_global_position_int_cov_get_vz(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field covariance from global_position_int_cov message
|
||||
*
|
||||
* @return Covariance matrix (first six entries are the first ROW, next six entries are the second row, etc.)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_position_int_cov_get_covariance(const mavlink_message_t* msg, float *covariance)
|
||||
{
|
||||
return _MAV_RETURN_float_array(msg, covariance, 36, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a global_position_int_cov message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param global_position_int_cov C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_global_position_int_cov_decode(const mavlink_message_t* msg, mavlink_global_position_int_cov_t* global_position_int_cov)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
global_position_int_cov->time_usec = mavlink_msg_global_position_int_cov_get_time_usec(msg);
|
||||
global_position_int_cov->lat = mavlink_msg_global_position_int_cov_get_lat(msg);
|
||||
global_position_int_cov->lon = mavlink_msg_global_position_int_cov_get_lon(msg);
|
||||
global_position_int_cov->alt = mavlink_msg_global_position_int_cov_get_alt(msg);
|
||||
global_position_int_cov->relative_alt = mavlink_msg_global_position_int_cov_get_relative_alt(msg);
|
||||
global_position_int_cov->vx = mavlink_msg_global_position_int_cov_get_vx(msg);
|
||||
global_position_int_cov->vy = mavlink_msg_global_position_int_cov_get_vy(msg);
|
||||
global_position_int_cov->vz = mavlink_msg_global_position_int_cov_get_vz(msg);
|
||||
mavlink_msg_global_position_int_cov_get_covariance(msg, global_position_int_cov->covariance);
|
||||
global_position_int_cov->estimator_type = mavlink_msg_global_position_int_cov_get_estimator_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN;
|
||||
memset(global_position_int_cov, 0, MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_LEN);
|
||||
memcpy(global_position_int_cov, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Vendored
-363
@@ -1,363 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GLOBAL_VISION_POSITION_ESTIMATE PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE 101
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_global_vision_position_estimate_t {
|
||||
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*/
|
||||
float roll; /*< Roll angle in rad*/
|
||||
float pitch; /*< Pitch angle in rad*/
|
||||
float yaw; /*< Yaw angle in rad*/
|
||||
}) mavlink_global_vision_position_estimate_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN 32
|
||||
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN 32
|
||||
#define MAVLINK_MSG_ID_101_LEN 32
|
||||
#define MAVLINK_MSG_ID_101_MIN_LEN 32
|
||||
|
||||
#define MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC 102
|
||||
#define MAVLINK_MSG_ID_101_CRC 102
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
|
||||
101, \
|
||||
"GLOBAL_VISION_POSITION_ESTIMATE", \
|
||||
7, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE { \
|
||||
"GLOBAL_VISION_POSITION_ESTIMATE", \
|
||||
7, \
|
||||
{ { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_vision_position_estimate_t, usec) }, \
|
||||
{ "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_vision_position_estimate_t, x) }, \
|
||||
{ "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_vision_position_estimate_t, y) }, \
|
||||
{ "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_vision_position_estimate_t, z) }, \
|
||||
{ "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_vision_position_estimate_t, roll) }, \
|
||||
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_vision_position_estimate_t, pitch) }, \
|
||||
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_vision_position_estimate_t, yaw) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a global_vision_position_estimate 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 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
|
||||
* @param roll Roll angle in rad
|
||||
* @param pitch Pitch angle in rad
|
||||
* @param yaw Yaw angle in rad
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t packet;
|
||||
packet.usec = usec;
|
||||
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, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a global_vision_position_estimate message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param 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
|
||||
* @param roll Roll angle in rad
|
||||
* @param pitch Pitch angle in rad
|
||||
* @param yaw Yaw angle in rad
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t usec,float x,float y,float z,float roll,float pitch,float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t packet;
|
||||
packet.usec = usec;
|
||||
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, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_vision_position_estimate struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_vision_position_estimate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
|
||||
{
|
||||
return mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a global_vision_position_estimate struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param global_vision_position_estimate C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_global_vision_position_estimate_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
|
||||
{
|
||||
return mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, chan, msg, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_vision_position_estimate message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @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
|
||||
* @param roll Roll angle in rad
|
||||
* @param pitch Pitch angle in rad
|
||||
* @param yaw Yaw angle in rad
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN];
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t packet;
|
||||
packet.usec = usec;
|
||||
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_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)&packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a global_vision_position_estimate message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_global_vision_position_estimate_send_struct(mavlink_channel_t chan, const mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_global_vision_position_estimate_send(chan, global_vision_position_estimate->usec, global_vision_position_estimate->x, global_vision_position_estimate->y, global_vision_position_estimate->z, global_vision_position_estimate->roll, global_vision_position_estimate->pitch, global_vision_position_estimate->yaw);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)global_vision_position_estimate, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_global_vision_position_estimate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, usec);
|
||||
_mav_put_float(buf, 8, x);
|
||||
_mav_put_float(buf, 12, y);
|
||||
_mav_put_float(buf, 16, z);
|
||||
_mav_put_float(buf, 20, roll);
|
||||
_mav_put_float(buf, 24, pitch);
|
||||
_mav_put_float(buf, 28, yaw);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE, buf, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#else
|
||||
mavlink_global_vision_position_estimate_t *packet = (mavlink_global_vision_position_estimate_t *)msgbuf;
|
||||
packet->usec = usec;
|
||||
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_GLOBAL_VISION_POSITION_ESTIMATE, (const char *)packet, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GLOBAL_VISION_POSITION_ESTIMATE UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field usec from global_vision_position_estimate message
|
||||
*
|
||||
* @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)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field x from global_vision_position_estimate message
|
||||
*
|
||||
* @return Global X position
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_x(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field y from global_vision_position_estimate message
|
||||
*
|
||||
* @return Global Y position
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_y(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field z from global_vision_position_estimate message
|
||||
*
|
||||
* @return Global Z position
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_z(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field roll from global_vision_position_estimate message
|
||||
*
|
||||
* @return Roll angle in rad
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_roll(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pitch from global_vision_position_estimate message
|
||||
*
|
||||
* @return Pitch angle in rad
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_pitch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field yaw from global_vision_position_estimate message
|
||||
*
|
||||
* @return Yaw angle in rad
|
||||
*/
|
||||
static inline float mavlink_msg_global_vision_position_estimate_get_yaw(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a global_vision_position_estimate message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param global_vision_position_estimate C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_global_vision_position_estimate_decode(const mavlink_message_t* msg, mavlink_global_vision_position_estimate_t* global_vision_position_estimate)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
global_vision_position_estimate->usec = mavlink_msg_global_vision_position_estimate_get_usec(msg);
|
||||
global_vision_position_estimate->x = mavlink_msg_global_vision_position_estimate_get_x(msg);
|
||||
global_vision_position_estimate->y = mavlink_msg_global_vision_position_estimate_get_y(msg);
|
||||
global_vision_position_estimate->z = mavlink_msg_global_vision_position_estimate_get_z(msg);
|
||||
global_vision_position_estimate->roll = mavlink_msg_global_vision_position_estimate_get_roll(msg);
|
||||
global_vision_position_estimate->pitch = mavlink_msg_global_vision_position_estimate_get_pitch(msg);
|
||||
global_vision_position_estimate->yaw = mavlink_msg_global_vision_position_estimate_get_yaw(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN? msg->len : MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN;
|
||||
memset(global_vision_position_estimate, 0, MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_LEN);
|
||||
memcpy(global_vision_position_estimate, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -1,488 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS2_RAW PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RAW 124
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps2_raw_t {
|
||||
uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
|
||||
int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
|
||||
int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
|
||||
int32_t alt; /*< Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)*/
|
||||
uint32_t dgps_age; /*< Age of DGPS info*/
|
||||
uint16_t eph; /*< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX*/
|
||||
uint16_t epv; /*< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX*/
|
||||
uint16_t vel; /*< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX*/
|
||||
uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
|
||||
uint8_t fix_type; /*< See the GPS_FIX_TYPE enum.*/
|
||||
uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
|
||||
uint8_t dgps_numch; /*< Number of DGPS satellites*/
|
||||
}) mavlink_gps2_raw_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RAW_LEN 35
|
||||
#define MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN 35
|
||||
#define MAVLINK_MSG_ID_124_LEN 35
|
||||
#define MAVLINK_MSG_ID_124_MIN_LEN 35
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RAW_CRC 87
|
||||
#define MAVLINK_MSG_ID_124_CRC 87
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
|
||||
124, \
|
||||
"GPS2_RAW", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \
|
||||
{ "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
|
||||
{ "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
|
||||
"GPS2_RAW", \
|
||||
12, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \
|
||||
{ "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
|
||||
{ "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps2_raw 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 since UNIX epoch or microseconds since system boot)
|
||||
* @param fix_type See the GPS_FIX_TYPE enum.
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
|
||||
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param dgps_numch Number of DGPS satellites
|
||||
* @param dgps_age Age of DGPS info
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint32_t(buf, 20, dgps_age);
|
||||
_mav_put_uint16_t(buf, 24, eph);
|
||||
_mav_put_uint16_t(buf, 26, epv);
|
||||
_mav_put_uint16_t(buf, 28, vel);
|
||||
_mav_put_uint16_t(buf, 30, cog);
|
||||
_mav_put_uint8_t(buf, 32, fix_type);
|
||||
_mav_put_uint8_t(buf, 33, satellites_visible);
|
||||
_mav_put_uint8_t(buf, 34, dgps_numch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
#else
|
||||
mavlink_gps2_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.dgps_age = dgps_age;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.dgps_numch = dgps_numch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS2_RAW;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps2_raw message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
* @param fix_type See the GPS_FIX_TYPE enum.
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
|
||||
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param dgps_numch Number of DGPS satellites
|
||||
* @param dgps_age Age of DGPS info
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,uint8_t dgps_numch,uint32_t dgps_age)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint32_t(buf, 20, dgps_age);
|
||||
_mav_put_uint16_t(buf, 24, eph);
|
||||
_mav_put_uint16_t(buf, 26, epv);
|
||||
_mav_put_uint16_t(buf, 28, vel);
|
||||
_mav_put_uint16_t(buf, 30, cog);
|
||||
_mav_put_uint8_t(buf, 32, fix_type);
|
||||
_mav_put_uint8_t(buf, 33, satellites_visible);
|
||||
_mav_put_uint8_t(buf, 34, dgps_numch);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
#else
|
||||
mavlink_gps2_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.dgps_age = dgps_age;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.dgps_numch = dgps_numch;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS2_RAW;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps2_raw struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps2_raw C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
|
||||
{
|
||||
return mavlink_msg_gps2_raw_pack(system_id, component_id, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps2_raw struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps2_raw C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
|
||||
{
|
||||
return mavlink_msg_gps2_raw_pack_chan(system_id, component_id, chan, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps2_raw message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
* @param fix_type See the GPS_FIX_TYPE enum.
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
|
||||
* @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @param dgps_numch Number of DGPS satellites
|
||||
* @param dgps_age Age of DGPS info
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint32_t(buf, 20, dgps_age);
|
||||
_mav_put_uint16_t(buf, 24, eph);
|
||||
_mav_put_uint16_t(buf, 26, epv);
|
||||
_mav_put_uint16_t(buf, 28, vel);
|
||||
_mav_put_uint16_t(buf, 30, cog);
|
||||
_mav_put_uint8_t(buf, 32, fix_type);
|
||||
_mav_put_uint8_t(buf, 33, satellites_visible);
|
||||
_mav_put_uint8_t(buf, 34, dgps_numch);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#else
|
||||
mavlink_gps2_raw_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.dgps_age = dgps_age;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
packet.dgps_numch = dgps_numch;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps2_raw message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_raw_send_struct(mavlink_channel_t chan, const mavlink_gps2_raw_t* gps2_raw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps2_raw_send(chan, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)gps2_raw, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS2_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint32_t(buf, 20, dgps_age);
|
||||
_mav_put_uint16_t(buf, 24, eph);
|
||||
_mav_put_uint16_t(buf, 26, epv);
|
||||
_mav_put_uint16_t(buf, 28, vel);
|
||||
_mav_put_uint16_t(buf, 30, cog);
|
||||
_mav_put_uint8_t(buf, 32, fix_type);
|
||||
_mav_put_uint8_t(buf, 33, satellites_visible);
|
||||
_mav_put_uint8_t(buf, 34, dgps_numch);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#else
|
||||
mavlink_gps2_raw_t *packet = (mavlink_gps2_raw_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->dgps_age = dgps_age;
|
||||
packet->eph = eph;
|
||||
packet->epv = epv;
|
||||
packet->vel = vel;
|
||||
packet->cog = cog;
|
||||
packet->fix_type = fix_type;
|
||||
packet->satellites_visible = satellites_visible;
|
||||
packet->dgps_numch = dgps_numch;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS2_RAW UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from gps2_raw message
|
||||
*
|
||||
* @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fix_type from gps2_raw message
|
||||
*
|
||||
* @return See the GPS_FIX_TYPE enum.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_raw_get_fix_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from gps2_raw message
|
||||
*
|
||||
* @return Latitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_raw_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from gps2_raw message
|
||||
*
|
||||
* @return Longitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from gps2_raw message
|
||||
*
|
||||
* @return Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field eph from gps2_raw message
|
||||
*
|
||||
* @return GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_get_eph(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field epv from gps2_raw message
|
||||
*
|
||||
* @return GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_get_epv(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel from gps2_raw message
|
||||
*
|
||||
* @return GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_get_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cog from gps2_raw message
|
||||
*
|
||||
* @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_raw_get_cog(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellites_visible from gps2_raw message
|
||||
*
|
||||
* @return Number of satellites visible. If unknown, set to 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_raw_get_satellites_visible(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field dgps_numch from gps2_raw message
|
||||
*
|
||||
* @return Number of DGPS satellites
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_raw_get_dgps_numch(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field dgps_age from gps2_raw message
|
||||
*
|
||||
* @return Age of DGPS info
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps2_raw_get_dgps_age(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps2_raw message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps2_raw C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_raw_decode(const mavlink_message_t* msg, mavlink_gps2_raw_t* gps2_raw)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps2_raw->time_usec = mavlink_msg_gps2_raw_get_time_usec(msg);
|
||||
gps2_raw->lat = mavlink_msg_gps2_raw_get_lat(msg);
|
||||
gps2_raw->lon = mavlink_msg_gps2_raw_get_lon(msg);
|
||||
gps2_raw->alt = mavlink_msg_gps2_raw_get_alt(msg);
|
||||
gps2_raw->dgps_age = mavlink_msg_gps2_raw_get_dgps_age(msg);
|
||||
gps2_raw->eph = mavlink_msg_gps2_raw_get_eph(msg);
|
||||
gps2_raw->epv = mavlink_msg_gps2_raw_get_epv(msg);
|
||||
gps2_raw->vel = mavlink_msg_gps2_raw_get_vel(msg);
|
||||
gps2_raw->cog = mavlink_msg_gps2_raw_get_cog(msg);
|
||||
gps2_raw->fix_type = mavlink_msg_gps2_raw_get_fix_type(msg);
|
||||
gps2_raw->satellites_visible = mavlink_msg_gps2_raw_get_satellites_visible(msg);
|
||||
gps2_raw->dgps_numch = mavlink_msg_gps2_raw_get_dgps_numch(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RAW_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RAW_LEN;
|
||||
memset(gps2_raw, 0, MAVLINK_MSG_ID_GPS2_RAW_LEN);
|
||||
memcpy(gps2_raw, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -1,513 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS2_RTK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RTK 128
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps2_rtk_t {
|
||||
uint32_t time_last_baseline_ms; /*< Time since boot of last baseline message received in ms.*/
|
||||
uint32_t tow; /*< GPS Time of Week of last baseline*/
|
||||
int32_t baseline_a_mm; /*< Current baseline in ECEF x or NED north component in mm.*/
|
||||
int32_t baseline_b_mm; /*< Current baseline in ECEF y or NED east component in mm.*/
|
||||
int32_t baseline_c_mm; /*< Current baseline in ECEF z or NED down component in mm.*/
|
||||
uint32_t accuracy; /*< Current estimate of baseline accuracy.*/
|
||||
int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/
|
||||
uint16_t wn; /*< GPS Week Number of last baseline*/
|
||||
uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/
|
||||
uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/
|
||||
uint8_t rtk_rate; /*< Rate of baseline messages being received by GPS, in HZ*/
|
||||
uint8_t nsats; /*< Current number of sats used for RTK calculation.*/
|
||||
uint8_t baseline_coords_type; /*< Coordinate system of baseline. 0 == ECEF, 1 == NED*/
|
||||
}) mavlink_gps2_rtk_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RTK_LEN 35
|
||||
#define MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN 35
|
||||
#define MAVLINK_MSG_ID_128_LEN 35
|
||||
#define MAVLINK_MSG_ID_128_MIN_LEN 35
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS2_RTK_CRC 226
|
||||
#define MAVLINK_MSG_ID_128_CRC 226
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS2_RTK { \
|
||||
128, \
|
||||
"GPS2_RTK", \
|
||||
13, \
|
||||
{ { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \
|
||||
{ "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \
|
||||
{ "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \
|
||||
{ "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \
|
||||
{ "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \
|
||||
{ "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \
|
||||
{ "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \
|
||||
{ "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \
|
||||
{ "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \
|
||||
{ "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \
|
||||
{ "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \
|
||||
{ "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \
|
||||
{ "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS2_RTK { \
|
||||
"GPS2_RTK", \
|
||||
13, \
|
||||
{ { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps2_rtk_t, time_last_baseline_ms) }, \
|
||||
{ "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps2_rtk_t, tow) }, \
|
||||
{ "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_rtk_t, baseline_a_mm) }, \
|
||||
{ "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_rtk_t, baseline_b_mm) }, \
|
||||
{ "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_rtk_t, baseline_c_mm) }, \
|
||||
{ "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_rtk_t, accuracy) }, \
|
||||
{ "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps2_rtk_t, iar_num_hypotheses) }, \
|
||||
{ "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_rtk_t, wn) }, \
|
||||
{ "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps2_rtk_t, rtk_receiver_id) }, \
|
||||
{ "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps2_rtk_t, rtk_health) }, \
|
||||
{ "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_rtk_t, rtk_rate) }, \
|
||||
{ "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_rtk_t, nsats) }, \
|
||||
{ "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_rtk_t, baseline_coords_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps2_rtk 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_last_baseline_ms Time since boot of last baseline message received in ms.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate Rate of baseline messages being received by GPS, in HZ
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
|
||||
* @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
|
||||
* @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
|
||||
* @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
#else
|
||||
mavlink_gps2_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS2_RTK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps2_rtk message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_last_baseline_ms Time since boot of last baseline message received in ms.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate Rate of baseline messages being received by GPS, in HZ
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
|
||||
* @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
|
||||
* @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
|
||||
* @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
#else
|
||||
mavlink_gps2_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS2_RTK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps2_rtk struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps2_rtk C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_rtk_t* gps2_rtk)
|
||||
{
|
||||
return mavlink_msg_gps2_rtk_pack(system_id, component_id, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps2_rtk struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps2_rtk C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_rtk_t* gps2_rtk)
|
||||
{
|
||||
return mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, chan, msg, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps2_rtk message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_last_baseline_ms Time since boot of last baseline message received in ms.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate Rate of baseline messages being received by GPS, in HZ
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
|
||||
* @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
|
||||
* @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
|
||||
* @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps2_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS2_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#else
|
||||
mavlink_gps2_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps2_rtk message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_rtk_send_struct(mavlink_channel_t chan, const mavlink_gps2_rtk_t* gps2_rtk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps2_rtk_send(chan, gps2_rtk->time_last_baseline_ms, gps2_rtk->rtk_receiver_id, gps2_rtk->wn, gps2_rtk->tow, gps2_rtk->rtk_health, gps2_rtk->rtk_rate, gps2_rtk->nsats, gps2_rtk->baseline_coords_type, gps2_rtk->baseline_a_mm, gps2_rtk->baseline_b_mm, gps2_rtk->baseline_c_mm, gps2_rtk->accuracy, gps2_rtk->iar_num_hypotheses);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)gps2_rtk, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS2_RTK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, buf, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#else
|
||||
mavlink_gps2_rtk_t *packet = (mavlink_gps2_rtk_t *)msgbuf;
|
||||
packet->time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet->tow = tow;
|
||||
packet->baseline_a_mm = baseline_a_mm;
|
||||
packet->baseline_b_mm = baseline_b_mm;
|
||||
packet->baseline_c_mm = baseline_c_mm;
|
||||
packet->accuracy = accuracy;
|
||||
packet->iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet->wn = wn;
|
||||
packet->rtk_receiver_id = rtk_receiver_id;
|
||||
packet->rtk_health = rtk_health;
|
||||
packet->rtk_rate = rtk_rate;
|
||||
packet->nsats = nsats;
|
||||
packet->baseline_coords_type = baseline_coords_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS2_RTK_LEN, MAVLINK_MSG_ID_GPS2_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS2_RTK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_last_baseline_ms from gps2_rtk message
|
||||
*
|
||||
* @return Time since boot of last baseline message received in ms.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps2_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_receiver_id from gps2_rtk message
|
||||
*
|
||||
* @return Identification of connected RTK receiver.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_receiver_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wn from gps2_rtk message
|
||||
*
|
||||
* @return GPS Week Number of last baseline
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps2_rtk_get_wn(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tow from gps2_rtk message
|
||||
*
|
||||
* @return GPS Time of Week of last baseline
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps2_rtk_get_tow(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_health from gps2_rtk message
|
||||
*
|
||||
* @return GPS-specific health report for RTK data.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_health(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_rate from gps2_rtk message
|
||||
*
|
||||
* @return Rate of baseline messages being received by GPS, in HZ
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_rtk_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field nsats from gps2_rtk message
|
||||
*
|
||||
* @return Current number of sats used for RTK calculation.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_nsats(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_coords_type from gps2_rtk message
|
||||
*
|
||||
* @return Coordinate system of baseline. 0 == ECEF, 1 == NED
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps2_rtk_get_baseline_coords_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_a_mm from gps2_rtk message
|
||||
*
|
||||
* @return Current baseline in ECEF x or NED north component in mm.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_rtk_get_baseline_a_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_b_mm from gps2_rtk message
|
||||
*
|
||||
* @return Current baseline in ECEF y or NED east component in mm.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_rtk_get_baseline_b_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_c_mm from gps2_rtk message
|
||||
*
|
||||
* @return Current baseline in ECEF z or NED down component in mm.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_rtk_get_baseline_c_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accuracy from gps2_rtk message
|
||||
*
|
||||
* @return Current estimate of baseline accuracy.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps2_rtk_get_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field iar_num_hypotheses from gps2_rtk message
|
||||
*
|
||||
* @return Current number of integer ambiguity hypotheses.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps2_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps2_rtk message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps2_rtk C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps2_rtk_decode(const mavlink_message_t* msg, mavlink_gps2_rtk_t* gps2_rtk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps2_rtk->time_last_baseline_ms = mavlink_msg_gps2_rtk_get_time_last_baseline_ms(msg);
|
||||
gps2_rtk->tow = mavlink_msg_gps2_rtk_get_tow(msg);
|
||||
gps2_rtk->baseline_a_mm = mavlink_msg_gps2_rtk_get_baseline_a_mm(msg);
|
||||
gps2_rtk->baseline_b_mm = mavlink_msg_gps2_rtk_get_baseline_b_mm(msg);
|
||||
gps2_rtk->baseline_c_mm = mavlink_msg_gps2_rtk_get_baseline_c_mm(msg);
|
||||
gps2_rtk->accuracy = mavlink_msg_gps2_rtk_get_accuracy(msg);
|
||||
gps2_rtk->iar_num_hypotheses = mavlink_msg_gps2_rtk_get_iar_num_hypotheses(msg);
|
||||
gps2_rtk->wn = mavlink_msg_gps2_rtk_get_wn(msg);
|
||||
gps2_rtk->rtk_receiver_id = mavlink_msg_gps2_rtk_get_rtk_receiver_id(msg);
|
||||
gps2_rtk->rtk_health = mavlink_msg_gps2_rtk_get_rtk_health(msg);
|
||||
gps2_rtk->rtk_rate = mavlink_msg_gps2_rtk_get_rtk_rate(msg);
|
||||
gps2_rtk->nsats = mavlink_msg_gps2_rtk_get_nsats(msg);
|
||||
gps2_rtk->baseline_coords_type = mavlink_msg_gps2_rtk_get_baseline_coords_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS2_RTK_LEN? msg->len : MAVLINK_MSG_ID_GPS2_RTK_LEN;
|
||||
memset(gps2_rtk, 0, MAVLINK_MSG_ID_GPS2_RTK_LEN);
|
||||
memcpy(gps2_rtk, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-263
@@ -1,263 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_GLOBAL_ORIGIN PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN 49
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_global_origin_t {
|
||||
int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/
|
||||
int32_t longitude; /*< Longitude (WGS84), in degrees * 1E7*/
|
||||
int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/
|
||||
}) mavlink_gps_global_origin_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN 12
|
||||
#define MAVLINK_MSG_ID_49_LEN 12
|
||||
#define MAVLINK_MSG_ID_49_MIN_LEN 12
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC 39
|
||||
#define MAVLINK_MSG_ID_49_CRC 39
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \
|
||||
49, \
|
||||
"GPS_GLOBAL_ORIGIN", \
|
||||
3, \
|
||||
{ { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \
|
||||
"GPS_GLOBAL_ORIGIN", \
|
||||
3, \
|
||||
{ { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \
|
||||
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \
|
||||
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_global_origin 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 latitude Latitude (WGS84), in degrees * 1E7
|
||||
* @param longitude Longitude (WGS84), in degrees * 1E7
|
||||
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t latitude, int32_t longitude, int32_t altitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
#else
|
||||
mavlink_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_global_origin message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param latitude Latitude (WGS84), in degrees * 1E7
|
||||
* @param longitude Longitude (WGS84), in degrees * 1E7
|
||||
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int32_t latitude,int32_t longitude,int32_t altitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
#else
|
||||
mavlink_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_global_origin struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_global_origin C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin)
|
||||
{
|
||||
return mavlink_msg_gps_global_origin_pack(system_id, component_id, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_global_origin struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_global_origin C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_global_origin_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin)
|
||||
{
|
||||
return mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, chan, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_global_origin message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param latitude Latitude (WGS84), in degrees * 1E7
|
||||
* @param longitude Longitude (WGS84), in degrees * 1E7
|
||||
* @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_global_origin_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN];
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#else
|
||||
mavlink_gps_global_origin_t packet;
|
||||
packet.latitude = latitude;
|
||||
packet.longitude = longitude;
|
||||
packet.altitude = altitude;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_global_origin message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_global_origin_send_struct(mavlink_channel_t chan, const mavlink_gps_global_origin_t* gps_global_origin)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_global_origin_send(chan, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)gps_global_origin, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_global_origin_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, latitude);
|
||||
_mav_put_int32_t(buf, 4, longitude);
|
||||
_mav_put_int32_t(buf, 8, altitude);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#else
|
||||
mavlink_gps_global_origin_t *packet = (mavlink_gps_global_origin_t *)msgbuf;
|
||||
packet->latitude = latitude;
|
||||
packet->longitude = longitude;
|
||||
packet->altitude = altitude;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)packet, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_GLOBAL_ORIGIN UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field latitude from gps_global_origin message
|
||||
*
|
||||
* @return Latitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field longitude from gps_global_origin message
|
||||
*
|
||||
* @return Longitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field altitude from gps_global_origin message
|
||||
*
|
||||
* @return Altitude (AMSL), in meters * 1000 (positive for up)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_global_origin message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_global_origin C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_global_origin_decode(const mavlink_message_t* msg, mavlink_gps_global_origin_t* gps_global_origin)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_global_origin->latitude = mavlink_msg_gps_global_origin_get_latitude(msg);
|
||||
gps_global_origin->longitude = mavlink_msg_gps_global_origin_get_longitude(msg);
|
||||
gps_global_origin->altitude = mavlink_msg_gps_global_origin_get_altitude(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN? msg->len : MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN;
|
||||
memset(gps_global_origin, 0, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN);
|
||||
memcpy(gps_global_origin, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-280
@@ -1,280 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_INJECT_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INJECT_DATA 123
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_inject_data_t {
|
||||
uint8_t target_system; /*< System ID*/
|
||||
uint8_t target_component; /*< Component ID*/
|
||||
uint8_t len; /*< data length*/
|
||||
uint8_t data[110]; /*< raw data (110 is enough for 12 satellites of RTCMv2)*/
|
||||
}) mavlink_gps_inject_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN 113
|
||||
#define MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN 113
|
||||
#define MAVLINK_MSG_ID_123_LEN 113
|
||||
#define MAVLINK_MSG_ID_123_MIN_LEN 113
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC 250
|
||||
#define MAVLINK_MSG_ID_123_CRC 250
|
||||
|
||||
#define MAVLINK_MSG_GPS_INJECT_DATA_FIELD_DATA_LEN 110
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA { \
|
||||
123, \
|
||||
"GPS_INJECT_DATA", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_inject_data_t, target_component) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_inject_data_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 110, 3, offsetof(mavlink_gps_inject_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA { \
|
||||
"GPS_INJECT_DATA", \
|
||||
4, \
|
||||
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_inject_data_t, target_system) }, \
|
||||
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_inject_data_t, target_component) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_inject_data_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 110, 3, offsetof(mavlink_gps_inject_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_inject_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param len data length
|
||||
* @param data raw data (110 is enough for 12 satellites of RTCMv2)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, len);
|
||||
_mav_put_uint8_t_array(buf, 3, data, 110);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
#else
|
||||
mavlink_gps_inject_data_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_inject_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param len data length
|
||||
* @param data raw data (110 is enough for 12 satellites of RTCMv2)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t target_system,uint8_t target_component,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, len);
|
||||
_mav_put_uint8_t_array(buf, 3, data, 110);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
#else
|
||||
mavlink_gps_inject_data_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_INJECT_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_inject_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_inject_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_inject_data_t* gps_inject_data)
|
||||
{
|
||||
return mavlink_msg_gps_inject_data_pack(system_id, component_id, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_inject_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_inject_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_inject_data_t* gps_inject_data)
|
||||
{
|
||||
return mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, chan, msg, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_inject_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param target_system System ID
|
||||
* @param target_component Component ID
|
||||
* @param len data length
|
||||
* @param data raw data (110 is enough for 12 satellites of RTCMv2)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_inject_data_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, len);
|
||||
_mav_put_uint8_t_array(buf, 3, data, 110);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#else
|
||||
mavlink_gps_inject_data_t packet;
|
||||
packet.target_system = target_system;
|
||||
packet.target_component = target_component;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*110);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_inject_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_inject_data_send_struct(mavlink_channel_t chan, const mavlink_gps_inject_data_t* gps_inject_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_inject_data_send(chan, gps_inject_data->target_system, gps_inject_data->target_component, gps_inject_data->len, gps_inject_data->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)gps_inject_data, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_inject_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, target_system);
|
||||
_mav_put_uint8_t(buf, 1, target_component);
|
||||
_mav_put_uint8_t(buf, 2, len);
|
||||
_mav_put_uint8_t_array(buf, 3, data, 110);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, buf, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#else
|
||||
mavlink_gps_inject_data_t *packet = (mavlink_gps_inject_data_t *)msgbuf;
|
||||
packet->target_system = target_system;
|
||||
packet->target_component = target_component;
|
||||
packet->len = len;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*110);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INJECT_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN, MAVLINK_MSG_ID_GPS_INJECT_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_INJECT_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field target_system from gps_inject_data message
|
||||
*
|
||||
* @return System ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_inject_data_get_target_system(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field target_component from gps_inject_data message
|
||||
*
|
||||
* @return Component ID
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_inject_data_get_target_component(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from gps_inject_data message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_inject_data_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from gps_inject_data message
|
||||
*
|
||||
* @return raw data (110 is enough for 12 satellites of RTCMv2)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_inject_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 110, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_inject_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_inject_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_inject_data_decode(const mavlink_message_t* msg, mavlink_gps_inject_data_t* gps_inject_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_inject_data->target_system = mavlink_msg_gps_inject_data_get_target_system(msg);
|
||||
gps_inject_data->target_component = mavlink_msg_gps_inject_data_get_target_component(msg);
|
||||
gps_inject_data->len = mavlink_msg_gps_inject_data_get_len(msg);
|
||||
mavlink_msg_gps_inject_data_get_data(msg, gps_inject_data->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN? msg->len : MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN;
|
||||
memset(gps_inject_data, 0, MAVLINK_MSG_ID_GPS_INJECT_DATA_LEN);
|
||||
memcpy(gps_inject_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-638
@@ -1,638 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_INPUT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INPUT 232
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_input_t {
|
||||
uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
|
||||
uint32_t time_week_ms; /*< GPS time (milliseconds from start of GPS week)*/
|
||||
int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
|
||||
int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
|
||||
float alt; /*< Altitude (AMSL, not WGS84), in m (positive for up)*/
|
||||
float hdop; /*< GPS HDOP horizontal dilution of position in m*/
|
||||
float vdop; /*< GPS VDOP vertical dilution of position in m*/
|
||||
float vn; /*< GPS velocity in m/s in NORTH direction in earth-fixed NED frame*/
|
||||
float ve; /*< GPS velocity in m/s in EAST direction in earth-fixed NED frame*/
|
||||
float vd; /*< GPS velocity in m/s in DOWN direction in earth-fixed NED frame*/
|
||||
float speed_accuracy; /*< GPS speed accuracy in m/s*/
|
||||
float horiz_accuracy; /*< GPS horizontal accuracy in m*/
|
||||
float vert_accuracy; /*< GPS vertical accuracy in m*/
|
||||
uint16_t ignore_flags; /*< Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided.*/
|
||||
uint16_t time_week; /*< GPS week number*/
|
||||
uint8_t gps_id; /*< ID of the GPS for multiple GPS inputs*/
|
||||
uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK*/
|
||||
uint8_t satellites_visible; /*< Number of satellites visible.*/
|
||||
}) mavlink_gps_input_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INPUT_LEN 63
|
||||
#define MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN 63
|
||||
#define MAVLINK_MSG_ID_232_LEN 63
|
||||
#define MAVLINK_MSG_ID_232_MIN_LEN 63
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_INPUT_CRC 151
|
||||
#define MAVLINK_MSG_ID_232_CRC 151
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_INPUT { \
|
||||
232, \
|
||||
"GPS_INPUT", \
|
||||
18, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_input_t, time_usec) }, \
|
||||
{ "time_week_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gps_input_t, time_week_ms) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_input_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_input_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_input_t, alt) }, \
|
||||
{ "hdop", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gps_input_t, hdop) }, \
|
||||
{ "vdop", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gps_input_t, vdop) }, \
|
||||
{ "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gps_input_t, vn) }, \
|
||||
{ "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gps_input_t, ve) }, \
|
||||
{ "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gps_input_t, vd) }, \
|
||||
{ "speed_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_gps_input_t, speed_accuracy) }, \
|
||||
{ "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_gps_input_t, horiz_accuracy) }, \
|
||||
{ "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_gps_input_t, vert_accuracy) }, \
|
||||
{ "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \
|
||||
{ "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \
|
||||
{ "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 62, offsetof(mavlink_gps_input_t, satellites_visible) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_INPUT { \
|
||||
"GPS_INPUT", \
|
||||
18, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_input_t, time_usec) }, \
|
||||
{ "time_week_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gps_input_t, time_week_ms) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_input_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_input_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_input_t, alt) }, \
|
||||
{ "hdop", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gps_input_t, hdop) }, \
|
||||
{ "vdop", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gps_input_t, vdop) }, \
|
||||
{ "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gps_input_t, vn) }, \
|
||||
{ "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gps_input_t, ve) }, \
|
||||
{ "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gps_input_t, vd) }, \
|
||||
{ "speed_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_gps_input_t, speed_accuracy) }, \
|
||||
{ "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_gps_input_t, horiz_accuracy) }, \
|
||||
{ "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_gps_input_t, vert_accuracy) }, \
|
||||
{ "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \
|
||||
{ "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \
|
||||
{ "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 62, offsetof(mavlink_gps_input_t, satellites_visible) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_input 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 (micros since boot or Unix epoch)
|
||||
* @param gps_id ID of the GPS for multiple GPS inputs
|
||||
* @param ignore_flags Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided.
|
||||
* @param time_week_ms GPS time (milliseconds from start of GPS week)
|
||||
* @param time_week GPS week number
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, not WGS84), in m (positive for up)
|
||||
* @param hdop GPS HDOP horizontal dilution of position in m
|
||||
* @param vdop GPS VDOP vertical dilution of position in m
|
||||
* @param vn GPS velocity in m/s in NORTH direction in earth-fixed NED frame
|
||||
* @param ve GPS velocity in m/s in EAST direction in earth-fixed NED frame
|
||||
* @param vd GPS velocity in m/s in DOWN direction in earth-fixed NED frame
|
||||
* @param speed_accuracy GPS speed accuracy in m/s
|
||||
* @param horiz_accuracy GPS horizontal accuracy in m
|
||||
* @param vert_accuracy GPS vertical accuracy in m
|
||||
* @param satellites_visible Number of satellites visible.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, time_week_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_float(buf, 20, alt);
|
||||
_mav_put_float(buf, 24, hdop);
|
||||
_mav_put_float(buf, 28, vdop);
|
||||
_mav_put_float(buf, 32, vn);
|
||||
_mav_put_float(buf, 36, ve);
|
||||
_mav_put_float(buf, 40, vd);
|
||||
_mav_put_float(buf, 44, speed_accuracy);
|
||||
_mav_put_float(buf, 48, horiz_accuracy);
|
||||
_mav_put_float(buf, 52, vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 56, ignore_flags);
|
||||
_mav_put_uint16_t(buf, 58, time_week);
|
||||
_mav_put_uint8_t(buf, 60, gps_id);
|
||||
_mav_put_uint8_t(buf, 61, fix_type);
|
||||
_mav_put_uint8_t(buf, 62, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
#else
|
||||
mavlink_gps_input_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.time_week_ms = time_week_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.hdop = hdop;
|
||||
packet.vdop = vdop;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.speed_accuracy = speed_accuracy;
|
||||
packet.horiz_accuracy = horiz_accuracy;
|
||||
packet.vert_accuracy = vert_accuracy;
|
||||
packet.ignore_flags = ignore_flags;
|
||||
packet.time_week = time_week;
|
||||
packet.gps_id = gps_id;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_INPUT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_input message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param gps_id ID of the GPS for multiple GPS inputs
|
||||
* @param ignore_flags Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided.
|
||||
* @param time_week_ms GPS time (milliseconds from start of GPS week)
|
||||
* @param time_week GPS week number
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, not WGS84), in m (positive for up)
|
||||
* @param hdop GPS HDOP horizontal dilution of position in m
|
||||
* @param vdop GPS VDOP vertical dilution of position in m
|
||||
* @param vn GPS velocity in m/s in NORTH direction in earth-fixed NED frame
|
||||
* @param ve GPS velocity in m/s in EAST direction in earth-fixed NED frame
|
||||
* @param vd GPS velocity in m/s in DOWN direction in earth-fixed NED frame
|
||||
* @param speed_accuracy GPS speed accuracy in m/s
|
||||
* @param horiz_accuracy GPS horizontal accuracy in m
|
||||
* @param vert_accuracy GPS vertical accuracy in m
|
||||
* @param satellites_visible Number of satellites visible.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t gps_id,uint16_t ignore_flags,uint32_t time_week_ms,uint16_t time_week,uint8_t fix_type,int32_t lat,int32_t lon,float alt,float hdop,float vdop,float vn,float ve,float vd,float speed_accuracy,float horiz_accuracy,float vert_accuracy,uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, time_week_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_float(buf, 20, alt);
|
||||
_mav_put_float(buf, 24, hdop);
|
||||
_mav_put_float(buf, 28, vdop);
|
||||
_mav_put_float(buf, 32, vn);
|
||||
_mav_put_float(buf, 36, ve);
|
||||
_mav_put_float(buf, 40, vd);
|
||||
_mav_put_float(buf, 44, speed_accuracy);
|
||||
_mav_put_float(buf, 48, horiz_accuracy);
|
||||
_mav_put_float(buf, 52, vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 56, ignore_flags);
|
||||
_mav_put_uint16_t(buf, 58, time_week);
|
||||
_mav_put_uint8_t(buf, 60, gps_id);
|
||||
_mav_put_uint8_t(buf, 61, fix_type);
|
||||
_mav_put_uint8_t(buf, 62, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
#else
|
||||
mavlink_gps_input_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.time_week_ms = time_week_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.hdop = hdop;
|
||||
packet.vdop = vdop;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.speed_accuracy = speed_accuracy;
|
||||
packet.horiz_accuracy = horiz_accuracy;
|
||||
packet.vert_accuracy = vert_accuracy;
|
||||
packet.ignore_flags = ignore_flags;
|
||||
packet.time_week = time_week;
|
||||
packet.gps_id = gps_id;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_INPUT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_input struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_input C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_input_t* gps_input)
|
||||
{
|
||||
return mavlink_msg_gps_input_pack(system_id, component_id, msg, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_input struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_input C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_input_t* gps_input)
|
||||
{
|
||||
return mavlink_msg_gps_input_pack_chan(system_id, component_id, chan, msg, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_input message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (micros since boot or Unix epoch)
|
||||
* @param gps_id ID of the GPS for multiple GPS inputs
|
||||
* @param ignore_flags Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided.
|
||||
* @param time_week_ms GPS time (milliseconds from start of GPS week)
|
||||
* @param time_week GPS week number
|
||||
* @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, not WGS84), in m (positive for up)
|
||||
* @param hdop GPS HDOP horizontal dilution of position in m
|
||||
* @param vdop GPS VDOP vertical dilution of position in m
|
||||
* @param vn GPS velocity in m/s in NORTH direction in earth-fixed NED frame
|
||||
* @param ve GPS velocity in m/s in EAST direction in earth-fixed NED frame
|
||||
* @param vd GPS velocity in m/s in DOWN direction in earth-fixed NED frame
|
||||
* @param speed_accuracy GPS speed accuracy in m/s
|
||||
* @param horiz_accuracy GPS horizontal accuracy in m
|
||||
* @param vert_accuracy GPS vertical accuracy in m
|
||||
* @param satellites_visible Number of satellites visible.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_input_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, time_week_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_float(buf, 20, alt);
|
||||
_mav_put_float(buf, 24, hdop);
|
||||
_mav_put_float(buf, 28, vdop);
|
||||
_mav_put_float(buf, 32, vn);
|
||||
_mav_put_float(buf, 36, ve);
|
||||
_mav_put_float(buf, 40, vd);
|
||||
_mav_put_float(buf, 44, speed_accuracy);
|
||||
_mav_put_float(buf, 48, horiz_accuracy);
|
||||
_mav_put_float(buf, 52, vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 56, ignore_flags);
|
||||
_mav_put_uint16_t(buf, 58, time_week);
|
||||
_mav_put_uint8_t(buf, 60, gps_id);
|
||||
_mav_put_uint8_t(buf, 61, fix_type);
|
||||
_mav_put_uint8_t(buf, 62, satellites_visible);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, buf, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#else
|
||||
mavlink_gps_input_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.time_week_ms = time_week_ms;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.hdop = hdop;
|
||||
packet.vdop = vdop;
|
||||
packet.vn = vn;
|
||||
packet.ve = ve;
|
||||
packet.vd = vd;
|
||||
packet.speed_accuracy = speed_accuracy;
|
||||
packet.horiz_accuracy = horiz_accuracy;
|
||||
packet.vert_accuracy = vert_accuracy;
|
||||
packet.ignore_flags = ignore_flags;
|
||||
packet.time_week = time_week;
|
||||
packet.gps_id = gps_id;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)&packet, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_input message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_input_send_struct(mavlink_channel_t chan, const mavlink_gps_input_t* gps_input)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_input_send(chan, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)gps_input, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_INPUT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_input_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_uint32_t(buf, 8, time_week_ms);
|
||||
_mav_put_int32_t(buf, 12, lat);
|
||||
_mav_put_int32_t(buf, 16, lon);
|
||||
_mav_put_float(buf, 20, alt);
|
||||
_mav_put_float(buf, 24, hdop);
|
||||
_mav_put_float(buf, 28, vdop);
|
||||
_mav_put_float(buf, 32, vn);
|
||||
_mav_put_float(buf, 36, ve);
|
||||
_mav_put_float(buf, 40, vd);
|
||||
_mav_put_float(buf, 44, speed_accuracy);
|
||||
_mav_put_float(buf, 48, horiz_accuracy);
|
||||
_mav_put_float(buf, 52, vert_accuracy);
|
||||
_mav_put_uint16_t(buf, 56, ignore_flags);
|
||||
_mav_put_uint16_t(buf, 58, time_week);
|
||||
_mav_put_uint8_t(buf, 60, gps_id);
|
||||
_mav_put_uint8_t(buf, 61, fix_type);
|
||||
_mav_put_uint8_t(buf, 62, satellites_visible);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, buf, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#else
|
||||
mavlink_gps_input_t *packet = (mavlink_gps_input_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->time_week_ms = time_week_ms;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->hdop = hdop;
|
||||
packet->vdop = vdop;
|
||||
packet->vn = vn;
|
||||
packet->ve = ve;
|
||||
packet->vd = vd;
|
||||
packet->speed_accuracy = speed_accuracy;
|
||||
packet->horiz_accuracy = horiz_accuracy;
|
||||
packet->vert_accuracy = vert_accuracy;
|
||||
packet->ignore_flags = ignore_flags;
|
||||
packet->time_week = time_week;
|
||||
packet->gps_id = gps_id;
|
||||
packet->fix_type = fix_type;
|
||||
packet->satellites_visible = satellites_visible;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)packet, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_INPUT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from gps_input message
|
||||
*
|
||||
* @return Timestamp (micros since boot or Unix epoch)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_gps_input_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gps_id from gps_input message
|
||||
*
|
||||
* @return ID of the GPS for multiple GPS inputs
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_input_get_gps_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 60);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ignore_flags from gps_input message
|
||||
*
|
||||
* @return Flags indicating which fields to ignore (see GPS_INPUT_IGNORE_FLAGS enum). All other fields must be provided.
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_get_ignore_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 56);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_week_ms from gps_input message
|
||||
*
|
||||
* @return GPS time (milliseconds from start of GPS week)
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_input_get_time_week_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field time_week from gps_input message
|
||||
*
|
||||
* @return GPS week number
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_input_get_time_week(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 58);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fix_type from gps_input message
|
||||
*
|
||||
* @return 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_input_get_fix_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 61);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from gps_input message
|
||||
*
|
||||
* @return Latitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_input_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from gps_input message
|
||||
*
|
||||
* @return Longitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_input_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from gps_input message
|
||||
*
|
||||
* @return Altitude (AMSL, not WGS84), in m (positive for up)
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field hdop from gps_input message
|
||||
*
|
||||
* @return GPS HDOP horizontal dilution of position in m
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_hdop(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vdop from gps_input message
|
||||
*
|
||||
* @return GPS VDOP vertical dilution of position in m
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_vdop(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vn from gps_input message
|
||||
*
|
||||
* @return GPS velocity in m/s in NORTH direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_vn(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field ve from gps_input message
|
||||
*
|
||||
* @return GPS velocity in m/s in EAST direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_ve(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 36);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vd from gps_input message
|
||||
*
|
||||
* @return GPS velocity in m/s in DOWN direction in earth-fixed NED frame
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_vd(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field speed_accuracy from gps_input message
|
||||
*
|
||||
* @return GPS speed accuracy in m/s
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_speed_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 44);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field horiz_accuracy from gps_input message
|
||||
*
|
||||
* @return GPS horizontal accuracy in m
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_horiz_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vert_accuracy from gps_input message
|
||||
*
|
||||
* @return GPS vertical accuracy in m
|
||||
*/
|
||||
static inline float mavlink_msg_gps_input_get_vert_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 52);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellites_visible from gps_input message
|
||||
*
|
||||
* @return Number of satellites visible.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_input_get_satellites_visible(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 62);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_input message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_input C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_input_decode(const mavlink_message_t* msg, mavlink_gps_input_t* gps_input)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_input->time_usec = mavlink_msg_gps_input_get_time_usec(msg);
|
||||
gps_input->time_week_ms = mavlink_msg_gps_input_get_time_week_ms(msg);
|
||||
gps_input->lat = mavlink_msg_gps_input_get_lat(msg);
|
||||
gps_input->lon = mavlink_msg_gps_input_get_lon(msg);
|
||||
gps_input->alt = mavlink_msg_gps_input_get_alt(msg);
|
||||
gps_input->hdop = mavlink_msg_gps_input_get_hdop(msg);
|
||||
gps_input->vdop = mavlink_msg_gps_input_get_vdop(msg);
|
||||
gps_input->vn = mavlink_msg_gps_input_get_vn(msg);
|
||||
gps_input->ve = mavlink_msg_gps_input_get_ve(msg);
|
||||
gps_input->vd = mavlink_msg_gps_input_get_vd(msg);
|
||||
gps_input->speed_accuracy = mavlink_msg_gps_input_get_speed_accuracy(msg);
|
||||
gps_input->horiz_accuracy = mavlink_msg_gps_input_get_horiz_accuracy(msg);
|
||||
gps_input->vert_accuracy = mavlink_msg_gps_input_get_vert_accuracy(msg);
|
||||
gps_input->ignore_flags = mavlink_msg_gps_input_get_ignore_flags(msg);
|
||||
gps_input->time_week = mavlink_msg_gps_input_get_time_week(msg);
|
||||
gps_input->gps_id = mavlink_msg_gps_input_get_gps_id(msg);
|
||||
gps_input->fix_type = mavlink_msg_gps_input_get_fix_type(msg);
|
||||
gps_input->satellites_visible = mavlink_msg_gps_input_get_satellites_visible(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_INPUT_LEN? msg->len : MAVLINK_MSG_ID_GPS_INPUT_LEN;
|
||||
memset(gps_input, 0, MAVLINK_MSG_ID_GPS_INPUT_LEN);
|
||||
memcpy(gps_input, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-438
@@ -1,438 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_RAW_INT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RAW_INT 24
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_raw_int_t {
|
||||
uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
|
||||
int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
|
||||
int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
|
||||
int32_t alt; /*< Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.*/
|
||||
uint16_t eph; /*< GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX*/
|
||||
uint16_t epv; /*< GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX*/
|
||||
uint16_t vel; /*< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX*/
|
||||
uint16_t cog; /*< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX*/
|
||||
uint8_t fix_type; /*< See the GPS_FIX_TYPE enum.*/
|
||||
uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
|
||||
}) mavlink_gps_raw_int_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RAW_INT_LEN 30
|
||||
#define MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN 30
|
||||
#define MAVLINK_MSG_ID_24_LEN 30
|
||||
#define MAVLINK_MSG_ID_24_MIN_LEN 30
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RAW_INT_CRC 24
|
||||
#define MAVLINK_MSG_ID_24_CRC 24
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \
|
||||
24, \
|
||||
"GPS_RAW_INT", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \
|
||||
"GPS_RAW_INT", \
|
||||
10, \
|
||||
{ { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \
|
||||
{ "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \
|
||||
{ "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \
|
||||
{ "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \
|
||||
{ "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \
|
||||
{ "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \
|
||||
{ "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \
|
||||
{ "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_raw_int 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 since UNIX epoch or microseconds since system boot)
|
||||
* @param fix_type See the GPS_FIX_TYPE enum.
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
|
||||
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_uint16_t(buf, 26, cog);
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
#else
|
||||
mavlink_gps_raw_int_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_raw_int message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
* @param fix_type See the GPS_FIX_TYPE enum.
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
|
||||
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_uint16_t(buf, 26, cog);
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
#else
|
||||
mavlink_gps_raw_int_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_raw_int struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_raw_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int)
|
||||
{
|
||||
return mavlink_msg_gps_raw_int_pack(system_id, component_id, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_raw_int struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_raw_int C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int)
|
||||
{
|
||||
return mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, chan, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_raw_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
* @param fix_type See the GPS_FIX_TYPE enum.
|
||||
* @param lat Latitude (WGS84), in degrees * 1E7
|
||||
* @param lon Longitude (WGS84), in degrees * 1E7
|
||||
* @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
|
||||
* @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
* @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
|
||||
* @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
* @param satellites_visible Number of satellites visible. If unknown, set to 255
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_raw_int_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_uint16_t(buf, 26, cog);
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#else
|
||||
mavlink_gps_raw_int_t packet;
|
||||
packet.time_usec = time_usec;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.alt = alt;
|
||||
packet.eph = eph;
|
||||
packet.epv = epv;
|
||||
packet.vel = vel;
|
||||
packet.cog = cog;
|
||||
packet.fix_type = fix_type;
|
||||
packet.satellites_visible = satellites_visible;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_raw_int message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_raw_int_send_struct(mavlink_channel_t chan, const mavlink_gps_raw_int_t* gps_raw_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_raw_int_send(chan, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)gps_raw_int, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_RAW_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_raw_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, time_usec);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_int32_t(buf, 16, alt);
|
||||
_mav_put_uint16_t(buf, 20, eph);
|
||||
_mav_put_uint16_t(buf, 22, epv);
|
||||
_mav_put_uint16_t(buf, 24, vel);
|
||||
_mav_put_uint16_t(buf, 26, cog);
|
||||
_mav_put_uint8_t(buf, 28, fix_type);
|
||||
_mav_put_uint8_t(buf, 29, satellites_visible);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#else
|
||||
mavlink_gps_raw_int_t *packet = (mavlink_gps_raw_int_t *)msgbuf;
|
||||
packet->time_usec = time_usec;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->alt = alt;
|
||||
packet->eph = eph;
|
||||
packet->epv = epv;
|
||||
packet->vel = vel;
|
||||
packet->cog = cog;
|
||||
packet->fix_type = fix_type;
|
||||
packet->satellites_visible = satellites_visible;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_RAW_INT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_usec from gps_raw_int message
|
||||
*
|
||||
* @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_gps_raw_int_get_time_usec(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field fix_type from gps_raw_int message
|
||||
*
|
||||
* @return See the GPS_FIX_TYPE enum.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lat from gps_raw_int message
|
||||
*
|
||||
* @return Latitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from gps_raw_int message
|
||||
*
|
||||
* @return Longitude (WGS84), in degrees * 1E7
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field alt from gps_raw_int message
|
||||
*
|
||||
* @return Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field eph from gps_raw_int message
|
||||
*
|
||||
* @return GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field epv from gps_raw_int message
|
||||
*
|
||||
* @return GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 22);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field vel from gps_raw_int message
|
||||
*
|
||||
* @return GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_vel(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field cog from gps_raw_int message
|
||||
*
|
||||
* @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_raw_int_get_cog(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field satellites_visible from gps_raw_int message
|
||||
*
|
||||
* @return Number of satellites visible. If unknown, set to 255
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_raw_int_get_satellites_visible(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 29);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_raw_int message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_raw_int C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_raw_int_decode(const mavlink_message_t* msg, mavlink_gps_raw_int_t* gps_raw_int)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_raw_int->time_usec = mavlink_msg_gps_raw_int_get_time_usec(msg);
|
||||
gps_raw_int->lat = mavlink_msg_gps_raw_int_get_lat(msg);
|
||||
gps_raw_int->lon = mavlink_msg_gps_raw_int_get_lon(msg);
|
||||
gps_raw_int->alt = mavlink_msg_gps_raw_int_get_alt(msg);
|
||||
gps_raw_int->eph = mavlink_msg_gps_raw_int_get_eph(msg);
|
||||
gps_raw_int->epv = mavlink_msg_gps_raw_int_get_epv(msg);
|
||||
gps_raw_int->vel = mavlink_msg_gps_raw_int_get_vel(msg);
|
||||
gps_raw_int->cog = mavlink_msg_gps_raw_int_get_cog(msg);
|
||||
gps_raw_int->fix_type = mavlink_msg_gps_raw_int_get_fix_type(msg);
|
||||
gps_raw_int->satellites_visible = mavlink_msg_gps_raw_int_get_satellites_visible(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RAW_INT_LEN? msg->len : MAVLINK_MSG_ID_GPS_RAW_INT_LEN;
|
||||
memset(gps_raw_int, 0, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
|
||||
memcpy(gps_raw_int, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
-255
@@ -1,255 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_RTCM_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTCM_DATA 233
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_rtcm_data_t {
|
||||
uint8_t flags; /*< LSB: 1 means message is fragmented*/
|
||||
uint8_t len; /*< data length*/
|
||||
uint8_t data[180]; /*< RTCM message (may be fragmented)*/
|
||||
}) mavlink_gps_rtcm_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN 182
|
||||
#define MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN 182
|
||||
#define MAVLINK_MSG_ID_233_LEN 182
|
||||
#define MAVLINK_MSG_ID_233_MIN_LEN 182
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC 35
|
||||
#define MAVLINK_MSG_ID_233_CRC 35
|
||||
|
||||
#define MAVLINK_MSG_GPS_RTCM_DATA_FIELD_DATA_LEN 180
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA { \
|
||||
233, \
|
||||
"GPS_RTCM_DATA", \
|
||||
3, \
|
||||
{ { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_rtcm_data_t, flags) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_rtcm_data_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 180, 2, offsetof(mavlink_gps_rtcm_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RTCM_DATA { \
|
||||
"GPS_RTCM_DATA", \
|
||||
3, \
|
||||
{ { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_rtcm_data_t, flags) }, \
|
||||
{ "len", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_rtcm_data_t, len) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_UINT8_T, 180, 2, offsetof(mavlink_gps_rtcm_data_t, data) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_rtcm_data 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 flags LSB: 1 means message is fragmented
|
||||
* @param len data length
|
||||
* @param data RTCM message (may be fragmented)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint8_t flags, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, flags);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 180);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
#else
|
||||
mavlink_gps_rtcm_data_t packet;
|
||||
packet.flags = flags;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RTCM_DATA;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_rtcm_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param flags LSB: 1 means message is fragmented
|
||||
* @param len data length
|
||||
* @param data RTCM message (may be fragmented)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint8_t flags,uint8_t len,const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, flags);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 180);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
#else
|
||||
mavlink_gps_rtcm_data_t packet;
|
||||
packet.flags = flags;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RTCM_DATA;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_rtcm_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_rtcm_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
|
||||
{
|
||||
return mavlink_msg_gps_rtcm_data_pack(system_id, component_id, msg, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_rtcm_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_rtcm_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
|
||||
{
|
||||
return mavlink_msg_gps_rtcm_data_pack_chan(system_id, component_id, chan, msg, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_rtcm_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param flags LSB: 1 means message is fragmented
|
||||
* @param len data length
|
||||
* @param data RTCM message (may be fragmented)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_rtcm_data_send(mavlink_channel_t chan, uint8_t flags, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN];
|
||||
_mav_put_uint8_t(buf, 0, flags);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 180);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#else
|
||||
mavlink_gps_rtcm_data_t packet;
|
||||
packet.flags = flags;
|
||||
packet.len = len;
|
||||
mav_array_memcpy(packet.data, data, sizeof(uint8_t)*180);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_rtcm_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtcm_data_send_struct(mavlink_channel_t chan, const mavlink_gps_rtcm_data_t* gps_rtcm_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_rtcm_data_send(chan, gps_rtcm_data->flags, gps_rtcm_data->len, gps_rtcm_data->data);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)gps_rtcm_data, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtcm_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t flags, uint8_t len, const uint8_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint8_t(buf, 0, flags);
|
||||
_mav_put_uint8_t(buf, 1, len);
|
||||
_mav_put_uint8_t_array(buf, 2, data, 180);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, buf, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#else
|
||||
mavlink_gps_rtcm_data_t *packet = (mavlink_gps_rtcm_data_t *)msgbuf;
|
||||
packet->flags = flags;
|
||||
packet->len = len;
|
||||
mav_array_memcpy(packet->data, data, sizeof(uint8_t)*180);
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTCM_DATA, (const char *)packet, MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN, MAVLINK_MSG_ID_GPS_RTCM_DATA_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_RTCM_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field flags from gps_rtcm_data message
|
||||
*
|
||||
* @return LSB: 1 means message is fragmented
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtcm_data_get_flags(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field len from gps_rtcm_data message
|
||||
*
|
||||
* @return data length
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtcm_data_get_len(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from gps_rtcm_data message
|
||||
*
|
||||
* @return RTCM message (may be fragmented)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtcm_data_get_data(const mavlink_message_t* msg, uint8_t *data)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t_array(msg, data, 180, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_rtcm_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_rtcm_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtcm_data_decode(const mavlink_message_t* msg, mavlink_gps_rtcm_data_t* gps_rtcm_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_rtcm_data->flags = mavlink_msg_gps_rtcm_data_get_flags(msg);
|
||||
gps_rtcm_data->len = mavlink_msg_gps_rtcm_data_get_len(msg);
|
||||
mavlink_msg_gps_rtcm_data_get_data(msg, gps_rtcm_data->data);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN? msg->len : MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN;
|
||||
memset(gps_rtcm_data, 0, MAVLINK_MSG_ID_GPS_RTCM_DATA_LEN);
|
||||
memcpy(gps_rtcm_data, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
@@ -1,513 +0,0 @@
|
||||
#pragma once
|
||||
// MESSAGE GPS_RTK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTK 127
|
||||
|
||||
MAVPACKED(
|
||||
typedef struct __mavlink_gps_rtk_t {
|
||||
uint32_t time_last_baseline_ms; /*< Time since boot of last baseline message received in ms.*/
|
||||
uint32_t tow; /*< GPS Time of Week of last baseline*/
|
||||
int32_t baseline_a_mm; /*< Current baseline in ECEF x or NED north component in mm.*/
|
||||
int32_t baseline_b_mm; /*< Current baseline in ECEF y or NED east component in mm.*/
|
||||
int32_t baseline_c_mm; /*< Current baseline in ECEF z or NED down component in mm.*/
|
||||
uint32_t accuracy; /*< Current estimate of baseline accuracy.*/
|
||||
int32_t iar_num_hypotheses; /*< Current number of integer ambiguity hypotheses.*/
|
||||
uint16_t wn; /*< GPS Week Number of last baseline*/
|
||||
uint8_t rtk_receiver_id; /*< Identification of connected RTK receiver.*/
|
||||
uint8_t rtk_health; /*< GPS-specific health report for RTK data.*/
|
||||
uint8_t rtk_rate; /*< Rate of baseline messages being received by GPS, in HZ*/
|
||||
uint8_t nsats; /*< Current number of sats used for RTK calculation.*/
|
||||
uint8_t baseline_coords_type; /*< Coordinate system of baseline. 0 == ECEF, 1 == NED*/
|
||||
}) mavlink_gps_rtk_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTK_LEN 35
|
||||
#define MAVLINK_MSG_ID_GPS_RTK_MIN_LEN 35
|
||||
#define MAVLINK_MSG_ID_127_LEN 35
|
||||
#define MAVLINK_MSG_ID_127_MIN_LEN 35
|
||||
|
||||
#define MAVLINK_MSG_ID_GPS_RTK_CRC 25
|
||||
#define MAVLINK_MSG_ID_127_CRC 25
|
||||
|
||||
|
||||
|
||||
#if MAVLINK_COMMAND_24BIT
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RTK { \
|
||||
127, \
|
||||
"GPS_RTK", \
|
||||
13, \
|
||||
{ { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \
|
||||
{ "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \
|
||||
{ "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \
|
||||
{ "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \
|
||||
{ "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \
|
||||
{ "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \
|
||||
{ "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \
|
||||
{ "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \
|
||||
{ "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \
|
||||
{ "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \
|
||||
{ "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \
|
||||
{ "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \
|
||||
{ "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define MAVLINK_MESSAGE_INFO_GPS_RTK { \
|
||||
"GPS_RTK", \
|
||||
13, \
|
||||
{ { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \
|
||||
{ "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \
|
||||
{ "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \
|
||||
{ "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \
|
||||
{ "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \
|
||||
{ "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \
|
||||
{ "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \
|
||||
{ "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \
|
||||
{ "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \
|
||||
{ "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \
|
||||
{ "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \
|
||||
{ "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \
|
||||
{ "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_rtk 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_last_baseline_ms Time since boot of last baseline message received in ms.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate Rate of baseline messages being received by GPS, in HZ
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
|
||||
* @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
|
||||
* @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
|
||||
* @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
#else
|
||||
mavlink_gps_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RTK;
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a gps_rtk message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param time_last_baseline_ms Time since boot of last baseline message received in ms.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate Rate of baseline messages being received by GPS, in HZ
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
|
||||
* @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
|
||||
* @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
|
||||
* @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
#else
|
||||
mavlink_gps_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_GPS_RTK;
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_rtk struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_rtk C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk)
|
||||
{
|
||||
return mavlink_msg_gps_rtk_pack(system_id, component_id, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a gps_rtk struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param gps_rtk C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk)
|
||||
{
|
||||
return mavlink_msg_gps_rtk_pack_chan(system_id, component_id, chan, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_rtk message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param time_last_baseline_ms Time since boot of last baseline message received in ms.
|
||||
* @param rtk_receiver_id Identification of connected RTK receiver.
|
||||
* @param wn GPS Week Number of last baseline
|
||||
* @param tow GPS Time of Week of last baseline
|
||||
* @param rtk_health GPS-specific health report for RTK data.
|
||||
* @param rtk_rate Rate of baseline messages being received by GPS, in HZ
|
||||
* @param nsats Current number of sats used for RTK calculation.
|
||||
* @param baseline_coords_type Coordinate system of baseline. 0 == ECEF, 1 == NED
|
||||
* @param baseline_a_mm Current baseline in ECEF x or NED north component in mm.
|
||||
* @param baseline_b_mm Current baseline in ECEF y or NED east component in mm.
|
||||
* @param baseline_c_mm Current baseline in ECEF z or NED down component in mm.
|
||||
* @param accuracy Current estimate of baseline accuracy.
|
||||
* @param iar_num_hypotheses Current number of integer ambiguity hypotheses.
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_gps_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#else
|
||||
mavlink_gps_rtk_t packet;
|
||||
packet.time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet.tow = tow;
|
||||
packet.baseline_a_mm = baseline_a_mm;
|
||||
packet.baseline_b_mm = baseline_b_mm;
|
||||
packet.baseline_c_mm = baseline_c_mm;
|
||||
packet.accuracy = accuracy;
|
||||
packet.iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet.wn = wn;
|
||||
packet.rtk_receiver_id = rtk_receiver_id;
|
||||
packet.rtk_health = rtk_health;
|
||||
packet.rtk_rate = rtk_rate;
|
||||
packet.nsats = nsats;
|
||||
packet.baseline_coords_type = baseline_coords_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a gps_rtk message
|
||||
* @param chan MAVLink channel to send the message
|
||||
* @param struct The MAVLink struct to serialize
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtk_send_struct(mavlink_channel_t chan, const mavlink_gps_rtk_t* gps_rtk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
mavlink_msg_gps_rtk_send(chan, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)gps_rtk, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_GPS_RTK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
||||
/*
|
||||
This varient of _send() can be used to save stack space by re-using
|
||||
memory from the receive buffer. The caller provides a
|
||||
mavlink_message_t which is the size of a full mavlink message. This
|
||||
is usually the receive buffer for the channel, and allows a reply to an
|
||||
incoming message with minimum stack space usage.
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint32_t(buf, 0, time_last_baseline_ms);
|
||||
_mav_put_uint32_t(buf, 4, tow);
|
||||
_mav_put_int32_t(buf, 8, baseline_a_mm);
|
||||
_mav_put_int32_t(buf, 12, baseline_b_mm);
|
||||
_mav_put_int32_t(buf, 16, baseline_c_mm);
|
||||
_mav_put_uint32_t(buf, 20, accuracy);
|
||||
_mav_put_int32_t(buf, 24, iar_num_hypotheses);
|
||||
_mav_put_uint16_t(buf, 28, wn);
|
||||
_mav_put_uint8_t(buf, 30, rtk_receiver_id);
|
||||
_mav_put_uint8_t(buf, 31, rtk_health);
|
||||
_mav_put_uint8_t(buf, 32, rtk_rate);
|
||||
_mav_put_uint8_t(buf, 33, nsats);
|
||||
_mav_put_uint8_t(buf, 34, baseline_coords_type);
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#else
|
||||
mavlink_gps_rtk_t *packet = (mavlink_gps_rtk_t *)msgbuf;
|
||||
packet->time_last_baseline_ms = time_last_baseline_ms;
|
||||
packet->tow = tow;
|
||||
packet->baseline_a_mm = baseline_a_mm;
|
||||
packet->baseline_b_mm = baseline_b_mm;
|
||||
packet->baseline_c_mm = baseline_c_mm;
|
||||
packet->accuracy = accuracy;
|
||||
packet->iar_num_hypotheses = iar_num_hypotheses;
|
||||
packet->wn = wn;
|
||||
packet->rtk_receiver_id = rtk_receiver_id;
|
||||
packet->rtk_health = rtk_health;
|
||||
packet->rtk_rate = rtk_rate;
|
||||
packet->nsats = nsats;
|
||||
packet->baseline_coords_type = baseline_coords_type;
|
||||
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS_RTK_MIN_LEN, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE GPS_RTK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field time_last_baseline_ms from gps_rtk message
|
||||
*
|
||||
* @return Time since boot of last baseline message received in ms.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_receiver_id from gps_rtk message
|
||||
*
|
||||
* @return Identification of connected RTK receiver.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field wn from gps_rtk message
|
||||
*
|
||||
* @return GPS Week Number of last baseline
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 28);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field tow from gps_rtk message
|
||||
*
|
||||
* @return GPS Time of Week of last baseline
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_health from gps_rtk message
|
||||
*
|
||||
* @return GPS-specific health report for RTK data.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field rtk_rate from gps_rtk message
|
||||
*
|
||||
* @return Rate of baseline messages being received by GPS, in HZ
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field nsats from gps_rtk message
|
||||
*
|
||||
* @return Current number of sats used for RTK calculation.
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 33);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_coords_type from gps_rtk message
|
||||
*
|
||||
* @return Coordinate system of baseline. 0 == ECEF, 1 == NED
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 34);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_a_mm from gps_rtk message
|
||||
*
|
||||
* @return Current baseline in ECEF x or NED north component in mm.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_b_mm from gps_rtk message
|
||||
*
|
||||
* @return Current baseline in ECEF y or NED east component in mm.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field baseline_c_mm from gps_rtk message
|
||||
*
|
||||
* @return Current baseline in ECEF z or NED down component in mm.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field accuracy from gps_rtk message
|
||||
*
|
||||
* @return Current estimate of baseline accuracy.
|
||||
*/
|
||||
static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint32_t(msg, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field iar_num_hypotheses from gps_rtk message
|
||||
*
|
||||
* @return Current number of integer ambiguity hypotheses.
|
||||
*/
|
||||
static inline int32_t mavlink_msg_gps_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a gps_rtk message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param gps_rtk C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_gps_rtk_decode(const mavlink_message_t* msg, mavlink_gps_rtk_t* gps_rtk)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
gps_rtk->time_last_baseline_ms = mavlink_msg_gps_rtk_get_time_last_baseline_ms(msg);
|
||||
gps_rtk->tow = mavlink_msg_gps_rtk_get_tow(msg);
|
||||
gps_rtk->baseline_a_mm = mavlink_msg_gps_rtk_get_baseline_a_mm(msg);
|
||||
gps_rtk->baseline_b_mm = mavlink_msg_gps_rtk_get_baseline_b_mm(msg);
|
||||
gps_rtk->baseline_c_mm = mavlink_msg_gps_rtk_get_baseline_c_mm(msg);
|
||||
gps_rtk->accuracy = mavlink_msg_gps_rtk_get_accuracy(msg);
|
||||
gps_rtk->iar_num_hypotheses = mavlink_msg_gps_rtk_get_iar_num_hypotheses(msg);
|
||||
gps_rtk->wn = mavlink_msg_gps_rtk_get_wn(msg);
|
||||
gps_rtk->rtk_receiver_id = mavlink_msg_gps_rtk_get_rtk_receiver_id(msg);
|
||||
gps_rtk->rtk_health = mavlink_msg_gps_rtk_get_rtk_health(msg);
|
||||
gps_rtk->rtk_rate = mavlink_msg_gps_rtk_get_rtk_rate(msg);
|
||||
gps_rtk->nsats = mavlink_msg_gps_rtk_get_nsats(msg);
|
||||
gps_rtk->baseline_coords_type = mavlink_msg_gps_rtk_get_baseline_coords_type(msg);
|
||||
#else
|
||||
uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RTK_LEN? msg->len : MAVLINK_MSG_ID_GPS_RTK_LEN;
|
||||
memset(gps_rtk, 0, MAVLINK_MSG_ID_GPS_RTK_LEN);
|
||||
memcpy(gps_rtk, _MAV_PAYLOAD(msg), len);
|
||||
#endif
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user