3 #define MAVLINK_MSG_ID_TERRAIN_REQUEST 133
13 #define MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN 18
14 #define MAVLINK_MSG_ID_133_LEN 18
16 #define MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC 6
17 #define MAVLINK_MSG_ID_133_CRC 6
21 #define MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST { \
24 { { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \
25 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \
26 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_terrain_request_t, lon) }, \
27 { "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_request_t, grid_spacing) }, \
44 static inline uint16_t mavlink_msg_terrain_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
45 int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
47 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
48 char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
49 _mav_put_uint64_t(buf, 0, mask);
50 _mav_put_int32_t(buf, 8, lat);
51 _mav_put_int32_t(buf, 12, lon);
52 _mav_put_uint16_t(buf, 16, grid_spacing);
54 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
62 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
65 msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST;
67 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
69 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
85 static inline uint16_t mavlink_msg_terrain_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
86 mavlink_message_t* msg,
87 int32_t lat,int32_t lon,uint16_t grid_spacing,uint64_t mask)
89 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
90 char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
91 _mav_put_uint64_t(buf, 0, mask);
92 _mav_put_int32_t(buf, 8, lat);
93 _mav_put_int32_t(buf, 12, lon);
94 _mav_put_uint16_t(buf, 16, grid_spacing);
96 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
107 msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST;
108 #if MAVLINK_CRC_EXTRA
109 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
111 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
123 static inline uint16_t mavlink_msg_terrain_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_terrain_request_t* terrain_request)
125 return mavlink_msg_terrain_request_pack(system_id, component_id, msg, terrain_request->
lat, terrain_request->
lon, terrain_request->
grid_spacing, terrain_request->
mask);
137 static inline uint16_t mavlink_msg_terrain_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_terrain_request_t* terrain_request)
139 return mavlink_msg_terrain_request_pack_chan(system_id, component_id, chan, msg, terrain_request->
lat, terrain_request->
lon, terrain_request->
grid_spacing, terrain_request->
mask);
151 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
153 static inline void mavlink_msg_terrain_request_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
155 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
156 char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
157 _mav_put_uint64_t(buf, 0, mask);
158 _mav_put_int32_t(buf, 8, lat);
159 _mav_put_int32_t(buf, 12, lon);
160 _mav_put_uint16_t(buf, 16, grid_spacing);
162 #if MAVLINK_CRC_EXTRA
163 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
165 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
174 #if MAVLINK_CRC_EXTRA
175 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (
const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
177 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (
const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
182 #if MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
190 static inline void mavlink_msg_terrain_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
192 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193 char *buf = (
char *)msgbuf;
194 _mav_put_uint64_t(buf, 0, mask);
195 _mav_put_int32_t(buf, 8, lat);
196 _mav_put_int32_t(buf, 12, lon);
197 _mav_put_uint16_t(buf, 16, grid_spacing);
199 #if MAVLINK_CRC_EXTRA
200 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
202 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
211 #if MAVLINK_CRC_EXTRA
212 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (
const char *)packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
214 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (
const char *)packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
230 static inline int32_t mavlink_msg_terrain_request_get_lat(
const mavlink_message_t* msg)
232 return _MAV_RETURN_int32_t(msg, 8);
240 static inline int32_t mavlink_msg_terrain_request_get_lon(
const mavlink_message_t* msg)
242 return _MAV_RETURN_int32_t(msg, 12);
250 static inline uint16_t mavlink_msg_terrain_request_get_grid_spacing(
const mavlink_message_t* msg)
252 return _MAV_RETURN_uint16_t(msg, 16);
260 static inline uint64_t mavlink_msg_terrain_request_get_mask(
const mavlink_message_t* msg)
262 return _MAV_RETURN_uint64_t(msg, 0);
271 static inline void mavlink_msg_terrain_request_decode(
const mavlink_message_t* msg,
mavlink_terrain_request_t* terrain_request)
273 #if MAVLINK_NEED_BYTE_SWAP
274 terrain_request->
mask = mavlink_msg_terrain_request_get_mask(msg);
275 terrain_request->
lat = mavlink_msg_terrain_request_get_lat(msg);
276 terrain_request->
lon = mavlink_msg_terrain_request_get_lon(msg);
277 terrain_request->
grid_spacing = mavlink_msg_terrain_request_get_grid_spacing(msg);
279 memcpy(terrain_request, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
int32_t lon
Longitude of SW corner of first grid (in degrees *10^7)
Definition: mavlink_msg_terrain_request.h:9
int32_t lat
Latitude of SW corner of first grid (degrees *10^7)
Definition: mavlink_msg_terrain_request.h:8
uint64_t mask
Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
Definition: mavlink_msg_terrain_request.h:7
Definition: mavlink_msg_terrain_request.h:5
uint16_t grid_spacing
Grid spacing in meters.
Definition: mavlink_msg_terrain_request.h:10