mavlink library
Dependents: mavlink F429ZI_LCD_demo
Fork of mavlink_bridge by
Revision 11:76345550efb4, committed 2018-07-23
- Comitter:
- wupinxian
- Date:
- Mon Jul 23 16:34:26 2018 +0000
- Parent:
- 10:bd4a08d39e94
- Commit message:
- mavlink for stm32 Nucleo
Changed in this revision
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink.h --- a/mavlink/v10/uwb/mavlink.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/** @file - * @brief MAVLink comm protocol built from uwb.xml - * @see http://mavlink.org - */ -#ifndef MAVLINK_H -#define MAVLINK_H - -#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 - -#include "version.h" -#include "uwb.h" - -#endif // MAVLINK_H
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_2way_multi_range_raw_10.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_2way_multi_range_raw_10.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -// MESSAGE UWB_2WAY_MULTI_RANGE_RAW_10 PACKING - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10 180 - -typedef struct __mavlink_uwb_2way_multi_range_raw_10_t -{ - uint64_t timestamp_master_request_1_recv; /*< Timestamp of master request 1 on slave module.*/ - uint64_t timestamp_slave_reply_send; /*< Timestamp of slave reply on slave module.*/ - uint64_t timestamp_master_request_2_recv; /*< Timestamp of master request 2 on slave module.*/ - uint64_t timestamp_master_request_1[10]; /*< Timestamp of master request 1 on tracker modules.*/ - uint64_t timestamp_slave_reply[10]; /*< Timestamp of slave reply on tracker modules.*/ - uint64_t timestamp_master_request_2[10]; /*< Timestamp of master request 2 on tracker modules.*/ - uint8_t num_of_units; /*< Number of UWB units on the tracker.*/ - uint8_t address; /*< Address of UWB tracker.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as slave.*/ -} mavlink_uwb_2way_multi_range_raw_10_t; - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN 267 -#define MAVLINK_MSG_ID_180_LEN 267 - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_CRC 13 -#define MAVLINK_MSG_ID_180_CRC 13 - -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_10_FIELD_TIMESTAMP_MASTER_REQUEST_1_LEN 10 -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_10_FIELD_TIMESTAMP_SLAVE_REPLY_LEN 10 -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_10_FIELD_TIMESTAMP_MASTER_REQUEST_2_LEN 10 - -#define MAVLINK_MESSAGE_INFO_UWB_2WAY_MULTI_RANGE_RAW_10 { \ - "UWB_2WAY_MULTI_RANGE_RAW_10", \ - 9, \ - { { "timestamp_master_request_1_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, timestamp_master_request_1_recv) }, \ - { "timestamp_slave_reply_send", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, timestamp_slave_reply_send) }, \ - { "timestamp_master_request_2_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, timestamp_master_request_2_recv) }, \ - { "timestamp_master_request_1", NULL, MAVLINK_TYPE_UINT64_T, 10, 24, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, timestamp_master_request_1) }, \ - { "timestamp_slave_reply", NULL, MAVLINK_TYPE_UINT64_T, 10, 104, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, timestamp_slave_reply) }, \ - { "timestamp_master_request_2", NULL, MAVLINK_TYPE_UINT64_T, 10, 184, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, timestamp_master_request_2) }, \ - { "num_of_units", NULL, MAVLINK_TYPE_UINT8_T, 0, 264, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, num_of_units) }, \ - { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 265, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, address) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 266, offsetof(mavlink_uwb_2way_multi_range_raw_10_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_2way_multi_range_raw_10 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_10_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 264, num_of_units); - _mav_put_uint8_t(buf, 265, address); - _mav_put_uint8_t(buf, 266, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 10); - _mav_put_uint64_t_array(buf, 104, timestamp_slave_reply, 10); - _mav_put_uint64_t_array(buf, 184, timestamp_master_request_2, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#else - mavlink_uwb_2way_multi_range_raw_10_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif -} - -/** - * @brief Pack a uwb_2way_multi_range_raw_10 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_10_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t num_of_units,uint8_t address,uint8_t remote_address,uint64_t timestamp_master_request_1_recv,uint64_t timestamp_slave_reply_send,uint64_t timestamp_master_request_2_recv,const uint64_t *timestamp_master_request_1,const uint64_t *timestamp_slave_reply,const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 264, num_of_units); - _mav_put_uint8_t(buf, 265, address); - _mav_put_uint8_t(buf, 266, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 10); - _mav_put_uint64_t_array(buf, 104, timestamp_slave_reply, 10); - _mav_put_uint64_t_array(buf, 184, timestamp_master_request_2, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#else - mavlink_uwb_2way_multi_range_raw_10_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif -} - -/** - * @brief Encode a uwb_2way_multi_range_raw_10 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 uwb_2way_multi_range_raw_10 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_10_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_2way_multi_range_raw_10_t* uwb_2way_multi_range_raw_10) -{ - return mavlink_msg_uwb_2way_multi_range_raw_10_pack(system_id, component_id, msg, uwb_2way_multi_range_raw_10->num_of_units, uwb_2way_multi_range_raw_10->address, uwb_2way_multi_range_raw_10->remote_address, uwb_2way_multi_range_raw_10->timestamp_master_request_1_recv, uwb_2way_multi_range_raw_10->timestamp_slave_reply_send, uwb_2way_multi_range_raw_10->timestamp_master_request_2_recv, uwb_2way_multi_range_raw_10->timestamp_master_request_1, uwb_2way_multi_range_raw_10->timestamp_slave_reply, uwb_2way_multi_range_raw_10->timestamp_master_request_2); -} - -/** - * @brief Encode a uwb_2way_multi_range_raw_10 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 uwb_2way_multi_range_raw_10 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_10_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_2way_multi_range_raw_10_t* uwb_2way_multi_range_raw_10) -{ - return mavlink_msg_uwb_2way_multi_range_raw_10_pack_chan(system_id, component_id, chan, msg, uwb_2way_multi_range_raw_10->num_of_units, uwb_2way_multi_range_raw_10->address, uwb_2way_multi_range_raw_10->remote_address, uwb_2way_multi_range_raw_10->timestamp_master_request_1_recv, uwb_2way_multi_range_raw_10->timestamp_slave_reply_send, uwb_2way_multi_range_raw_10->timestamp_master_request_2_recv, uwb_2way_multi_range_raw_10->timestamp_master_request_1, uwb_2way_multi_range_raw_10->timestamp_slave_reply, uwb_2way_multi_range_raw_10->timestamp_master_request_2); -} - -/** - * @brief Send a uwb_2way_multi_range_raw_10 message - * @param chan MAVLink channel to send the message - * - * @param num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_2way_multi_range_raw_10_send(mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 264, num_of_units); - _mav_put_uint8_t(buf, 265, address); - _mav_put_uint8_t(buf, 266, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 10); - _mav_put_uint64_t_array(buf, 104, timestamp_slave_reply, 10); - _mav_put_uint64_t_array(buf, 184, timestamp_master_request_2, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif -#else - mavlink_uwb_2way_multi_range_raw_10_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10, (const char *)&packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10, (const char *)&packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_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_uwb_2way_multi_range_raw_10_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 264, num_of_units); - _mav_put_uint8_t(buf, 265, address); - _mav_put_uint8_t(buf, 266, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 10); - _mav_put_uint64_t_array(buf, 104, timestamp_slave_reply, 10); - _mav_put_uint64_t_array(buf, 184, timestamp_master_request_2, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif -#else - mavlink_uwb_2way_multi_range_raw_10_t *packet = (mavlink_uwb_2way_multi_range_raw_10_t *)msgbuf; - packet->timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet->timestamp_slave_reply_send = timestamp_slave_reply_send; - packet->timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet->num_of_units = num_of_units; - packet->address = address; - packet->remote_address = remote_address; - mav_array_memcpy(packet->timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet->timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet->timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10, (const char *)packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10, (const char *)packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_2WAY_MULTI_RANGE_RAW_10 UNPACKING - - -/** - * @brief Get field num_of_units from uwb_2way_multi_range_raw_10 message - * - * @return Number of UWB units on the tracker. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_10_get_num_of_units(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 264); -} - -/** - * @brief Get field address from uwb_2way_multi_range_raw_10 message - * - * @return Address of UWB tracker. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_10_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 265); -} - -/** - * @brief Get field remote_address from uwb_2way_multi_range_raw_10 message - * - * @return Address of remote UWB unit that was used as slave. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_10_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 266); -} - -/** - * @brief Get field timestamp_master_request_1_recv from uwb_2way_multi_range_raw_10 message - * - * @return Timestamp of master request 1 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_master_request_1_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field timestamp_slave_reply_send from uwb_2way_multi_range_raw_10 message - * - * @return Timestamp of slave reply on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_slave_reply_send(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 8); -} - -/** - * @brief Get field timestamp_master_request_2_recv from uwb_2way_multi_range_raw_10 message - * - * @return Timestamp of master request 2 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_master_request_2_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 16); -} - -/** - * @brief Get field timestamp_master_request_1 from uwb_2way_multi_range_raw_10 message - * - * @return Timestamp of master request 1 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_master_request_1(const mavlink_message_t* msg, uint64_t *timestamp_master_request_1) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_1, 10, 24); -} - -/** - * @brief Get field timestamp_slave_reply from uwb_2way_multi_range_raw_10 message - * - * @return Timestamp of slave reply on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_slave_reply(const mavlink_message_t* msg, uint64_t *timestamp_slave_reply) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_slave_reply, 10, 104); -} - -/** - * @brief Get field timestamp_master_request_2 from uwb_2way_multi_range_raw_10 message - * - * @return Timestamp of master request 2 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_master_request_2(const mavlink_message_t* msg, uint64_t *timestamp_master_request_2) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_2, 10, 184); -} - -/** - * @brief Decode a uwb_2way_multi_range_raw_10 message into a struct - * - * @param msg The message to decode - * @param uwb_2way_multi_range_raw_10 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_2way_multi_range_raw_10_decode(const mavlink_message_t* msg, mavlink_uwb_2way_multi_range_raw_10_t* uwb_2way_multi_range_raw_10) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_2way_multi_range_raw_10->timestamp_master_request_1_recv = mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_master_request_1_recv(msg); - uwb_2way_multi_range_raw_10->timestamp_slave_reply_send = mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_slave_reply_send(msg); - uwb_2way_multi_range_raw_10->timestamp_master_request_2_recv = mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_master_request_2_recv(msg); - mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_master_request_1(msg, uwb_2way_multi_range_raw_10->timestamp_master_request_1); - mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_slave_reply(msg, uwb_2way_multi_range_raw_10->timestamp_slave_reply); - mavlink_msg_uwb_2way_multi_range_raw_10_get_timestamp_master_request_2(msg, uwb_2way_multi_range_raw_10->timestamp_master_request_2); - uwb_2way_multi_range_raw_10->num_of_units = mavlink_msg_uwb_2way_multi_range_raw_10_get_num_of_units(msg); - uwb_2way_multi_range_raw_10->address = mavlink_msg_uwb_2way_multi_range_raw_10_get_address(msg); - uwb_2way_multi_range_raw_10->remote_address = mavlink_msg_uwb_2way_multi_range_raw_10_get_remote_address(msg); -#else - memcpy(uwb_2way_multi_range_raw_10, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_10_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_2way_multi_range_raw_4.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_2way_multi_range_raw_4.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -// MESSAGE UWB_2WAY_MULTI_RANGE_RAW_4 PACKING - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4 184 - -typedef struct __mavlink_uwb_2way_multi_range_raw_4_t -{ - uint64_t timestamp_master_request_1_recv; /*< Timestamp of master request 1 on slave module.*/ - uint64_t timestamp_slave_reply_send; /*< Timestamp of slave reply on slave module.*/ - uint64_t timestamp_master_request_2_recv; /*< Timestamp of master request 2 on slave module.*/ - uint64_t timestamp_master_request_1[4]; /*< Timestamp of master request 1 on tracker modules.*/ - uint64_t timestamp_slave_reply[4]; /*< Timestamp of slave reply on tracker modules.*/ - uint64_t timestamp_master_request_2[4]; /*< Timestamp of master request 2 on tracker modules.*/ - uint8_t num_of_units; /*< Number of UWB units on the tracker.*/ - uint8_t address; /*< Address of UWB tracker.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as slave.*/ -} mavlink_uwb_2way_multi_range_raw_4_t; - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN 123 -#define MAVLINK_MSG_ID_184_LEN 123 - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_CRC 113 -#define MAVLINK_MSG_ID_184_CRC 113 - -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_4_FIELD_TIMESTAMP_MASTER_REQUEST_1_LEN 4 -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_4_FIELD_TIMESTAMP_SLAVE_REPLY_LEN 4 -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_4_FIELD_TIMESTAMP_MASTER_REQUEST_2_LEN 4 - -#define MAVLINK_MESSAGE_INFO_UWB_2WAY_MULTI_RANGE_RAW_4 { \ - "UWB_2WAY_MULTI_RANGE_RAW_4", \ - 9, \ - { { "timestamp_master_request_1_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, timestamp_master_request_1_recv) }, \ - { "timestamp_slave_reply_send", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, timestamp_slave_reply_send) }, \ - { "timestamp_master_request_2_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, timestamp_master_request_2_recv) }, \ - { "timestamp_master_request_1", NULL, MAVLINK_TYPE_UINT64_T, 4, 24, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, timestamp_master_request_1) }, \ - { "timestamp_slave_reply", NULL, MAVLINK_TYPE_UINT64_T, 4, 56, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, timestamp_slave_reply) }, \ - { "timestamp_master_request_2", NULL, MAVLINK_TYPE_UINT64_T, 4, 88, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, timestamp_master_request_2) }, \ - { "num_of_units", NULL, MAVLINK_TYPE_UINT8_T, 0, 120, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, num_of_units) }, \ - { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 121, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, address) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 122, offsetof(mavlink_uwb_2way_multi_range_raw_4_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_2way_multi_range_raw_4 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_4_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_master_request_2, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#else - mavlink_uwb_2way_multi_range_raw_4_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif -} - -/** - * @brief Pack a uwb_2way_multi_range_raw_4 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_4_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t num_of_units,uint8_t address,uint8_t remote_address,uint64_t timestamp_master_request_1_recv,uint64_t timestamp_slave_reply_send,uint64_t timestamp_master_request_2_recv,const uint64_t *timestamp_master_request_1,const uint64_t *timestamp_slave_reply,const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_master_request_2, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#else - mavlink_uwb_2way_multi_range_raw_4_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif -} - -/** - * @brief Encode a uwb_2way_multi_range_raw_4 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 uwb_2way_multi_range_raw_4 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_4_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_2way_multi_range_raw_4_t* uwb_2way_multi_range_raw_4) -{ - return mavlink_msg_uwb_2way_multi_range_raw_4_pack(system_id, component_id, msg, uwb_2way_multi_range_raw_4->num_of_units, uwb_2way_multi_range_raw_4->address, uwb_2way_multi_range_raw_4->remote_address, uwb_2way_multi_range_raw_4->timestamp_master_request_1_recv, uwb_2way_multi_range_raw_4->timestamp_slave_reply_send, uwb_2way_multi_range_raw_4->timestamp_master_request_2_recv, uwb_2way_multi_range_raw_4->timestamp_master_request_1, uwb_2way_multi_range_raw_4->timestamp_slave_reply, uwb_2way_multi_range_raw_4->timestamp_master_request_2); -} - -/** - * @brief Encode a uwb_2way_multi_range_raw_4 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 uwb_2way_multi_range_raw_4 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_4_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_2way_multi_range_raw_4_t* uwb_2way_multi_range_raw_4) -{ - return mavlink_msg_uwb_2way_multi_range_raw_4_pack_chan(system_id, component_id, chan, msg, uwb_2way_multi_range_raw_4->num_of_units, uwb_2way_multi_range_raw_4->address, uwb_2way_multi_range_raw_4->remote_address, uwb_2way_multi_range_raw_4->timestamp_master_request_1_recv, uwb_2way_multi_range_raw_4->timestamp_slave_reply_send, uwb_2way_multi_range_raw_4->timestamp_master_request_2_recv, uwb_2way_multi_range_raw_4->timestamp_master_request_1, uwb_2way_multi_range_raw_4->timestamp_slave_reply, uwb_2way_multi_range_raw_4->timestamp_master_request_2); -} - -/** - * @brief Send a uwb_2way_multi_range_raw_4 message - * @param chan MAVLink channel to send the message - * - * @param num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_2way_multi_range_raw_4_send(mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_master_request_2, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif -#else - mavlink_uwb_2way_multi_range_raw_4_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4, (const char *)&packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4, (const char *)&packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_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_uwb_2way_multi_range_raw_4_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_master_request_2, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif -#else - mavlink_uwb_2way_multi_range_raw_4_t *packet = (mavlink_uwb_2way_multi_range_raw_4_t *)msgbuf; - packet->timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet->timestamp_slave_reply_send = timestamp_slave_reply_send; - packet->timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet->num_of_units = num_of_units; - packet->address = address; - packet->remote_address = remote_address; - mav_array_memcpy(packet->timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet->timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet->timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4, (const char *)packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4, (const char *)packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_2WAY_MULTI_RANGE_RAW_4 UNPACKING - - -/** - * @brief Get field num_of_units from uwb_2way_multi_range_raw_4 message - * - * @return Number of UWB units on the tracker. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_4_get_num_of_units(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 120); -} - -/** - * @brief Get field address from uwb_2way_multi_range_raw_4 message - * - * @return Address of UWB tracker. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_4_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 121); -} - -/** - * @brief Get field remote_address from uwb_2way_multi_range_raw_4 message - * - * @return Address of remote UWB unit that was used as slave. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_4_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 122); -} - -/** - * @brief Get field timestamp_master_request_1_recv from uwb_2way_multi_range_raw_4 message - * - * @return Timestamp of master request 1 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_master_request_1_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field timestamp_slave_reply_send from uwb_2way_multi_range_raw_4 message - * - * @return Timestamp of slave reply on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_slave_reply_send(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 8); -} - -/** - * @brief Get field timestamp_master_request_2_recv from uwb_2way_multi_range_raw_4 message - * - * @return Timestamp of master request 2 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_master_request_2_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 16); -} - -/** - * @brief Get field timestamp_master_request_1 from uwb_2way_multi_range_raw_4 message - * - * @return Timestamp of master request 1 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_master_request_1(const mavlink_message_t* msg, uint64_t *timestamp_master_request_1) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_1, 4, 24); -} - -/** - * @brief Get field timestamp_slave_reply from uwb_2way_multi_range_raw_4 message - * - * @return Timestamp of slave reply on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_slave_reply(const mavlink_message_t* msg, uint64_t *timestamp_slave_reply) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_slave_reply, 4, 56); -} - -/** - * @brief Get field timestamp_master_request_2 from uwb_2way_multi_range_raw_4 message - * - * @return Timestamp of master request 2 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_master_request_2(const mavlink_message_t* msg, uint64_t *timestamp_master_request_2) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_2, 4, 88); -} - -/** - * @brief Decode a uwb_2way_multi_range_raw_4 message into a struct - * - * @param msg The message to decode - * @param uwb_2way_multi_range_raw_4 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_2way_multi_range_raw_4_decode(const mavlink_message_t* msg, mavlink_uwb_2way_multi_range_raw_4_t* uwb_2way_multi_range_raw_4) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_2way_multi_range_raw_4->timestamp_master_request_1_recv = mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_master_request_1_recv(msg); - uwb_2way_multi_range_raw_4->timestamp_slave_reply_send = mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_slave_reply_send(msg); - uwb_2way_multi_range_raw_4->timestamp_master_request_2_recv = mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_master_request_2_recv(msg); - mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_master_request_1(msg, uwb_2way_multi_range_raw_4->timestamp_master_request_1); - mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_slave_reply(msg, uwb_2way_multi_range_raw_4->timestamp_slave_reply); - mavlink_msg_uwb_2way_multi_range_raw_4_get_timestamp_master_request_2(msg, uwb_2way_multi_range_raw_4->timestamp_master_request_2); - uwb_2way_multi_range_raw_4->num_of_units = mavlink_msg_uwb_2way_multi_range_raw_4_get_num_of_units(msg); - uwb_2way_multi_range_raw_4->address = mavlink_msg_uwb_2way_multi_range_raw_4_get_address(msg); - uwb_2way_multi_range_raw_4->remote_address = mavlink_msg_uwb_2way_multi_range_raw_4_get_remote_address(msg); -#else - memcpy(uwb_2way_multi_range_raw_4, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_4_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_2way_multi_range_raw_5.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_2way_multi_range_raw_5.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -// MESSAGE UWB_2WAY_MULTI_RANGE_RAW_5 PACKING - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5 185 - -typedef struct __mavlink_uwb_2way_multi_range_raw_5_t -{ - uint64_t timestamp_master_request_1_recv; /*< Timestamp of master request 1 on slave module.*/ - uint64_t timestamp_slave_reply_send; /*< Timestamp of slave reply on slave module.*/ - uint64_t timestamp_master_request_2_recv; /*< Timestamp of master request 2 on slave module.*/ - uint64_t timestamp_master_request_1[5]; /*< Timestamp of master request 1 on tracker modules.*/ - uint64_t timestamp_slave_reply[5]; /*< Timestamp of slave reply on tracker modules.*/ - uint64_t timestamp_master_request_2[5]; /*< Timestamp of master request 2 on tracker modules.*/ - uint8_t num_of_units; /*< Number of UWB units on the tracker.*/ - uint8_t address; /*< Address of UWB tracker.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as slave.*/ -} mavlink_uwb_2way_multi_range_raw_5_t; - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN 147 -#define MAVLINK_MSG_ID_185_LEN 147 - -#define MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_CRC 101 -#define MAVLINK_MSG_ID_185_CRC 101 - -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_5_FIELD_TIMESTAMP_MASTER_REQUEST_1_LEN 5 -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_5_FIELD_TIMESTAMP_SLAVE_REPLY_LEN 5 -#define MAVLINK_MSG_UWB_2WAY_MULTI_RANGE_RAW_5_FIELD_TIMESTAMP_MASTER_REQUEST_2_LEN 5 - -#define MAVLINK_MESSAGE_INFO_UWB_2WAY_MULTI_RANGE_RAW_5 { \ - "UWB_2WAY_MULTI_RANGE_RAW_5", \ - 9, \ - { { "timestamp_master_request_1_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, timestamp_master_request_1_recv) }, \ - { "timestamp_slave_reply_send", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, timestamp_slave_reply_send) }, \ - { "timestamp_master_request_2_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, timestamp_master_request_2_recv) }, \ - { "timestamp_master_request_1", NULL, MAVLINK_TYPE_UINT64_T, 5, 24, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, timestamp_master_request_1) }, \ - { "timestamp_slave_reply", NULL, MAVLINK_TYPE_UINT64_T, 5, 64, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, timestamp_slave_reply) }, \ - { "timestamp_master_request_2", NULL, MAVLINK_TYPE_UINT64_T, 5, 104, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, timestamp_master_request_2) }, \ - { "num_of_units", NULL, MAVLINK_TYPE_UINT8_T, 0, 144, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, num_of_units) }, \ - { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 145, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, address) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 146, offsetof(mavlink_uwb_2way_multi_range_raw_5_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_2way_multi_range_raw_5 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_5_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 144, num_of_units); - _mav_put_uint8_t(buf, 145, address); - _mav_put_uint8_t(buf, 146, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 5); - _mav_put_uint64_t_array(buf, 64, timestamp_slave_reply, 5); - _mav_put_uint64_t_array(buf, 104, timestamp_master_request_2, 5); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#else - mavlink_uwb_2way_multi_range_raw_5_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*5); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*5); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*5); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif -} - -/** - * @brief Pack a uwb_2way_multi_range_raw_5 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_5_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t num_of_units,uint8_t address,uint8_t remote_address,uint64_t timestamp_master_request_1_recv,uint64_t timestamp_slave_reply_send,uint64_t timestamp_master_request_2_recv,const uint64_t *timestamp_master_request_1,const uint64_t *timestamp_slave_reply,const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 144, num_of_units); - _mav_put_uint8_t(buf, 145, address); - _mav_put_uint8_t(buf, 146, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 5); - _mav_put_uint64_t_array(buf, 64, timestamp_slave_reply, 5); - _mav_put_uint64_t_array(buf, 104, timestamp_master_request_2, 5); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#else - mavlink_uwb_2way_multi_range_raw_5_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*5); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*5); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*5); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif -} - -/** - * @brief Encode a uwb_2way_multi_range_raw_5 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 uwb_2way_multi_range_raw_5 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_5_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_2way_multi_range_raw_5_t* uwb_2way_multi_range_raw_5) -{ - return mavlink_msg_uwb_2way_multi_range_raw_5_pack(system_id, component_id, msg, uwb_2way_multi_range_raw_5->num_of_units, uwb_2way_multi_range_raw_5->address, uwb_2way_multi_range_raw_5->remote_address, uwb_2way_multi_range_raw_5->timestamp_master_request_1_recv, uwb_2way_multi_range_raw_5->timestamp_slave_reply_send, uwb_2way_multi_range_raw_5->timestamp_master_request_2_recv, uwb_2way_multi_range_raw_5->timestamp_master_request_1, uwb_2way_multi_range_raw_5->timestamp_slave_reply, uwb_2way_multi_range_raw_5->timestamp_master_request_2); -} - -/** - * @brief Encode a uwb_2way_multi_range_raw_5 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 uwb_2way_multi_range_raw_5 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_5_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_2way_multi_range_raw_5_t* uwb_2way_multi_range_raw_5) -{ - return mavlink_msg_uwb_2way_multi_range_raw_5_pack_chan(system_id, component_id, chan, msg, uwb_2way_multi_range_raw_5->num_of_units, uwb_2way_multi_range_raw_5->address, uwb_2way_multi_range_raw_5->remote_address, uwb_2way_multi_range_raw_5->timestamp_master_request_1_recv, uwb_2way_multi_range_raw_5->timestamp_slave_reply_send, uwb_2way_multi_range_raw_5->timestamp_master_request_2_recv, uwb_2way_multi_range_raw_5->timestamp_master_request_1, uwb_2way_multi_range_raw_5->timestamp_slave_reply, uwb_2way_multi_range_raw_5->timestamp_master_request_2); -} - -/** - * @brief Send a uwb_2way_multi_range_raw_5 message - * @param chan MAVLink channel to send the message - * - * @param num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_2way_multi_range_raw_5_send(mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 144, num_of_units); - _mav_put_uint8_t(buf, 145, address); - _mav_put_uint8_t(buf, 146, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 5); - _mav_put_uint64_t_array(buf, 64, timestamp_slave_reply, 5); - _mav_put_uint64_t_array(buf, 104, timestamp_master_request_2, 5); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif -#else - mavlink_uwb_2way_multi_range_raw_5_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*5); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*5); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*5); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5, (const char *)&packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5, (const char *)&packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_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_uwb_2way_multi_range_raw_5_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 144, num_of_units); - _mav_put_uint8_t(buf, 145, address); - _mav_put_uint8_t(buf, 146, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 5); - _mav_put_uint64_t_array(buf, 64, timestamp_slave_reply, 5); - _mav_put_uint64_t_array(buf, 104, timestamp_master_request_2, 5); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5, buf, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif -#else - mavlink_uwb_2way_multi_range_raw_5_t *packet = (mavlink_uwb_2way_multi_range_raw_5_t *)msgbuf; - packet->timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet->timestamp_slave_reply_send = timestamp_slave_reply_send; - packet->timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet->num_of_units = num_of_units; - packet->address = address; - packet->remote_address = remote_address; - mav_array_memcpy(packet->timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*5); - mav_array_memcpy(packet->timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*5); - mav_array_memcpy(packet->timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*5); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5, (const char *)packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5, (const char *)packet, MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_2WAY_MULTI_RANGE_RAW_5 UNPACKING - - -/** - * @brief Get field num_of_units from uwb_2way_multi_range_raw_5 message - * - * @return Number of UWB units on the tracker. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_5_get_num_of_units(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 144); -} - -/** - * @brief Get field address from uwb_2way_multi_range_raw_5 message - * - * @return Address of UWB tracker. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_5_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 145); -} - -/** - * @brief Get field remote_address from uwb_2way_multi_range_raw_5 message - * - * @return Address of remote UWB unit that was used as slave. - */ -static inline uint8_t mavlink_msg_uwb_2way_multi_range_raw_5_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 146); -} - -/** - * @brief Get field timestamp_master_request_1_recv from uwb_2way_multi_range_raw_5 message - * - * @return Timestamp of master request 1 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_master_request_1_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field timestamp_slave_reply_send from uwb_2way_multi_range_raw_5 message - * - * @return Timestamp of slave reply on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_slave_reply_send(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 8); -} - -/** - * @brief Get field timestamp_master_request_2_recv from uwb_2way_multi_range_raw_5 message - * - * @return Timestamp of master request 2 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_master_request_2_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 16); -} - -/** - * @brief Get field timestamp_master_request_1 from uwb_2way_multi_range_raw_5 message - * - * @return Timestamp of master request 1 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_master_request_1(const mavlink_message_t* msg, uint64_t *timestamp_master_request_1) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_1, 5, 24); -} - -/** - * @brief Get field timestamp_slave_reply from uwb_2way_multi_range_raw_5 message - * - * @return Timestamp of slave reply on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_slave_reply(const mavlink_message_t* msg, uint64_t *timestamp_slave_reply) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_slave_reply, 5, 64); -} - -/** - * @brief Get field timestamp_master_request_2 from uwb_2way_multi_range_raw_5 message - * - * @return Timestamp of master request 2 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_master_request_2(const mavlink_message_t* msg, uint64_t *timestamp_master_request_2) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_2, 5, 104); -} - -/** - * @brief Decode a uwb_2way_multi_range_raw_5 message into a struct - * - * @param msg The message to decode - * @param uwb_2way_multi_range_raw_5 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_2way_multi_range_raw_5_decode(const mavlink_message_t* msg, mavlink_uwb_2way_multi_range_raw_5_t* uwb_2way_multi_range_raw_5) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_2way_multi_range_raw_5->timestamp_master_request_1_recv = mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_master_request_1_recv(msg); - uwb_2way_multi_range_raw_5->timestamp_slave_reply_send = mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_slave_reply_send(msg); - uwb_2way_multi_range_raw_5->timestamp_master_request_2_recv = mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_master_request_2_recv(msg); - mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_master_request_1(msg, uwb_2way_multi_range_raw_5->timestamp_master_request_1); - mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_slave_reply(msg, uwb_2way_multi_range_raw_5->timestamp_slave_reply); - mavlink_msg_uwb_2way_multi_range_raw_5_get_timestamp_master_request_2(msg, uwb_2way_multi_range_raw_5->timestamp_master_request_2); - uwb_2way_multi_range_raw_5->num_of_units = mavlink_msg_uwb_2way_multi_range_raw_5_get_num_of_units(msg); - uwb_2way_multi_range_raw_5->address = mavlink_msg_uwb_2way_multi_range_raw_5_get_address(msg); - uwb_2way_multi_range_raw_5->remote_address = mavlink_msg_uwb_2way_multi_range_raw_5_get_remote_address(msg); -#else - memcpy(uwb_2way_multi_range_raw_5, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_2WAY_MULTI_RANGE_RAW_5_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_error.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_error.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,249 +0,0 @@ -// MESSAGE UWB_ERROR PACKING - -#define MAVLINK_MSG_ID_UWB_ERROR 191 - -typedef struct __mavlink_uwb_error_t -{ - uint8_t address; /*< Address of UWB tracker.*/ - uint8_t type; /*< Error type.*/ - char description[127]; /*< Error description.*/ -} mavlink_uwb_error_t; - -#define MAVLINK_MSG_ID_UWB_ERROR_LEN 129 -#define MAVLINK_MSG_ID_191_LEN 129 - -#define MAVLINK_MSG_ID_UWB_ERROR_CRC 223 -#define MAVLINK_MSG_ID_191_CRC 223 - -#define MAVLINK_MSG_UWB_ERROR_FIELD_DESCRIPTION_LEN 127 - -#define MAVLINK_MESSAGE_INFO_UWB_ERROR { \ - "UWB_ERROR", \ - 3, \ - { { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_uwb_error_t, address) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_uwb_error_t, type) }, \ - { "description", NULL, MAVLINK_TYPE_CHAR, 127, 2, offsetof(mavlink_uwb_error_t, description) }, \ - } \ -} - - -/** - * @brief Pack a uwb_error 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 address Address of UWB tracker. - * @param type Error type. - * @param description Error description. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_error_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t address, uint8_t type, const char *description) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_ERROR_LEN]; - _mav_put_uint8_t(buf, 0, address); - _mav_put_uint8_t(buf, 1, type); - _mav_put_char_array(buf, 2, description, 127); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#else - mavlink_uwb_error_t packet; - packet.address = address; - packet.type = type; - mav_array_memcpy(packet.description, description, sizeof(char)*127); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_ERROR; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_ERROR_LEN, MAVLINK_MSG_ID_UWB_ERROR_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif -} - -/** - * @brief Pack a uwb_error 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 address Address of UWB tracker. - * @param type Error type. - * @param description Error description. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_error_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t address,uint8_t type,const char *description) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_ERROR_LEN]; - _mav_put_uint8_t(buf, 0, address); - _mav_put_uint8_t(buf, 1, type); - _mav_put_char_array(buf, 2, description, 127); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#else - mavlink_uwb_error_t packet; - packet.address = address; - packet.type = type; - mav_array_memcpy(packet.description, description, sizeof(char)*127); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_ERROR; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_ERROR_LEN, MAVLINK_MSG_ID_UWB_ERROR_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif -} - -/** - * @brief Encode a uwb_error 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 uwb_error C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_error_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_error_t* uwb_error) -{ - return mavlink_msg_uwb_error_pack(system_id, component_id, msg, uwb_error->address, uwb_error->type, uwb_error->description); -} - -/** - * @brief Encode a uwb_error 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 uwb_error C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_error_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_error_t* uwb_error) -{ - return mavlink_msg_uwb_error_pack_chan(system_id, component_id, chan, msg, uwb_error->address, uwb_error->type, uwb_error->description); -} - -/** - * @brief Send a uwb_error message - * @param chan MAVLink channel to send the message - * - * @param address Address of UWB tracker. - * @param type Error type. - * @param description Error description. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_error_send(mavlink_channel_t chan, uint8_t address, uint8_t type, const char *description) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_ERROR_LEN]; - _mav_put_uint8_t(buf, 0, address); - _mav_put_uint8_t(buf, 1, type); - _mav_put_char_array(buf, 2, description, 127); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_ERROR, buf, MAVLINK_MSG_ID_UWB_ERROR_LEN, MAVLINK_MSG_ID_UWB_ERROR_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_ERROR, buf, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif -#else - mavlink_uwb_error_t packet; - packet.address = address; - packet.type = type; - mav_array_memcpy(packet.description, description, sizeof(char)*127); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_ERROR, (const char *)&packet, MAVLINK_MSG_ID_UWB_ERROR_LEN, MAVLINK_MSG_ID_UWB_ERROR_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_ERROR, (const char *)&packet, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_ERROR_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_uwb_error_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t address, uint8_t type, const char *description) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, address); - _mav_put_uint8_t(buf, 1, type); - _mav_put_char_array(buf, 2, description, 127); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_ERROR, buf, MAVLINK_MSG_ID_UWB_ERROR_LEN, MAVLINK_MSG_ID_UWB_ERROR_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_ERROR, buf, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif -#else - mavlink_uwb_error_t *packet = (mavlink_uwb_error_t *)msgbuf; - packet->address = address; - packet->type = type; - mav_array_memcpy(packet->description, description, sizeof(char)*127); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_ERROR, (const char *)packet, MAVLINK_MSG_ID_UWB_ERROR_LEN, MAVLINK_MSG_ID_UWB_ERROR_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_ERROR, (const char *)packet, MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_ERROR UNPACKING - - -/** - * @brief Get field address from uwb_error message - * - * @return Address of UWB tracker. - */ -static inline uint8_t mavlink_msg_uwb_error_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field type from uwb_error message - * - * @return Error type. - */ -static inline uint8_t mavlink_msg_uwb_error_get_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 1); -} - -/** - * @brief Get field description from uwb_error message - * - * @return Error description. - */ -static inline uint16_t mavlink_msg_uwb_error_get_description(const mavlink_message_t* msg, char *description) -{ - return _MAV_RETURN_char_array(msg, description, 127, 2); -} - -/** - * @brief Decode a uwb_error message into a struct - * - * @param msg The message to decode - * @param uwb_error C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_error_decode(const mavlink_message_t* msg, mavlink_uwb_error_t* uwb_error) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_error->address = mavlink_msg_uwb_error_get_address(msg); - uwb_error->type = mavlink_msg_uwb_error_get_type(msg); - mavlink_msg_uwb_error_get_description(msg, uwb_error->description); -#else - memcpy(uwb_error, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_ERROR_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_multi_range_raw_4.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_multi_range_raw_4.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -// MESSAGE UWB_MULTI_RANGE_RAW_4 PACKING - -#define MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4 174 - -typedef struct __mavlink_uwb_multi_range_raw_4_t -{ - uint64_t timestamp_master_request_recv; /*< Timestamp of master request on slave module.*/ - uint64_t timestamp_slave_reply_send_1; /*< Timestamp of slave reply 1 on slave module.*/ - uint64_t timestamp_slave_reply_send_2; /*< Timestamp of slave reply 2 on slave module.*/ - uint64_t timestamp_master_request[4]; /*< Timestamp of master request 1 on tracker modules.*/ - uint64_t timestamp_slave_reply_1[4]; /*< Timestamp of slave reply 1 on tracker modules.*/ - uint64_t timestamp_slave_reply_2[4]; /*< Timestamp of slave reply 2 on tracker modules.*/ - uint8_t num_of_units; /*< Number of UWB units on the tracker.*/ - uint8_t address; /*< Address of UWB tracker.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as slave.*/ -} mavlink_uwb_multi_range_raw_4_t; - -#define MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN 123 -#define MAVLINK_MSG_ID_174_LEN 123 - -#define MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_CRC 177 -#define MAVLINK_MSG_ID_174_CRC 177 - -#define MAVLINK_MSG_UWB_MULTI_RANGE_RAW_4_FIELD_TIMESTAMP_MASTER_REQUEST_LEN 4 -#define MAVLINK_MSG_UWB_MULTI_RANGE_RAW_4_FIELD_TIMESTAMP_SLAVE_REPLY_1_LEN 4 -#define MAVLINK_MSG_UWB_MULTI_RANGE_RAW_4_FIELD_TIMESTAMP_SLAVE_REPLY_2_LEN 4 - -#define MAVLINK_MESSAGE_INFO_UWB_MULTI_RANGE_RAW_4 { \ - "UWB_MULTI_RANGE_RAW_4", \ - 9, \ - { { "timestamp_master_request_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uwb_multi_range_raw_4_t, timestamp_master_request_recv) }, \ - { "timestamp_slave_reply_send_1", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_uwb_multi_range_raw_4_t, timestamp_slave_reply_send_1) }, \ - { "timestamp_slave_reply_send_2", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_uwb_multi_range_raw_4_t, timestamp_slave_reply_send_2) }, \ - { "timestamp_master_request", NULL, MAVLINK_TYPE_UINT64_T, 4, 24, offsetof(mavlink_uwb_multi_range_raw_4_t, timestamp_master_request) }, \ - { "timestamp_slave_reply_1", NULL, MAVLINK_TYPE_UINT64_T, 4, 56, offsetof(mavlink_uwb_multi_range_raw_4_t, timestamp_slave_reply_1) }, \ - { "timestamp_slave_reply_2", NULL, MAVLINK_TYPE_UINT64_T, 4, 88, offsetof(mavlink_uwb_multi_range_raw_4_t, timestamp_slave_reply_2) }, \ - { "num_of_units", NULL, MAVLINK_TYPE_UINT8_T, 0, 120, offsetof(mavlink_uwb_multi_range_raw_4_t, num_of_units) }, \ - { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 121, offsetof(mavlink_uwb_multi_range_raw_4_t, address) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 122, offsetof(mavlink_uwb_multi_range_raw_4_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_multi_range_raw_4 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_recv Timestamp of master request on slave module. - * @param timestamp_slave_reply_send_1 Timestamp of slave reply 1 on slave module. - * @param timestamp_slave_reply_send_2 Timestamp of slave reply 2 on slave module. - * @param timestamp_master_request Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply_1 Timestamp of slave reply 1 on tracker modules. - * @param timestamp_slave_reply_2 Timestamp of slave reply 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_multi_range_raw_4_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_recv, uint64_t timestamp_slave_reply_send_1, uint64_t timestamp_slave_reply_send_2, const uint64_t *timestamp_master_request, const uint64_t *timestamp_slave_reply_1, const uint64_t *timestamp_slave_reply_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send_1); - _mav_put_uint64_t(buf, 16, timestamp_slave_reply_send_2); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply_1, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_slave_reply_2, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#else - mavlink_uwb_multi_range_raw_4_t packet; - packet.timestamp_master_request_recv = timestamp_master_request_recv; - packet.timestamp_slave_reply_send_1 = timestamp_slave_reply_send_1; - packet.timestamp_slave_reply_send_2 = timestamp_slave_reply_send_2; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request, timestamp_master_request, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply_1, timestamp_slave_reply_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply_2, timestamp_slave_reply_2, sizeof(uint64_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif -} - -/** - * @brief Pack a uwb_multi_range_raw_4 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_recv Timestamp of master request on slave module. - * @param timestamp_slave_reply_send_1 Timestamp of slave reply 1 on slave module. - * @param timestamp_slave_reply_send_2 Timestamp of slave reply 2 on slave module. - * @param timestamp_master_request Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply_1 Timestamp of slave reply 1 on tracker modules. - * @param timestamp_slave_reply_2 Timestamp of slave reply 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_multi_range_raw_4_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t num_of_units,uint8_t address,uint8_t remote_address,uint64_t timestamp_master_request_recv,uint64_t timestamp_slave_reply_send_1,uint64_t timestamp_slave_reply_send_2,const uint64_t *timestamp_master_request,const uint64_t *timestamp_slave_reply_1,const uint64_t *timestamp_slave_reply_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send_1); - _mav_put_uint64_t(buf, 16, timestamp_slave_reply_send_2); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply_1, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_slave_reply_2, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#else - mavlink_uwb_multi_range_raw_4_t packet; - packet.timestamp_master_request_recv = timestamp_master_request_recv; - packet.timestamp_slave_reply_send_1 = timestamp_slave_reply_send_1; - packet.timestamp_slave_reply_send_2 = timestamp_slave_reply_send_2; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request, timestamp_master_request, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply_1, timestamp_slave_reply_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply_2, timestamp_slave_reply_2, sizeof(uint64_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif -} - -/** - * @brief Encode a uwb_multi_range_raw_4 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 uwb_multi_range_raw_4 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_multi_range_raw_4_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_multi_range_raw_4_t* uwb_multi_range_raw_4) -{ - return mavlink_msg_uwb_multi_range_raw_4_pack(system_id, component_id, msg, uwb_multi_range_raw_4->num_of_units, uwb_multi_range_raw_4->address, uwb_multi_range_raw_4->remote_address, uwb_multi_range_raw_4->timestamp_master_request_recv, uwb_multi_range_raw_4->timestamp_slave_reply_send_1, uwb_multi_range_raw_4->timestamp_slave_reply_send_2, uwb_multi_range_raw_4->timestamp_master_request, uwb_multi_range_raw_4->timestamp_slave_reply_1, uwb_multi_range_raw_4->timestamp_slave_reply_2); -} - -/** - * @brief Encode a uwb_multi_range_raw_4 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 uwb_multi_range_raw_4 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_multi_range_raw_4_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_multi_range_raw_4_t* uwb_multi_range_raw_4) -{ - return mavlink_msg_uwb_multi_range_raw_4_pack_chan(system_id, component_id, chan, msg, uwb_multi_range_raw_4->num_of_units, uwb_multi_range_raw_4->address, uwb_multi_range_raw_4->remote_address, uwb_multi_range_raw_4->timestamp_master_request_recv, uwb_multi_range_raw_4->timestamp_slave_reply_send_1, uwb_multi_range_raw_4->timestamp_slave_reply_send_2, uwb_multi_range_raw_4->timestamp_master_request, uwb_multi_range_raw_4->timestamp_slave_reply_1, uwb_multi_range_raw_4->timestamp_slave_reply_2); -} - -/** - * @brief Send a uwb_multi_range_raw_4 message - * @param chan MAVLink channel to send the message - * - * @param num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_recv Timestamp of master request on slave module. - * @param timestamp_slave_reply_send_1 Timestamp of slave reply 1 on slave module. - * @param timestamp_slave_reply_send_2 Timestamp of slave reply 2 on slave module. - * @param timestamp_master_request Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply_1 Timestamp of slave reply 1 on tracker modules. - * @param timestamp_slave_reply_2 Timestamp of slave reply 2 on tracker modules. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_multi_range_raw_4_send(mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_recv, uint64_t timestamp_slave_reply_send_1, uint64_t timestamp_slave_reply_send_2, const uint64_t *timestamp_master_request, const uint64_t *timestamp_slave_reply_1, const uint64_t *timestamp_slave_reply_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send_1); - _mav_put_uint64_t(buf, 16, timestamp_slave_reply_send_2); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply_1, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_slave_reply_2, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4, buf, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4, buf, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif -#else - mavlink_uwb_multi_range_raw_4_t packet; - packet.timestamp_master_request_recv = timestamp_master_request_recv; - packet.timestamp_slave_reply_send_1 = timestamp_slave_reply_send_1; - packet.timestamp_slave_reply_send_2 = timestamp_slave_reply_send_2; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request, timestamp_master_request, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply_1, timestamp_slave_reply_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply_2, timestamp_slave_reply_2, sizeof(uint64_t)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4, (const char *)&packet, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4, (const char *)&packet, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_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_uwb_multi_range_raw_4_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_recv, uint64_t timestamp_slave_reply_send_1, uint64_t timestamp_slave_reply_send_2, const uint64_t *timestamp_master_request, const uint64_t *timestamp_slave_reply_1, const uint64_t *timestamp_slave_reply_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, timestamp_master_request_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send_1); - _mav_put_uint64_t(buf, 16, timestamp_slave_reply_send_2); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply_1, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_slave_reply_2, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4, buf, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4, buf, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif -#else - mavlink_uwb_multi_range_raw_4_t *packet = (mavlink_uwb_multi_range_raw_4_t *)msgbuf; - packet->timestamp_master_request_recv = timestamp_master_request_recv; - packet->timestamp_slave_reply_send_1 = timestamp_slave_reply_send_1; - packet->timestamp_slave_reply_send_2 = timestamp_slave_reply_send_2; - packet->num_of_units = num_of_units; - packet->address = address; - packet->remote_address = remote_address; - mav_array_memcpy(packet->timestamp_master_request, timestamp_master_request, sizeof(uint64_t)*4); - mav_array_memcpy(packet->timestamp_slave_reply_1, timestamp_slave_reply_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet->timestamp_slave_reply_2, timestamp_slave_reply_2, sizeof(uint64_t)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4, (const char *)packet, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4, (const char *)packet, MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_MULTI_RANGE_RAW_4 UNPACKING - - -/** - * @brief Get field num_of_units from uwb_multi_range_raw_4 message - * - * @return Number of UWB units on the tracker. - */ -static inline uint8_t mavlink_msg_uwb_multi_range_raw_4_get_num_of_units(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 120); -} - -/** - * @brief Get field address from uwb_multi_range_raw_4 message - * - * @return Address of UWB tracker. - */ -static inline uint8_t mavlink_msg_uwb_multi_range_raw_4_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 121); -} - -/** - * @brief Get field remote_address from uwb_multi_range_raw_4 message - * - * @return Address of remote UWB unit that was used as slave. - */ -static inline uint8_t mavlink_msg_uwb_multi_range_raw_4_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 122); -} - -/** - * @brief Get field timestamp_master_request_recv from uwb_multi_range_raw_4 message - * - * @return Timestamp of master request on slave module. - */ -static inline uint64_t mavlink_msg_uwb_multi_range_raw_4_get_timestamp_master_request_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field timestamp_slave_reply_send_1 from uwb_multi_range_raw_4 message - * - * @return Timestamp of slave reply 1 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_multi_range_raw_4_get_timestamp_slave_reply_send_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 8); -} - -/** - * @brief Get field timestamp_slave_reply_send_2 from uwb_multi_range_raw_4 message - * - * @return Timestamp of slave reply 2 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_multi_range_raw_4_get_timestamp_slave_reply_send_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 16); -} - -/** - * @brief Get field timestamp_master_request from uwb_multi_range_raw_4 message - * - * @return Timestamp of master request 1 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_multi_range_raw_4_get_timestamp_master_request(const mavlink_message_t* msg, uint64_t *timestamp_master_request) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request, 4, 24); -} - -/** - * @brief Get field timestamp_slave_reply_1 from uwb_multi_range_raw_4 message - * - * @return Timestamp of slave reply 1 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_multi_range_raw_4_get_timestamp_slave_reply_1(const mavlink_message_t* msg, uint64_t *timestamp_slave_reply_1) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_slave_reply_1, 4, 56); -} - -/** - * @brief Get field timestamp_slave_reply_2 from uwb_multi_range_raw_4 message - * - * @return Timestamp of slave reply 2 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_multi_range_raw_4_get_timestamp_slave_reply_2(const mavlink_message_t* msg, uint64_t *timestamp_slave_reply_2) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_slave_reply_2, 4, 88); -} - -/** - * @brief Decode a uwb_multi_range_raw_4 message into a struct - * - * @param msg The message to decode - * @param uwb_multi_range_raw_4 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_multi_range_raw_4_decode(const mavlink_message_t* msg, mavlink_uwb_multi_range_raw_4_t* uwb_multi_range_raw_4) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_multi_range_raw_4->timestamp_master_request_recv = mavlink_msg_uwb_multi_range_raw_4_get_timestamp_master_request_recv(msg); - uwb_multi_range_raw_4->timestamp_slave_reply_send_1 = mavlink_msg_uwb_multi_range_raw_4_get_timestamp_slave_reply_send_1(msg); - uwb_multi_range_raw_4->timestamp_slave_reply_send_2 = mavlink_msg_uwb_multi_range_raw_4_get_timestamp_slave_reply_send_2(msg); - mavlink_msg_uwb_multi_range_raw_4_get_timestamp_master_request(msg, uwb_multi_range_raw_4->timestamp_master_request); - mavlink_msg_uwb_multi_range_raw_4_get_timestamp_slave_reply_1(msg, uwb_multi_range_raw_4->timestamp_slave_reply_1); - mavlink_msg_uwb_multi_range_raw_4_get_timestamp_slave_reply_2(msg, uwb_multi_range_raw_4->timestamp_slave_reply_2); - uwb_multi_range_raw_4->num_of_units = mavlink_msg_uwb_multi_range_raw_4_get_num_of_units(msg); - uwb_multi_range_raw_4->address = mavlink_msg_uwb_multi_range_raw_4_get_address(msg); - uwb_multi_range_raw_4->remote_address = mavlink_msg_uwb_multi_range_raw_4_get_remote_address(msg); -#else - memcpy(uwb_multi_range_raw_4, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_MULTI_RANGE_RAW_4_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_prototyping.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_prototyping.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -// MESSAGE UWB_PROTOTYPING PACKING - -#define MAVLINK_MSG_ID_UWB_PROTOTYPING 195 - -typedef struct __mavlink_uwb_prototyping_t -{ - uint64_t integers[10]; /*< Arbitrary integer values.*/ - float floats[10]; /*< Arbitrary float values.*/ - uint8_t type; /*< Message type description.*/ -} mavlink_uwb_prototyping_t; - -#define MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN 121 -#define MAVLINK_MSG_ID_195_LEN 121 - -#define MAVLINK_MSG_ID_UWB_PROTOTYPING_CRC 71 -#define MAVLINK_MSG_ID_195_CRC 71 - -#define MAVLINK_MSG_UWB_PROTOTYPING_FIELD_INTEGERS_LEN 10 -#define MAVLINK_MSG_UWB_PROTOTYPING_FIELD_FLOATS_LEN 10 - -#define MAVLINK_MESSAGE_INFO_UWB_PROTOTYPING { \ - "UWB_PROTOTYPING", \ - 3, \ - { { "integers", NULL, MAVLINK_TYPE_UINT64_T, 10, 0, offsetof(mavlink_uwb_prototyping_t, integers) }, \ - { "floats", NULL, MAVLINK_TYPE_FLOAT, 10, 80, offsetof(mavlink_uwb_prototyping_t, floats) }, \ - { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 120, offsetof(mavlink_uwb_prototyping_t, type) }, \ - } \ -} - - -/** - * @brief Pack a uwb_prototyping 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 Message type description. - * @param integers Arbitrary integer values. - * @param floats Arbitrary float values. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_prototyping_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t type, const uint64_t *integers, const float *floats) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN]; - _mav_put_uint8_t(buf, 120, type); - _mav_put_uint64_t_array(buf, 0, integers, 10); - _mav_put_float_array(buf, 80, floats, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#else - mavlink_uwb_prototyping_t packet; - packet.type = type; - mav_array_memcpy(packet.integers, integers, sizeof(uint64_t)*10); - mav_array_memcpy(packet.floats, floats, sizeof(float)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_PROTOTYPING; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN, MAVLINK_MSG_ID_UWB_PROTOTYPING_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif -} - -/** - * @brief Pack a uwb_prototyping 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 Message type description. - * @param integers Arbitrary integer values. - * @param floats Arbitrary float values. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_prototyping_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t type,const uint64_t *integers,const float *floats) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN]; - _mav_put_uint8_t(buf, 120, type); - _mav_put_uint64_t_array(buf, 0, integers, 10); - _mav_put_float_array(buf, 80, floats, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#else - mavlink_uwb_prototyping_t packet; - packet.type = type; - mav_array_memcpy(packet.integers, integers, sizeof(uint64_t)*10); - mav_array_memcpy(packet.floats, floats, sizeof(float)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_PROTOTYPING; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN, MAVLINK_MSG_ID_UWB_PROTOTYPING_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif -} - -/** - * @brief Encode a uwb_prototyping 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 uwb_prototyping C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_prototyping_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_prototyping_t* uwb_prototyping) -{ - return mavlink_msg_uwb_prototyping_pack(system_id, component_id, msg, uwb_prototyping->type, uwb_prototyping->integers, uwb_prototyping->floats); -} - -/** - * @brief Encode a uwb_prototyping 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 uwb_prototyping C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_prototyping_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_prototyping_t* uwb_prototyping) -{ - return mavlink_msg_uwb_prototyping_pack_chan(system_id, component_id, chan, msg, uwb_prototyping->type, uwb_prototyping->integers, uwb_prototyping->floats); -} - -/** - * @brief Send a uwb_prototyping message - * @param chan MAVLink channel to send the message - * - * @param type Message type description. - * @param integers Arbitrary integer values. - * @param floats Arbitrary float values. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_prototyping_send(mavlink_channel_t chan, uint8_t type, const uint64_t *integers, const float *floats) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN]; - _mav_put_uint8_t(buf, 120, type); - _mav_put_uint64_t_array(buf, 0, integers, 10); - _mav_put_float_array(buf, 80, floats, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_PROTOTYPING, buf, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN, MAVLINK_MSG_ID_UWB_PROTOTYPING_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_PROTOTYPING, buf, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif -#else - mavlink_uwb_prototyping_t packet; - packet.type = type; - mav_array_memcpy(packet.integers, integers, sizeof(uint64_t)*10); - mav_array_memcpy(packet.floats, floats, sizeof(float)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_PROTOTYPING, (const char *)&packet, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN, MAVLINK_MSG_ID_UWB_PROTOTYPING_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_PROTOTYPING, (const char *)&packet, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_PROTOTYPING_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_uwb_prototyping_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, const uint64_t *integers, const float *floats) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 120, type); - _mav_put_uint64_t_array(buf, 0, integers, 10); - _mav_put_float_array(buf, 80, floats, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_PROTOTYPING, buf, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN, MAVLINK_MSG_ID_UWB_PROTOTYPING_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_PROTOTYPING, buf, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif -#else - mavlink_uwb_prototyping_t *packet = (mavlink_uwb_prototyping_t *)msgbuf; - packet->type = type; - mav_array_memcpy(packet->integers, integers, sizeof(uint64_t)*10); - mav_array_memcpy(packet->floats, floats, sizeof(float)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_PROTOTYPING, (const char *)packet, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN, MAVLINK_MSG_ID_UWB_PROTOTYPING_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_PROTOTYPING, (const char *)packet, MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_PROTOTYPING UNPACKING - - -/** - * @brief Get field type from uwb_prototyping message - * - * @return Message type description. - */ -static inline uint8_t mavlink_msg_uwb_prototyping_get_type(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 120); -} - -/** - * @brief Get field integers from uwb_prototyping message - * - * @return Arbitrary integer values. - */ -static inline uint16_t mavlink_msg_uwb_prototyping_get_integers(const mavlink_message_t* msg, uint64_t *integers) -{ - return _MAV_RETURN_uint64_t_array(msg, integers, 10, 0); -} - -/** - * @brief Get field floats from uwb_prototyping message - * - * @return Arbitrary float values. - */ -static inline uint16_t mavlink_msg_uwb_prototyping_get_floats(const mavlink_message_t* msg, float *floats) -{ - return _MAV_RETURN_float_array(msg, floats, 10, 80); -} - -/** - * @brief Decode a uwb_prototyping message into a struct - * - * @param msg The message to decode - * @param uwb_prototyping C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_prototyping_decode(const mavlink_message_t* msg, mavlink_uwb_prototyping_t* uwb_prototyping) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_uwb_prototyping_get_integers(msg, uwb_prototyping->integers); - mavlink_msg_uwb_prototyping_get_floats(msg, uwb_prototyping->floats); - uwb_prototyping->type = mavlink_msg_uwb_prototyping_get_type(msg); -#else - memcpy(uwb_prototyping, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_PROTOTYPING_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_range.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_range.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,305 +0,0 @@ -// MESSAGE UWB_RANGE PACKING - -#define MAVLINK_MSG_ID_UWB_RANGE 200 - -typedef struct __mavlink_uwb_range_t -{ - uint32_t stamp_us; /*< Timestamp of measurement in microseconds.*/ - float round_trip_time; /*< Round trip time in nanoseconds.*/ - float range; /*< Range.*/ - uint8_t address; /*< Address of UWB unit.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as an anchor.*/ -} mavlink_uwb_range_t; - -#define MAVLINK_MSG_ID_UWB_RANGE_LEN 14 -#define MAVLINK_MSG_ID_200_LEN 14 - -#define MAVLINK_MSG_ID_UWB_RANGE_CRC 105 -#define MAVLINK_MSG_ID_200_CRC 105 - - - -#define MAVLINK_MESSAGE_INFO_UWB_RANGE { \ - "UWB_RANGE", \ - 5, \ - { { "stamp_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_uwb_range_t, stamp_us) }, \ - { "round_trip_time", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_uwb_range_t, round_trip_time) }, \ - { "range", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_uwb_range_t, range) }, \ - { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_uwb_range_t, address) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_uwb_range_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_range 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 address Address of UWB unit. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param stamp_us Timestamp of measurement in microseconds. - * @param round_trip_time Round trip time in nanoseconds. - * @param range Range. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t address, uint8_t remote_address, uint32_t stamp_us, float round_trip_time, float range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_LEN]; - _mav_put_uint32_t(buf, 0, stamp_us); - _mav_put_float(buf, 4, round_trip_time); - _mav_put_float(buf, 8, range); - _mav_put_uint8_t(buf, 12, address); - _mav_put_uint8_t(buf, 13, remote_address); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#else - mavlink_uwb_range_t packet; - packet.stamp_us = stamp_us; - packet.round_trip_time = round_trip_time; - packet.range = range; - packet.address = address; - packet.remote_address = remote_address; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_LEN, MAVLINK_MSG_ID_UWB_RANGE_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif -} - -/** - * @brief Pack a uwb_range 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 address Address of UWB unit. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param stamp_us Timestamp of measurement in microseconds. - * @param round_trip_time Round trip time in nanoseconds. - * @param range Range. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t address,uint8_t remote_address,uint32_t stamp_us,float round_trip_time,float range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_LEN]; - _mav_put_uint32_t(buf, 0, stamp_us); - _mav_put_float(buf, 4, round_trip_time); - _mav_put_float(buf, 8, range); - _mav_put_uint8_t(buf, 12, address); - _mav_put_uint8_t(buf, 13, remote_address); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#else - mavlink_uwb_range_t packet; - packet.stamp_us = stamp_us; - packet.round_trip_time = round_trip_time; - packet.range = range; - packet.address = address; - packet.remote_address = remote_address; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_LEN, MAVLINK_MSG_ID_UWB_RANGE_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif -} - -/** - * @brief Encode a uwb_range 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 uwb_range C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_range_t* uwb_range) -{ - return mavlink_msg_uwb_range_pack(system_id, component_id, msg, uwb_range->address, uwb_range->remote_address, uwb_range->stamp_us, uwb_range->round_trip_time, uwb_range->range); -} - -/** - * @brief Encode a uwb_range 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 uwb_range C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_range_t* uwb_range) -{ - return mavlink_msg_uwb_range_pack_chan(system_id, component_id, chan, msg, uwb_range->address, uwb_range->remote_address, uwb_range->stamp_us, uwb_range->round_trip_time, uwb_range->range); -} - -/** - * @brief Send a uwb_range message - * @param chan MAVLink channel to send the message - * - * @param address Address of UWB unit. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param stamp_us Timestamp of measurement in microseconds. - * @param round_trip_time Round trip time in nanoseconds. - * @param range Range. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_range_send(mavlink_channel_t chan, uint8_t address, uint8_t remote_address, uint32_t stamp_us, float round_trip_time, float range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_LEN]; - _mav_put_uint32_t(buf, 0, stamp_us); - _mav_put_float(buf, 4, round_trip_time); - _mav_put_float(buf, 8, range); - _mav_put_uint8_t(buf, 12, address); - _mav_put_uint8_t(buf, 13, remote_address); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE, buf, MAVLINK_MSG_ID_UWB_RANGE_LEN, MAVLINK_MSG_ID_UWB_RANGE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE, buf, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif -#else - mavlink_uwb_range_t packet; - packet.stamp_us = stamp_us; - packet.round_trip_time = round_trip_time; - packet.range = range; - packet.address = address; - packet.remote_address = remote_address; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_LEN, MAVLINK_MSG_ID_UWB_RANGE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_RANGE_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_uwb_range_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t address, uint8_t remote_address, uint32_t stamp_us, float round_trip_time, float range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, stamp_us); - _mav_put_float(buf, 4, round_trip_time); - _mav_put_float(buf, 8, range); - _mav_put_uint8_t(buf, 12, address); - _mav_put_uint8_t(buf, 13, remote_address); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE, buf, MAVLINK_MSG_ID_UWB_RANGE_LEN, MAVLINK_MSG_ID_UWB_RANGE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE, buf, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif -#else - mavlink_uwb_range_t *packet = (mavlink_uwb_range_t *)msgbuf; - packet->stamp_us = stamp_us; - packet->round_trip_time = round_trip_time; - packet->range = range; - packet->address = address; - packet->remote_address = remote_address; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_LEN, MAVLINK_MSG_ID_UWB_RANGE_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_RANGE UNPACKING - - -/** - * @brief Get field address from uwb_range message - * - * @return Address of UWB unit. - */ -static inline uint8_t mavlink_msg_uwb_range_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 12); -} - -/** - * @brief Get field remote_address from uwb_range message - * - * @return Address of remote UWB unit that was used as an anchor. - */ -static inline uint8_t mavlink_msg_uwb_range_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 13); -} - -/** - * @brief Get field stamp_us from uwb_range message - * - * @return Timestamp of measurement in microseconds. - */ -static inline uint32_t mavlink_msg_uwb_range_get_stamp_us(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Get field round_trip_time from uwb_range message - * - * @return Round trip time in nanoseconds. - */ -static inline float mavlink_msg_uwb_range_get_round_trip_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field range from uwb_range message - * - * @return Range. - */ -static inline float mavlink_msg_uwb_range_get_range(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Decode a uwb_range message into a struct - * - * @param msg The message to decode - * @param uwb_range C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_range_decode(const mavlink_message_t* msg, mavlink_uwb_range_t* uwb_range) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_range->stamp_us = mavlink_msg_uwb_range_get_stamp_us(msg); - uwb_range->round_trip_time = mavlink_msg_uwb_range_get_round_trip_time(msg); - uwb_range->range = mavlink_msg_uwb_range_get_range(msg); - uwb_range->address = mavlink_msg_uwb_range_get_address(msg); - uwb_range->remote_address = mavlink_msg_uwb_range_get_remote_address(msg); -#else - memcpy(uwb_range, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_RANGE_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_range_batch_2.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_range_batch_2.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -// MESSAGE UWB_RANGE_BATCH_2 PACKING - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_2 212 - -typedef struct __mavlink_uwb_range_batch_2_t -{ - float range[2]; /*< Ranges.*/ - uint8_t addresses[2]; /*< Addresses of UWB units.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as an anchor.*/ -} mavlink_uwb_range_batch_2_t; - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN 11 -#define MAVLINK_MSG_ID_212_LEN 11 - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_CRC 211 -#define MAVLINK_MSG_ID_212_CRC 211 - -#define MAVLINK_MSG_UWB_RANGE_BATCH_2_FIELD_RANGE_LEN 2 -#define MAVLINK_MSG_UWB_RANGE_BATCH_2_FIELD_ADDRESSES_LEN 2 - -#define MAVLINK_MESSAGE_INFO_UWB_RANGE_BATCH_2 { \ - "UWB_RANGE_BATCH_2", \ - 3, \ - { { "range", NULL, MAVLINK_TYPE_FLOAT, 2, 0, offsetof(mavlink_uwb_range_batch_2_t, range) }, \ - { "addresses", NULL, MAVLINK_TYPE_UINT8_T, 2, 8, offsetof(mavlink_uwb_range_batch_2_t, addresses) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_uwb_range_batch_2_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_range_batch_2 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 addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_batch_2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN]; - _mav_put_uint8_t(buf, 10, remote_address); - _mav_put_float_array(buf, 0, range, 2); - _mav_put_uint8_t_array(buf, 8, addresses, 2); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#else - mavlink_uwb_range_batch_2_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*2); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*2); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_BATCH_2; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif -} - -/** - * @brief Pack a uwb_range_batch_2 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 addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_batch_2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const uint8_t *addresses,uint8_t remote_address,const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN]; - _mav_put_uint8_t(buf, 10, remote_address); - _mav_put_float_array(buf, 0, range, 2); - _mav_put_uint8_t_array(buf, 8, addresses, 2); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#else - mavlink_uwb_range_batch_2_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*2); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*2); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_BATCH_2; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif -} - -/** - * @brief Encode a uwb_range_batch_2 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 uwb_range_batch_2 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_batch_2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_range_batch_2_t* uwb_range_batch_2) -{ - return mavlink_msg_uwb_range_batch_2_pack(system_id, component_id, msg, uwb_range_batch_2->addresses, uwb_range_batch_2->remote_address, uwb_range_batch_2->range); -} - -/** - * @brief Encode a uwb_range_batch_2 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 uwb_range_batch_2 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_batch_2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_range_batch_2_t* uwb_range_batch_2) -{ - return mavlink_msg_uwb_range_batch_2_pack_chan(system_id, component_id, chan, msg, uwb_range_batch_2->addresses, uwb_range_batch_2->remote_address, uwb_range_batch_2->range); -} - -/** - * @brief Send a uwb_range_batch_2 message - * @param chan MAVLink channel to send the message - * - * @param addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_range_batch_2_send(mavlink_channel_t chan, const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN]; - _mav_put_uint8_t(buf, 10, remote_address); - _mav_put_float_array(buf, 0, range, 2); - _mav_put_uint8_t_array(buf, 8, addresses, 2); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif -#else - mavlink_uwb_range_batch_2_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*2); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*2); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_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_uwb_range_batch_2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 10, remote_address); - _mav_put_float_array(buf, 0, range, 2); - _mav_put_uint8_t_array(buf, 8, addresses, 2); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif -#else - mavlink_uwb_range_batch_2_t *packet = (mavlink_uwb_range_batch_2_t *)msgbuf; - packet->remote_address = remote_address; - mav_array_memcpy(packet->range, range, sizeof(float)*2); - mav_array_memcpy(packet->addresses, addresses, sizeof(uint8_t)*2); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_RANGE_BATCH_2 UNPACKING - - -/** - * @brief Get field addresses from uwb_range_batch_2 message - * - * @return Addresses of UWB units. - */ -static inline uint16_t mavlink_msg_uwb_range_batch_2_get_addresses(const mavlink_message_t* msg, uint8_t *addresses) -{ - return _MAV_RETURN_uint8_t_array(msg, addresses, 2, 8); -} - -/** - * @brief Get field remote_address from uwb_range_batch_2 message - * - * @return Address of remote UWB unit that was used as an anchor. - */ -static inline uint8_t mavlink_msg_uwb_range_batch_2_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 10); -} - -/** - * @brief Get field range from uwb_range_batch_2 message - * - * @return Ranges. - */ -static inline uint16_t mavlink_msg_uwb_range_batch_2_get_range(const mavlink_message_t* msg, float *range) -{ - return _MAV_RETURN_float_array(msg, range, 2, 0); -} - -/** - * @brief Decode a uwb_range_batch_2 message into a struct - * - * @param msg The message to decode - * @param uwb_range_batch_2 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_range_batch_2_decode(const mavlink_message_t* msg, mavlink_uwb_range_batch_2_t* uwb_range_batch_2) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_uwb_range_batch_2_get_range(msg, uwb_range_batch_2->range); - mavlink_msg_uwb_range_batch_2_get_addresses(msg, uwb_range_batch_2->addresses); - uwb_range_batch_2->remote_address = mavlink_msg_uwb_range_batch_2_get_remote_address(msg); -#else - memcpy(uwb_range_batch_2, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_RANGE_BATCH_2_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_range_batch_3.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_range_batch_3.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -// MESSAGE UWB_RANGE_BATCH_3 PACKING - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_3 213 - -typedef struct __mavlink_uwb_range_batch_3_t -{ - float range[3]; /*< Ranges.*/ - uint8_t addresses[3]; /*< Addresses of UWB units.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as an anchor.*/ -} mavlink_uwb_range_batch_3_t; - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN 16 -#define MAVLINK_MSG_ID_213_LEN 16 - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_CRC 96 -#define MAVLINK_MSG_ID_213_CRC 96 - -#define MAVLINK_MSG_UWB_RANGE_BATCH_3_FIELD_RANGE_LEN 3 -#define MAVLINK_MSG_UWB_RANGE_BATCH_3_FIELD_ADDRESSES_LEN 3 - -#define MAVLINK_MESSAGE_INFO_UWB_RANGE_BATCH_3 { \ - "UWB_RANGE_BATCH_3", \ - 3, \ - { { "range", NULL, MAVLINK_TYPE_FLOAT, 3, 0, offsetof(mavlink_uwb_range_batch_3_t, range) }, \ - { "addresses", NULL, MAVLINK_TYPE_UINT8_T, 3, 12, offsetof(mavlink_uwb_range_batch_3_t, addresses) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_uwb_range_batch_3_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_range_batch_3 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 addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_batch_3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN]; - _mav_put_uint8_t(buf, 15, remote_address); - _mav_put_float_array(buf, 0, range, 3); - _mav_put_uint8_t_array(buf, 12, addresses, 3); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#else - mavlink_uwb_range_batch_3_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*3); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*3); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_BATCH_3; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif -} - -/** - * @brief Pack a uwb_range_batch_3 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 addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_batch_3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const uint8_t *addresses,uint8_t remote_address,const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN]; - _mav_put_uint8_t(buf, 15, remote_address); - _mav_put_float_array(buf, 0, range, 3); - _mav_put_uint8_t_array(buf, 12, addresses, 3); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#else - mavlink_uwb_range_batch_3_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*3); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*3); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_BATCH_3; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif -} - -/** - * @brief Encode a uwb_range_batch_3 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 uwb_range_batch_3 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_batch_3_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_range_batch_3_t* uwb_range_batch_3) -{ - return mavlink_msg_uwb_range_batch_3_pack(system_id, component_id, msg, uwb_range_batch_3->addresses, uwb_range_batch_3->remote_address, uwb_range_batch_3->range); -} - -/** - * @brief Encode a uwb_range_batch_3 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 uwb_range_batch_3 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_batch_3_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_range_batch_3_t* uwb_range_batch_3) -{ - return mavlink_msg_uwb_range_batch_3_pack_chan(system_id, component_id, chan, msg, uwb_range_batch_3->addresses, uwb_range_batch_3->remote_address, uwb_range_batch_3->range); -} - -/** - * @brief Send a uwb_range_batch_3 message - * @param chan MAVLink channel to send the message - * - * @param addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_range_batch_3_send(mavlink_channel_t chan, const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN]; - _mav_put_uint8_t(buf, 15, remote_address); - _mav_put_float_array(buf, 0, range, 3); - _mav_put_uint8_t_array(buf, 12, addresses, 3); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif -#else - mavlink_uwb_range_batch_3_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*3); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*3); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_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_uwb_range_batch_3_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 15, remote_address); - _mav_put_float_array(buf, 0, range, 3); - _mav_put_uint8_t_array(buf, 12, addresses, 3); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif -#else - mavlink_uwb_range_batch_3_t *packet = (mavlink_uwb_range_batch_3_t *)msgbuf; - packet->remote_address = remote_address; - mav_array_memcpy(packet->range, range, sizeof(float)*3); - mav_array_memcpy(packet->addresses, addresses, sizeof(uint8_t)*3); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_RANGE_BATCH_3 UNPACKING - - -/** - * @brief Get field addresses from uwb_range_batch_3 message - * - * @return Addresses of UWB units. - */ -static inline uint16_t mavlink_msg_uwb_range_batch_3_get_addresses(const mavlink_message_t* msg, uint8_t *addresses) -{ - return _MAV_RETURN_uint8_t_array(msg, addresses, 3, 12); -} - -/** - * @brief Get field remote_address from uwb_range_batch_3 message - * - * @return Address of remote UWB unit that was used as an anchor. - */ -static inline uint8_t mavlink_msg_uwb_range_batch_3_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 15); -} - -/** - * @brief Get field range from uwb_range_batch_3 message - * - * @return Ranges. - */ -static inline uint16_t mavlink_msg_uwb_range_batch_3_get_range(const mavlink_message_t* msg, float *range) -{ - return _MAV_RETURN_float_array(msg, range, 3, 0); -} - -/** - * @brief Decode a uwb_range_batch_3 message into a struct - * - * @param msg The message to decode - * @param uwb_range_batch_3 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_range_batch_3_decode(const mavlink_message_t* msg, mavlink_uwb_range_batch_3_t* uwb_range_batch_3) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_uwb_range_batch_3_get_range(msg, uwb_range_batch_3->range); - mavlink_msg_uwb_range_batch_3_get_addresses(msg, uwb_range_batch_3->addresses); - uwb_range_batch_3->remote_address = mavlink_msg_uwb_range_batch_3_get_remote_address(msg); -#else - memcpy(uwb_range_batch_3, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_RANGE_BATCH_3_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_range_batch_4.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_range_batch_4.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -// MESSAGE UWB_RANGE_BATCH_4 PACKING - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_4 214 - -typedef struct __mavlink_uwb_range_batch_4_t -{ - float range[4]; /*< Ranges.*/ - uint8_t addresses[4]; /*< Addresses of UWB units.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as an anchor.*/ -} mavlink_uwb_range_batch_4_t; - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN 21 -#define MAVLINK_MSG_ID_214_LEN 21 - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_CRC 74 -#define MAVLINK_MSG_ID_214_CRC 74 - -#define MAVLINK_MSG_UWB_RANGE_BATCH_4_FIELD_RANGE_LEN 4 -#define MAVLINK_MSG_UWB_RANGE_BATCH_4_FIELD_ADDRESSES_LEN 4 - -#define MAVLINK_MESSAGE_INFO_UWB_RANGE_BATCH_4 { \ - "UWB_RANGE_BATCH_4", \ - 3, \ - { { "range", NULL, MAVLINK_TYPE_FLOAT, 4, 0, offsetof(mavlink_uwb_range_batch_4_t, range) }, \ - { "addresses", NULL, MAVLINK_TYPE_UINT8_T, 4, 16, offsetof(mavlink_uwb_range_batch_4_t, addresses) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_uwb_range_batch_4_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_range_batch_4 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 addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_batch_4_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN]; - _mav_put_uint8_t(buf, 20, remote_address); - _mav_put_float_array(buf, 0, range, 4); - _mav_put_uint8_t_array(buf, 16, addresses, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#else - mavlink_uwb_range_batch_4_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*4); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_BATCH_4; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif -} - -/** - * @brief Pack a uwb_range_batch_4 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 addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_batch_4_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const uint8_t *addresses,uint8_t remote_address,const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN]; - _mav_put_uint8_t(buf, 20, remote_address); - _mav_put_float_array(buf, 0, range, 4); - _mav_put_uint8_t_array(buf, 16, addresses, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#else - mavlink_uwb_range_batch_4_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*4); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_BATCH_4; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif -} - -/** - * @brief Encode a uwb_range_batch_4 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 uwb_range_batch_4 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_batch_4_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_range_batch_4_t* uwb_range_batch_4) -{ - return mavlink_msg_uwb_range_batch_4_pack(system_id, component_id, msg, uwb_range_batch_4->addresses, uwb_range_batch_4->remote_address, uwb_range_batch_4->range); -} - -/** - * @brief Encode a uwb_range_batch_4 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 uwb_range_batch_4 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_batch_4_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_range_batch_4_t* uwb_range_batch_4) -{ - return mavlink_msg_uwb_range_batch_4_pack_chan(system_id, component_id, chan, msg, uwb_range_batch_4->addresses, uwb_range_batch_4->remote_address, uwb_range_batch_4->range); -} - -/** - * @brief Send a uwb_range_batch_4 message - * @param chan MAVLink channel to send the message - * - * @param addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_range_batch_4_send(mavlink_channel_t chan, const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN]; - _mav_put_uint8_t(buf, 20, remote_address); - _mav_put_float_array(buf, 0, range, 4); - _mav_put_uint8_t_array(buf, 16, addresses, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif -#else - mavlink_uwb_range_batch_4_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*4); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_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_uwb_range_batch_4_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 20, remote_address); - _mav_put_float_array(buf, 0, range, 4); - _mav_put_uint8_t_array(buf, 16, addresses, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif -#else - mavlink_uwb_range_batch_4_t *packet = (mavlink_uwb_range_batch_4_t *)msgbuf; - packet->remote_address = remote_address; - mav_array_memcpy(packet->range, range, sizeof(float)*4); - mav_array_memcpy(packet->addresses, addresses, sizeof(uint8_t)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_RANGE_BATCH_4 UNPACKING - - -/** - * @brief Get field addresses from uwb_range_batch_4 message - * - * @return Addresses of UWB units. - */ -static inline uint16_t mavlink_msg_uwb_range_batch_4_get_addresses(const mavlink_message_t* msg, uint8_t *addresses) -{ - return _MAV_RETURN_uint8_t_array(msg, addresses, 4, 16); -} - -/** - * @brief Get field remote_address from uwb_range_batch_4 message - * - * @return Address of remote UWB unit that was used as an anchor. - */ -static inline uint8_t mavlink_msg_uwb_range_batch_4_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 20); -} - -/** - * @brief Get field range from uwb_range_batch_4 message - * - * @return Ranges. - */ -static inline uint16_t mavlink_msg_uwb_range_batch_4_get_range(const mavlink_message_t* msg, float *range) -{ - return _MAV_RETURN_float_array(msg, range, 4, 0); -} - -/** - * @brief Decode a uwb_range_batch_4 message into a struct - * - * @param msg The message to decode - * @param uwb_range_batch_4 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_range_batch_4_decode(const mavlink_message_t* msg, mavlink_uwb_range_batch_4_t* uwb_range_batch_4) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_uwb_range_batch_4_get_range(msg, uwb_range_batch_4->range); - mavlink_msg_uwb_range_batch_4_get_addresses(msg, uwb_range_batch_4->addresses); - uwb_range_batch_4->remote_address = mavlink_msg_uwb_range_batch_4_get_remote_address(msg); -#else - memcpy(uwb_range_batch_4, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_RANGE_BATCH_4_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_range_batch_5.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_range_batch_5.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -// MESSAGE UWB_RANGE_BATCH_5 PACKING - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_5 215 - -typedef struct __mavlink_uwb_range_batch_5_t -{ - float range[5]; /*< Ranges.*/ - uint8_t addresses[5]; /*< Addresses of UWB units.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as an anchor.*/ -} mavlink_uwb_range_batch_5_t; - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN 26 -#define MAVLINK_MSG_ID_215_LEN 26 - -#define MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_CRC 249 -#define MAVLINK_MSG_ID_215_CRC 249 - -#define MAVLINK_MSG_UWB_RANGE_BATCH_5_FIELD_RANGE_LEN 5 -#define MAVLINK_MSG_UWB_RANGE_BATCH_5_FIELD_ADDRESSES_LEN 5 - -#define MAVLINK_MESSAGE_INFO_UWB_RANGE_BATCH_5 { \ - "UWB_RANGE_BATCH_5", \ - 3, \ - { { "range", NULL, MAVLINK_TYPE_FLOAT, 5, 0, offsetof(mavlink_uwb_range_batch_5_t, range) }, \ - { "addresses", NULL, MAVLINK_TYPE_UINT8_T, 5, 20, offsetof(mavlink_uwb_range_batch_5_t, addresses) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_uwb_range_batch_5_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_range_batch_5 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 addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_batch_5_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN]; - _mav_put_uint8_t(buf, 25, remote_address); - _mav_put_float_array(buf, 0, range, 5); - _mav_put_uint8_t_array(buf, 20, addresses, 5); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#else - mavlink_uwb_range_batch_5_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*5); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*5); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_BATCH_5; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif -} - -/** - * @brief Pack a uwb_range_batch_5 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 addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_batch_5_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - const uint8_t *addresses,uint8_t remote_address,const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN]; - _mav_put_uint8_t(buf, 25, remote_address); - _mav_put_float_array(buf, 0, range, 5); - _mav_put_uint8_t_array(buf, 20, addresses, 5); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#else - mavlink_uwb_range_batch_5_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*5); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*5); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_BATCH_5; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif -} - -/** - * @brief Encode a uwb_range_batch_5 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 uwb_range_batch_5 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_batch_5_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_range_batch_5_t* uwb_range_batch_5) -{ - return mavlink_msg_uwb_range_batch_5_pack(system_id, component_id, msg, uwb_range_batch_5->addresses, uwb_range_batch_5->remote_address, uwb_range_batch_5->range); -} - -/** - * @brief Encode a uwb_range_batch_5 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 uwb_range_batch_5 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_batch_5_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_range_batch_5_t* uwb_range_batch_5) -{ - return mavlink_msg_uwb_range_batch_5_pack_chan(system_id, component_id, chan, msg, uwb_range_batch_5->addresses, uwb_range_batch_5->remote_address, uwb_range_batch_5->range); -} - -/** - * @brief Send a uwb_range_batch_5 message - * @param chan MAVLink channel to send the message - * - * @param addresses Addresses of UWB units. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param range Ranges. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_range_batch_5_send(mavlink_channel_t chan, const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN]; - _mav_put_uint8_t(buf, 25, remote_address); - _mav_put_float_array(buf, 0, range, 5); - _mav_put_uint8_t_array(buf, 20, addresses, 5); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif -#else - mavlink_uwb_range_batch_5_t packet; - packet.remote_address = remote_address; - mav_array_memcpy(packet.range, range, sizeof(float)*5); - mav_array_memcpy(packet.addresses, addresses, sizeof(uint8_t)*5); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_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_uwb_range_batch_5_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const uint8_t *addresses, uint8_t remote_address, const float *range) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 25, remote_address); - _mav_put_float_array(buf, 0, range, 5); - _mav_put_uint8_t_array(buf, 20, addresses, 5); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5, buf, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif -#else - mavlink_uwb_range_batch_5_t *packet = (mavlink_uwb_range_batch_5_t *)msgbuf; - packet->remote_address = remote_address; - mav_array_memcpy(packet->range, range, sizeof(float)*5); - mav_array_memcpy(packet->addresses, addresses, sizeof(uint8_t)*5); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_RANGE_BATCH_5 UNPACKING - - -/** - * @brief Get field addresses from uwb_range_batch_5 message - * - * @return Addresses of UWB units. - */ -static inline uint16_t mavlink_msg_uwb_range_batch_5_get_addresses(const mavlink_message_t* msg, uint8_t *addresses) -{ - return _MAV_RETURN_uint8_t_array(msg, addresses, 5, 20); -} - -/** - * @brief Get field remote_address from uwb_range_batch_5 message - * - * @return Address of remote UWB unit that was used as an anchor. - */ -static inline uint8_t mavlink_msg_uwb_range_batch_5_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 25); -} - -/** - * @brief Get field range from uwb_range_batch_5 message - * - * @return Ranges. - */ -static inline uint16_t mavlink_msg_uwb_range_batch_5_get_range(const mavlink_message_t* msg, float *range) -{ - return _MAV_RETURN_float_array(msg, range, 5, 0); -} - -/** - * @brief Decode a uwb_range_batch_5 message into a struct - * - * @param msg The message to decode - * @param uwb_range_batch_5 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_range_batch_5_decode(const mavlink_message_t* msg, mavlink_uwb_range_batch_5_t* uwb_range_batch_5) -{ -#if MAVLINK_NEED_BYTE_SWAP - mavlink_msg_uwb_range_batch_5_get_range(msg, uwb_range_batch_5->range); - mavlink_msg_uwb_range_batch_5_get_addresses(msg, uwb_range_batch_5->addresses); - uwb_range_batch_5->remote_address = mavlink_msg_uwb_range_batch_5_get_remote_address(msg); -#else - memcpy(uwb_range_batch_5, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_RANGE_BATCH_5_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_range_stats.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_range_stats.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,689 +0,0 @@ -// MESSAGE UWB_RANGE_STATS PACKING - -#define MAVLINK_MSG_ID_UWB_RANGE_STATS 201 - -typedef struct __mavlink_uwb_range_stats_t -{ - uint32_t stamp_us; /*< Timestamp of measurement in microseconds.*/ - float round_trip_time; /*< Round trip time in nanoseconds.*/ - float range; /*< Range.*/ - uint16_t std_noise_1; /*< Noise 1.*/ - uint16_t std_noise_2; /*< Noise 2.*/ - uint16_t preamble_acc_count_1; /*< Preamble accumulator count 1.*/ - uint16_t preamble_acc_count_2; /*< Preamble accumulator count 2.*/ - uint16_t first_path_index_1; /*< First path index 1.*/ - uint16_t first_path_index_2; /*< First path index 2.*/ - uint16_t first_path_amp_1_1; /*< First path amplitude 1 1.*/ - uint16_t first_path_amp_1_2; /*< First path amplitude 1 2.*/ - uint16_t first_path_amp_2_1; /*< First path amplitude 2 1.*/ - uint16_t first_path_amp_2_2; /*< First path amplitude 2 2.*/ - uint16_t first_path_amp_3_1; /*< First path amplitude 3 1.*/ - uint16_t first_path_amp_3_2; /*< First path amplitude 3 2.*/ - uint16_t channel_impulse_response_power_1; /*< Channel impulse response power 1.*/ - uint16_t channel_impulse_response_power_2; /*< Channel impulse response power 2.*/ - uint16_t prf_1; /*< PRF 1.*/ - uint16_t prf_2; /*< PRF 2.*/ - uint8_t address; /*< Address of UWB unit.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as an anchor.*/ -} mavlink_uwb_range_stats_t; - -#define MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN 46 -#define MAVLINK_MSG_ID_201_LEN 46 - -#define MAVLINK_MSG_ID_UWB_RANGE_STATS_CRC 219 -#define MAVLINK_MSG_ID_201_CRC 219 - - - -#define MAVLINK_MESSAGE_INFO_UWB_RANGE_STATS { \ - "UWB_RANGE_STATS", \ - 21, \ - { { "stamp_us", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_uwb_range_stats_t, stamp_us) }, \ - { "round_trip_time", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_uwb_range_stats_t, round_trip_time) }, \ - { "range", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_uwb_range_stats_t, range) }, \ - { "std_noise_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_uwb_range_stats_t, std_noise_1) }, \ - { "std_noise_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_uwb_range_stats_t, std_noise_2) }, \ - { "preamble_acc_count_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_uwb_range_stats_t, preamble_acc_count_1) }, \ - { "preamble_acc_count_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_uwb_range_stats_t, preamble_acc_count_2) }, \ - { "first_path_index_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_uwb_range_stats_t, first_path_index_1) }, \ - { "first_path_index_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_uwb_range_stats_t, first_path_index_2) }, \ - { "first_path_amp_1_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_uwb_range_stats_t, first_path_amp_1_1) }, \ - { "first_path_amp_1_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_uwb_range_stats_t, first_path_amp_1_2) }, \ - { "first_path_amp_2_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_uwb_range_stats_t, first_path_amp_2_1) }, \ - { "first_path_amp_2_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_uwb_range_stats_t, first_path_amp_2_2) }, \ - { "first_path_amp_3_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_uwb_range_stats_t, first_path_amp_3_1) }, \ - { "first_path_amp_3_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_uwb_range_stats_t, first_path_amp_3_2) }, \ - { "channel_impulse_response_power_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_uwb_range_stats_t, channel_impulse_response_power_1) }, \ - { "channel_impulse_response_power_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_uwb_range_stats_t, channel_impulse_response_power_2) }, \ - { "prf_1", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_uwb_range_stats_t, prf_1) }, \ - { "prf_2", NULL, MAVLINK_TYPE_UINT16_T, 0, 42, offsetof(mavlink_uwb_range_stats_t, prf_2) }, \ - { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 44, offsetof(mavlink_uwb_range_stats_t, address) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 45, offsetof(mavlink_uwb_range_stats_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_range_stats 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 address Address of UWB unit. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param stamp_us Timestamp of measurement in microseconds. - * @param round_trip_time Round trip time in nanoseconds. - * @param range Range. - * @param std_noise_1 Noise 1. - * @param std_noise_2 Noise 2. - * @param preamble_acc_count_1 Preamble accumulator count 1. - * @param preamble_acc_count_2 Preamble accumulator count 2. - * @param first_path_index_1 First path index 1. - * @param first_path_index_2 First path index 2. - * @param first_path_amp_1_1 First path amplitude 1 1. - * @param first_path_amp_1_2 First path amplitude 1 2. - * @param first_path_amp_2_1 First path amplitude 2 1. - * @param first_path_amp_2_2 First path amplitude 2 2. - * @param first_path_amp_3_1 First path amplitude 3 1. - * @param first_path_amp_3_2 First path amplitude 3 2. - * @param channel_impulse_response_power_1 Channel impulse response power 1. - * @param channel_impulse_response_power_2 Channel impulse response power 2. - * @param prf_1 PRF 1. - * @param prf_2 PRF 2. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_stats_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t address, uint8_t remote_address, uint32_t stamp_us, float round_trip_time, float range, uint16_t std_noise_1, uint16_t std_noise_2, uint16_t preamble_acc_count_1, uint16_t preamble_acc_count_2, uint16_t first_path_index_1, uint16_t first_path_index_2, uint16_t first_path_amp_1_1, uint16_t first_path_amp_1_2, uint16_t first_path_amp_2_1, uint16_t first_path_amp_2_2, uint16_t first_path_amp_3_1, uint16_t first_path_amp_3_2, uint16_t channel_impulse_response_power_1, uint16_t channel_impulse_response_power_2, uint16_t prf_1, uint16_t prf_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN]; - _mav_put_uint32_t(buf, 0, stamp_us); - _mav_put_float(buf, 4, round_trip_time); - _mav_put_float(buf, 8, range); - _mav_put_uint16_t(buf, 12, std_noise_1); - _mav_put_uint16_t(buf, 14, std_noise_2); - _mav_put_uint16_t(buf, 16, preamble_acc_count_1); - _mav_put_uint16_t(buf, 18, preamble_acc_count_2); - _mav_put_uint16_t(buf, 20, first_path_index_1); - _mav_put_uint16_t(buf, 22, first_path_index_2); - _mav_put_uint16_t(buf, 24, first_path_amp_1_1); - _mav_put_uint16_t(buf, 26, first_path_amp_1_2); - _mav_put_uint16_t(buf, 28, first_path_amp_2_1); - _mav_put_uint16_t(buf, 30, first_path_amp_2_2); - _mav_put_uint16_t(buf, 32, first_path_amp_3_1); - _mav_put_uint16_t(buf, 34, first_path_amp_3_2); - _mav_put_uint16_t(buf, 36, channel_impulse_response_power_1); - _mav_put_uint16_t(buf, 38, channel_impulse_response_power_2); - _mav_put_uint16_t(buf, 40, prf_1); - _mav_put_uint16_t(buf, 42, prf_2); - _mav_put_uint8_t(buf, 44, address); - _mav_put_uint8_t(buf, 45, remote_address); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#else - mavlink_uwb_range_stats_t packet; - packet.stamp_us = stamp_us; - packet.round_trip_time = round_trip_time; - packet.range = range; - packet.std_noise_1 = std_noise_1; - packet.std_noise_2 = std_noise_2; - packet.preamble_acc_count_1 = preamble_acc_count_1; - packet.preamble_acc_count_2 = preamble_acc_count_2; - packet.first_path_index_1 = first_path_index_1; - packet.first_path_index_2 = first_path_index_2; - packet.first_path_amp_1_1 = first_path_amp_1_1; - packet.first_path_amp_1_2 = first_path_amp_1_2; - packet.first_path_amp_2_1 = first_path_amp_2_1; - packet.first_path_amp_2_2 = first_path_amp_2_2; - packet.first_path_amp_3_1 = first_path_amp_3_1; - packet.first_path_amp_3_2 = first_path_amp_3_2; - packet.channel_impulse_response_power_1 = channel_impulse_response_power_1; - packet.channel_impulse_response_power_2 = channel_impulse_response_power_2; - packet.prf_1 = prf_1; - packet.prf_2 = prf_2; - packet.address = address; - packet.remote_address = remote_address; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_STATS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN, MAVLINK_MSG_ID_UWB_RANGE_STATS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif -} - -/** - * @brief Pack a uwb_range_stats 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 address Address of UWB unit. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param stamp_us Timestamp of measurement in microseconds. - * @param round_trip_time Round trip time in nanoseconds. - * @param range Range. - * @param std_noise_1 Noise 1. - * @param std_noise_2 Noise 2. - * @param preamble_acc_count_1 Preamble accumulator count 1. - * @param preamble_acc_count_2 Preamble accumulator count 2. - * @param first_path_index_1 First path index 1. - * @param first_path_index_2 First path index 2. - * @param first_path_amp_1_1 First path amplitude 1 1. - * @param first_path_amp_1_2 First path amplitude 1 2. - * @param first_path_amp_2_1 First path amplitude 2 1. - * @param first_path_amp_2_2 First path amplitude 2 2. - * @param first_path_amp_3_1 First path amplitude 3 1. - * @param first_path_amp_3_2 First path amplitude 3 2. - * @param channel_impulse_response_power_1 Channel impulse response power 1. - * @param channel_impulse_response_power_2 Channel impulse response power 2. - * @param prf_1 PRF 1. - * @param prf_2 PRF 2. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_range_stats_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t address,uint8_t remote_address,uint32_t stamp_us,float round_trip_time,float range,uint16_t std_noise_1,uint16_t std_noise_2,uint16_t preamble_acc_count_1,uint16_t preamble_acc_count_2,uint16_t first_path_index_1,uint16_t first_path_index_2,uint16_t first_path_amp_1_1,uint16_t first_path_amp_1_2,uint16_t first_path_amp_2_1,uint16_t first_path_amp_2_2,uint16_t first_path_amp_3_1,uint16_t first_path_amp_3_2,uint16_t channel_impulse_response_power_1,uint16_t channel_impulse_response_power_2,uint16_t prf_1,uint16_t prf_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN]; - _mav_put_uint32_t(buf, 0, stamp_us); - _mav_put_float(buf, 4, round_trip_time); - _mav_put_float(buf, 8, range); - _mav_put_uint16_t(buf, 12, std_noise_1); - _mav_put_uint16_t(buf, 14, std_noise_2); - _mav_put_uint16_t(buf, 16, preamble_acc_count_1); - _mav_put_uint16_t(buf, 18, preamble_acc_count_2); - _mav_put_uint16_t(buf, 20, first_path_index_1); - _mav_put_uint16_t(buf, 22, first_path_index_2); - _mav_put_uint16_t(buf, 24, first_path_amp_1_1); - _mav_put_uint16_t(buf, 26, first_path_amp_1_2); - _mav_put_uint16_t(buf, 28, first_path_amp_2_1); - _mav_put_uint16_t(buf, 30, first_path_amp_2_2); - _mav_put_uint16_t(buf, 32, first_path_amp_3_1); - _mav_put_uint16_t(buf, 34, first_path_amp_3_2); - _mav_put_uint16_t(buf, 36, channel_impulse_response_power_1); - _mav_put_uint16_t(buf, 38, channel_impulse_response_power_2); - _mav_put_uint16_t(buf, 40, prf_1); - _mav_put_uint16_t(buf, 42, prf_2); - _mav_put_uint8_t(buf, 44, address); - _mav_put_uint8_t(buf, 45, remote_address); - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#else - mavlink_uwb_range_stats_t packet; - packet.stamp_us = stamp_us; - packet.round_trip_time = round_trip_time; - packet.range = range; - packet.std_noise_1 = std_noise_1; - packet.std_noise_2 = std_noise_2; - packet.preamble_acc_count_1 = preamble_acc_count_1; - packet.preamble_acc_count_2 = preamble_acc_count_2; - packet.first_path_index_1 = first_path_index_1; - packet.first_path_index_2 = first_path_index_2; - packet.first_path_amp_1_1 = first_path_amp_1_1; - packet.first_path_amp_1_2 = first_path_amp_1_2; - packet.first_path_amp_2_1 = first_path_amp_2_1; - packet.first_path_amp_2_2 = first_path_amp_2_2; - packet.first_path_amp_3_1 = first_path_amp_3_1; - packet.first_path_amp_3_2 = first_path_amp_3_2; - packet.channel_impulse_response_power_1 = channel_impulse_response_power_1; - packet.channel_impulse_response_power_2 = channel_impulse_response_power_2; - packet.prf_1 = prf_1; - packet.prf_2 = prf_2; - packet.address = address; - packet.remote_address = remote_address; - - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_RANGE_STATS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN, MAVLINK_MSG_ID_UWB_RANGE_STATS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif -} - -/** - * @brief Encode a uwb_range_stats 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 uwb_range_stats C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_stats_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_range_stats_t* uwb_range_stats) -{ - return mavlink_msg_uwb_range_stats_pack(system_id, component_id, msg, uwb_range_stats->address, uwb_range_stats->remote_address, uwb_range_stats->stamp_us, uwb_range_stats->round_trip_time, uwb_range_stats->range, uwb_range_stats->std_noise_1, uwb_range_stats->std_noise_2, uwb_range_stats->preamble_acc_count_1, uwb_range_stats->preamble_acc_count_2, uwb_range_stats->first_path_index_1, uwb_range_stats->first_path_index_2, uwb_range_stats->first_path_amp_1_1, uwb_range_stats->first_path_amp_1_2, uwb_range_stats->first_path_amp_2_1, uwb_range_stats->first_path_amp_2_2, uwb_range_stats->first_path_amp_3_1, uwb_range_stats->first_path_amp_3_2, uwb_range_stats->channel_impulse_response_power_1, uwb_range_stats->channel_impulse_response_power_2, uwb_range_stats->prf_1, uwb_range_stats->prf_2); -} - -/** - * @brief Encode a uwb_range_stats 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 uwb_range_stats C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_range_stats_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_range_stats_t* uwb_range_stats) -{ - return mavlink_msg_uwb_range_stats_pack_chan(system_id, component_id, chan, msg, uwb_range_stats->address, uwb_range_stats->remote_address, uwb_range_stats->stamp_us, uwb_range_stats->round_trip_time, uwb_range_stats->range, uwb_range_stats->std_noise_1, uwb_range_stats->std_noise_2, uwb_range_stats->preamble_acc_count_1, uwb_range_stats->preamble_acc_count_2, uwb_range_stats->first_path_index_1, uwb_range_stats->first_path_index_2, uwb_range_stats->first_path_amp_1_1, uwb_range_stats->first_path_amp_1_2, uwb_range_stats->first_path_amp_2_1, uwb_range_stats->first_path_amp_2_2, uwb_range_stats->first_path_amp_3_1, uwb_range_stats->first_path_amp_3_2, uwb_range_stats->channel_impulse_response_power_1, uwb_range_stats->channel_impulse_response_power_2, uwb_range_stats->prf_1, uwb_range_stats->prf_2); -} - -/** - * @brief Send a uwb_range_stats message - * @param chan MAVLink channel to send the message - * - * @param address Address of UWB unit. - * @param remote_address Address of remote UWB unit that was used as an anchor. - * @param stamp_us Timestamp of measurement in microseconds. - * @param round_trip_time Round trip time in nanoseconds. - * @param range Range. - * @param std_noise_1 Noise 1. - * @param std_noise_2 Noise 2. - * @param preamble_acc_count_1 Preamble accumulator count 1. - * @param preamble_acc_count_2 Preamble accumulator count 2. - * @param first_path_index_1 First path index 1. - * @param first_path_index_2 First path index 2. - * @param first_path_amp_1_1 First path amplitude 1 1. - * @param first_path_amp_1_2 First path amplitude 1 2. - * @param first_path_amp_2_1 First path amplitude 2 1. - * @param first_path_amp_2_2 First path amplitude 2 2. - * @param first_path_amp_3_1 First path amplitude 3 1. - * @param first_path_amp_3_2 First path amplitude 3 2. - * @param channel_impulse_response_power_1 Channel impulse response power 1. - * @param channel_impulse_response_power_2 Channel impulse response power 2. - * @param prf_1 PRF 1. - * @param prf_2 PRF 2. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_range_stats_send(mavlink_channel_t chan, uint8_t address, uint8_t remote_address, uint32_t stamp_us, float round_trip_time, float range, uint16_t std_noise_1, uint16_t std_noise_2, uint16_t preamble_acc_count_1, uint16_t preamble_acc_count_2, uint16_t first_path_index_1, uint16_t first_path_index_2, uint16_t first_path_amp_1_1, uint16_t first_path_amp_1_2, uint16_t first_path_amp_2_1, uint16_t first_path_amp_2_2, uint16_t first_path_amp_3_1, uint16_t first_path_amp_3_2, uint16_t channel_impulse_response_power_1, uint16_t channel_impulse_response_power_2, uint16_t prf_1, uint16_t prf_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN]; - _mav_put_uint32_t(buf, 0, stamp_us); - _mav_put_float(buf, 4, round_trip_time); - _mav_put_float(buf, 8, range); - _mav_put_uint16_t(buf, 12, std_noise_1); - _mav_put_uint16_t(buf, 14, std_noise_2); - _mav_put_uint16_t(buf, 16, preamble_acc_count_1); - _mav_put_uint16_t(buf, 18, preamble_acc_count_2); - _mav_put_uint16_t(buf, 20, first_path_index_1); - _mav_put_uint16_t(buf, 22, first_path_index_2); - _mav_put_uint16_t(buf, 24, first_path_amp_1_1); - _mav_put_uint16_t(buf, 26, first_path_amp_1_2); - _mav_put_uint16_t(buf, 28, first_path_amp_2_1); - _mav_put_uint16_t(buf, 30, first_path_amp_2_2); - _mav_put_uint16_t(buf, 32, first_path_amp_3_1); - _mav_put_uint16_t(buf, 34, first_path_amp_3_2); - _mav_put_uint16_t(buf, 36, channel_impulse_response_power_1); - _mav_put_uint16_t(buf, 38, channel_impulse_response_power_2); - _mav_put_uint16_t(buf, 40, prf_1); - _mav_put_uint16_t(buf, 42, prf_2); - _mav_put_uint8_t(buf, 44, address); - _mav_put_uint8_t(buf, 45, remote_address); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_STATS, buf, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN, MAVLINK_MSG_ID_UWB_RANGE_STATS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_STATS, buf, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif -#else - mavlink_uwb_range_stats_t packet; - packet.stamp_us = stamp_us; - packet.round_trip_time = round_trip_time; - packet.range = range; - packet.std_noise_1 = std_noise_1; - packet.std_noise_2 = std_noise_2; - packet.preamble_acc_count_1 = preamble_acc_count_1; - packet.preamble_acc_count_2 = preamble_acc_count_2; - packet.first_path_index_1 = first_path_index_1; - packet.first_path_index_2 = first_path_index_2; - packet.first_path_amp_1_1 = first_path_amp_1_1; - packet.first_path_amp_1_2 = first_path_amp_1_2; - packet.first_path_amp_2_1 = first_path_amp_2_1; - packet.first_path_amp_2_2 = first_path_amp_2_2; - packet.first_path_amp_3_1 = first_path_amp_3_1; - packet.first_path_amp_3_2 = first_path_amp_3_2; - packet.channel_impulse_response_power_1 = channel_impulse_response_power_1; - packet.channel_impulse_response_power_2 = channel_impulse_response_power_2; - packet.prf_1 = prf_1; - packet.prf_2 = prf_2; - packet.address = address; - packet.remote_address = remote_address; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_STATS, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN, MAVLINK_MSG_ID_UWB_RANGE_STATS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_STATS, (const char *)&packet, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_RANGE_STATS_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_uwb_range_stats_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t address, uint8_t remote_address, uint32_t stamp_us, float round_trip_time, float range, uint16_t std_noise_1, uint16_t std_noise_2, uint16_t preamble_acc_count_1, uint16_t preamble_acc_count_2, uint16_t first_path_index_1, uint16_t first_path_index_2, uint16_t first_path_amp_1_1, uint16_t first_path_amp_1_2, uint16_t first_path_amp_2_1, uint16_t first_path_amp_2_2, uint16_t first_path_amp_3_1, uint16_t first_path_amp_3_2, uint16_t channel_impulse_response_power_1, uint16_t channel_impulse_response_power_2, uint16_t prf_1, uint16_t prf_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint32_t(buf, 0, stamp_us); - _mav_put_float(buf, 4, round_trip_time); - _mav_put_float(buf, 8, range); - _mav_put_uint16_t(buf, 12, std_noise_1); - _mav_put_uint16_t(buf, 14, std_noise_2); - _mav_put_uint16_t(buf, 16, preamble_acc_count_1); - _mav_put_uint16_t(buf, 18, preamble_acc_count_2); - _mav_put_uint16_t(buf, 20, first_path_index_1); - _mav_put_uint16_t(buf, 22, first_path_index_2); - _mav_put_uint16_t(buf, 24, first_path_amp_1_1); - _mav_put_uint16_t(buf, 26, first_path_amp_1_2); - _mav_put_uint16_t(buf, 28, first_path_amp_2_1); - _mav_put_uint16_t(buf, 30, first_path_amp_2_2); - _mav_put_uint16_t(buf, 32, first_path_amp_3_1); - _mav_put_uint16_t(buf, 34, first_path_amp_3_2); - _mav_put_uint16_t(buf, 36, channel_impulse_response_power_1); - _mav_put_uint16_t(buf, 38, channel_impulse_response_power_2); - _mav_put_uint16_t(buf, 40, prf_1); - _mav_put_uint16_t(buf, 42, prf_2); - _mav_put_uint8_t(buf, 44, address); - _mav_put_uint8_t(buf, 45, remote_address); - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_STATS, buf, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN, MAVLINK_MSG_ID_UWB_RANGE_STATS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_STATS, buf, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif -#else - mavlink_uwb_range_stats_t *packet = (mavlink_uwb_range_stats_t *)msgbuf; - packet->stamp_us = stamp_us; - packet->round_trip_time = round_trip_time; - packet->range = range; - packet->std_noise_1 = std_noise_1; - packet->std_noise_2 = std_noise_2; - packet->preamble_acc_count_1 = preamble_acc_count_1; - packet->preamble_acc_count_2 = preamble_acc_count_2; - packet->first_path_index_1 = first_path_index_1; - packet->first_path_index_2 = first_path_index_2; - packet->first_path_amp_1_1 = first_path_amp_1_1; - packet->first_path_amp_1_2 = first_path_amp_1_2; - packet->first_path_amp_2_1 = first_path_amp_2_1; - packet->first_path_amp_2_2 = first_path_amp_2_2; - packet->first_path_amp_3_1 = first_path_amp_3_1; - packet->first_path_amp_3_2 = first_path_amp_3_2; - packet->channel_impulse_response_power_1 = channel_impulse_response_power_1; - packet->channel_impulse_response_power_2 = channel_impulse_response_power_2; - packet->prf_1 = prf_1; - packet->prf_2 = prf_2; - packet->address = address; - packet->remote_address = remote_address; - -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_STATS, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN, MAVLINK_MSG_ID_UWB_RANGE_STATS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_RANGE_STATS, (const char *)packet, MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_RANGE_STATS UNPACKING - - -/** - * @brief Get field address from uwb_range_stats message - * - * @return Address of UWB unit. - */ -static inline uint8_t mavlink_msg_uwb_range_stats_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 44); -} - -/** - * @brief Get field remote_address from uwb_range_stats message - * - * @return Address of remote UWB unit that was used as an anchor. - */ -static inline uint8_t mavlink_msg_uwb_range_stats_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 45); -} - -/** - * @brief Get field stamp_us from uwb_range_stats message - * - * @return Timestamp of measurement in microseconds. - */ -static inline uint32_t mavlink_msg_uwb_range_stats_get_stamp_us(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint32_t(msg, 0); -} - -/** - * @brief Get field round_trip_time from uwb_range_stats message - * - * @return Round trip time in nanoseconds. - */ -static inline float mavlink_msg_uwb_range_stats_get_round_trip_time(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 4); -} - -/** - * @brief Get field range from uwb_range_stats message - * - * @return Range. - */ -static inline float mavlink_msg_uwb_range_stats_get_range(const mavlink_message_t* msg) -{ - return _MAV_RETURN_float(msg, 8); -} - -/** - * @brief Get field std_noise_1 from uwb_range_stats message - * - * @return Noise 1. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_std_noise_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 12); -} - -/** - * @brief Get field std_noise_2 from uwb_range_stats message - * - * @return Noise 2. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_std_noise_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 14); -} - -/** - * @brief Get field preamble_acc_count_1 from uwb_range_stats message - * - * @return Preamble accumulator count 1. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_preamble_acc_count_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 16); -} - -/** - * @brief Get field preamble_acc_count_2 from uwb_range_stats message - * - * @return Preamble accumulator count 2. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_preamble_acc_count_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 18); -} - -/** - * @brief Get field first_path_index_1 from uwb_range_stats message - * - * @return First path index 1. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_first_path_index_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 20); -} - -/** - * @brief Get field first_path_index_2 from uwb_range_stats message - * - * @return First path index 2. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_first_path_index_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 22); -} - -/** - * @brief Get field first_path_amp_1_1 from uwb_range_stats message - * - * @return First path amplitude 1 1. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_first_path_amp_1_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 24); -} - -/** - * @brief Get field first_path_amp_1_2 from uwb_range_stats message - * - * @return First path amplitude 1 2. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_first_path_amp_1_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 26); -} - -/** - * @brief Get field first_path_amp_2_1 from uwb_range_stats message - * - * @return First path amplitude 2 1. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_first_path_amp_2_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 28); -} - -/** - * @brief Get field first_path_amp_2_2 from uwb_range_stats message - * - * @return First path amplitude 2 2. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_first_path_amp_2_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 30); -} - -/** - * @brief Get field first_path_amp_3_1 from uwb_range_stats message - * - * @return First path amplitude 3 1. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_first_path_amp_3_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 32); -} - -/** - * @brief Get field first_path_amp_3_2 from uwb_range_stats message - * - * @return First path amplitude 3 2. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_first_path_amp_3_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 34); -} - -/** - * @brief Get field channel_impulse_response_power_1 from uwb_range_stats message - * - * @return Channel impulse response power 1. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_channel_impulse_response_power_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 36); -} - -/** - * @brief Get field channel_impulse_response_power_2 from uwb_range_stats message - * - * @return Channel impulse response power 2. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_channel_impulse_response_power_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 38); -} - -/** - * @brief Get field prf_1 from uwb_range_stats message - * - * @return PRF 1. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_prf_1(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 40); -} - -/** - * @brief Get field prf_2 from uwb_range_stats message - * - * @return PRF 2. - */ -static inline uint16_t mavlink_msg_uwb_range_stats_get_prf_2(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint16_t(msg, 42); -} - -/** - * @brief Decode a uwb_range_stats message into a struct - * - * @param msg The message to decode - * @param uwb_range_stats C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_range_stats_decode(const mavlink_message_t* msg, mavlink_uwb_range_stats_t* uwb_range_stats) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_range_stats->stamp_us = mavlink_msg_uwb_range_stats_get_stamp_us(msg); - uwb_range_stats->round_trip_time = mavlink_msg_uwb_range_stats_get_round_trip_time(msg); - uwb_range_stats->range = mavlink_msg_uwb_range_stats_get_range(msg); - uwb_range_stats->std_noise_1 = mavlink_msg_uwb_range_stats_get_std_noise_1(msg); - uwb_range_stats->std_noise_2 = mavlink_msg_uwb_range_stats_get_std_noise_2(msg); - uwb_range_stats->preamble_acc_count_1 = mavlink_msg_uwb_range_stats_get_preamble_acc_count_1(msg); - uwb_range_stats->preamble_acc_count_2 = mavlink_msg_uwb_range_stats_get_preamble_acc_count_2(msg); - uwb_range_stats->first_path_index_1 = mavlink_msg_uwb_range_stats_get_first_path_index_1(msg); - uwb_range_stats->first_path_index_2 = mavlink_msg_uwb_range_stats_get_first_path_index_2(msg); - uwb_range_stats->first_path_amp_1_1 = mavlink_msg_uwb_range_stats_get_first_path_amp_1_1(msg); - uwb_range_stats->first_path_amp_1_2 = mavlink_msg_uwb_range_stats_get_first_path_amp_1_2(msg); - uwb_range_stats->first_path_amp_2_1 = mavlink_msg_uwb_range_stats_get_first_path_amp_2_1(msg); - uwb_range_stats->first_path_amp_2_2 = mavlink_msg_uwb_range_stats_get_first_path_amp_2_2(msg); - uwb_range_stats->first_path_amp_3_1 = mavlink_msg_uwb_range_stats_get_first_path_amp_3_1(msg); - uwb_range_stats->first_path_amp_3_2 = mavlink_msg_uwb_range_stats_get_first_path_amp_3_2(msg); - uwb_range_stats->channel_impulse_response_power_1 = mavlink_msg_uwb_range_stats_get_channel_impulse_response_power_1(msg); - uwb_range_stats->channel_impulse_response_power_2 = mavlink_msg_uwb_range_stats_get_channel_impulse_response_power_2(msg); - uwb_range_stats->prf_1 = mavlink_msg_uwb_range_stats_get_prf_1(msg); - uwb_range_stats->prf_2 = mavlink_msg_uwb_range_stats_get_prf_2(msg); - uwb_range_stats->address = mavlink_msg_uwb_range_stats_get_address(msg); - uwb_range_stats->remote_address = mavlink_msg_uwb_range_stats_get_remote_address(msg); -#else - memcpy(uwb_range_stats, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_RANGE_STATS_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_status.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_status.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ -// MESSAGE UWB_STATUS PACKING - -#define MAVLINK_MSG_ID_UWB_STATUS 190 - -typedef struct __mavlink_uwb_status_t -{ - uint8_t address; /*< Address of UWB tracker.*/ - char description[127]; /*< Status description.*/ -} mavlink_uwb_status_t; - -#define MAVLINK_MSG_ID_UWB_STATUS_LEN 128 -#define MAVLINK_MSG_ID_190_LEN 128 - -#define MAVLINK_MSG_ID_UWB_STATUS_CRC 234 -#define MAVLINK_MSG_ID_190_CRC 234 - -#define MAVLINK_MSG_UWB_STATUS_FIELD_DESCRIPTION_LEN 127 - -#define MAVLINK_MESSAGE_INFO_UWB_STATUS { \ - "UWB_STATUS", \ - 2, \ - { { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_uwb_status_t, address) }, \ - { "description", NULL, MAVLINK_TYPE_CHAR, 127, 1, offsetof(mavlink_uwb_status_t, description) }, \ - } \ -} - - -/** - * @brief Pack a uwb_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 address Address of UWB tracker. - * @param description Status description. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t address, const char *description) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_STATUS_LEN]; - _mav_put_uint8_t(buf, 0, address); - _mav_put_char_array(buf, 1, description, 127); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#else - mavlink_uwb_status_t packet; - packet.address = address; - mav_array_memcpy(packet.description, description, sizeof(char)*127); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_STATUS_LEN, MAVLINK_MSG_ID_UWB_STATUS_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif -} - -/** - * @brief Pack a uwb_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 address Address of UWB tracker. - * @param description Status description. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t address,const char *description) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_STATUS_LEN]; - _mav_put_uint8_t(buf, 0, address); - _mav_put_char_array(buf, 1, description, 127); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#else - mavlink_uwb_status_t packet; - packet.address = address; - mav_array_memcpy(packet.description, description, sizeof(char)*127); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_STATUS; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_STATUS_LEN, MAVLINK_MSG_ID_UWB_STATUS_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif -} - -/** - * @brief Encode a uwb_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 uwb_status C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_status_t* uwb_status) -{ - return mavlink_msg_uwb_status_pack(system_id, component_id, msg, uwb_status->address, uwb_status->description); -} - -/** - * @brief Encode a uwb_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 uwb_status C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_status_t* uwb_status) -{ - return mavlink_msg_uwb_status_pack_chan(system_id, component_id, chan, msg, uwb_status->address, uwb_status->description); -} - -/** - * @brief Send a uwb_status message - * @param chan MAVLink channel to send the message - * - * @param address Address of UWB tracker. - * @param description Status description. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_status_send(mavlink_channel_t chan, uint8_t address, const char *description) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_STATUS_LEN]; - _mav_put_uint8_t(buf, 0, address); - _mav_put_char_array(buf, 1, description, 127); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_STATUS, buf, MAVLINK_MSG_ID_UWB_STATUS_LEN, MAVLINK_MSG_ID_UWB_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_STATUS, buf, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif -#else - mavlink_uwb_status_t packet; - packet.address = address; - mav_array_memcpy(packet.description, description, sizeof(char)*127); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_STATUS, (const char *)&packet, MAVLINK_MSG_ID_UWB_STATUS_LEN, MAVLINK_MSG_ID_UWB_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_STATUS, (const char *)&packet, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_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_uwb_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t address, const char *description) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint8_t(buf, 0, address); - _mav_put_char_array(buf, 1, description, 127); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_STATUS, buf, MAVLINK_MSG_ID_UWB_STATUS_LEN, MAVLINK_MSG_ID_UWB_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_STATUS, buf, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif -#else - mavlink_uwb_status_t *packet = (mavlink_uwb_status_t *)msgbuf; - packet->address = address; - mav_array_memcpy(packet->description, description, sizeof(char)*127); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_STATUS, (const char *)packet, MAVLINK_MSG_ID_UWB_STATUS_LEN, MAVLINK_MSG_ID_UWB_STATUS_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_STATUS, (const char *)packet, MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_STATUS UNPACKING - - -/** - * @brief Get field address from uwb_status message - * - * @return Address of UWB tracker. - */ -static inline uint8_t mavlink_msg_uwb_status_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 0); -} - -/** - * @brief Get field description from uwb_status message - * - * @return Status description. - */ -static inline uint16_t mavlink_msg_uwb_status_get_description(const mavlink_message_t* msg, char *description) -{ - return _MAV_RETURN_char_array(msg, description, 127, 1); -} - -/** - * @brief Decode a uwb_status message into a struct - * - * @param msg The message to decode - * @param uwb_status C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_status_decode(const mavlink_message_t* msg, mavlink_uwb_status_t* uwb_status) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_status->address = mavlink_msg_uwb_status_get_address(msg); - mavlink_msg_uwb_status_get_description(msg, uwb_status->description); -#else - memcpy(uwb_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_STATUS_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_tracker_raw_10.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_tracker_raw_10.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -// MESSAGE UWB_TRACKER_RAW_10 PACKING - -#define MAVLINK_MSG_ID_UWB_TRACKER_RAW_10 180 - -typedef struct __mavlink_uwb_tracker_raw_10_t -{ - uint64_t timestamp_master_request_1_recv; /*< Timestamp of master request 1 on slave module.*/ - uint64_t timestamp_slave_reply_send; /*< Timestamp of slave reply on slave module.*/ - uint64_t timestamp_master_request_2_recv; /*< Timestamp of master request 2 on slave module.*/ - uint64_t timestamp_master_request_1[10]; /*< Timestamp of master request 1 on tracker modules.*/ - uint64_t timestamp_slave_reply[10]; /*< Timestamp of slave reply on tracker modules.*/ - uint64_t timestamp_master_request_2[10]; /*< Timestamp of master request 2 on tracker modules.*/ - uint8_t num_of_units; /*< Number of UWB units on the tracker.*/ - uint8_t address; /*< Address of UWB tracker.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as slave.*/ -} mavlink_uwb_tracker_raw_10_t; - -#define MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN 267 -#define MAVLINK_MSG_ID_180_LEN 267 - -#define MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_CRC 32 -#define MAVLINK_MSG_ID_180_CRC 32 - -#define MAVLINK_MSG_UWB_TRACKER_RAW_10_FIELD_TIMESTAMP_MASTER_REQUEST_1_LEN 10 -#define MAVLINK_MSG_UWB_TRACKER_RAW_10_FIELD_TIMESTAMP_SLAVE_REPLY_LEN 10 -#define MAVLINK_MSG_UWB_TRACKER_RAW_10_FIELD_TIMESTAMP_MASTER_REQUEST_2_LEN 10 - -#define MAVLINK_MESSAGE_INFO_UWB_TRACKER_RAW_10 { \ - "UWB_TRACKER_RAW_10", \ - 9, \ - { { "timestamp_master_request_1_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uwb_tracker_raw_10_t, timestamp_master_request_1_recv) }, \ - { "timestamp_slave_reply_send", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_uwb_tracker_raw_10_t, timestamp_slave_reply_send) }, \ - { "timestamp_master_request_2_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_uwb_tracker_raw_10_t, timestamp_master_request_2_recv) }, \ - { "timestamp_master_request_1", NULL, MAVLINK_TYPE_UINT64_T, 10, 24, offsetof(mavlink_uwb_tracker_raw_10_t, timestamp_master_request_1) }, \ - { "timestamp_slave_reply", NULL, MAVLINK_TYPE_UINT64_T, 10, 104, offsetof(mavlink_uwb_tracker_raw_10_t, timestamp_slave_reply) }, \ - { "timestamp_master_request_2", NULL, MAVLINK_TYPE_UINT64_T, 10, 184, offsetof(mavlink_uwb_tracker_raw_10_t, timestamp_master_request_2) }, \ - { "num_of_units", NULL, MAVLINK_TYPE_UINT8_T, 0, 264, offsetof(mavlink_uwb_tracker_raw_10_t, num_of_units) }, \ - { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 265, offsetof(mavlink_uwb_tracker_raw_10_t, address) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 266, offsetof(mavlink_uwb_tracker_raw_10_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_tracker_raw_10 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_10_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 264, num_of_units); - _mav_put_uint8_t(buf, 265, address); - _mav_put_uint8_t(buf, 266, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 10); - _mav_put_uint64_t_array(buf, 104, timestamp_slave_reply, 10); - _mav_put_uint64_t_array(buf, 184, timestamp_master_request_2, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#else - mavlink_uwb_tracker_raw_10_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_TRACKER_RAW_10; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif -} - -/** - * @brief Pack a uwb_tracker_raw_10 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_10_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t num_of_units,uint8_t address,uint8_t remote_address,uint64_t timestamp_master_request_1_recv,uint64_t timestamp_slave_reply_send,uint64_t timestamp_master_request_2_recv,const uint64_t *timestamp_master_request_1,const uint64_t *timestamp_slave_reply,const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 264, num_of_units); - _mav_put_uint8_t(buf, 265, address); - _mav_put_uint8_t(buf, 266, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 10); - _mav_put_uint64_t_array(buf, 104, timestamp_slave_reply, 10); - _mav_put_uint64_t_array(buf, 184, timestamp_master_request_2, 10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#else - mavlink_uwb_tracker_raw_10_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*10); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_TRACKER_RAW_10; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif -} - -/** - * @brief Encode a uwb_tracker_raw_10 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 uwb_tracker_raw_10 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_10_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_tracker_raw_10_t* uwb_tracker_raw_10) -{ - return mavlink_msg_uwb_tracker_raw_10_pack(system_id, component_id, msg, uwb_tracker_raw_10->num_of_units, uwb_tracker_raw_10->address, uwb_tracker_raw_10->remote_address, uwb_tracker_raw_10->timestamp_master_request_1_recv, uwb_tracker_raw_10->timestamp_slave_reply_send, uwb_tracker_raw_10->timestamp_master_request_2_recv, uwb_tracker_raw_10->timestamp_master_request_1, uwb_tracker_raw_10->timestamp_slave_reply, uwb_tracker_raw_10->timestamp_master_request_2); -} - -/** - * @brief Encode a uwb_tracker_raw_10 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 uwb_tracker_raw_10 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_10_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_tracker_raw_10_t* uwb_tracker_raw_10) -{ - return mavlink_msg_uwb_tracker_raw_10_pack_chan(system_id, component_id, chan, msg, uwb_tracker_raw_10->num_of_units, uwb_tracker_raw_10->address, uwb_tracker_raw_10->remote_address, uwb_tracker_raw_10->timestamp_master_request_1_recv, uwb_tracker_raw_10->timestamp_slave_reply_send, uwb_tracker_raw_10->timestamp_master_request_2_recv, uwb_tracker_raw_10->timestamp_master_request_1, uwb_tracker_raw_10->timestamp_slave_reply, uwb_tracker_raw_10->timestamp_master_request_2); -} - -/** - * @brief Send a uwb_tracker_raw_10 message - * @param chan MAVLink channel to send the message - * - * @param num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_tracker_raw_10_send(mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 264, num_of_units); - _mav_put_uint8_t(buf, 265, address); - _mav_put_uint8_t(buf, 266, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 10); - _mav_put_uint64_t_array(buf, 104, timestamp_slave_reply, 10); - _mav_put_uint64_t_array(buf, 184, timestamp_master_request_2, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10, buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10, buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif -#else - mavlink_uwb_tracker_raw_10_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10, (const char *)&packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10, (const char *)&packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_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_uwb_tracker_raw_10_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 264, num_of_units); - _mav_put_uint8_t(buf, 265, address); - _mav_put_uint8_t(buf, 266, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 10); - _mav_put_uint64_t_array(buf, 104, timestamp_slave_reply, 10); - _mav_put_uint64_t_array(buf, 184, timestamp_master_request_2, 10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10, buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10, buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif -#else - mavlink_uwb_tracker_raw_10_t *packet = (mavlink_uwb_tracker_raw_10_t *)msgbuf; - packet->timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet->timestamp_slave_reply_send = timestamp_slave_reply_send; - packet->timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet->num_of_units = num_of_units; - packet->address = address; - packet->remote_address = remote_address; - mav_array_memcpy(packet->timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet->timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet->timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*10); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10, (const char *)packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10, (const char *)packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_TRACKER_RAW_10 UNPACKING - - -/** - * @brief Get field num_of_units from uwb_tracker_raw_10 message - * - * @return Number of UWB units on the tracker. - */ -static inline uint8_t mavlink_msg_uwb_tracker_raw_10_get_num_of_units(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 264); -} - -/** - * @brief Get field address from uwb_tracker_raw_10 message - * - * @return Address of UWB tracker. - */ -static inline uint8_t mavlink_msg_uwb_tracker_raw_10_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 265); -} - -/** - * @brief Get field remote_address from uwb_tracker_raw_10 message - * - * @return Address of remote UWB unit that was used as slave. - */ -static inline uint8_t mavlink_msg_uwb_tracker_raw_10_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 266); -} - -/** - * @brief Get field timestamp_master_request_1_recv from uwb_tracker_raw_10 message - * - * @return Timestamp of master request 1 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_tracker_raw_10_get_timestamp_master_request_1_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field timestamp_slave_reply_send from uwb_tracker_raw_10 message - * - * @return Timestamp of slave reply on slave module. - */ -static inline uint64_t mavlink_msg_uwb_tracker_raw_10_get_timestamp_slave_reply_send(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 8); -} - -/** - * @brief Get field timestamp_master_request_2_recv from uwb_tracker_raw_10 message - * - * @return Timestamp of master request 2 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_tracker_raw_10_get_timestamp_master_request_2_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 16); -} - -/** - * @brief Get field timestamp_master_request_1 from uwb_tracker_raw_10 message - * - * @return Timestamp of master request 1 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_10_get_timestamp_master_request_1(const mavlink_message_t* msg, uint64_t *timestamp_master_request_1) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_1, 10, 24); -} - -/** - * @brief Get field timestamp_slave_reply from uwb_tracker_raw_10 message - * - * @return Timestamp of slave reply on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_10_get_timestamp_slave_reply(const mavlink_message_t* msg, uint64_t *timestamp_slave_reply) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_slave_reply, 10, 104); -} - -/** - * @brief Get field timestamp_master_request_2 from uwb_tracker_raw_10 message - * - * @return Timestamp of master request 2 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_10_get_timestamp_master_request_2(const mavlink_message_t* msg, uint64_t *timestamp_master_request_2) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_2, 10, 184); -} - -/** - * @brief Decode a uwb_tracker_raw_10 message into a struct - * - * @param msg The message to decode - * @param uwb_tracker_raw_10 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_tracker_raw_10_decode(const mavlink_message_t* msg, mavlink_uwb_tracker_raw_10_t* uwb_tracker_raw_10) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_tracker_raw_10->timestamp_master_request_1_recv = mavlink_msg_uwb_tracker_raw_10_get_timestamp_master_request_1_recv(msg); - uwb_tracker_raw_10->timestamp_slave_reply_send = mavlink_msg_uwb_tracker_raw_10_get_timestamp_slave_reply_send(msg); - uwb_tracker_raw_10->timestamp_master_request_2_recv = mavlink_msg_uwb_tracker_raw_10_get_timestamp_master_request_2_recv(msg); - mavlink_msg_uwb_tracker_raw_10_get_timestamp_master_request_1(msg, uwb_tracker_raw_10->timestamp_master_request_1); - mavlink_msg_uwb_tracker_raw_10_get_timestamp_slave_reply(msg, uwb_tracker_raw_10->timestamp_slave_reply); - mavlink_msg_uwb_tracker_raw_10_get_timestamp_master_request_2(msg, uwb_tracker_raw_10->timestamp_master_request_2); - uwb_tracker_raw_10->num_of_units = mavlink_msg_uwb_tracker_raw_10_get_num_of_units(msg); - uwb_tracker_raw_10->address = mavlink_msg_uwb_tracker_raw_10_get_address(msg); - uwb_tracker_raw_10->remote_address = mavlink_msg_uwb_tracker_raw_10_get_remote_address(msg); -#else - memcpy(uwb_tracker_raw_10, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_TRACKER_RAW_10_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/mavlink_msg_uwb_tracker_raw_4.h --- a/mavlink/v10/uwb/mavlink_msg_uwb_tracker_raw_4.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -// MESSAGE UWB_TRACKER_RAW_4 PACKING - -#define MAVLINK_MSG_ID_UWB_TRACKER_RAW_4 185 - -typedef struct __mavlink_uwb_tracker_raw_4_t -{ - uint64_t timestamp_master_request_1_recv; /*< Timestamp of master request 1 on slave module.*/ - uint64_t timestamp_slave_reply_send; /*< Timestamp of slave reply on slave module.*/ - uint64_t timestamp_master_request_2_recv; /*< Timestamp of master request 2 on slave module.*/ - uint64_t timestamp_master_request_1[4]; /*< Timestamp of master request 1 on tracker modules.*/ - uint64_t timestamp_slave_reply[4]; /*< Timestamp of slave reply on tracker modules.*/ - uint64_t timestamp_master_request_2[4]; /*< Timestamp of master request 2 on tracker modules.*/ - uint8_t num_of_units; /*< Number of UWB units on the tracker.*/ - uint8_t address; /*< Address of UWB tracker.*/ - uint8_t remote_address; /*< Address of remote UWB unit that was used as slave.*/ -} mavlink_uwb_tracker_raw_4_t; - -#define MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN 123 -#define MAVLINK_MSG_ID_185_LEN 123 - -#define MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_CRC 237 -#define MAVLINK_MSG_ID_185_CRC 237 - -#define MAVLINK_MSG_UWB_TRACKER_RAW_4_FIELD_TIMESTAMP_MASTER_REQUEST_1_LEN 4 -#define MAVLINK_MSG_UWB_TRACKER_RAW_4_FIELD_TIMESTAMP_SLAVE_REPLY_LEN 4 -#define MAVLINK_MSG_UWB_TRACKER_RAW_4_FIELD_TIMESTAMP_MASTER_REQUEST_2_LEN 4 - -#define MAVLINK_MESSAGE_INFO_UWB_TRACKER_RAW_4 { \ - "UWB_TRACKER_RAW_4", \ - 9, \ - { { "timestamp_master_request_1_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uwb_tracker_raw_4_t, timestamp_master_request_1_recv) }, \ - { "timestamp_slave_reply_send", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_uwb_tracker_raw_4_t, timestamp_slave_reply_send) }, \ - { "timestamp_master_request_2_recv", NULL, MAVLINK_TYPE_UINT64_T, 0, 16, offsetof(mavlink_uwb_tracker_raw_4_t, timestamp_master_request_2_recv) }, \ - { "timestamp_master_request_1", NULL, MAVLINK_TYPE_UINT64_T, 4, 24, offsetof(mavlink_uwb_tracker_raw_4_t, timestamp_master_request_1) }, \ - { "timestamp_slave_reply", NULL, MAVLINK_TYPE_UINT64_T, 4, 56, offsetof(mavlink_uwb_tracker_raw_4_t, timestamp_slave_reply) }, \ - { "timestamp_master_request_2", NULL, MAVLINK_TYPE_UINT64_T, 4, 88, offsetof(mavlink_uwb_tracker_raw_4_t, timestamp_master_request_2) }, \ - { "num_of_units", NULL, MAVLINK_TYPE_UINT8_T, 0, 120, offsetof(mavlink_uwb_tracker_raw_4_t, num_of_units) }, \ - { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 121, offsetof(mavlink_uwb_tracker_raw_4_t, address) }, \ - { "remote_address", NULL, MAVLINK_TYPE_UINT8_T, 0, 122, offsetof(mavlink_uwb_tracker_raw_4_t, remote_address) }, \ - } \ -} - - -/** - * @brief Pack a uwb_tracker_raw_4 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_4_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_master_request_2, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#else - mavlink_uwb_tracker_raw_4_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_TRACKER_RAW_4; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_CRC); -#else - return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif -} - -/** - * @brief Pack a uwb_tracker_raw_4 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 num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - * @return length of the message in bytes (excluding serial stream start sign) - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_4_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, - mavlink_message_t* msg, - uint8_t num_of_units,uint8_t address,uint8_t remote_address,uint64_t timestamp_master_request_1_recv,uint64_t timestamp_slave_reply_send,uint64_t timestamp_master_request_2_recv,const uint64_t *timestamp_master_request_1,const uint64_t *timestamp_slave_reply,const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_master_request_2, 4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#else - mavlink_uwb_tracker_raw_4_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*4); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif - - msg->msgid = MAVLINK_MSG_ID_UWB_TRACKER_RAW_4; -#if MAVLINK_CRC_EXTRA - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_CRC); -#else - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif -} - -/** - * @brief Encode a uwb_tracker_raw_4 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 uwb_tracker_raw_4 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_4_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uwb_tracker_raw_4_t* uwb_tracker_raw_4) -{ - return mavlink_msg_uwb_tracker_raw_4_pack(system_id, component_id, msg, uwb_tracker_raw_4->num_of_units, uwb_tracker_raw_4->address, uwb_tracker_raw_4->remote_address, uwb_tracker_raw_4->timestamp_master_request_1_recv, uwb_tracker_raw_4->timestamp_slave_reply_send, uwb_tracker_raw_4->timestamp_master_request_2_recv, uwb_tracker_raw_4->timestamp_master_request_1, uwb_tracker_raw_4->timestamp_slave_reply, uwb_tracker_raw_4->timestamp_master_request_2); -} - -/** - * @brief Encode a uwb_tracker_raw_4 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 uwb_tracker_raw_4 C-struct to read the message contents from - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_4_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uwb_tracker_raw_4_t* uwb_tracker_raw_4) -{ - return mavlink_msg_uwb_tracker_raw_4_pack_chan(system_id, component_id, chan, msg, uwb_tracker_raw_4->num_of_units, uwb_tracker_raw_4->address, uwb_tracker_raw_4->remote_address, uwb_tracker_raw_4->timestamp_master_request_1_recv, uwb_tracker_raw_4->timestamp_slave_reply_send, uwb_tracker_raw_4->timestamp_master_request_2_recv, uwb_tracker_raw_4->timestamp_master_request_1, uwb_tracker_raw_4->timestamp_slave_reply, uwb_tracker_raw_4->timestamp_master_request_2); -} - -/** - * @brief Send a uwb_tracker_raw_4 message - * @param chan MAVLink channel to send the message - * - * @param num_of_units Number of UWB units on the tracker. - * @param address Address of UWB tracker. - * @param remote_address Address of remote UWB unit that was used as slave. - * @param timestamp_master_request_1_recv Timestamp of master request 1 on slave module. - * @param timestamp_slave_reply_send Timestamp of slave reply on slave module. - * @param timestamp_master_request_2_recv Timestamp of master request 2 on slave module. - * @param timestamp_master_request_1 Timestamp of master request 1 on tracker modules. - * @param timestamp_slave_reply Timestamp of slave reply on tracker modules. - * @param timestamp_master_request_2 Timestamp of master request 2 on tracker modules. - */ -#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS - -static inline void mavlink_msg_uwb_tracker_raw_4_send(mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN]; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_master_request_2, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4, buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4, buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif -#else - mavlink_uwb_tracker_raw_4_t packet; - packet.timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet.timestamp_slave_reply_send = timestamp_slave_reply_send; - packet.timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet.num_of_units = num_of_units; - packet.address = address; - packet.remote_address = remote_address; - mav_array_memcpy(packet.timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet.timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4, (const char *)&packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4, (const char *)&packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif -#endif -} - -#if MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_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_uwb_tracker_raw_4_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t num_of_units, uint8_t address, uint8_t remote_address, uint64_t timestamp_master_request_1_recv, uint64_t timestamp_slave_reply_send, uint64_t timestamp_master_request_2_recv, const uint64_t *timestamp_master_request_1, const uint64_t *timestamp_slave_reply, const uint64_t *timestamp_master_request_2) -{ -#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char *buf = (char *)msgbuf; - _mav_put_uint64_t(buf, 0, timestamp_master_request_1_recv); - _mav_put_uint64_t(buf, 8, timestamp_slave_reply_send); - _mav_put_uint64_t(buf, 16, timestamp_master_request_2_recv); - _mav_put_uint8_t(buf, 120, num_of_units); - _mav_put_uint8_t(buf, 121, address); - _mav_put_uint8_t(buf, 122, remote_address); - _mav_put_uint64_t_array(buf, 24, timestamp_master_request_1, 4); - _mav_put_uint64_t_array(buf, 56, timestamp_slave_reply, 4); - _mav_put_uint64_t_array(buf, 88, timestamp_master_request_2, 4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4, buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4, buf, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif -#else - mavlink_uwb_tracker_raw_4_t *packet = (mavlink_uwb_tracker_raw_4_t *)msgbuf; - packet->timestamp_master_request_1_recv = timestamp_master_request_1_recv; - packet->timestamp_slave_reply_send = timestamp_slave_reply_send; - packet->timestamp_master_request_2_recv = timestamp_master_request_2_recv; - packet->num_of_units = num_of_units; - packet->address = address; - packet->remote_address = remote_address; - mav_array_memcpy(packet->timestamp_master_request_1, timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet->timestamp_slave_reply, timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet->timestamp_master_request_2, timestamp_master_request_2, sizeof(uint64_t)*4); -#if MAVLINK_CRC_EXTRA - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4, (const char *)packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_CRC); -#else - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4, (const char *)packet, MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif -#endif -} -#endif - -#endif - -// MESSAGE UWB_TRACKER_RAW_4 UNPACKING - - -/** - * @brief Get field num_of_units from uwb_tracker_raw_4 message - * - * @return Number of UWB units on the tracker. - */ -static inline uint8_t mavlink_msg_uwb_tracker_raw_4_get_num_of_units(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 120); -} - -/** - * @brief Get field address from uwb_tracker_raw_4 message - * - * @return Address of UWB tracker. - */ -static inline uint8_t mavlink_msg_uwb_tracker_raw_4_get_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 121); -} - -/** - * @brief Get field remote_address from uwb_tracker_raw_4 message - * - * @return Address of remote UWB unit that was used as slave. - */ -static inline uint8_t mavlink_msg_uwb_tracker_raw_4_get_remote_address(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint8_t(msg, 122); -} - -/** - * @brief Get field timestamp_master_request_1_recv from uwb_tracker_raw_4 message - * - * @return Timestamp of master request 1 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_tracker_raw_4_get_timestamp_master_request_1_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 0); -} - -/** - * @brief Get field timestamp_slave_reply_send from uwb_tracker_raw_4 message - * - * @return Timestamp of slave reply on slave module. - */ -static inline uint64_t mavlink_msg_uwb_tracker_raw_4_get_timestamp_slave_reply_send(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 8); -} - -/** - * @brief Get field timestamp_master_request_2_recv from uwb_tracker_raw_4 message - * - * @return Timestamp of master request 2 on slave module. - */ -static inline uint64_t mavlink_msg_uwb_tracker_raw_4_get_timestamp_master_request_2_recv(const mavlink_message_t* msg) -{ - return _MAV_RETURN_uint64_t(msg, 16); -} - -/** - * @brief Get field timestamp_master_request_1 from uwb_tracker_raw_4 message - * - * @return Timestamp of master request 1 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_4_get_timestamp_master_request_1(const mavlink_message_t* msg, uint64_t *timestamp_master_request_1) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_1, 4, 24); -} - -/** - * @brief Get field timestamp_slave_reply from uwb_tracker_raw_4 message - * - * @return Timestamp of slave reply on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_4_get_timestamp_slave_reply(const mavlink_message_t* msg, uint64_t *timestamp_slave_reply) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_slave_reply, 4, 56); -} - -/** - * @brief Get field timestamp_master_request_2 from uwb_tracker_raw_4 message - * - * @return Timestamp of master request 2 on tracker modules. - */ -static inline uint16_t mavlink_msg_uwb_tracker_raw_4_get_timestamp_master_request_2(const mavlink_message_t* msg, uint64_t *timestamp_master_request_2) -{ - return _MAV_RETURN_uint64_t_array(msg, timestamp_master_request_2, 4, 88); -} - -/** - * @brief Decode a uwb_tracker_raw_4 message into a struct - * - * @param msg The message to decode - * @param uwb_tracker_raw_4 C-struct to decode the message contents into - */ -static inline void mavlink_msg_uwb_tracker_raw_4_decode(const mavlink_message_t* msg, mavlink_uwb_tracker_raw_4_t* uwb_tracker_raw_4) -{ -#if MAVLINK_NEED_BYTE_SWAP - uwb_tracker_raw_4->timestamp_master_request_1_recv = mavlink_msg_uwb_tracker_raw_4_get_timestamp_master_request_1_recv(msg); - uwb_tracker_raw_4->timestamp_slave_reply_send = mavlink_msg_uwb_tracker_raw_4_get_timestamp_slave_reply_send(msg); - uwb_tracker_raw_4->timestamp_master_request_2_recv = mavlink_msg_uwb_tracker_raw_4_get_timestamp_master_request_2_recv(msg); - mavlink_msg_uwb_tracker_raw_4_get_timestamp_master_request_1(msg, uwb_tracker_raw_4->timestamp_master_request_1); - mavlink_msg_uwb_tracker_raw_4_get_timestamp_slave_reply(msg, uwb_tracker_raw_4->timestamp_slave_reply); - mavlink_msg_uwb_tracker_raw_4_get_timestamp_master_request_2(msg, uwb_tracker_raw_4->timestamp_master_request_2); - uwb_tracker_raw_4->num_of_units = mavlink_msg_uwb_tracker_raw_4_get_num_of_units(msg); - uwb_tracker_raw_4->address = mavlink_msg_uwb_tracker_raw_4_get_address(msg); - uwb_tracker_raw_4->remote_address = mavlink_msg_uwb_tracker_raw_4_get_remote_address(msg); -#else - memcpy(uwb_tracker_raw_4, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_UWB_TRACKER_RAW_4_LEN); -#endif -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/testsuite.h --- a/mavlink/v10/uwb/testsuite.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,629 +0,0 @@ -/** @file - * @brief MAVLink comm protocol testsuite generated from uwb.xml - * @see http://qgroundcontrol.org/mavlink/ - */ -#ifndef UWB_TESTSUITE_H -#define UWB_TESTSUITE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef MAVLINK_TEST_ALL -#define MAVLINK_TEST_ALL -static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg); -static void mavlink_test_uwb(uint8_t, uint8_t, mavlink_message_t *last_msg); - -static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_test_common(system_id, component_id, last_msg); - mavlink_test_uwb(system_id, component_id, last_msg); -} -#endif - -#include "../common/testsuite.h" - - -static void mavlink_test_uwb_multi_range_raw_4(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_multi_range_raw_4_t packet_in = { - 93372036854775807ULL,93372036854776311ULL,93372036854776815ULL,{ 93372036854777319, 93372036854777320, 93372036854777321, 93372036854777322 },{ 93372036854779335, 93372036854779336, 93372036854779337, 93372036854779338 },{ 93372036854781351, 93372036854781352, 93372036854781353, 93372036854781354 },109,176,243 - }; - mavlink_uwb_multi_range_raw_4_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.timestamp_master_request_recv = packet_in.timestamp_master_request_recv; - packet1.timestamp_slave_reply_send_1 = packet_in.timestamp_slave_reply_send_1; - packet1.timestamp_slave_reply_send_2 = packet_in.timestamp_slave_reply_send_2; - packet1.num_of_units = packet_in.num_of_units; - packet1.address = packet_in.address; - packet1.remote_address = packet_in.remote_address; - - mav_array_memcpy(packet1.timestamp_master_request, packet_in.timestamp_master_request, sizeof(uint64_t)*4); - mav_array_memcpy(packet1.timestamp_slave_reply_1, packet_in.timestamp_slave_reply_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet1.timestamp_slave_reply_2, packet_in.timestamp_slave_reply_2, sizeof(uint64_t)*4); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_multi_range_raw_4_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_multi_range_raw_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_multi_range_raw_4_pack(system_id, component_id, &msg , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_recv , packet1.timestamp_slave_reply_send_1 , packet1.timestamp_slave_reply_send_2 , packet1.timestamp_master_request , packet1.timestamp_slave_reply_1 , packet1.timestamp_slave_reply_2 ); - mavlink_msg_uwb_multi_range_raw_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_multi_range_raw_4_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_recv , packet1.timestamp_slave_reply_send_1 , packet1.timestamp_slave_reply_send_2 , packet1.timestamp_master_request , packet1.timestamp_slave_reply_1 , packet1.timestamp_slave_reply_2 ); - mavlink_msg_uwb_multi_range_raw_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_multi_range_raw_4_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_multi_range_raw_4_send(MAVLINK_COMM_1 , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_recv , packet1.timestamp_slave_reply_send_1 , packet1.timestamp_slave_reply_send_2 , packet1.timestamp_master_request , packet1.timestamp_slave_reply_1 , packet1.timestamp_slave_reply_2 ); - mavlink_msg_uwb_multi_range_raw_4_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_2way_multi_range_raw_10(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_2way_multi_range_raw_10_t packet_in = { - 93372036854775807ULL,93372036854776311ULL,93372036854776815ULL,{ 93372036854777319, 93372036854777320, 93372036854777321, 93372036854777322, 93372036854777323, 93372036854777324, 93372036854777325, 93372036854777326, 93372036854777327, 93372036854777328 },{ 93372036854782359, 93372036854782360, 93372036854782361, 93372036854782362, 93372036854782363, 93372036854782364, 93372036854782365, 93372036854782366, 93372036854782367, 93372036854782368 },{ 93372036854787399, 93372036854787400, 93372036854787401, 93372036854787402, 93372036854787403, 93372036854787404, 93372036854787405, 93372036854787406, 93372036854787407, 93372036854787408 },29,96,163 - }; - mavlink_uwb_2way_multi_range_raw_10_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.timestamp_master_request_1_recv = packet_in.timestamp_master_request_1_recv; - packet1.timestamp_slave_reply_send = packet_in.timestamp_slave_reply_send; - packet1.timestamp_master_request_2_recv = packet_in.timestamp_master_request_2_recv; - packet1.num_of_units = packet_in.num_of_units; - packet1.address = packet_in.address; - packet1.remote_address = packet_in.remote_address; - - mav_array_memcpy(packet1.timestamp_master_request_1, packet_in.timestamp_master_request_1, sizeof(uint64_t)*10); - mav_array_memcpy(packet1.timestamp_slave_reply, packet_in.timestamp_slave_reply, sizeof(uint64_t)*10); - mav_array_memcpy(packet1.timestamp_master_request_2, packet_in.timestamp_master_request_2, sizeof(uint64_t)*10); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_10_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_2way_multi_range_raw_10_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_10_pack(system_id, component_id, &msg , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_10_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_10_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_10_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_2way_multi_range_raw_10_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_10_send(MAVLINK_COMM_1 , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_10_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_2way_multi_range_raw_4(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_2way_multi_range_raw_4_t packet_in = { - 93372036854775807ULL,93372036854776311ULL,93372036854776815ULL,{ 93372036854777319, 93372036854777320, 93372036854777321, 93372036854777322 },{ 93372036854779335, 93372036854779336, 93372036854779337, 93372036854779338 },{ 93372036854781351, 93372036854781352, 93372036854781353, 93372036854781354 },109,176,243 - }; - mavlink_uwb_2way_multi_range_raw_4_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.timestamp_master_request_1_recv = packet_in.timestamp_master_request_1_recv; - packet1.timestamp_slave_reply_send = packet_in.timestamp_slave_reply_send; - packet1.timestamp_master_request_2_recv = packet_in.timestamp_master_request_2_recv; - packet1.num_of_units = packet_in.num_of_units; - packet1.address = packet_in.address; - packet1.remote_address = packet_in.remote_address; - - mav_array_memcpy(packet1.timestamp_master_request_1, packet_in.timestamp_master_request_1, sizeof(uint64_t)*4); - mav_array_memcpy(packet1.timestamp_slave_reply, packet_in.timestamp_slave_reply, sizeof(uint64_t)*4); - mav_array_memcpy(packet1.timestamp_master_request_2, packet_in.timestamp_master_request_2, sizeof(uint64_t)*4); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_4_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_2way_multi_range_raw_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_4_pack(system_id, component_id, &msg , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_4_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_2way_multi_range_raw_4_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_4_send(MAVLINK_COMM_1 , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_4_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_2way_multi_range_raw_5(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_2way_multi_range_raw_5_t packet_in = { - 93372036854775807ULL,93372036854776311ULL,93372036854776815ULL,{ 93372036854777319, 93372036854777320, 93372036854777321, 93372036854777322, 93372036854777323 },{ 93372036854779839, 93372036854779840, 93372036854779841, 93372036854779842, 93372036854779843 },{ 93372036854782359, 93372036854782360, 93372036854782361, 93372036854782362, 93372036854782363 },181,248,59 - }; - mavlink_uwb_2way_multi_range_raw_5_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.timestamp_master_request_1_recv = packet_in.timestamp_master_request_1_recv; - packet1.timestamp_slave_reply_send = packet_in.timestamp_slave_reply_send; - packet1.timestamp_master_request_2_recv = packet_in.timestamp_master_request_2_recv; - packet1.num_of_units = packet_in.num_of_units; - packet1.address = packet_in.address; - packet1.remote_address = packet_in.remote_address; - - mav_array_memcpy(packet1.timestamp_master_request_1, packet_in.timestamp_master_request_1, sizeof(uint64_t)*5); - mav_array_memcpy(packet1.timestamp_slave_reply, packet_in.timestamp_slave_reply, sizeof(uint64_t)*5); - mav_array_memcpy(packet1.timestamp_master_request_2, packet_in.timestamp_master_request_2, sizeof(uint64_t)*5); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_5_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_2way_multi_range_raw_5_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_5_pack(system_id, component_id, &msg , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_5_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_5_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_5_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_2way_multi_range_raw_5_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_2way_multi_range_raw_5_send(MAVLINK_COMM_1 , packet1.num_of_units , packet1.address , packet1.remote_address , packet1.timestamp_master_request_1_recv , packet1.timestamp_slave_reply_send , packet1.timestamp_master_request_2_recv , packet1.timestamp_master_request_1 , packet1.timestamp_slave_reply , packet1.timestamp_master_request_2 ); - mavlink_msg_uwb_2way_multi_range_raw_5_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_status_t packet_in = { - 5,"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW" - }; - mavlink_uwb_status_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.address = packet_in.address; - - mav_array_memcpy(packet1.description, packet_in.description, sizeof(char)*127); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_status_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_status_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_status_pack(system_id, component_id, &msg , packet1.address , packet1.description ); - mavlink_msg_uwb_status_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.description ); - mavlink_msg_uwb_status_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_status_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_status_send(MAVLINK_COMM_1 , packet1.address , packet1.description ); - mavlink_msg_uwb_status_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_prototyping(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_prototyping_t packet_in = { - { 93372036854775807, 93372036854775808, 93372036854775809, 93372036854775810, 93372036854775811, 93372036854775812, 93372036854775813, 93372036854775814, 93372036854775815, 93372036854775816 },{ 577.0, 578.0, 579.0, 580.0, 581.0, 582.0, 583.0, 584.0, 585.0, 586.0 },109 - }; - mavlink_uwb_prototyping_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.type = packet_in.type; - - mav_array_memcpy(packet1.integers, packet_in.integers, sizeof(uint64_t)*10); - mav_array_memcpy(packet1.floats, packet_in.floats, sizeof(float)*10); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_prototyping_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_prototyping_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_prototyping_pack(system_id, component_id, &msg , packet1.type , packet1.integers , packet1.floats ); - mavlink_msg_uwb_prototyping_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_prototyping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.integers , packet1.floats ); - mavlink_msg_uwb_prototyping_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_prototyping_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_prototyping_send(MAVLINK_COMM_1 , packet1.type , packet1.integers , packet1.floats ); - mavlink_msg_uwb_prototyping_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_range(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_range_t packet_in = { - 963497464,45.0,73.0,41,108 - }; - mavlink_uwb_range_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.stamp_us = packet_in.stamp_us; - packet1.round_trip_time = packet_in.round_trip_time; - packet1.range = packet_in.range; - packet1.address = packet_in.address; - packet1.remote_address = packet_in.remote_address; - - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_range_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_pack(system_id, component_id, &msg , packet1.address , packet1.remote_address , packet1.stamp_us , packet1.round_trip_time , packet1.range ); - mavlink_msg_uwb_range_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.remote_address , packet1.stamp_us , packet1.round_trip_time , packet1.range ); - mavlink_msg_uwb_range_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_range_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_send(MAVLINK_COMM_1 , packet1.address , packet1.remote_address , packet1.stamp_us , packet1.round_trip_time , packet1.range ); - mavlink_msg_uwb_range_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_range_stats(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_range_stats_t packet_in = { - 963497464,45.0,73.0,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,19315,19419,137,204 - }; - mavlink_uwb_range_stats_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.stamp_us = packet_in.stamp_us; - packet1.round_trip_time = packet_in.round_trip_time; - packet1.range = packet_in.range; - packet1.std_noise_1 = packet_in.std_noise_1; - packet1.std_noise_2 = packet_in.std_noise_2; - packet1.preamble_acc_count_1 = packet_in.preamble_acc_count_1; - packet1.preamble_acc_count_2 = packet_in.preamble_acc_count_2; - packet1.first_path_index_1 = packet_in.first_path_index_1; - packet1.first_path_index_2 = packet_in.first_path_index_2; - packet1.first_path_amp_1_1 = packet_in.first_path_amp_1_1; - packet1.first_path_amp_1_2 = packet_in.first_path_amp_1_2; - packet1.first_path_amp_2_1 = packet_in.first_path_amp_2_1; - packet1.first_path_amp_2_2 = packet_in.first_path_amp_2_2; - packet1.first_path_amp_3_1 = packet_in.first_path_amp_3_1; - packet1.first_path_amp_3_2 = packet_in.first_path_amp_3_2; - packet1.channel_impulse_response_power_1 = packet_in.channel_impulse_response_power_1; - packet1.channel_impulse_response_power_2 = packet_in.channel_impulse_response_power_2; - packet1.prf_1 = packet_in.prf_1; - packet1.prf_2 = packet_in.prf_2; - packet1.address = packet_in.address; - packet1.remote_address = packet_in.remote_address; - - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_stats_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_range_stats_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_stats_pack(system_id, component_id, &msg , packet1.address , packet1.remote_address , packet1.stamp_us , packet1.round_trip_time , packet1.range , packet1.std_noise_1 , packet1.std_noise_2 , packet1.preamble_acc_count_1 , packet1.preamble_acc_count_2 , packet1.first_path_index_1 , packet1.first_path_index_2 , packet1.first_path_amp_1_1 , packet1.first_path_amp_1_2 , packet1.first_path_amp_2_1 , packet1.first_path_amp_2_2 , packet1.first_path_amp_3_1 , packet1.first_path_amp_3_2 , packet1.channel_impulse_response_power_1 , packet1.channel_impulse_response_power_2 , packet1.prf_1 , packet1.prf_2 ); - mavlink_msg_uwb_range_stats_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_stats_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.remote_address , packet1.stamp_us , packet1.round_trip_time , packet1.range , packet1.std_noise_1 , packet1.std_noise_2 , packet1.preamble_acc_count_1 , packet1.preamble_acc_count_2 , packet1.first_path_index_1 , packet1.first_path_index_2 , packet1.first_path_amp_1_1 , packet1.first_path_amp_1_2 , packet1.first_path_amp_2_1 , packet1.first_path_amp_2_2 , packet1.first_path_amp_3_1 , packet1.first_path_amp_3_2 , packet1.channel_impulse_response_power_1 , packet1.channel_impulse_response_power_2 , packet1.prf_1 , packet1.prf_2 ); - mavlink_msg_uwb_range_stats_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_range_stats_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_stats_send(MAVLINK_COMM_1 , packet1.address , packet1.remote_address , packet1.stamp_us , packet1.round_trip_time , packet1.range , packet1.std_noise_1 , packet1.std_noise_2 , packet1.preamble_acc_count_1 , packet1.preamble_acc_count_2 , packet1.first_path_index_1 , packet1.first_path_index_2 , packet1.first_path_amp_1_1 , packet1.first_path_amp_1_2 , packet1.first_path_amp_2_1 , packet1.first_path_amp_2_2 , packet1.first_path_amp_3_1 , packet1.first_path_amp_3_2 , packet1.channel_impulse_response_power_1 , packet1.channel_impulse_response_power_2 , packet1.prf_1 , packet1.prf_2 ); - mavlink_msg_uwb_range_stats_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_range_batch_2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_range_batch_2_t packet_in = { - { 17.0, 18.0 },{ 29, 30 },163 - }; - mavlink_uwb_range_batch_2_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.remote_address = packet_in.remote_address; - - mav_array_memcpy(packet1.range, packet_in.range, sizeof(float)*2); - mav_array_memcpy(packet1.addresses, packet_in.addresses, sizeof(uint8_t)*2); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_2_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_range_batch_2_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_2_pack(system_id, component_id, &msg , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_2_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_2_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_range_batch_2_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_2_send(MAVLINK_COMM_1 , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_2_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_range_batch_3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_range_batch_3_t packet_in = { - { 17.0, 18.0, 19.0 },{ 41, 42, 43 },242 - }; - mavlink_uwb_range_batch_3_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.remote_address = packet_in.remote_address; - - mav_array_memcpy(packet1.range, packet_in.range, sizeof(float)*3); - mav_array_memcpy(packet1.addresses, packet_in.addresses, sizeof(uint8_t)*3); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_3_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_range_batch_3_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_3_pack(system_id, component_id, &msg , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_3_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_3_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_range_batch_3_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_3_send(MAVLINK_COMM_1 , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_3_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_range_batch_4(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_range_batch_4_t packet_in = { - { 17.0, 18.0, 19.0, 20.0 },{ 53, 54, 55, 56 },65 - }; - mavlink_uwb_range_batch_4_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.remote_address = packet_in.remote_address; - - mav_array_memcpy(packet1.range, packet_in.range, sizeof(float)*4); - mav_array_memcpy(packet1.addresses, packet_in.addresses, sizeof(uint8_t)*4); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_4_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_range_batch_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_4_pack(system_id, component_id, &msg , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_4_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_4_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_range_batch_4_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_4_send(MAVLINK_COMM_1 , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_4_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb_range_batch_5(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_message_t msg; - uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; - uint16_t i; - mavlink_uwb_range_batch_5_t packet_in = { - { 17.0, 18.0, 19.0, 20.0, 21.0 },{ 65, 66, 67, 68, 69 },144 - }; - mavlink_uwb_range_batch_5_t packet1, packet2; - memset(&packet1, 0, sizeof(packet1)); - packet1.remote_address = packet_in.remote_address; - - mav_array_memcpy(packet1.range, packet_in.range, sizeof(float)*5); - mav_array_memcpy(packet1.addresses, packet_in.addresses, sizeof(uint8_t)*5); - - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_5_encode(system_id, component_id, &msg, &packet1); - mavlink_msg_uwb_range_batch_5_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_5_pack(system_id, component_id, &msg , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_5_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_5_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_5_decode(&msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_to_send_buffer(buffer, &msg); - for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) { - comm_send_ch(MAVLINK_COMM_0, buffer[i]); - } - mavlink_msg_uwb_range_batch_5_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); - - memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_uwb_range_batch_5_send(MAVLINK_COMM_1 , packet1.addresses , packet1.remote_address , packet1.range ); - mavlink_msg_uwb_range_batch_5_decode(last_msg, &packet2); - MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); -} - -static void mavlink_test_uwb(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) -{ - mavlink_test_uwb_multi_range_raw_4(system_id, component_id, last_msg); - mavlink_test_uwb_2way_multi_range_raw_10(system_id, component_id, last_msg); - mavlink_test_uwb_2way_multi_range_raw_4(system_id, component_id, last_msg); - mavlink_test_uwb_2way_multi_range_raw_5(system_id, component_id, last_msg); - mavlink_test_uwb_status(system_id, component_id, last_msg); - mavlink_test_uwb_prototyping(system_id, component_id, last_msg); - mavlink_test_uwb_range(system_id, component_id, last_msg); - mavlink_test_uwb_range_stats(system_id, component_id, last_msg); - mavlink_test_uwb_range_batch_2(system_id, component_id, last_msg); - mavlink_test_uwb_range_batch_3(system_id, component_id, last_msg); - mavlink_test_uwb_range_batch_4(system_id, component_id, last_msg); - mavlink_test_uwb_range_batch_5(system_id, component_id, last_msg); -} - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // UWB_TESTSUITE_H
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/uwb.h --- a/mavlink/v10/uwb/uwb.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/** @file - * @brief MAVLink comm protocol generated from uwb.xml - * @see http://mavlink.org - */ -#ifndef MAVLINK_UWB_H -#define MAVLINK_UWB_H - -#ifndef MAVLINK_H - #error Wrong include order: MAVLINK_UWB.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// MESSAGE LENGTHS AND CRCS - -#ifndef MAVLINK_MESSAGE_LENGTHS -#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 229, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 20, 13, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 12, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 24, 243, 0, 0, 0, 100, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 267, 0, 0, 0, 123, 147, 0, 0, 0, 0, 128, 0, 0, 0, 0, 121, 0, 0, 0, 0, 14, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 16, 21, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 6, 1, 0, 0, 254, 36, 30, 18, 18, 51, 9, 0} -#endif - -#ifndef MAVLINK_MESSAGE_CRCS -#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 59, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 149, 57, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 148, 72, 0, 0, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 0, 0, 0, 0, 0, 13, 0, 0, 0, 113, 101, 0, 0, 0, 0, 234, 0, 0, 0, 0, 71, 0, 0, 0, 0, 105, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 96, 74, 249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 83, 0, 0, 8, 204, 49, 170, 44, 83, 46, 0} -#endif - -#ifndef MAVLINK_MESSAGE_INFO -#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_PARAM_MAP_RC, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_ATTITUDE_QUATERNION_COV, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT_COV, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_COV, MAVLINK_MESSAGE_INFO_RC_CHANNELS, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MISSION_ITEM_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_INT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_SETPOINT, MAVLINK_MESSAGE_INFO_SET_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_ATTITUDE_TARGET, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT, MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, MAVLINK_MESSAGE_INFO_SET_CONTROL_TARGET_LOCAL_NED, MAVLINK_MESSAGE_INFO_SET_GIMBAL_REFERENCE_LOCAL_NED, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_HIGHRES_IMU, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW_RAD, MAVLINK_MESSAGE_INFO_HIL_SENSOR, MAVLINK_MESSAGE_INFO_SIM_STATE, MAVLINK_MESSAGE_INFO_RADIO_STATUS, MAVLINK_MESSAGE_INFO_FILE_TRANSFER_PROTOCOL, MAVLINK_MESSAGE_INFO_TIMESYNC, MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER, MAVLINK_MESSAGE_INFO_HIL_GPS, MAVLINK_MESSAGE_INFO_HIL_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_HIL_STATE_QUATERNION, MAVLINK_MESSAGE_INFO_SCALED_IMU2, MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST, MAVLINK_MESSAGE_INFO_LOG_ENTRY, MAVLINK_MESSAGE_INFO_LOG_REQUEST_DATA, MAVLINK_MESSAGE_INFO_LOG_DATA, MAVLINK_MESSAGE_INFO_LOG_ERASE, MAVLINK_MESSAGE_INFO_LOG_REQUEST_END, MAVLINK_MESSAGE_INFO_GPS_INJECT_DATA, MAVLINK_MESSAGE_INFO_GPS2_RAW, MAVLINK_MESSAGE_INFO_POWER_STATUS, MAVLINK_MESSAGE_INFO_SERIAL_CONTROL, MAVLINK_MESSAGE_INFO_GPS_RTK, MAVLINK_MESSAGE_INFO_GPS2_RTK, MAVLINK_MESSAGE_INFO_SCALED_IMU3, MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE, MAVLINK_MESSAGE_INFO_ENCAPSULATED_DATA, MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR, MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST, MAVLINK_MESSAGE_INFO_TERRAIN_DATA, MAVLINK_MESSAGE_INFO_TERRAIN_CHECK, MAVLINK_MESSAGE_INFO_TERRAIN_REPORT, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE2, MAVLINK_MESSAGE_INFO_ATT_POS_MOCAP, MAVLINK_MESSAGE_INFO_SET_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ACTUATOR_CONTROL_TARGET, MAVLINK_MESSAGE_INFO_ALTITUDE, MAVLINK_MESSAGE_INFO_RESOURCE_REQUEST, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_CONTROL_SYSTEM_STATE, MAVLINK_MESSAGE_INFO_BATTERY_STATUS, MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION, MAVLINK_MESSAGE_INFO_LANDING_TARGET, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_UWB_MULTI_RANGE_RAW_4, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_UWB_2WAY_MULTI_RANGE_RAW_10, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_UWB_2WAY_MULTI_RANGE_RAW_4, MAVLINK_MESSAGE_INFO_UWB_2WAY_MULTI_RANGE_RAW_5, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_UWB_STATUS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_UWB_PROTOTYPING, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_UWB_RANGE, MAVLINK_MESSAGE_INFO_UWB_RANGE_STATS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_UWB_RANGE_BATCH_2, MAVLINK_MESSAGE_INFO_UWB_RANGE_BATCH_3, MAVLINK_MESSAGE_INFO_UWB_RANGE_BATCH_4, MAVLINK_MESSAGE_INFO_UWB_RANGE_BATCH_5, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VIBRATION, MAVLINK_MESSAGE_INFO_HOME_POSITION, MAVLINK_MESSAGE_INFO_SET_HOME_POSITION, MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL, MAVLINK_MESSAGE_INFO_VTOL_STATE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_V2_EXTENSION, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} -#endif - -#include "../protocol.h" - -#define MAVLINK_ENABLED_UWB - -// ENUM DEFINITIONS - - - -#include "../common/common.h" - -// MAVLINK VERSION - -#ifndef MAVLINK_VERSION -#define MAVLINK_VERSION 3 -#endif - -#if (MAVLINK_VERSION == 0) -#undef MAVLINK_VERSION -#define MAVLINK_VERSION 3 -#endif - -// MESSAGE DEFINITIONS -#include "./mavlink_msg_uwb_multi_range_raw_4.h" -#include "./mavlink_msg_uwb_2way_multi_range_raw_10.h" -#include "./mavlink_msg_uwb_2way_multi_range_raw_4.h" -#include "./mavlink_msg_uwb_2way_multi_range_raw_5.h" -#include "./mavlink_msg_uwb_status.h" -#include "./mavlink_msg_uwb_prototyping.h" -#include "./mavlink_msg_uwb_range.h" -#include "./mavlink_msg_uwb_range_stats.h" -#include "./mavlink_msg_uwb_range_batch_2.h" -#include "./mavlink_msg_uwb_range_batch_3.h" -#include "./mavlink_msg_uwb_range_batch_4.h" -#include "./mavlink_msg_uwb_range_batch_5.h" - -#ifdef __cplusplus -} -#endif // __cplusplus -#endif // MAVLINK_UWB_H
diff -r bd4a08d39e94 -r 76345550efb4 mavlink/v10/uwb/version.h --- a/mavlink/v10/uwb/version.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -/** @file - * @brief MAVLink comm protocol built from uwb.xml - * @see http://mavlink.org - */ -#ifndef MAVLINK_VERSION_H -#define MAVLINK_VERSION_H - -#define MAVLINK_BUILD_DATE "Thu Feb 18 13:54:35 2016" -#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" -#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 267 - -#endif // MAVLINK_VERSION_H
diff -r bd4a08d39e94 -r 76345550efb4 mavlink_bridge.cpp --- a/mavlink_bridge.cpp Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -#include "mavlink_bridge.h" - -using namespace ait; - -MAVLinkBridge::MAVLinkBridge(UART_Interface* uart, mavlink_channel_t mavlink_channel, uint8_t sysid, uint8_t compid) - : _uart(uart), _mavlink_channel(mavlink_channel), _packet_drops(0) { - setSysId(sysid); - setCompId(compid); -} - -void MAVLinkBridge::sendMessage(const mavlink_message_t& msg) { - uint8_t buf[MAVLINK_MAX_PACKET_LEN]; - uint16_t len = mavlink_msg_to_send_buffer(buf, &msg); - sendBuffer(buf, len); -} - -void MAVLinkBridge::sendBuffer(const uint8_t* buf, uint16_t len) { - for (uint16_t i = 0; i < len; ++i) { - _uart->writeChar(buf[i]); - } -} - -bool MAVLinkBridge::tryReceiveMessage() { - mavlink_status_t status; - while (_uart->isCharAvailable()) { - uint8_t c = _uart->readChar(); - // Try to get a new message - if (mavlink_parse_char(_mavlink_channel, c, &_recv_msg, &status)) { - return true; - } - } - - // Update packet drops counter - _packet_drops += _recv_status.packet_rx_drop_count; - - return false; -} - -const mavlink_message_t& MAVLinkBridge::getLastReceivedMessage() { - return _recv_msg; -}
diff -r bd4a08d39e94 -r 76345550efb4 mavlink_bridge.h --- a/mavlink_bridge.h Mon Apr 04 11:18:57 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -#pragma once - -#include "uart_interface.h" - -#include "mavlink_bridge/mavlink/v10/uwb/mavlink.h" - -namespace ait { - -class MAVLinkBridge { - UART_Interface* _uart; - mavlink_system_t _mavlink_system; - // TODO: Is this int? - mavlink_channel_t _mavlink_channel; - mavlink_message_t _recv_msg; - mavlink_status_t _recv_status; - int _packet_drops; - -public: - MAVLinkBridge(UART_Interface* uart, mavlink_channel_t mavlink_channel = MAVLINK_COMM_0, uint8_t sysid = 1, uint8_t compid = MAV_COMP_ID_UART_BRIDGE); - - void setSysId(uint8_t sysid) { - _mavlink_system.sysid = sysid; - } - - uint8_t getSysId() const { - return _mavlink_system.sysid; - } - - void setCompId(uint8_t compid) { - _mavlink_system.compid = compid; - } - - uint8_t getCompId() const { - return _mavlink_system.compid; - } - - void sendMessage(const mavlink_message_t& msg); - - bool tryReceiveMessage(); - - const mavlink_message_t& getLastReceivedMessage(); - -protected: - void sendBuffer(const uint8_t* buf, uint16_t len); -}; - -}