#pragma once // MESSAGE VKFLY_EDU_STATUS PACKING #define MAVLINK_MSG_ID_VKFLY_EDU_STATUS 53025 typedef struct __mavlink_vkfly_edu_status_t { uint64_t unix_timestamp; /*< [ms] Unix timestamp in ms, from 1 Jan 1970.*/ uint32_t boot_timestamp; /*< [ms] Timestamp in ms from system boot.*/ uint32_t seq; /*< Sequence number for this package.*/ uint32_t dev_sn; /*< Device SN number.*/ int32_t longitude; /*< [degE7] wgs84 longitude*/ int32_t latitude; /*< [degE7] wgs84 latitude*/ float amsl; /*< [m] altitude amsl*/ float alt_relative; /*< [m] altitude above takeoff*/ int16_t ve; /*< [cm/s] */ int16_t vn; /*< [cm/s] */ int16_t vu; /*< [cm/s] */ int16_t yaw; /*< [cdeg] */ int16_t pitch; /*< [cdeg] */ int16_t roll; /*< [cdeg] */ int16_t yaw_rate; /*< [cdeg/s] */ uint8_t dev_type; /*< 0 for flight controller. 1 for elec-stake*/ uint8_t retry_cnt; /*< Retry send this message count.*/ uint8_t fix_type; /*< 0 no fix, 1 single, 2 RTK*/ uint8_t reserve; /*< */ uint8_t flight_mode; /*< */ } mavlink_vkfly_edu_status_t; #define MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN 55 #define MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN 55 #define MAVLINK_MSG_ID_53025_LEN 55 #define MAVLINK_MSG_ID_53025_MIN_LEN 55 #define MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC 24 #define MAVLINK_MSG_ID_53025_CRC 24 #if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_VKFLY_EDU_STATUS { \ 53025, \ "VKFLY_EDU_STATUS", \ 20, \ { { "unix_timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vkfly_edu_status_t, unix_timestamp) }, \ { "boot_timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_vkfly_edu_status_t, boot_timestamp) }, \ { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_vkfly_edu_status_t, seq) }, \ { "dev_sn", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_vkfly_edu_status_t, dev_sn) }, \ { "dev_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_vkfly_edu_status_t, dev_type) }, \ { "retry_cnt", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_vkfly_edu_status_t, retry_cnt) }, \ { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_vkfly_edu_status_t, fix_type) }, \ { "reserve", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_vkfly_edu_status_t, reserve) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_vkfly_edu_status_t, longitude) }, \ { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_vkfly_edu_status_t, latitude) }, \ { "amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vkfly_edu_status_t, amsl) }, \ { "alt_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_vkfly_edu_status_t, alt_relative) }, \ { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_vkfly_edu_status_t, ve) }, \ { "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_vkfly_edu_status_t, vn) }, \ { "vu", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_vkfly_edu_status_t, vu) }, \ { "yaw", NULL, MAVLINK_TYPE_INT16_T, 0, 42, offsetof(mavlink_vkfly_edu_status_t, yaw) }, \ { "pitch", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_vkfly_edu_status_t, pitch) }, \ { "roll", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_vkfly_edu_status_t, roll) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_vkfly_edu_status_t, yaw_rate) }, \ { "flight_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 54, offsetof(mavlink_vkfly_edu_status_t, flight_mode) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_VKFLY_EDU_STATUS { \ "VKFLY_EDU_STATUS", \ 20, \ { { "unix_timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vkfly_edu_status_t, unix_timestamp) }, \ { "boot_timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_vkfly_edu_status_t, boot_timestamp) }, \ { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_vkfly_edu_status_t, seq) }, \ { "dev_sn", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_vkfly_edu_status_t, dev_sn) }, \ { "dev_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_vkfly_edu_status_t, dev_type) }, \ { "retry_cnt", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_vkfly_edu_status_t, retry_cnt) }, \ { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_vkfly_edu_status_t, fix_type) }, \ { "reserve", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_vkfly_edu_status_t, reserve) }, \ { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_vkfly_edu_status_t, longitude) }, \ { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_vkfly_edu_status_t, latitude) }, \ { "amsl", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vkfly_edu_status_t, amsl) }, \ { "alt_relative", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_vkfly_edu_status_t, alt_relative) }, \ { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_vkfly_edu_status_t, ve) }, \ { "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_vkfly_edu_status_t, vn) }, \ { "vu", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_vkfly_edu_status_t, vu) }, \ { "yaw", NULL, MAVLINK_TYPE_INT16_T, 0, 42, offsetof(mavlink_vkfly_edu_status_t, yaw) }, \ { "pitch", NULL, MAVLINK_TYPE_INT16_T, 0, 44, offsetof(mavlink_vkfly_edu_status_t, pitch) }, \ { "roll", NULL, MAVLINK_TYPE_INT16_T, 0, 46, offsetof(mavlink_vkfly_edu_status_t, roll) }, \ { "yaw_rate", NULL, MAVLINK_TYPE_INT16_T, 0, 48, offsetof(mavlink_vkfly_edu_status_t, yaw_rate) }, \ { "flight_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 54, offsetof(mavlink_vkfly_edu_status_t, flight_mode) }, \ } \ } #endif /** * @brief Pack a vkfly_edu_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 unix_timestamp [ms] Unix timestamp in ms, from 1 Jan 1970. * @param boot_timestamp [ms] Timestamp in ms from system boot. * @param seq Sequence number for this package. * @param dev_sn Device SN number. * @param dev_type 0 for flight controller. 1 for elec-stake * @param retry_cnt Retry send this message count. * @param fix_type 0 no fix, 1 single, 2 RTK * @param reserve * @param longitude [degE7] wgs84 longitude * @param latitude [degE7] wgs84 latitude * @param amsl [m] altitude amsl * @param alt_relative [m] altitude above takeoff * @param ve [cm/s] * @param vn [cm/s] * @param vu [cm/s] * @param yaw [cdeg] * @param pitch [cdeg] * @param roll [cdeg] * @param yaw_rate [cdeg/s] * @param flight_mode * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vkfly_edu_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint64_t unix_timestamp, uint32_t boot_timestamp, uint32_t seq, uint32_t dev_sn, uint8_t dev_type, uint8_t retry_cnt, uint8_t fix_type, uint8_t reserve, int32_t longitude, int32_t latitude, float amsl, float alt_relative, int16_t ve, int16_t vn, int16_t vu, int16_t yaw, int16_t pitch, int16_t roll, int16_t yaw_rate, uint8_t flight_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN]; _mav_put_uint64_t(buf, 0, unix_timestamp); _mav_put_uint32_t(buf, 8, boot_timestamp); _mav_put_uint32_t(buf, 12, seq); _mav_put_uint32_t(buf, 16, dev_sn); _mav_put_int32_t(buf, 20, longitude); _mav_put_int32_t(buf, 24, latitude); _mav_put_float(buf, 28, amsl); _mav_put_float(buf, 32, alt_relative); _mav_put_int16_t(buf, 36, ve); _mav_put_int16_t(buf, 38, vn); _mav_put_int16_t(buf, 40, vu); _mav_put_int16_t(buf, 42, yaw); _mav_put_int16_t(buf, 44, pitch); _mav_put_int16_t(buf, 46, roll); _mav_put_int16_t(buf, 48, yaw_rate); _mav_put_uint8_t(buf, 50, dev_type); _mav_put_uint8_t(buf, 51, retry_cnt); _mav_put_uint8_t(buf, 52, fix_type); _mav_put_uint8_t(buf, 53, reserve); _mav_put_uint8_t(buf, 54, flight_mode); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN); #else mavlink_vkfly_edu_status_t packet; packet.unix_timestamp = unix_timestamp; packet.boot_timestamp = boot_timestamp; packet.seq = seq; packet.dev_sn = dev_sn; packet.longitude = longitude; packet.latitude = latitude; packet.amsl = amsl; packet.alt_relative = alt_relative; packet.ve = ve; packet.vn = vn; packet.vu = vu; packet.yaw = yaw; packet.pitch = pitch; packet.roll = roll; packet.yaw_rate = yaw_rate; packet.dev_type = dev_type; packet.retry_cnt = retry_cnt; packet.fix_type = fix_type; packet.reserve = reserve; packet.flight_mode = flight_mode; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VKFLY_EDU_STATUS; return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC); } /** * @brief Pack a vkfly_edu_status message * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param status MAVLink status structure * @param msg The MAVLink message to compress the data into * * @param unix_timestamp [ms] Unix timestamp in ms, from 1 Jan 1970. * @param boot_timestamp [ms] Timestamp in ms from system boot. * @param seq Sequence number for this package. * @param dev_sn Device SN number. * @param dev_type 0 for flight controller. 1 for elec-stake * @param retry_cnt Retry send this message count. * @param fix_type 0 no fix, 1 single, 2 RTK * @param reserve * @param longitude [degE7] wgs84 longitude * @param latitude [degE7] wgs84 latitude * @param amsl [m] altitude amsl * @param alt_relative [m] altitude above takeoff * @param ve [cm/s] * @param vn [cm/s] * @param vu [cm/s] * @param yaw [cdeg] * @param pitch [cdeg] * @param roll [cdeg] * @param yaw_rate [cdeg/s] * @param flight_mode * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vkfly_edu_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg, uint64_t unix_timestamp, uint32_t boot_timestamp, uint32_t seq, uint32_t dev_sn, uint8_t dev_type, uint8_t retry_cnt, uint8_t fix_type, uint8_t reserve, int32_t longitude, int32_t latitude, float amsl, float alt_relative, int16_t ve, int16_t vn, int16_t vu, int16_t yaw, int16_t pitch, int16_t roll, int16_t yaw_rate, uint8_t flight_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN]; _mav_put_uint64_t(buf, 0, unix_timestamp); _mav_put_uint32_t(buf, 8, boot_timestamp); _mav_put_uint32_t(buf, 12, seq); _mav_put_uint32_t(buf, 16, dev_sn); _mav_put_int32_t(buf, 20, longitude); _mav_put_int32_t(buf, 24, latitude); _mav_put_float(buf, 28, amsl); _mav_put_float(buf, 32, alt_relative); _mav_put_int16_t(buf, 36, ve); _mav_put_int16_t(buf, 38, vn); _mav_put_int16_t(buf, 40, vu); _mav_put_int16_t(buf, 42, yaw); _mav_put_int16_t(buf, 44, pitch); _mav_put_int16_t(buf, 46, roll); _mav_put_int16_t(buf, 48, yaw_rate); _mav_put_uint8_t(buf, 50, dev_type); _mav_put_uint8_t(buf, 51, retry_cnt); _mav_put_uint8_t(buf, 52, fix_type); _mav_put_uint8_t(buf, 53, reserve); _mav_put_uint8_t(buf, 54, flight_mode); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN); #else mavlink_vkfly_edu_status_t packet; packet.unix_timestamp = unix_timestamp; packet.boot_timestamp = boot_timestamp; packet.seq = seq; packet.dev_sn = dev_sn; packet.longitude = longitude; packet.latitude = latitude; packet.amsl = amsl; packet.alt_relative = alt_relative; packet.ve = ve; packet.vn = vn; packet.vu = vu; packet.yaw = yaw; packet.pitch = pitch; packet.roll = roll; packet.yaw_rate = yaw_rate; packet.dev_type = dev_type; packet.retry_cnt = retry_cnt; packet.fix_type = fix_type; packet.reserve = reserve; packet.flight_mode = flight_mode; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VKFLY_EDU_STATUS; #if MAVLINK_CRC_EXTRA return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC); #else return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN); #endif } /** * @brief Pack a vkfly_edu_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 unix_timestamp [ms] Unix timestamp in ms, from 1 Jan 1970. * @param boot_timestamp [ms] Timestamp in ms from system boot. * @param seq Sequence number for this package. * @param dev_sn Device SN number. * @param dev_type 0 for flight controller. 1 for elec-stake * @param retry_cnt Retry send this message count. * @param fix_type 0 no fix, 1 single, 2 RTK * @param reserve * @param longitude [degE7] wgs84 longitude * @param latitude [degE7] wgs84 latitude * @param amsl [m] altitude amsl * @param alt_relative [m] altitude above takeoff * @param ve [cm/s] * @param vn [cm/s] * @param vu [cm/s] * @param yaw [cdeg] * @param pitch [cdeg] * @param roll [cdeg] * @param yaw_rate [cdeg/s] * @param flight_mode * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vkfly_edu_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint64_t unix_timestamp,uint32_t boot_timestamp,uint32_t seq,uint32_t dev_sn,uint8_t dev_type,uint8_t retry_cnt,uint8_t fix_type,uint8_t reserve,int32_t longitude,int32_t latitude,float amsl,float alt_relative,int16_t ve,int16_t vn,int16_t vu,int16_t yaw,int16_t pitch,int16_t roll,int16_t yaw_rate,uint8_t flight_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN]; _mav_put_uint64_t(buf, 0, unix_timestamp); _mav_put_uint32_t(buf, 8, boot_timestamp); _mav_put_uint32_t(buf, 12, seq); _mav_put_uint32_t(buf, 16, dev_sn); _mav_put_int32_t(buf, 20, longitude); _mav_put_int32_t(buf, 24, latitude); _mav_put_float(buf, 28, amsl); _mav_put_float(buf, 32, alt_relative); _mav_put_int16_t(buf, 36, ve); _mav_put_int16_t(buf, 38, vn); _mav_put_int16_t(buf, 40, vu); _mav_put_int16_t(buf, 42, yaw); _mav_put_int16_t(buf, 44, pitch); _mav_put_int16_t(buf, 46, roll); _mav_put_int16_t(buf, 48, yaw_rate); _mav_put_uint8_t(buf, 50, dev_type); _mav_put_uint8_t(buf, 51, retry_cnt); _mav_put_uint8_t(buf, 52, fix_type); _mav_put_uint8_t(buf, 53, reserve); _mav_put_uint8_t(buf, 54, flight_mode); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN); #else mavlink_vkfly_edu_status_t packet; packet.unix_timestamp = unix_timestamp; packet.boot_timestamp = boot_timestamp; packet.seq = seq; packet.dev_sn = dev_sn; packet.longitude = longitude; packet.latitude = latitude; packet.amsl = amsl; packet.alt_relative = alt_relative; packet.ve = ve; packet.vn = vn; packet.vu = vu; packet.yaw = yaw; packet.pitch = pitch; packet.roll = roll; packet.yaw_rate = yaw_rate; packet.dev_type = dev_type; packet.retry_cnt = retry_cnt; packet.fix_type = fix_type; packet.reserve = reserve; packet.flight_mode = flight_mode; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VKFLY_EDU_STATUS; return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC); } /** * @brief Encode a vkfly_edu_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 vkfly_edu_status C-struct to read the message contents from */ static inline uint16_t mavlink_msg_vkfly_edu_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vkfly_edu_status_t* vkfly_edu_status) { return mavlink_msg_vkfly_edu_status_pack(system_id, component_id, msg, vkfly_edu_status->unix_timestamp, vkfly_edu_status->boot_timestamp, vkfly_edu_status->seq, vkfly_edu_status->dev_sn, vkfly_edu_status->dev_type, vkfly_edu_status->retry_cnt, vkfly_edu_status->fix_type, vkfly_edu_status->reserve, vkfly_edu_status->longitude, vkfly_edu_status->latitude, vkfly_edu_status->amsl, vkfly_edu_status->alt_relative, vkfly_edu_status->ve, vkfly_edu_status->vn, vkfly_edu_status->vu, vkfly_edu_status->yaw, vkfly_edu_status->pitch, vkfly_edu_status->roll, vkfly_edu_status->yaw_rate, vkfly_edu_status->flight_mode); } /** * @brief Encode a vkfly_edu_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 vkfly_edu_status C-struct to read the message contents from */ static inline uint16_t mavlink_msg_vkfly_edu_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vkfly_edu_status_t* vkfly_edu_status) { return mavlink_msg_vkfly_edu_status_pack_chan(system_id, component_id, chan, msg, vkfly_edu_status->unix_timestamp, vkfly_edu_status->boot_timestamp, vkfly_edu_status->seq, vkfly_edu_status->dev_sn, vkfly_edu_status->dev_type, vkfly_edu_status->retry_cnt, vkfly_edu_status->fix_type, vkfly_edu_status->reserve, vkfly_edu_status->longitude, vkfly_edu_status->latitude, vkfly_edu_status->amsl, vkfly_edu_status->alt_relative, vkfly_edu_status->ve, vkfly_edu_status->vn, vkfly_edu_status->vu, vkfly_edu_status->yaw, vkfly_edu_status->pitch, vkfly_edu_status->roll, vkfly_edu_status->yaw_rate, vkfly_edu_status->flight_mode); } /** * @brief Encode a vkfly_edu_status struct with provided status structure * * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param status MAVLink status structure * @param msg The MAVLink message to compress the data into * @param vkfly_edu_status C-struct to read the message contents from */ static inline uint16_t mavlink_msg_vkfly_edu_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_vkfly_edu_status_t* vkfly_edu_status) { return mavlink_msg_vkfly_edu_status_pack_status(system_id, component_id, _status, msg, vkfly_edu_status->unix_timestamp, vkfly_edu_status->boot_timestamp, vkfly_edu_status->seq, vkfly_edu_status->dev_sn, vkfly_edu_status->dev_type, vkfly_edu_status->retry_cnt, vkfly_edu_status->fix_type, vkfly_edu_status->reserve, vkfly_edu_status->longitude, vkfly_edu_status->latitude, vkfly_edu_status->amsl, vkfly_edu_status->alt_relative, vkfly_edu_status->ve, vkfly_edu_status->vn, vkfly_edu_status->vu, vkfly_edu_status->yaw, vkfly_edu_status->pitch, vkfly_edu_status->roll, vkfly_edu_status->yaw_rate, vkfly_edu_status->flight_mode); } /** * @brief Send a vkfly_edu_status message * @param chan MAVLink channel to send the message * * @param unix_timestamp [ms] Unix timestamp in ms, from 1 Jan 1970. * @param boot_timestamp [ms] Timestamp in ms from system boot. * @param seq Sequence number for this package. * @param dev_sn Device SN number. * @param dev_type 0 for flight controller. 1 for elec-stake * @param retry_cnt Retry send this message count. * @param fix_type 0 no fix, 1 single, 2 RTK * @param reserve * @param longitude [degE7] wgs84 longitude * @param latitude [degE7] wgs84 latitude * @param amsl [m] altitude amsl * @param alt_relative [m] altitude above takeoff * @param ve [cm/s] * @param vn [cm/s] * @param vu [cm/s] * @param yaw [cdeg] * @param pitch [cdeg] * @param roll [cdeg] * @param yaw_rate [cdeg/s] * @param flight_mode */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS static inline void mavlink_msg_vkfly_edu_status_send(mavlink_channel_t chan, uint64_t unix_timestamp, uint32_t boot_timestamp, uint32_t seq, uint32_t dev_sn, uint8_t dev_type, uint8_t retry_cnt, uint8_t fix_type, uint8_t reserve, int32_t longitude, int32_t latitude, float amsl, float alt_relative, int16_t ve, int16_t vn, int16_t vu, int16_t yaw, int16_t pitch, int16_t roll, int16_t yaw_rate, uint8_t flight_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN]; _mav_put_uint64_t(buf, 0, unix_timestamp); _mav_put_uint32_t(buf, 8, boot_timestamp); _mav_put_uint32_t(buf, 12, seq); _mav_put_uint32_t(buf, 16, dev_sn); _mav_put_int32_t(buf, 20, longitude); _mav_put_int32_t(buf, 24, latitude); _mav_put_float(buf, 28, amsl); _mav_put_float(buf, 32, alt_relative); _mav_put_int16_t(buf, 36, ve); _mav_put_int16_t(buf, 38, vn); _mav_put_int16_t(buf, 40, vu); _mav_put_int16_t(buf, 42, yaw); _mav_put_int16_t(buf, 44, pitch); _mav_put_int16_t(buf, 46, roll); _mav_put_int16_t(buf, 48, yaw_rate); _mav_put_uint8_t(buf, 50, dev_type); _mav_put_uint8_t(buf, 51, retry_cnt); _mav_put_uint8_t(buf, 52, fix_type); _mav_put_uint8_t(buf, 53, reserve); _mav_put_uint8_t(buf, 54, flight_mode); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS, buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC); #else mavlink_vkfly_edu_status_t packet; packet.unix_timestamp = unix_timestamp; packet.boot_timestamp = boot_timestamp; packet.seq = seq; packet.dev_sn = dev_sn; packet.longitude = longitude; packet.latitude = latitude; packet.amsl = amsl; packet.alt_relative = alt_relative; packet.ve = ve; packet.vn = vn; packet.vu = vu; packet.yaw = yaw; packet.pitch = pitch; packet.roll = roll; packet.yaw_rate = yaw_rate; packet.dev_type = dev_type; packet.retry_cnt = retry_cnt; packet.fix_type = fix_type; packet.reserve = reserve; packet.flight_mode = flight_mode; _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS, (const char *)&packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC); #endif } /** * @brief Send a vkfly_edu_status message * @param chan MAVLink channel to send the message * @param struct The MAVLink struct to serialize */ static inline void mavlink_msg_vkfly_edu_status_send_struct(mavlink_channel_t chan, const mavlink_vkfly_edu_status_t* vkfly_edu_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS mavlink_msg_vkfly_edu_status_send(chan, vkfly_edu_status->unix_timestamp, vkfly_edu_status->boot_timestamp, vkfly_edu_status->seq, vkfly_edu_status->dev_sn, vkfly_edu_status->dev_type, vkfly_edu_status->retry_cnt, vkfly_edu_status->fix_type, vkfly_edu_status->reserve, vkfly_edu_status->longitude, vkfly_edu_status->latitude, vkfly_edu_status->amsl, vkfly_edu_status->alt_relative, vkfly_edu_status->ve, vkfly_edu_status->vn, vkfly_edu_status->vu, vkfly_edu_status->yaw, vkfly_edu_status->pitch, vkfly_edu_status->roll, vkfly_edu_status->yaw_rate, vkfly_edu_status->flight_mode); #else _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS, (const char *)vkfly_edu_status, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC); #endif } #if MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN /* This variant of _send() can be used to save stack space by reusing 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_vkfly_edu_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t unix_timestamp, uint32_t boot_timestamp, uint32_t seq, uint32_t dev_sn, uint8_t dev_type, uint8_t retry_cnt, uint8_t fix_type, uint8_t reserve, int32_t longitude, int32_t latitude, float amsl, float alt_relative, int16_t ve, int16_t vn, int16_t vu, int16_t yaw, int16_t pitch, int16_t roll, int16_t yaw_rate, uint8_t flight_mode) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char *buf = (char *)msgbuf; _mav_put_uint64_t(buf, 0, unix_timestamp); _mav_put_uint32_t(buf, 8, boot_timestamp); _mav_put_uint32_t(buf, 12, seq); _mav_put_uint32_t(buf, 16, dev_sn); _mav_put_int32_t(buf, 20, longitude); _mav_put_int32_t(buf, 24, latitude); _mav_put_float(buf, 28, amsl); _mav_put_float(buf, 32, alt_relative); _mav_put_int16_t(buf, 36, ve); _mav_put_int16_t(buf, 38, vn); _mav_put_int16_t(buf, 40, vu); _mav_put_int16_t(buf, 42, yaw); _mav_put_int16_t(buf, 44, pitch); _mav_put_int16_t(buf, 46, roll); _mav_put_int16_t(buf, 48, yaw_rate); _mav_put_uint8_t(buf, 50, dev_type); _mav_put_uint8_t(buf, 51, retry_cnt); _mav_put_uint8_t(buf, 52, fix_type); _mav_put_uint8_t(buf, 53, reserve); _mav_put_uint8_t(buf, 54, flight_mode); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS, buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC); #else mavlink_vkfly_edu_status_t *packet = (mavlink_vkfly_edu_status_t *)msgbuf; packet->unix_timestamp = unix_timestamp; packet->boot_timestamp = boot_timestamp; packet->seq = seq; packet->dev_sn = dev_sn; packet->longitude = longitude; packet->latitude = latitude; packet->amsl = amsl; packet->alt_relative = alt_relative; packet->ve = ve; packet->vn = vn; packet->vu = vu; packet->yaw = yaw; packet->pitch = pitch; packet->roll = roll; packet->yaw_rate = yaw_rate; packet->dev_type = dev_type; packet->retry_cnt = retry_cnt; packet->fix_type = fix_type; packet->reserve = reserve; packet->flight_mode = flight_mode; _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS, (const char *)packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_CRC); #endif } #endif #endif // MESSAGE VKFLY_EDU_STATUS UNPACKING /** * @brief Get field unix_timestamp from vkfly_edu_status message * * @return [ms] Unix timestamp in ms, from 1 Jan 1970. */ static inline uint64_t mavlink_msg_vkfly_edu_status_get_unix_timestamp(const mavlink_message_t* msg) { return _MAV_RETURN_uint64_t(msg, 0); } /** * @brief Get field boot_timestamp from vkfly_edu_status message * * @return [ms] Timestamp in ms from system boot. */ static inline uint32_t mavlink_msg_vkfly_edu_status_get_boot_timestamp(const mavlink_message_t* msg) { return _MAV_RETURN_uint32_t(msg, 8); } /** * @brief Get field seq from vkfly_edu_status message * * @return Sequence number for this package. */ static inline uint32_t mavlink_msg_vkfly_edu_status_get_seq(const mavlink_message_t* msg) { return _MAV_RETURN_uint32_t(msg, 12); } /** * @brief Get field dev_sn from vkfly_edu_status message * * @return Device SN number. */ static inline uint32_t mavlink_msg_vkfly_edu_status_get_dev_sn(const mavlink_message_t* msg) { return _MAV_RETURN_uint32_t(msg, 16); } /** * @brief Get field dev_type from vkfly_edu_status message * * @return 0 for flight controller. 1 for elec-stake */ static inline uint8_t mavlink_msg_vkfly_edu_status_get_dev_type(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 50); } /** * @brief Get field retry_cnt from vkfly_edu_status message * * @return Retry send this message count. */ static inline uint8_t mavlink_msg_vkfly_edu_status_get_retry_cnt(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 51); } /** * @brief Get field fix_type from vkfly_edu_status message * * @return 0 no fix, 1 single, 2 RTK */ static inline uint8_t mavlink_msg_vkfly_edu_status_get_fix_type(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 52); } /** * @brief Get field reserve from vkfly_edu_status message * * @return */ static inline uint8_t mavlink_msg_vkfly_edu_status_get_reserve(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 53); } /** * @brief Get field longitude from vkfly_edu_status message * * @return [degE7] wgs84 longitude */ static inline int32_t mavlink_msg_vkfly_edu_status_get_longitude(const mavlink_message_t* msg) { return _MAV_RETURN_int32_t(msg, 20); } /** * @brief Get field latitude from vkfly_edu_status message * * @return [degE7] wgs84 latitude */ static inline int32_t mavlink_msg_vkfly_edu_status_get_latitude(const mavlink_message_t* msg) { return _MAV_RETURN_int32_t(msg, 24); } /** * @brief Get field amsl from vkfly_edu_status message * * @return [m] altitude amsl */ static inline float mavlink_msg_vkfly_edu_status_get_amsl(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 28); } /** * @brief Get field alt_relative from vkfly_edu_status message * * @return [m] altitude above takeoff */ static inline float mavlink_msg_vkfly_edu_status_get_alt_relative(const mavlink_message_t* msg) { return _MAV_RETURN_float(msg, 32); } /** * @brief Get field ve from vkfly_edu_status message * * @return [cm/s] */ static inline int16_t mavlink_msg_vkfly_edu_status_get_ve(const mavlink_message_t* msg) { return _MAV_RETURN_int16_t(msg, 36); } /** * @brief Get field vn from vkfly_edu_status message * * @return [cm/s] */ static inline int16_t mavlink_msg_vkfly_edu_status_get_vn(const mavlink_message_t* msg) { return _MAV_RETURN_int16_t(msg, 38); } /** * @brief Get field vu from vkfly_edu_status message * * @return [cm/s] */ static inline int16_t mavlink_msg_vkfly_edu_status_get_vu(const mavlink_message_t* msg) { return _MAV_RETURN_int16_t(msg, 40); } /** * @brief Get field yaw from vkfly_edu_status message * * @return [cdeg] */ static inline int16_t mavlink_msg_vkfly_edu_status_get_yaw(const mavlink_message_t* msg) { return _MAV_RETURN_int16_t(msg, 42); } /** * @brief Get field pitch from vkfly_edu_status message * * @return [cdeg] */ static inline int16_t mavlink_msg_vkfly_edu_status_get_pitch(const mavlink_message_t* msg) { return _MAV_RETURN_int16_t(msg, 44); } /** * @brief Get field roll from vkfly_edu_status message * * @return [cdeg] */ static inline int16_t mavlink_msg_vkfly_edu_status_get_roll(const mavlink_message_t* msg) { return _MAV_RETURN_int16_t(msg, 46); } /** * @brief Get field yaw_rate from vkfly_edu_status message * * @return [cdeg/s] */ static inline int16_t mavlink_msg_vkfly_edu_status_get_yaw_rate(const mavlink_message_t* msg) { return _MAV_RETURN_int16_t(msg, 48); } /** * @brief Get field flight_mode from vkfly_edu_status message * * @return */ static inline uint8_t mavlink_msg_vkfly_edu_status_get_flight_mode(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 54); } /** * @brief Decode a vkfly_edu_status message into a struct * * @param msg The message to decode * @param vkfly_edu_status C-struct to decode the message contents into */ static inline void mavlink_msg_vkfly_edu_status_decode(const mavlink_message_t* msg, mavlink_vkfly_edu_status_t* vkfly_edu_status) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS vkfly_edu_status->unix_timestamp = mavlink_msg_vkfly_edu_status_get_unix_timestamp(msg); vkfly_edu_status->boot_timestamp = mavlink_msg_vkfly_edu_status_get_boot_timestamp(msg); vkfly_edu_status->seq = mavlink_msg_vkfly_edu_status_get_seq(msg); vkfly_edu_status->dev_sn = mavlink_msg_vkfly_edu_status_get_dev_sn(msg); vkfly_edu_status->longitude = mavlink_msg_vkfly_edu_status_get_longitude(msg); vkfly_edu_status->latitude = mavlink_msg_vkfly_edu_status_get_latitude(msg); vkfly_edu_status->amsl = mavlink_msg_vkfly_edu_status_get_amsl(msg); vkfly_edu_status->alt_relative = mavlink_msg_vkfly_edu_status_get_alt_relative(msg); vkfly_edu_status->ve = mavlink_msg_vkfly_edu_status_get_ve(msg); vkfly_edu_status->vn = mavlink_msg_vkfly_edu_status_get_vn(msg); vkfly_edu_status->vu = mavlink_msg_vkfly_edu_status_get_vu(msg); vkfly_edu_status->yaw = mavlink_msg_vkfly_edu_status_get_yaw(msg); vkfly_edu_status->pitch = mavlink_msg_vkfly_edu_status_get_pitch(msg); vkfly_edu_status->roll = mavlink_msg_vkfly_edu_status_get_roll(msg); vkfly_edu_status->yaw_rate = mavlink_msg_vkfly_edu_status_get_yaw_rate(msg); vkfly_edu_status->dev_type = mavlink_msg_vkfly_edu_status_get_dev_type(msg); vkfly_edu_status->retry_cnt = mavlink_msg_vkfly_edu_status_get_retry_cnt(msg); vkfly_edu_status->fix_type = mavlink_msg_vkfly_edu_status_get_fix_type(msg); vkfly_edu_status->reserve = mavlink_msg_vkfly_edu_status_get_reserve(msg); vkfly_edu_status->flight_mode = mavlink_msg_vkfly_edu_status_get_flight_mode(msg); #else uint8_t len = msg->len < MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN? msg->len : MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN; memset(vkfly_edu_status, 0, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_LEN); memcpy(vkfly_edu_status, _MAV_PAYLOAD(msg), len); #endif }