4#define MAVLINK_MSG_ID_TERRAIN_REPORT 136
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) },
40}
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) },
53}
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
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);
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);
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118static inline uint16_t mavlink_msg_terrain_report_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, 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
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);
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);
147 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168static inline uint16_t mavlink_msg_terrain_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
169 mavlink_message_t* msg,
170 int32_t lat,int32_t lon,uint16_t spacing,
float terrain_height,
float current_height,uint16_t pending,uint16_t loaded)
172#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
174 _mav_put_int32_t(buf, 0, lat);
175 _mav_put_int32_t(buf, 4, lon);
176 _mav_put_float(buf, 8, terrain_height);
177 _mav_put_float(buf, 12, current_height);
178 _mav_put_uint16_t(buf, 16, spacing);
179 _mav_put_uint16_t(buf, 18, pending);
180 _mav_put_uint16_t(buf, 20, loaded);
184 mavlink_terrain_report_t packet;
187 packet.terrain_height = terrain_height;
188 packet.current_height = current_height;
189 packet.spacing = spacing;
190 packet.pending = pending;
191 packet.loaded = loaded;
193 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
201
202
203
204
205
206
207
208static 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)
210 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);
214
215
216
217
218
219
220
221
222static 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)
224 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);
228
229
230
231
232
233
234
235
236static inline uint16_t mavlink_msg_terrain_report_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_terrain_report_t* terrain_report)
238 return mavlink_msg_terrain_report_pack_status(system_id, component_id, _status, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->terrain_height, terrain_report->current_height, terrain_report->pending, terrain_report->loaded);
242
243
244
245
246
247
248
249
250
251
252
253#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
255static 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)
257#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
258 char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
259 _mav_put_int32_t(buf, 0, lat);
260 _mav_put_int32_t(buf, 4, lon);
261 _mav_put_float(buf, 8, terrain_height);
262 _mav_put_float(buf, 12, current_height);
263 _mav_put_uint16_t(buf, 16, spacing);
264 _mav_put_uint16_t(buf, 18, pending);
265 _mav_put_uint16_t(buf, 20, loaded);
267 _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);
269 mavlink_terrain_report_t packet;
272 packet.terrain_height = terrain_height;
273 packet.current_height = current_height;
274 packet.spacing = spacing;
275 packet.pending = pending;
276 packet.loaded = loaded;
278 _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);
283
284
285
286
287static inline void mavlink_msg_terrain_report_send_struct(mavlink_channel_t chan,
const mavlink_terrain_report_t* terrain_report)
289#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
290 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);
292 _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);
296#if MAVLINK_MSG_ID_TERRAIN_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
298
299
300
301
302
303
304static 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)
306#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
307 char *buf = (
char *)msgbuf;
308 _mav_put_int32_t(buf, 0, lat);
309 _mav_put_int32_t(buf, 4, lon);
310 _mav_put_float(buf, 8, terrain_height);
311 _mav_put_float(buf, 12, current_height);
312 _mav_put_uint16_t(buf, 16, spacing);
313 _mav_put_uint16_t(buf, 18, pending);
314 _mav_put_uint16_t(buf, 20, loaded);
316 _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);
318 mavlink_terrain_report_t *packet = (mavlink_terrain_report_t *)msgbuf;
321 packet->terrain_height = terrain_height;
322 packet->current_height = current_height;
323 packet->spacing = spacing;
324 packet->pending = pending;
325 packet->loaded = loaded;
327 _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);
338
339
340
341
342static inline int32_t mavlink_msg_terrain_report_get_lat(
const mavlink_message_t* msg)
344 return _MAV_RETURN_int32_t(msg, 0);
348
349
350
351
352static inline int32_t mavlink_msg_terrain_report_get_lon(
const mavlink_message_t* msg)
354 return _MAV_RETURN_int32_t(msg, 4);
358
359
360
361
362static inline uint16_t mavlink_msg_terrain_report_get_spacing(
const mavlink_message_t* msg)
364 return _MAV_RETURN_uint16_t(msg, 16);
368
369
370
371
372static inline float mavlink_msg_terrain_report_get_terrain_height(
const mavlink_message_t* msg)
374 return _MAV_RETURN_float(msg, 8);
378
379
380
381
382static inline float mavlink_msg_terrain_report_get_current_height(
const mavlink_message_t* msg)
384 return _MAV_RETURN_float(msg, 12);
388
389
390
391
392static inline uint16_t mavlink_msg_terrain_report_get_pending(
const mavlink_message_t* msg)
394 return _MAV_RETURN_uint16_t(msg, 18);
398
399
400
401
402static inline uint16_t mavlink_msg_terrain_report_get_loaded(
const mavlink_message_t* msg)
404 return _MAV_RETURN_uint16_t(msg, 20);
408
409
410
411
412
413static inline void mavlink_msg_terrain_report_decode(
const mavlink_message_t* msg, mavlink_terrain_report_t* terrain_report)
415#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
416 terrain_report->lat = mavlink_msg_terrain_report_get_lat(msg);
417 terrain_report->lon = mavlink_msg_terrain_report_get_lon(msg);
418 terrain_report->terrain_height = mavlink_msg_terrain_report_get_terrain_height(msg);
419 terrain_report->current_height = mavlink_msg_terrain_report_get_current_height(msg);
420 terrain_report->spacing = mavlink_msg_terrain_report_get_spacing(msg);
421 terrain_report->pending = mavlink_msg_terrain_report_get_pending(msg);
422 terrain_report->loaded = mavlink_msg_terrain_report_get_loaded(msg);
424 uint8_t len = msg->len < MAVLINK_MSG_ID_TERRAIN_REPORT_LEN? msg->len : MAVLINK_MSG_ID_TERRAIN_REPORT_LEN;
425 memset(terrain_report, 0, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
426 memcpy(terrain_report, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_TERRAIN_REPORT_CRC
Definition: mavlink_msg_terrain_report.h:22
#define MAVLINK_MSG_ID_TERRAIN_REPORT_LEN
Definition: mavlink_msg_terrain_report.h:17
#define MAVLINK_MSG_ID_TERRAIN_REPORT
Definition: mavlink_msg_terrain_report.h:4
#define MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN
Definition: mavlink_msg_terrain_report.h:18
Definition: mavlink_msg_terrain_report.h:7
uint16_t spacing
Definition: mavlink_msg_terrain_report.h:12
int32_t lon
Definition: mavlink_msg_terrain_report.h:9
int32_t lat
Definition: mavlink_msg_terrain_report.h:8
uint16_t pending
Definition: mavlink_msg_terrain_report.h:13
float terrain_height
Definition: mavlink_msg_terrain_report.h:10
float current_height
Definition: mavlink_msg_terrain_report.h:11
uint16_t loaded
Definition: mavlink_msg_terrain_report.h:14