3 #define MAVLINK_MSG_ID_DISTANCE_SENSOR 132
17 #define MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN 14
18 #define MAVLINK_MSG_ID_132_LEN 14
20 #define MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC 85
21 #define MAVLINK_MSG_ID_132_CRC 85
25 #define MAVLINK_MESSAGE_INFO_DISTANCE_SENSOR { \
28 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_distance_sensor_t, time_boot_ms) }, \
29 { "min_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_distance_sensor_t, min_distance) }, \
30 { "max_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_distance_sensor_t, max_distance) }, \
31 { "current_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_distance_sensor_t, current_distance) }, \
32 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_distance_sensor_t, type) }, \
33 { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_distance_sensor_t, id) }, \
34 { "orientation", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_distance_sensor_t, orientation) }, \
35 { "covariance", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_distance_sensor_t, covariance) }, \
56 static inline uint16_t mavlink_msg_distance_sensor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
57 uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t
type, uint8_t
id, uint8_t orientation, uint8_t covariance)
59 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
109 static inline uint16_t mavlink_msg_distance_sensor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
110 mavlink_message_t* msg,
111 uint32_t time_boot_ms,uint16_t min_distance,uint16_t max_distance,uint16_t current_distance,uint8_t
type,uint8_t
id,uint8_t orientation,uint8_t covariance)
113 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
140 #if MAVLINK_CRC_EXTRA
155 static inline uint16_t mavlink_msg_distance_sensor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_distance_sensor_t* distance_sensor)
157 return mavlink_msg_distance_sensor_pack(system_id, component_id, msg, distance_sensor->
time_boot_ms, distance_sensor->
min_distance, distance_sensor->
max_distance, distance_sensor->
current_distance, distance_sensor->
type, distance_sensor->
id, distance_sensor->
orientation, distance_sensor->
covariance);
169 static inline uint16_t mavlink_msg_distance_sensor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_distance_sensor_t* distance_sensor)
171 return mavlink_msg_distance_sensor_pack_chan(system_id, component_id, chan, msg, distance_sensor->
time_boot_ms, distance_sensor->
min_distance, distance_sensor->
max_distance, distance_sensor->
current_distance, distance_sensor->
type, distance_sensor->
id, distance_sensor->
orientation, distance_sensor->
covariance);
187 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
189 static inline void mavlink_msg_distance_sensor_send(
mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t
id, uint8_t orientation, uint8_t covariance)
191 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
202 #if MAVLINK_CRC_EXTRA
218 #if MAVLINK_CRC_EXTRA
226 #if MAVLINK_MSG_ID_DISTANCE_SENSOR_LEN <= MAVLINK_MAX_PAYLOAD_LEN
234 static inline void mavlink_msg_distance_sensor_send_buf(mavlink_message_t *msgbuf,
mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t min_distance, uint16_t max_distance, uint16_t current_distance, uint8_t type, uint8_t
id, uint8_t orientation, uint8_t covariance)
236 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
237 char *buf = (
char *)msgbuf;
247 #if MAVLINK_CRC_EXTRA
263 #if MAVLINK_CRC_EXTRA
282 static inline uint32_t mavlink_msg_distance_sensor_get_time_boot_ms(
const mavlink_message_t* msg)
284 return _MAV_RETURN_uint32_t(msg, 0);
292 static inline uint16_t mavlink_msg_distance_sensor_get_min_distance(
const mavlink_message_t* msg)
294 return _MAV_RETURN_uint16_t(msg, 4);
302 static inline uint16_t mavlink_msg_distance_sensor_get_max_distance(
const mavlink_message_t* msg)
304 return _MAV_RETURN_uint16_t(msg, 6);
312 static inline uint16_t mavlink_msg_distance_sensor_get_current_distance(
const mavlink_message_t* msg)
314 return _MAV_RETURN_uint16_t(msg, 8);
322 static inline uint8_t mavlink_msg_distance_sensor_get_type(
const mavlink_message_t* msg)
332 static inline uint8_t mavlink_msg_distance_sensor_get_id(
const mavlink_message_t* msg)
342 static inline uint8_t mavlink_msg_distance_sensor_get_orientation(
const mavlink_message_t* msg)
352 static inline uint8_t mavlink_msg_distance_sensor_get_covariance(
const mavlink_message_t* msg)
363 static inline void mavlink_msg_distance_sensor_decode(
const mavlink_message_t* msg,
mavlink_distance_sensor_t* distance_sensor)
365 #if MAVLINK_NEED_BYTE_SWAP
366 distance_sensor->
time_boot_ms = mavlink_msg_distance_sensor_get_time_boot_ms(msg);
367 distance_sensor->
min_distance = mavlink_msg_distance_sensor_get_min_distance(msg);
368 distance_sensor->
max_distance = mavlink_msg_distance_sensor_get_max_distance(msg);
369 distance_sensor->
current_distance = mavlink_msg_distance_sensor_get_current_distance(msg);
370 distance_sensor->
type = mavlink_msg_distance_sensor_get_type(msg);
371 distance_sensor->
id = mavlink_msg_distance_sensor_get_id(msg);
372 distance_sensor->
orientation = mavlink_msg_distance_sensor_get_orientation(msg);
373 distance_sensor->
covariance = mavlink_msg_distance_sensor_get_covariance(msg);
uint8_t type
Definition: fat_standard.h:67
uint8_t type
Type from MAV_DISTANCE_SENSOR enum.
Definition: mavlink_msg_distance_sensor.h:11
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
uint32_t time_boot_ms
Time since system boot.
Definition: mavlink_msg_distance_sensor.h:7
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
uint8_t orientation
Direction the sensor faces from FIXME enum.
Definition: mavlink_msg_distance_sensor.h:13
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134
uint8_t id
Onboard ID of the sensor.
Definition: mavlink_msg_distance_sensor.h:12
#define _MAV_PAYLOAD_NON_CONST(msg)
Definition: mavlink_types.h:172
mavlink_channel_t
Definition: mavlink_types.h:178
Definition: mavlink_msg_distance_sensor.h:5
#define _MAV_PAYLOAD(msg)
Definition: mavlink_types.h:171
uint8_t covariance
Measurement covariance in centimeters, 0 for unknown / invalid readings.
Definition: mavlink_msg_distance_sensor.h:14
#define MAVLINK_MSG_ID_DISTANCE_SENSOR_CRC
Definition: mavlink_msg_distance_sensor.h:20
uint16_t max_distance
Maximum distance the sensor can measure in centimeters.
Definition: mavlink_msg_distance_sensor.h:9
#define MAVLINK_MSG_ID_DISTANCE_SENSOR
Definition: mavlink_msg_distance_sensor.h:3
struct __mavlink_distance_sensor_t mavlink_distance_sensor_t
uint16_t current_distance
Current distance reading.
Definition: mavlink_msg_distance_sensor.h:10
uint16_t min_distance
Minimum distance the sensor can measure in centimeters.
Definition: mavlink_msg_distance_sensor.h:8
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139
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_DISTANCE_SENSOR_LEN
Definition: mavlink_msg_distance_sensor.h:17
#define _mav_put_uint32_t(buf, wire_offset, b)
Definition: protocol.h:141