3 #define MAVLINK_MSG_ID_RANGEFINDER 173
11 #define MAVLINK_MSG_ID_RANGEFINDER_LEN 8
12 #define MAVLINK_MSG_ID_173_LEN 8
14 #define MAVLINK_MSG_ID_RANGEFINDER_CRC 83
15 #define MAVLINK_MSG_ID_173_CRC 83
19 #define MAVLINK_MESSAGE_INFO_RANGEFINDER { \
22 { { "distance", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_rangefinder_t, distance) }, \
23 { "voltage", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_rangefinder_t, voltage) }, \
38 static inline uint16_t mavlink_msg_rangefinder_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
39 float distance,
float voltage)
41 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
73 static inline uint16_t mavlink_msg_rangefinder_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
74 mavlink_message_t* msg,
75 float distance,
float voltage)
77 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
107 static inline uint16_t mavlink_msg_rangefinder_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_rangefinder_t* rangefinder)
109 return mavlink_msg_rangefinder_pack(system_id, component_id, msg, rangefinder->
distance, rangefinder->
voltage);
121 static inline uint16_t mavlink_msg_rangefinder_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_rangefinder_t* rangefinder)
123 return mavlink_msg_rangefinder_pack_chan(system_id, component_id, chan, msg, rangefinder->
distance, rangefinder->
voltage);
133 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
135 static inline void mavlink_msg_rangefinder_send(
mavlink_channel_t chan,
float distance,
float voltage)
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
142 #if MAVLINK_CRC_EXTRA
152 #if MAVLINK_CRC_EXTRA
160 #if MAVLINK_MSG_ID_RANGEFINDER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
168 static inline void mavlink_msg_rangefinder_send_buf(mavlink_message_t *msgbuf,
mavlink_channel_t chan,
float distance,
float voltage)
170 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171 char *buf = (
char *)msgbuf;
175 #if MAVLINK_CRC_EXTRA
185 #if MAVLINK_CRC_EXTRA
204 static inline float mavlink_msg_rangefinder_get_distance(
const mavlink_message_t* msg)
206 return _MAV_RETURN_float(msg, 0);
214 static inline float mavlink_msg_rangefinder_get_voltage(
const mavlink_message_t* msg)
216 return _MAV_RETURN_float(msg, 4);
225 static inline void mavlink_msg_rangefinder_decode(
const mavlink_message_t* msg,
mavlink_rangefinder_t* rangefinder)
227 #if MAVLINK_NEED_BYTE_SWAP
228 rangefinder->
distance = mavlink_msg_rangefinder_get_distance(msg);
229 rangefinder->
voltage = mavlink_msg_rangefinder_get_voltage(msg);
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:145
float voltage
raw voltage if available, zero otherwise
Definition: mavlink_msg_rangefinder.h:8
struct __mavlink_rangefinder_t mavlink_rangefinder_t
#define MAVLINK_MSG_ID_RANGEFINDER_CRC
Definition: mavlink_msg_rangefinder.h:14
#define MAVLINK_MSG_ID_RANGEFINDER_LEN
Definition: mavlink_msg_rangefinder.h:11
MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t *msg, uint8_t system_id, uint8_t component_id, uint8_t length)
Finalize a MAVLink message with MAVLINK_COMM_0 as default channel.
Definition: mavlink_helpers.h:105
#define _MAV_PAYLOAD_NON_CONST(msg)
Definition: mavlink_types.h:172
Definition: mavlink_msg_rangefinder.h:5
mavlink_channel_t
Definition: mavlink_types.h:178
float distance
distance in meters
Definition: mavlink_msg_rangefinder.h:7
#define _MAV_PAYLOAD(msg)
Definition: mavlink_types.h:171
MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t *msg, uint8_t system_id, uint8_t component_id, uint8_t chan, uint8_t length)
Finalize a MAVLink message with channel assignment.
Definition: mavlink_helpers.h:71
#define MAVLINK_MSG_ID_RANGEFINDER
Definition: mavlink_msg_rangefinder.h:3