#pragma once // MESSAGE VK_COMP_VERSION PACKING #define MAVLINK_MSG_ID_VK_COMP_VERSION 53006 typedef struct __mavlink_vk_comp_version_t { uint16_t comp_id; /*< component id*/ uint8_t hw_ver[16]; /*< hardware version*/ uint8_t fw_ver[16]; /*< firmware version*/ uint8_t SN[16]; /*< SN number*/ uint8_t manufactory[16]; /*< manufactory*/ uint8_t model[16]; /*< model*/ uint8_t priv_data[16]; /*< gnss configuration*/ } mavlink_vk_comp_version_t; #define MAVLINK_MSG_ID_VK_COMP_VERSION_LEN 98 #define MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN 98 #define MAVLINK_MSG_ID_53006_LEN 98 #define MAVLINK_MSG_ID_53006_MIN_LEN 98 #define MAVLINK_MSG_ID_VK_COMP_VERSION_CRC 227 #define MAVLINK_MSG_ID_53006_CRC 227 #define MAVLINK_MSG_VK_COMP_VERSION_FIELD_HW_VER_LEN 16 #define MAVLINK_MSG_VK_COMP_VERSION_FIELD_FW_VER_LEN 16 #define MAVLINK_MSG_VK_COMP_VERSION_FIELD_SN_LEN 16 #define MAVLINK_MSG_VK_COMP_VERSION_FIELD_MANUFACTORY_LEN 16 #define MAVLINK_MSG_VK_COMP_VERSION_FIELD_MODEL_LEN 16 #define MAVLINK_MSG_VK_COMP_VERSION_FIELD_PRIV_DATA_LEN 16 #if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_VK_COMP_VERSION { \ 53006, \ "VK_COMP_VERSION", \ 7, \ { { "comp_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_vk_comp_version_t, comp_id) }, \ { "hw_ver", NULL, MAVLINK_TYPE_UINT8_T, 16, 2, offsetof(mavlink_vk_comp_version_t, hw_ver) }, \ { "fw_ver", NULL, MAVLINK_TYPE_UINT8_T, 16, 18, offsetof(mavlink_vk_comp_version_t, fw_ver) }, \ { "SN", NULL, MAVLINK_TYPE_UINT8_T, 16, 34, offsetof(mavlink_vk_comp_version_t, SN) }, \ { "manufactory", NULL, MAVLINK_TYPE_UINT8_T, 16, 50, offsetof(mavlink_vk_comp_version_t, manufactory) }, \ { "model", NULL, MAVLINK_TYPE_UINT8_T, 16, 66, offsetof(mavlink_vk_comp_version_t, model) }, \ { "priv_data", NULL, MAVLINK_TYPE_UINT8_T, 16, 82, offsetof(mavlink_vk_comp_version_t, priv_data) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_VK_COMP_VERSION { \ "VK_COMP_VERSION", \ 7, \ { { "comp_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_vk_comp_version_t, comp_id) }, \ { "hw_ver", NULL, MAVLINK_TYPE_UINT8_T, 16, 2, offsetof(mavlink_vk_comp_version_t, hw_ver) }, \ { "fw_ver", NULL, MAVLINK_TYPE_UINT8_T, 16, 18, offsetof(mavlink_vk_comp_version_t, fw_ver) }, \ { "SN", NULL, MAVLINK_TYPE_UINT8_T, 16, 34, offsetof(mavlink_vk_comp_version_t, SN) }, \ { "manufactory", NULL, MAVLINK_TYPE_UINT8_T, 16, 50, offsetof(mavlink_vk_comp_version_t, manufactory) }, \ { "model", NULL, MAVLINK_TYPE_UINT8_T, 16, 66, offsetof(mavlink_vk_comp_version_t, model) }, \ { "priv_data", NULL, MAVLINK_TYPE_UINT8_T, 16, 82, offsetof(mavlink_vk_comp_version_t, priv_data) }, \ } \ } #endif /** * @brief Pack a vk_comp_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 comp_id component id * @param hw_ver hardware version * @param fw_ver firmware version * @param SN SN number * @param manufactory manufactory * @param model model * @param priv_data gnss configuration * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vk_comp_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint16_t comp_id, const uint8_t *hw_ver, const uint8_t *fw_ver, const uint8_t *SN, const uint8_t *manufactory, const uint8_t *model, const uint8_t *priv_data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_VK_COMP_VERSION_LEN]; _mav_put_uint16_t(buf, 0, comp_id); _mav_put_uint8_t_array(buf, 2, hw_ver, 16); _mav_put_uint8_t_array(buf, 18, fw_ver, 16); _mav_put_uint8_t_array(buf, 34, SN, 16); _mav_put_uint8_t_array(buf, 50, manufactory, 16); _mav_put_uint8_t_array(buf, 66, model, 16); _mav_put_uint8_t_array(buf, 82, priv_data, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN); #else mavlink_vk_comp_version_t packet; packet.comp_id = comp_id; mav_array_memcpy(packet.hw_ver, hw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet.fw_ver, fw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet.SN, SN, sizeof(uint8_t)*16); mav_array_memcpy(packet.manufactory, manufactory, sizeof(uint8_t)*16); mav_array_memcpy(packet.model, model, sizeof(uint8_t)*16); mav_array_memcpy(packet.priv_data, priv_data, sizeof(uint8_t)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VK_COMP_VERSION; return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_CRC); } /** * @brief Pack a vk_comp_version 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 comp_id component id * @param hw_ver hardware version * @param fw_ver firmware version * @param SN SN number * @param manufactory manufactory * @param model model * @param priv_data gnss configuration * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vk_comp_version_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg, uint16_t comp_id, const uint8_t *hw_ver, const uint8_t *fw_ver, const uint8_t *SN, const uint8_t *manufactory, const uint8_t *model, const uint8_t *priv_data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_VK_COMP_VERSION_LEN]; _mav_put_uint16_t(buf, 0, comp_id); _mav_put_uint8_t_array(buf, 2, hw_ver, 16); _mav_put_uint8_t_array(buf, 18, fw_ver, 16); _mav_put_uint8_t_array(buf, 34, SN, 16); _mav_put_uint8_t_array(buf, 50, manufactory, 16); _mav_put_uint8_t_array(buf, 66, model, 16); _mav_put_uint8_t_array(buf, 82, priv_data, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN); #else mavlink_vk_comp_version_t packet; packet.comp_id = comp_id; mav_array_memcpy(packet.hw_ver, hw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet.fw_ver, fw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet.SN, SN, sizeof(uint8_t)*16); mav_array_memcpy(packet.manufactory, manufactory, sizeof(uint8_t)*16); mav_array_memcpy(packet.model, model, sizeof(uint8_t)*16); mav_array_memcpy(packet.priv_data, priv_data, sizeof(uint8_t)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VK_COMP_VERSION; #if MAVLINK_CRC_EXTRA return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_CRC); #else return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN); #endif } /** * @brief Pack a vk_comp_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 comp_id component id * @param hw_ver hardware version * @param fw_ver firmware version * @param SN SN number * @param manufactory manufactory * @param model model * @param priv_data gnss configuration * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_vk_comp_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint16_t comp_id,const uint8_t *hw_ver,const uint8_t *fw_ver,const uint8_t *SN,const uint8_t *manufactory,const uint8_t *model,const uint8_t *priv_data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_VK_COMP_VERSION_LEN]; _mav_put_uint16_t(buf, 0, comp_id); _mav_put_uint8_t_array(buf, 2, hw_ver, 16); _mav_put_uint8_t_array(buf, 18, fw_ver, 16); _mav_put_uint8_t_array(buf, 34, SN, 16); _mav_put_uint8_t_array(buf, 50, manufactory, 16); _mav_put_uint8_t_array(buf, 66, model, 16); _mav_put_uint8_t_array(buf, 82, priv_data, 16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN); #else mavlink_vk_comp_version_t packet; packet.comp_id = comp_id; mav_array_memcpy(packet.hw_ver, hw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet.fw_ver, fw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet.SN, SN, sizeof(uint8_t)*16); mav_array_memcpy(packet.manufactory, manufactory, sizeof(uint8_t)*16); mav_array_memcpy(packet.model, model, sizeof(uint8_t)*16); mav_array_memcpy(packet.priv_data, priv_data, sizeof(uint8_t)*16); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN); #endif msg->msgid = MAVLINK_MSG_ID_VK_COMP_VERSION; return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_CRC); } /** * @brief Encode a vk_comp_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 vk_comp_version C-struct to read the message contents from */ static inline uint16_t mavlink_msg_vk_comp_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vk_comp_version_t* vk_comp_version) { return mavlink_msg_vk_comp_version_pack(system_id, component_id, msg, vk_comp_version->comp_id, vk_comp_version->hw_ver, vk_comp_version->fw_ver, vk_comp_version->SN, vk_comp_version->manufactory, vk_comp_version->model, vk_comp_version->priv_data); } /** * @brief Encode a vk_comp_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 vk_comp_version C-struct to read the message contents from */ static inline uint16_t mavlink_msg_vk_comp_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vk_comp_version_t* vk_comp_version) { return mavlink_msg_vk_comp_version_pack_chan(system_id, component_id, chan, msg, vk_comp_version->comp_id, vk_comp_version->hw_ver, vk_comp_version->fw_ver, vk_comp_version->SN, vk_comp_version->manufactory, vk_comp_version->model, vk_comp_version->priv_data); } /** * @brief Encode a vk_comp_version 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 vk_comp_version C-struct to read the message contents from */ static inline uint16_t mavlink_msg_vk_comp_version_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_vk_comp_version_t* vk_comp_version) { return mavlink_msg_vk_comp_version_pack_status(system_id, component_id, _status, msg, vk_comp_version->comp_id, vk_comp_version->hw_ver, vk_comp_version->fw_ver, vk_comp_version->SN, vk_comp_version->manufactory, vk_comp_version->model, vk_comp_version->priv_data); } /** * @brief Send a vk_comp_version message * @param chan MAVLink channel to send the message * * @param comp_id component id * @param hw_ver hardware version * @param fw_ver firmware version * @param SN SN number * @param manufactory manufactory * @param model model * @param priv_data gnss configuration */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS static inline void mavlink_msg_vk_comp_version_send(mavlink_channel_t chan, uint16_t comp_id, const uint8_t *hw_ver, const uint8_t *fw_ver, const uint8_t *SN, const uint8_t *manufactory, const uint8_t *model, const uint8_t *priv_data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_VK_COMP_VERSION_LEN]; _mav_put_uint16_t(buf, 0, comp_id); _mav_put_uint8_t_array(buf, 2, hw_ver, 16); _mav_put_uint8_t_array(buf, 18, fw_ver, 16); _mav_put_uint8_t_array(buf, 34, SN, 16); _mav_put_uint8_t_array(buf, 50, manufactory, 16); _mav_put_uint8_t_array(buf, 66, model, 16); _mav_put_uint8_t_array(buf, 82, priv_data, 16); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_COMP_VERSION, buf, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_CRC); #else mavlink_vk_comp_version_t packet; packet.comp_id = comp_id; mav_array_memcpy(packet.hw_ver, hw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet.fw_ver, fw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet.SN, SN, sizeof(uint8_t)*16); mav_array_memcpy(packet.manufactory, manufactory, sizeof(uint8_t)*16); mav_array_memcpy(packet.model, model, sizeof(uint8_t)*16); mav_array_memcpy(packet.priv_data, priv_data, sizeof(uint8_t)*16); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_COMP_VERSION, (const char *)&packet, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_CRC); #endif } /** * @brief Send a vk_comp_version message * @param chan MAVLink channel to send the message * @param struct The MAVLink struct to serialize */ static inline void mavlink_msg_vk_comp_version_send_struct(mavlink_channel_t chan, const mavlink_vk_comp_version_t* vk_comp_version) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS mavlink_msg_vk_comp_version_send(chan, vk_comp_version->comp_id, vk_comp_version->hw_ver, vk_comp_version->fw_ver, vk_comp_version->SN, vk_comp_version->manufactory, vk_comp_version->model, vk_comp_version->priv_data); #else _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_COMP_VERSION, (const char *)vk_comp_version, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_CRC); #endif } #if MAVLINK_MSG_ID_VK_COMP_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN /* This variant 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_vk_comp_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t comp_id, const uint8_t *hw_ver, const uint8_t *fw_ver, const uint8_t *SN, const uint8_t *manufactory, const uint8_t *model, const uint8_t *priv_data) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char *buf = (char *)msgbuf; _mav_put_uint16_t(buf, 0, comp_id); _mav_put_uint8_t_array(buf, 2, hw_ver, 16); _mav_put_uint8_t_array(buf, 18, fw_ver, 16); _mav_put_uint8_t_array(buf, 34, SN, 16); _mav_put_uint8_t_array(buf, 50, manufactory, 16); _mav_put_uint8_t_array(buf, 66, model, 16); _mav_put_uint8_t_array(buf, 82, priv_data, 16); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_COMP_VERSION, buf, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_CRC); #else mavlink_vk_comp_version_t *packet = (mavlink_vk_comp_version_t *)msgbuf; packet->comp_id = comp_id; mav_array_memcpy(packet->hw_ver, hw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet->fw_ver, fw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet->SN, SN, sizeof(uint8_t)*16); mav_array_memcpy(packet->manufactory, manufactory, sizeof(uint8_t)*16); mav_array_memcpy(packet->model, model, sizeof(uint8_t)*16); mav_array_memcpy(packet->priv_data, priv_data, sizeof(uint8_t)*16); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_COMP_VERSION, (const char *)packet, MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN, MAVLINK_MSG_ID_VK_COMP_VERSION_CRC); #endif } #endif #endif // MESSAGE VK_COMP_VERSION UNPACKING /** * @brief Get field comp_id from vk_comp_version message * * @return component id */ static inline uint16_t mavlink_msg_vk_comp_version_get_comp_id(const mavlink_message_t* msg) { return _MAV_RETURN_uint16_t(msg, 0); } /** * @brief Get field hw_ver from vk_comp_version message * * @return hardware version */ static inline uint16_t mavlink_msg_vk_comp_version_get_hw_ver(const mavlink_message_t* msg, uint8_t *hw_ver) { return _MAV_RETURN_uint8_t_array(msg, hw_ver, 16, 2); } /** * @brief Get field fw_ver from vk_comp_version message * * @return firmware version */ static inline uint16_t mavlink_msg_vk_comp_version_get_fw_ver(const mavlink_message_t* msg, uint8_t *fw_ver) { return _MAV_RETURN_uint8_t_array(msg, fw_ver, 16, 18); } /** * @brief Get field SN from vk_comp_version message * * @return SN number */ static inline uint16_t mavlink_msg_vk_comp_version_get_SN(const mavlink_message_t* msg, uint8_t *SN) { return _MAV_RETURN_uint8_t_array(msg, SN, 16, 34); } /** * @brief Get field manufactory from vk_comp_version message * * @return manufactory */ static inline uint16_t mavlink_msg_vk_comp_version_get_manufactory(const mavlink_message_t* msg, uint8_t *manufactory) { return _MAV_RETURN_uint8_t_array(msg, manufactory, 16, 50); } /** * @brief Get field model from vk_comp_version message * * @return model */ static inline uint16_t mavlink_msg_vk_comp_version_get_model(const mavlink_message_t* msg, uint8_t *model) { return _MAV_RETURN_uint8_t_array(msg, model, 16, 66); } /** * @brief Get field priv_data from vk_comp_version message * * @return gnss configuration */ static inline uint16_t mavlink_msg_vk_comp_version_get_priv_data(const mavlink_message_t* msg, uint8_t *priv_data) { return _MAV_RETURN_uint8_t_array(msg, priv_data, 16, 82); } /** * @brief Decode a vk_comp_version message into a struct * * @param msg The message to decode * @param vk_comp_version C-struct to decode the message contents into */ static inline void mavlink_msg_vk_comp_version_decode(const mavlink_message_t* msg, mavlink_vk_comp_version_t* vk_comp_version) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS vk_comp_version->comp_id = mavlink_msg_vk_comp_version_get_comp_id(msg); mavlink_msg_vk_comp_version_get_hw_ver(msg, vk_comp_version->hw_ver); mavlink_msg_vk_comp_version_get_fw_ver(msg, vk_comp_version->fw_ver); mavlink_msg_vk_comp_version_get_SN(msg, vk_comp_version->SN); mavlink_msg_vk_comp_version_get_manufactory(msg, vk_comp_version->manufactory); mavlink_msg_vk_comp_version_get_model(msg, vk_comp_version->model); mavlink_msg_vk_comp_version_get_priv_data(msg, vk_comp_version->priv_data); #else uint8_t len = msg->len < MAVLINK_MSG_ID_VK_COMP_VERSION_LEN? msg->len : MAVLINK_MSG_ID_VK_COMP_VERSION_LEN; memset(vk_comp_version, 0, MAVLINK_MSG_ID_VK_COMP_VERSION_LEN); memcpy(vk_comp_version, _MAV_PAYLOAD(msg), len); #endif }