539 lines
25 KiB
C
539 lines
25 KiB
C
#pragma once
|
|
// MESSAGE XYK_AIRPOINT_COMMAND PACKING
|
|
|
|
#define MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND 30033
|
|
|
|
MAVPACKED(
|
|
typedef struct __mavlink_xyk_airpoint_command_t {
|
|
int32_t latitude; /*< latitude,0.0000001,[-180^,180^]*/
|
|
int32_t longitude; /*< longitude,0.0000001,[-180^,180^]*/
|
|
int32_t altitude; /*< altitude,0.01m,[-50000,100000]*/
|
|
uint16_t AIRPOINT_ID; /*< Sequence1-800*/
|
|
uint16_t LINE_LENGTH; /*< LENGTH,points contained in the aireline*/
|
|
uint8_t PLANE_ID; /*< System which should execute the command*/
|
|
uint8_t confirmation; /*< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)*/
|
|
uint8_t LINE_ID; /*< SEE XYK_AIRLINE_TYPE.*/
|
|
uint8_t current; /*< false:0, true:1.*/
|
|
uint8_t SWITCH_MOD; /*< defallt Autocontinue to next waypoint.*/
|
|
uint8_t LOITER_MOD; /*< defallt arrive at next waypoint with an auto climb rate .*/
|
|
uint8_t ACTION; /*< not in use for now */
|
|
uint8_t MISSION_GRAP; /*< not in use for now.*/
|
|
uint8_t POINT_SPEED; /*< SPEED IAS,m/s,[stall_speed,256]*/
|
|
}) mavlink_xyk_airpoint_command_t;
|
|
|
|
#define MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN 25
|
|
#define MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_MIN_LEN 25
|
|
#define MAVLINK_MSG_ID_30033_LEN 25
|
|
#define MAVLINK_MSG_ID_30033_MIN_LEN 25
|
|
|
|
#define MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_CRC 142
|
|
#define MAVLINK_MSG_ID_30033_CRC 142
|
|
|
|
|
|
|
|
#if MAVLINK_COMMAND_24BIT
|
|
#define MAVLINK_MESSAGE_INFO_XYK_AIRPOINT_COMMAND { \
|
|
30033, \
|
|
"XYK_AIRPOINT_COMMAND", \
|
|
14, \
|
|
{ { "PLANE_ID", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_xyk_airpoint_command_t, PLANE_ID) }, \
|
|
{ "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_xyk_airpoint_command_t, confirmation) }, \
|
|
{ "LINE_ID", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_xyk_airpoint_command_t, LINE_ID) }, \
|
|
{ "AIRPOINT_ID", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_xyk_airpoint_command_t, AIRPOINT_ID) }, \
|
|
{ "LINE_LENGTH", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_xyk_airpoint_command_t, LINE_LENGTH) }, \
|
|
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_xyk_airpoint_command_t, current) }, \
|
|
{ "SWITCH_MOD", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_xyk_airpoint_command_t, SWITCH_MOD) }, \
|
|
{ "LOITER_MOD", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_xyk_airpoint_command_t, LOITER_MOD) }, \
|
|
{ "ACTION", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_xyk_airpoint_command_t, ACTION) }, \
|
|
{ "MISSION_GRAP", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_xyk_airpoint_command_t, MISSION_GRAP) }, \
|
|
{ "POINT_SPEED", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_xyk_airpoint_command_t, POINT_SPEED) }, \
|
|
{ "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_xyk_airpoint_command_t, latitude) }, \
|
|
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_xyk_airpoint_command_t, longitude) }, \
|
|
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_xyk_airpoint_command_t, altitude) }, \
|
|
} \
|
|
}
|
|
#else
|
|
#define MAVLINK_MESSAGE_INFO_XYK_AIRPOINT_COMMAND { \
|
|
"XYK_AIRPOINT_COMMAND", \
|
|
14, \
|
|
{ { "PLANE_ID", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_xyk_airpoint_command_t, PLANE_ID) }, \
|
|
{ "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_xyk_airpoint_command_t, confirmation) }, \
|
|
{ "LINE_ID", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_xyk_airpoint_command_t, LINE_ID) }, \
|
|
{ "AIRPOINT_ID", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_xyk_airpoint_command_t, AIRPOINT_ID) }, \
|
|
{ "LINE_LENGTH", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_xyk_airpoint_command_t, LINE_LENGTH) }, \
|
|
{ "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_xyk_airpoint_command_t, current) }, \
|
|
{ "SWITCH_MOD", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_xyk_airpoint_command_t, SWITCH_MOD) }, \
|
|
{ "LOITER_MOD", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_xyk_airpoint_command_t, LOITER_MOD) }, \
|
|
{ "ACTION", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_xyk_airpoint_command_t, ACTION) }, \
|
|
{ "MISSION_GRAP", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_xyk_airpoint_command_t, MISSION_GRAP) }, \
|
|
{ "POINT_SPEED", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_xyk_airpoint_command_t, POINT_SPEED) }, \
|
|
{ "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_xyk_airpoint_command_t, latitude) }, \
|
|
{ "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_xyk_airpoint_command_t, longitude) }, \
|
|
{ "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_xyk_airpoint_command_t, altitude) }, \
|
|
} \
|
|
}
|
|
#endif
|
|
|
|
/**
|
|
* @brief Pack a xyk_airpoint_command message
|
|
* @param system_id ID of this system
|
|
* @param component_id ID of this component (e.g. 200 for IMU)
|
|
* @param msg The MAVLink message to compress the data into
|
|
*
|
|
* @param PLANE_ID System which should execute the command
|
|
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
|
* @param LINE_ID SEE XYK_AIRLINE_TYPE.
|
|
* @param AIRPOINT_ID Sequence1-800
|
|
* @param LINE_LENGTH LENGTH,points contained in the aireline
|
|
* @param current false:0, true:1.
|
|
* @param SWITCH_MOD defallt Autocontinue to next waypoint.
|
|
* @param LOITER_MOD defallt arrive at next waypoint with an auto climb rate .
|
|
* @param ACTION not in use for now
|
|
* @param MISSION_GRAP not in use for now.
|
|
* @param POINT_SPEED SPEED IAS,m/s,[stall_speed,256]
|
|
* @param latitude latitude,0.0000001,[-180^,180^]
|
|
* @param longitude longitude,0.0000001,[-180^,180^]
|
|
* @param altitude altitude,0.01m,[-50000,100000]
|
|
* @return length of the message in bytes (excluding serial stream start sign)
|
|
*/
|
|
static inline uint16_t mavlink_msg_xyk_airpoint_command_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
|
uint8_t PLANE_ID, uint8_t confirmation, uint8_t LINE_ID, uint16_t AIRPOINT_ID, uint16_t LINE_LENGTH, uint8_t current, uint8_t SWITCH_MOD, uint8_t LOITER_MOD, uint8_t ACTION, uint8_t MISSION_GRAP, uint8_t POINT_SPEED, int32_t latitude, int32_t longitude, int32_t altitude)
|
|
{
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
char buf[MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN];
|
|
_mav_put_int32_t(buf, 0, latitude);
|
|
_mav_put_int32_t(buf, 4, longitude);
|
|
_mav_put_int32_t(buf, 8, altitude);
|
|
_mav_put_uint16_t(buf, 12, AIRPOINT_ID);
|
|
_mav_put_uint16_t(buf, 14, LINE_LENGTH);
|
|
_mav_put_uint8_t(buf, 16, PLANE_ID);
|
|
_mav_put_uint8_t(buf, 17, confirmation);
|
|
_mav_put_uint8_t(buf, 18, LINE_ID);
|
|
_mav_put_uint8_t(buf, 19, current);
|
|
_mav_put_uint8_t(buf, 20, SWITCH_MOD);
|
|
_mav_put_uint8_t(buf, 21, LOITER_MOD);
|
|
_mav_put_uint8_t(buf, 22, ACTION);
|
|
_mav_put_uint8_t(buf, 23, MISSION_GRAP);
|
|
_mav_put_uint8_t(buf, 24, POINT_SPEED);
|
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN);
|
|
#else
|
|
mavlink_xyk_airpoint_command_t packet;
|
|
packet.latitude = latitude;
|
|
packet.longitude = longitude;
|
|
packet.altitude = altitude;
|
|
packet.AIRPOINT_ID = AIRPOINT_ID;
|
|
packet.LINE_LENGTH = LINE_LENGTH;
|
|
packet.PLANE_ID = PLANE_ID;
|
|
packet.confirmation = confirmation;
|
|
packet.LINE_ID = LINE_ID;
|
|
packet.current = current;
|
|
packet.SWITCH_MOD = SWITCH_MOD;
|
|
packet.LOITER_MOD = LOITER_MOD;
|
|
packet.ACTION = ACTION;
|
|
packet.MISSION_GRAP = MISSION_GRAP;
|
|
packet.POINT_SPEED = POINT_SPEED;
|
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN);
|
|
#endif
|
|
|
|
msg->msgid = MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND;
|
|
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_MIN_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_CRC);
|
|
}
|
|
|
|
/**
|
|
* @brief Pack a xyk_airpoint_command message on a channel
|
|
* @param system_id ID of this system
|
|
* @param component_id ID of this component (e.g. 200 for IMU)
|
|
* @param chan The MAVLink channel this message will be sent over
|
|
* @param msg The MAVLink message to compress the data into
|
|
* @param PLANE_ID System which should execute the command
|
|
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
|
* @param LINE_ID SEE XYK_AIRLINE_TYPE.
|
|
* @param AIRPOINT_ID Sequence1-800
|
|
* @param LINE_LENGTH LENGTH,points contained in the aireline
|
|
* @param current false:0, true:1.
|
|
* @param SWITCH_MOD defallt Autocontinue to next waypoint.
|
|
* @param LOITER_MOD defallt arrive at next waypoint with an auto climb rate .
|
|
* @param ACTION not in use for now
|
|
* @param MISSION_GRAP not in use for now.
|
|
* @param POINT_SPEED SPEED IAS,m/s,[stall_speed,256]
|
|
* @param latitude latitude,0.0000001,[-180^,180^]
|
|
* @param longitude longitude,0.0000001,[-180^,180^]
|
|
* @param altitude altitude,0.01m,[-50000,100000]
|
|
* @return length of the message in bytes (excluding serial stream start sign)
|
|
*/
|
|
static inline uint16_t mavlink_msg_xyk_airpoint_command_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
|
mavlink_message_t* msg,
|
|
uint8_t PLANE_ID,uint8_t confirmation,uint8_t LINE_ID,uint16_t AIRPOINT_ID,uint16_t LINE_LENGTH,uint8_t current,uint8_t SWITCH_MOD,uint8_t LOITER_MOD,uint8_t ACTION,uint8_t MISSION_GRAP,uint8_t POINT_SPEED,int32_t latitude,int32_t longitude,int32_t altitude)
|
|
{
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
char buf[MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN];
|
|
_mav_put_int32_t(buf, 0, latitude);
|
|
_mav_put_int32_t(buf, 4, longitude);
|
|
_mav_put_int32_t(buf, 8, altitude);
|
|
_mav_put_uint16_t(buf, 12, AIRPOINT_ID);
|
|
_mav_put_uint16_t(buf, 14, LINE_LENGTH);
|
|
_mav_put_uint8_t(buf, 16, PLANE_ID);
|
|
_mav_put_uint8_t(buf, 17, confirmation);
|
|
_mav_put_uint8_t(buf, 18, LINE_ID);
|
|
_mav_put_uint8_t(buf, 19, current);
|
|
_mav_put_uint8_t(buf, 20, SWITCH_MOD);
|
|
_mav_put_uint8_t(buf, 21, LOITER_MOD);
|
|
_mav_put_uint8_t(buf, 22, ACTION);
|
|
_mav_put_uint8_t(buf, 23, MISSION_GRAP);
|
|
_mav_put_uint8_t(buf, 24, POINT_SPEED);
|
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN);
|
|
#else
|
|
mavlink_xyk_airpoint_command_t packet;
|
|
packet.latitude = latitude;
|
|
packet.longitude = longitude;
|
|
packet.altitude = altitude;
|
|
packet.AIRPOINT_ID = AIRPOINT_ID;
|
|
packet.LINE_LENGTH = LINE_LENGTH;
|
|
packet.PLANE_ID = PLANE_ID;
|
|
packet.confirmation = confirmation;
|
|
packet.LINE_ID = LINE_ID;
|
|
packet.current = current;
|
|
packet.SWITCH_MOD = SWITCH_MOD;
|
|
packet.LOITER_MOD = LOITER_MOD;
|
|
packet.ACTION = ACTION;
|
|
packet.MISSION_GRAP = MISSION_GRAP;
|
|
packet.POINT_SPEED = POINT_SPEED;
|
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN);
|
|
#endif
|
|
|
|
msg->msgid = MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND;
|
|
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_MIN_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_CRC);
|
|
}
|
|
|
|
/**
|
|
* @brief Encode a xyk_airpoint_command struct
|
|
*
|
|
* @param system_id ID of this system
|
|
* @param component_id ID of this component (e.g. 200 for IMU)
|
|
* @param msg The MAVLink message to compress the data into
|
|
* @param xyk_airpoint_command C-struct to read the message contents from
|
|
*/
|
|
static inline uint16_t mavlink_msg_xyk_airpoint_command_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_xyk_airpoint_command_t* xyk_airpoint_command)
|
|
{
|
|
return mavlink_msg_xyk_airpoint_command_pack(system_id, component_id, msg, xyk_airpoint_command->PLANE_ID, xyk_airpoint_command->confirmation, xyk_airpoint_command->LINE_ID, xyk_airpoint_command->AIRPOINT_ID, xyk_airpoint_command->LINE_LENGTH, xyk_airpoint_command->current, xyk_airpoint_command->SWITCH_MOD, xyk_airpoint_command->LOITER_MOD, xyk_airpoint_command->ACTION, xyk_airpoint_command->MISSION_GRAP, xyk_airpoint_command->POINT_SPEED, xyk_airpoint_command->latitude, xyk_airpoint_command->longitude, xyk_airpoint_command->altitude);
|
|
}
|
|
|
|
/**
|
|
* @brief Encode a xyk_airpoint_command struct on a channel
|
|
*
|
|
* @param system_id ID of this system
|
|
* @param component_id ID of this component (e.g. 200 for IMU)
|
|
* @param chan The MAVLink channel this message will be sent over
|
|
* @param msg The MAVLink message to compress the data into
|
|
* @param xyk_airpoint_command C-struct to read the message contents from
|
|
*/
|
|
static inline uint16_t mavlink_msg_xyk_airpoint_command_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_xyk_airpoint_command_t* xyk_airpoint_command)
|
|
{
|
|
return mavlink_msg_xyk_airpoint_command_pack_chan(system_id, component_id, chan, msg, xyk_airpoint_command->PLANE_ID, xyk_airpoint_command->confirmation, xyk_airpoint_command->LINE_ID, xyk_airpoint_command->AIRPOINT_ID, xyk_airpoint_command->LINE_LENGTH, xyk_airpoint_command->current, xyk_airpoint_command->SWITCH_MOD, xyk_airpoint_command->LOITER_MOD, xyk_airpoint_command->ACTION, xyk_airpoint_command->MISSION_GRAP, xyk_airpoint_command->POINT_SPEED, xyk_airpoint_command->latitude, xyk_airpoint_command->longitude, xyk_airpoint_command->altitude);
|
|
}
|
|
|
|
/**
|
|
* @brief Send a xyk_airpoint_command message
|
|
* @param chan MAVLink channel to send the message
|
|
*
|
|
* @param PLANE_ID System which should execute the command
|
|
* @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
|
* @param LINE_ID SEE XYK_AIRLINE_TYPE.
|
|
* @param AIRPOINT_ID Sequence1-800
|
|
* @param LINE_LENGTH LENGTH,points contained in the aireline
|
|
* @param current false:0, true:1.
|
|
* @param SWITCH_MOD defallt Autocontinue to next waypoint.
|
|
* @param LOITER_MOD defallt arrive at next waypoint with an auto climb rate .
|
|
* @param ACTION not in use for now
|
|
* @param MISSION_GRAP not in use for now.
|
|
* @param POINT_SPEED SPEED IAS,m/s,[stall_speed,256]
|
|
* @param latitude latitude,0.0000001,[-180^,180^]
|
|
* @param longitude longitude,0.0000001,[-180^,180^]
|
|
* @param altitude altitude,0.01m,[-50000,100000]
|
|
*/
|
|
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
|
|
|
static inline void mavlink_msg_xyk_airpoint_command_send(mavlink_channel_t chan, uint8_t PLANE_ID, uint8_t confirmation, uint8_t LINE_ID, uint16_t AIRPOINT_ID, uint16_t LINE_LENGTH, uint8_t current, uint8_t SWITCH_MOD, uint8_t LOITER_MOD, uint8_t ACTION, uint8_t MISSION_GRAP, uint8_t POINT_SPEED, int32_t latitude, int32_t longitude, int32_t altitude)
|
|
{
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
char buf[MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN];
|
|
_mav_put_int32_t(buf, 0, latitude);
|
|
_mav_put_int32_t(buf, 4, longitude);
|
|
_mav_put_int32_t(buf, 8, altitude);
|
|
_mav_put_uint16_t(buf, 12, AIRPOINT_ID);
|
|
_mav_put_uint16_t(buf, 14, LINE_LENGTH);
|
|
_mav_put_uint8_t(buf, 16, PLANE_ID);
|
|
_mav_put_uint8_t(buf, 17, confirmation);
|
|
_mav_put_uint8_t(buf, 18, LINE_ID);
|
|
_mav_put_uint8_t(buf, 19, current);
|
|
_mav_put_uint8_t(buf, 20, SWITCH_MOD);
|
|
_mav_put_uint8_t(buf, 21, LOITER_MOD);
|
|
_mav_put_uint8_t(buf, 22, ACTION);
|
|
_mav_put_uint8_t(buf, 23, MISSION_GRAP);
|
|
_mav_put_uint8_t(buf, 24, POINT_SPEED);
|
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND, buf, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_MIN_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_CRC);
|
|
#else
|
|
mavlink_xyk_airpoint_command_t packet;
|
|
packet.latitude = latitude;
|
|
packet.longitude = longitude;
|
|
packet.altitude = altitude;
|
|
packet.AIRPOINT_ID = AIRPOINT_ID;
|
|
packet.LINE_LENGTH = LINE_LENGTH;
|
|
packet.PLANE_ID = PLANE_ID;
|
|
packet.confirmation = confirmation;
|
|
packet.LINE_ID = LINE_ID;
|
|
packet.current = current;
|
|
packet.SWITCH_MOD = SWITCH_MOD;
|
|
packet.LOITER_MOD = LOITER_MOD;
|
|
packet.ACTION = ACTION;
|
|
packet.MISSION_GRAP = MISSION_GRAP;
|
|
packet.POINT_SPEED = POINT_SPEED;
|
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND, (const char *)&packet, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_MIN_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_CRC);
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* @brief Send a xyk_airpoint_command message
|
|
* @param chan MAVLink channel to send the message
|
|
* @param struct The MAVLink struct to serialize
|
|
*/
|
|
static inline void mavlink_msg_xyk_airpoint_command_send_struct(mavlink_channel_t chan, const mavlink_xyk_airpoint_command_t* xyk_airpoint_command)
|
|
{
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
mavlink_msg_xyk_airpoint_command_send(chan, xyk_airpoint_command->PLANE_ID, xyk_airpoint_command->confirmation, xyk_airpoint_command->LINE_ID, xyk_airpoint_command->AIRPOINT_ID, xyk_airpoint_command->LINE_LENGTH, xyk_airpoint_command->current, xyk_airpoint_command->SWITCH_MOD, xyk_airpoint_command->LOITER_MOD, xyk_airpoint_command->ACTION, xyk_airpoint_command->MISSION_GRAP, xyk_airpoint_command->POINT_SPEED, xyk_airpoint_command->latitude, xyk_airpoint_command->longitude, xyk_airpoint_command->altitude);
|
|
#else
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND, (const char *)xyk_airpoint_command, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_MIN_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_CRC);
|
|
#endif
|
|
}
|
|
|
|
#if MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
|
/*
|
|
This varient of _send() can be used to save stack space by re-using
|
|
memory from the receive buffer. The caller provides a
|
|
mavlink_message_t which is the size of a full mavlink message. This
|
|
is usually the receive buffer for the channel, and allows a reply to an
|
|
incoming message with minimum stack space usage.
|
|
*/
|
|
static inline void mavlink_msg_xyk_airpoint_command_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t PLANE_ID, uint8_t confirmation, uint8_t LINE_ID, uint16_t AIRPOINT_ID, uint16_t LINE_LENGTH, uint8_t current, uint8_t SWITCH_MOD, uint8_t LOITER_MOD, uint8_t ACTION, uint8_t MISSION_GRAP, uint8_t POINT_SPEED, 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_put_uint16_t(buf, 12, AIRPOINT_ID);
|
|
_mav_put_uint16_t(buf, 14, LINE_LENGTH);
|
|
_mav_put_uint8_t(buf, 16, PLANE_ID);
|
|
_mav_put_uint8_t(buf, 17, confirmation);
|
|
_mav_put_uint8_t(buf, 18, LINE_ID);
|
|
_mav_put_uint8_t(buf, 19, current);
|
|
_mav_put_uint8_t(buf, 20, SWITCH_MOD);
|
|
_mav_put_uint8_t(buf, 21, LOITER_MOD);
|
|
_mav_put_uint8_t(buf, 22, ACTION);
|
|
_mav_put_uint8_t(buf, 23, MISSION_GRAP);
|
|
_mav_put_uint8_t(buf, 24, POINT_SPEED);
|
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND, buf, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_MIN_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_CRC);
|
|
#else
|
|
mavlink_xyk_airpoint_command_t *packet = (mavlink_xyk_airpoint_command_t *)msgbuf;
|
|
packet->latitude = latitude;
|
|
packet->longitude = longitude;
|
|
packet->altitude = altitude;
|
|
packet->AIRPOINT_ID = AIRPOINT_ID;
|
|
packet->LINE_LENGTH = LINE_LENGTH;
|
|
packet->PLANE_ID = PLANE_ID;
|
|
packet->confirmation = confirmation;
|
|
packet->LINE_ID = LINE_ID;
|
|
packet->current = current;
|
|
packet->SWITCH_MOD = SWITCH_MOD;
|
|
packet->LOITER_MOD = LOITER_MOD;
|
|
packet->ACTION = ACTION;
|
|
packet->MISSION_GRAP = MISSION_GRAP;
|
|
packet->POINT_SPEED = POINT_SPEED;
|
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND, (const char *)packet, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_MIN_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_CRC);
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
// MESSAGE XYK_AIRPOINT_COMMAND UNPACKING
|
|
|
|
|
|
/**
|
|
* @brief Get field PLANE_ID from xyk_airpoint_command message
|
|
*
|
|
* @return System which should execute the command
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_PLANE_ID(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 16);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field confirmation from xyk_airpoint_command message
|
|
*
|
|
* @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_confirmation(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 17);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field LINE_ID from xyk_airpoint_command message
|
|
*
|
|
* @return SEE XYK_AIRLINE_TYPE.
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_LINE_ID(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 18);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field AIRPOINT_ID from xyk_airpoint_command message
|
|
*
|
|
* @return Sequence1-800
|
|
*/
|
|
static inline uint16_t mavlink_msg_xyk_airpoint_command_get_AIRPOINT_ID(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint16_t(msg, 12);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field LINE_LENGTH from xyk_airpoint_command message
|
|
*
|
|
* @return LENGTH,points contained in the aireline
|
|
*/
|
|
static inline uint16_t mavlink_msg_xyk_airpoint_command_get_LINE_LENGTH(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint16_t(msg, 14);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field current from xyk_airpoint_command message
|
|
*
|
|
* @return false:0, true:1.
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_current(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 19);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field SWITCH_MOD from xyk_airpoint_command message
|
|
*
|
|
* @return defallt Autocontinue to next waypoint.
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_SWITCH_MOD(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 20);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field LOITER_MOD from xyk_airpoint_command message
|
|
*
|
|
* @return defallt arrive at next waypoint with an auto climb rate .
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_LOITER_MOD(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 21);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field ACTION from xyk_airpoint_command message
|
|
*
|
|
* @return not in use for now
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_ACTION(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 22);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field MISSION_GRAP from xyk_airpoint_command message
|
|
*
|
|
* @return not in use for now.
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_MISSION_GRAP(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 23);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field POINT_SPEED from xyk_airpoint_command message
|
|
*
|
|
* @return SPEED IAS,m/s,[stall_speed,256]
|
|
*/
|
|
static inline uint8_t mavlink_msg_xyk_airpoint_command_get_POINT_SPEED(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_uint8_t(msg, 24);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field latitude from xyk_airpoint_command message
|
|
*
|
|
* @return latitude,0.0000001,[-180^,180^]
|
|
*/
|
|
static inline int32_t mavlink_msg_xyk_airpoint_command_get_latitude(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_int32_t(msg, 0);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field longitude from xyk_airpoint_command message
|
|
*
|
|
* @return longitude,0.0000001,[-180^,180^]
|
|
*/
|
|
static inline int32_t mavlink_msg_xyk_airpoint_command_get_longitude(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_int32_t(msg, 4);
|
|
}
|
|
|
|
/**
|
|
* @brief Get field altitude from xyk_airpoint_command message
|
|
*
|
|
* @return altitude,0.01m,[-50000,100000]
|
|
*/
|
|
static inline int32_t mavlink_msg_xyk_airpoint_command_get_altitude(const mavlink_message_t* msg)
|
|
{
|
|
return _MAV_RETURN_int32_t(msg, 8);
|
|
}
|
|
|
|
/**
|
|
* @brief Decode a xyk_airpoint_command message into a struct
|
|
*
|
|
* @param msg The message to decode
|
|
* @param xyk_airpoint_command C-struct to decode the message contents into
|
|
*/
|
|
static inline void mavlink_msg_xyk_airpoint_command_decode(const mavlink_message_t* msg, mavlink_xyk_airpoint_command_t* xyk_airpoint_command)
|
|
{
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
xyk_airpoint_command->latitude = mavlink_msg_xyk_airpoint_command_get_latitude(msg);
|
|
xyk_airpoint_command->longitude = mavlink_msg_xyk_airpoint_command_get_longitude(msg);
|
|
xyk_airpoint_command->altitude = mavlink_msg_xyk_airpoint_command_get_altitude(msg);
|
|
xyk_airpoint_command->AIRPOINT_ID = mavlink_msg_xyk_airpoint_command_get_AIRPOINT_ID(msg);
|
|
xyk_airpoint_command->LINE_LENGTH = mavlink_msg_xyk_airpoint_command_get_LINE_LENGTH(msg);
|
|
xyk_airpoint_command->PLANE_ID = mavlink_msg_xyk_airpoint_command_get_PLANE_ID(msg);
|
|
xyk_airpoint_command->confirmation = mavlink_msg_xyk_airpoint_command_get_confirmation(msg);
|
|
xyk_airpoint_command->LINE_ID = mavlink_msg_xyk_airpoint_command_get_LINE_ID(msg);
|
|
xyk_airpoint_command->current = mavlink_msg_xyk_airpoint_command_get_current(msg);
|
|
xyk_airpoint_command->SWITCH_MOD = mavlink_msg_xyk_airpoint_command_get_SWITCH_MOD(msg);
|
|
xyk_airpoint_command->LOITER_MOD = mavlink_msg_xyk_airpoint_command_get_LOITER_MOD(msg);
|
|
xyk_airpoint_command->ACTION = mavlink_msg_xyk_airpoint_command_get_ACTION(msg);
|
|
xyk_airpoint_command->MISSION_GRAP = mavlink_msg_xyk_airpoint_command_get_MISSION_GRAP(msg);
|
|
xyk_airpoint_command->POINT_SPEED = mavlink_msg_xyk_airpoint_command_get_POINT_SPEED(msg);
|
|
#else
|
|
uint8_t len = msg->len < MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN? msg->len : MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN;
|
|
memset(xyk_airpoint_command, 0, MAVLINK_MSG_ID_XYK_AIRPOINT_COMMAND_LEN);
|
|
memcpy(xyk_airpoint_command, _MAV_PAYLOAD(msg), len);
|
|
#endif
|
|
}
|