4#define MAVLINK_MSG_ID_TERRAIN_REPORT 136
7typedef struct __mavlink_terrain_report_t {
15}) mavlink_terrain_report_t;
17#define MAVLINK_MSG_ID_TERRAIN_REPORT_LEN 22
18#define MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN 22
19#define MAVLINK_MSG_ID_136_LEN 22
20#define MAVLINK_MSG_ID_136_MIN_LEN 22
22#define MAVLINK_MSG_ID_TERRAIN_REPORT_CRC 1
23#define MAVLINK_MSG_ID_136_CRC 1
27#if MAVLINK_COMMAND_24BIT
28#define MAVLINK_MESSAGE_INFO_TERRAIN_REPORT { \
32 { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \
33 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \
34 { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \
35 { "terrain_height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, terrain_height) }, \
36 { "current_height", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_terrain_report_t, current_height) }, \
37 { "pending", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_terrain_report_t, pending) }, \
38 { "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_terrain_report_t, loaded) }, \
42#define MAVLINK_MESSAGE_INFO_TERRAIN_REPORT { \
45 { { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \
46 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \
47 { "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, spacing) }, \
48 { "terrain_height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, terrain_height) }, \
49 { "current_height", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_terrain_report_t, current_height) }, \
50 { "pending", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_terrain_report_t, pending) }, \
51 { "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_terrain_report_t, loaded) }, \
71static inline uint16_t mavlink_msg_terrain_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
72 int32_t lat, int32_t lon, uint16_t spacing,
float terrain_height,
float current_height, uint16_t pending, uint16_t loaded)
74#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
75 char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
76 _mav_put_int32_t(buf, 0, lat);
77 _mav_put_int32_t(buf, 4, lon);
78 _mav_put_float(buf, 8, terrain_height);
79 _mav_put_float(buf, 12, current_height);
80 _mav_put_uint16_t(buf, 16, spacing);
81 _mav_put_uint16_t(buf, 18, pending);
82 _mav_put_uint16_t(buf, 20, loaded);
84 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
86 mavlink_terrain_report_t packet;
89 packet.terrain_height = terrain_height;
90 packet.current_height = current_height;
91 packet.spacing = spacing;
92 packet.pending = pending;
93 packet.loaded = loaded;
95 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
98 msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT;
99 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
117static inline uint16_t mavlink_msg_terrain_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
118 mavlink_message_t* msg,
119 int32_t lat,int32_t lon,uint16_t spacing,
float terrain_height,
float current_height,uint16_t pending,uint16_t loaded)
121#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
122 char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
123 _mav_put_int32_t(buf, 0, lat);
124 _mav_put_int32_t(buf, 4, lon);
125 _mav_put_float(buf, 8, terrain_height);
126 _mav_put_float(buf, 12, current_height);
127 _mav_put_uint16_t(buf, 16, spacing);
128 _mav_put_uint16_t(buf, 18, pending);
129 _mav_put_uint16_t(buf, 20, loaded);
131 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
133 mavlink_terrain_report_t packet;
136 packet.terrain_height = terrain_height;
137 packet.current_height = current_height;
138 packet.spacing = spacing;
139 packet.pending = pending;
140 packet.loaded = loaded;
142 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
145 msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT;
146 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
157static inline uint16_t mavlink_msg_terrain_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_terrain_report_t* terrain_report)
159 return mavlink_msg_terrain_report_pack(system_id, component_id, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded);
171static inline uint16_t mavlink_msg_terrain_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_terrain_report_t* terrain_report)
173 return mavlink_msg_terrain_report_pack_chan(system_id, component_id, chan, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded);
188#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
190static inline void mavlink_msg_terrain_report_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t spacing,
float terrain_height,
float current_height, uint16_t pending, uint16_t loaded)
192#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193 char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
194 _mav_put_int32_t(buf, 0, lat);
195 _mav_put_int32_t(buf, 4, lon);
196 _mav_put_float(buf, 8, terrain_height);
197 _mav_put_float(buf, 12, current_height);
198 _mav_put_uint16_t(buf, 16, spacing);
199 _mav_put_uint16_t(buf, 18, pending);
200 _mav_put_uint16_t(buf, 20, loaded);
202 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
204 mavlink_terrain_report_t packet;
207 packet.terrain_height = terrain_height;
208 packet.current_height = current_height;
209 packet.spacing = spacing;
210 packet.pending = pending;
211 packet.loaded = loaded;
213 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (
const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
222static inline void mavlink_msg_terrain_report_send_struct(mavlink_channel_t chan,
const mavlink_terrain_report_t* terrain_report)
224#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
225 mavlink_msg_terrain_report_send(chan, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded);
227 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (
const char *)terrain_report, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
231#if MAVLINK_MSG_ID_TERRAIN_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
239static inline void mavlink_msg_terrain_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t spacing,
float terrain_height,
float current_height, uint16_t pending, uint16_t loaded)
241#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
242 char *buf = (
char *)msgbuf;
243 _mav_put_int32_t(buf, 0, lat);
244 _mav_put_int32_t(buf, 4, lon);
245 _mav_put_float(buf, 8, terrain_height);
246 _mav_put_float(buf, 12, current_height);
247 _mav_put_uint16_t(buf, 16, spacing);
248 _mav_put_uint16_t(buf, 18, pending);
249 _mav_put_uint16_t(buf, 20, loaded);
251 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
253 mavlink_terrain_report_t *packet = (mavlink_terrain_report_t *)msgbuf;
256 packet->terrain_height = terrain_height;
257 packet->current_height = current_height;
258 packet->spacing = spacing;
259 packet->pending = pending;
260 packet->loaded = loaded;
262 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (
const char *)packet, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
277static inline int32_t mavlink_msg_terrain_report_get_lat(
const mavlink_message_t* msg)
279 return _MAV_RETURN_int32_t(msg, 0);
287static inline int32_t mavlink_msg_terrain_report_get_lon(
const mavlink_message_t* msg)
289 return _MAV_RETURN_int32_t(msg, 4);
297static inline uint16_t mavlink_msg_terrain_report_get_spacing(
const mavlink_message_t* msg)
299 return _MAV_RETURN_uint16_t(msg, 16);
307static inline float mavlink_msg_terrain_report_get_terrain_height(
const mavlink_message_t* msg)
309 return _MAV_RETURN_float(msg, 8);
317static inline float mavlink_msg_terrain_report_get_current_height(
const mavlink_message_t* msg)
319 return _MAV_RETURN_float(msg, 12);
327static inline uint16_t mavlink_msg_terrain_report_get_pending(
const mavlink_message_t* msg)
329 return _MAV_RETURN_uint16_t(msg, 18);
337static inline uint16_t mavlink_msg_terrain_report_get_loaded(
const mavlink_message_t* msg)
339 return _MAV_RETURN_uint16_t(msg, 20);
348static inline void mavlink_msg_terrain_report_decode(
const mavlink_message_t* msg, mavlink_terrain_report_t* terrain_report)
350#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
351 terrain_report->lat = mavlink_msg_terrain_report_get_lat(msg);
352 terrain_report->lon = mavlink_msg_terrain_report_get_lon(msg);
353 terrain_report->terrain_height = mavlink_msg_terrain_report_get_terrain_height(msg);
354 terrain_report->current_height = mavlink_msg_terrain_report_get_current_height(msg);
355 terrain_report->spacing = mavlink_msg_terrain_report_get_spacing(msg);
356 terrain_report->pending = mavlink_msg_terrain_report_get_pending(msg);
357 terrain_report->loaded = mavlink_msg_terrain_report_get_loaded(msg);
359 uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_REPORT_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_REPORT_LEN;
360 memset(terrain_report, 0, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
361 memcpy(terrain_report, _MAV_PAYLOAD(msg), len);