4#define MAVLINK_MSG_ID_ADSB_VEHICLE 246
7typedef struct __mavlink_adsb_vehicle_t {
13 uint16_t hor_velocity;
17 uint8_t altitude_type;
21}) mavlink_adsb_vehicle_t;
23#define MAVLINK_MSG_ID_ADSB_VEHICLE_LEN 38
24#define MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN 38
25#define MAVLINK_MSG_ID_246_LEN 38
26#define MAVLINK_MSG_ID_246_MIN_LEN 38
28#define MAVLINK_MSG_ID_ADSB_VEHICLE_CRC 184
29#define MAVLINK_MSG_ID_246_CRC 184
31#define MAVLINK_MSG_ADSB_VEHICLE_FIELD_CALLSIGN_LEN 9
33#if MAVLINK_COMMAND_24BIT
34#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \
38 { { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \
39 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \
40 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \
41 { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \
42 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \
43 { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \
44 { "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \
45 { "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \
46 { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \
47 { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \
48 { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \
49 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \
50 { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \
54#define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \
57 { { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \
58 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \
59 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \
60 { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \
61 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_adsb_vehicle_t, altitude) }, \
62 { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_adsb_vehicle_t, heading) }, \
63 { "hor_velocity", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_adsb_vehicle_t, hor_velocity) }, \
64 { "ver_velocity", NULL, MAVLINK_TYPE_INT16_T, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \
65 { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 27, offsetof(mavlink_adsb_vehicle_t, callsign) }, \
66 { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \
67 { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_adsb_vehicle_t, tslc) }, \
68 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_adsb_vehicle_t, flags) }, \
69 { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, squawk) }, \
95static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
96 uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity,
const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
98#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
99 char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
100 _mav_put_uint32_t(buf, 0, ICAO_address);
101 _mav_put_int32_t(buf, 4, lat);
102 _mav_put_int32_t(buf, 8, lon);
103 _mav_put_int32_t(buf, 12, altitude);
104 _mav_put_uint16_t(buf, 16, heading);
105 _mav_put_uint16_t(buf, 18, hor_velocity);
106 _mav_put_int16_t(buf, 20, ver_velocity);
107 _mav_put_uint16_t(buf, 22, flags);
108 _mav_put_uint16_t(buf, 24, squawk);
109 _mav_put_uint8_t(buf, 26, altitude_type);
110 _mav_put_uint8_t(buf, 36, emitter_type);
111 _mav_put_uint8_t(buf, 37, tslc);
112 _mav_put_char_array(buf, 27, callsign, 9);
113 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
115 mavlink_adsb_vehicle_t packet;
116 packet.ICAO_address = ICAO_address;
119 packet.altitude = altitude;
120 packet.heading = heading;
121 packet.hor_velocity = hor_velocity;
122 packet.ver_velocity = ver_velocity;
123 packet.flags = flags;
124 packet.squawk = squawk;
125 packet.altitude_type = altitude_type;
126 packet.emitter_type = emitter_type;
128 mav_array_memcpy(packet.callsign, callsign,
sizeof(
char)*9);
129 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
132 msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
133 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
157static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
158 mavlink_message_t* msg,
159 uint32_t ICAO_address,int32_t lat,int32_t lon,uint8_t altitude_type,int32_t altitude,uint16_t heading,uint16_t hor_velocity,int16_t ver_velocity,
const char *callsign,uint8_t emitter_type,uint8_t tslc,uint16_t flags,uint16_t squawk)
161#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
162 char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
163 _mav_put_uint32_t(buf, 0, ICAO_address);
164 _mav_put_int32_t(buf, 4, lat);
165 _mav_put_int32_t(buf, 8, lon);
166 _mav_put_int32_t(buf, 12, altitude);
167 _mav_put_uint16_t(buf, 16, heading);
168 _mav_put_uint16_t(buf, 18, hor_velocity);
169 _mav_put_int16_t(buf, 20, ver_velocity);
170 _mav_put_uint16_t(buf, 22, flags);
171 _mav_put_uint16_t(buf, 24, squawk);
172 _mav_put_uint8_t(buf, 26, altitude_type);
173 _mav_put_uint8_t(buf, 36, emitter_type);
174 _mav_put_uint8_t(buf, 37, tslc);
175 _mav_put_char_array(buf, 27, callsign, 9);
176 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
178 mavlink_adsb_vehicle_t packet;
179 packet.ICAO_address = ICAO_address;
182 packet.altitude = altitude;
183 packet.heading = heading;
184 packet.hor_velocity = hor_velocity;
185 packet.ver_velocity = ver_velocity;
186 packet.flags = flags;
187 packet.squawk = squawk;
188 packet.altitude_type = altitude_type;
189 packet.emitter_type = emitter_type;
191 mav_array_memcpy(packet.callsign, callsign,
sizeof(
char)*9);
192 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
195 msg->msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
196 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
207static inline uint16_t mavlink_msg_adsb_vehicle_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_adsb_vehicle_t* adsb_vehicle)
209 return mavlink_msg_adsb_vehicle_pack(system_id, component_id, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
221static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_adsb_vehicle_t* adsb_vehicle)
223 return mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, chan, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
244#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
246static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity,
const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
248#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
249 char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN];
250 _mav_put_uint32_t(buf, 0, ICAO_address);
251 _mav_put_int32_t(buf, 4, lat);
252 _mav_put_int32_t(buf, 8, lon);
253 _mav_put_int32_t(buf, 12, altitude);
254 _mav_put_uint16_t(buf, 16, heading);
255 _mav_put_uint16_t(buf, 18, hor_velocity);
256 _mav_put_int16_t(buf, 20, ver_velocity);
257 _mav_put_uint16_t(buf, 22, flags);
258 _mav_put_uint16_t(buf, 24, squawk);
259 _mav_put_uint8_t(buf, 26, altitude_type);
260 _mav_put_uint8_t(buf, 36, emitter_type);
261 _mav_put_uint8_t(buf, 37, tslc);
262 _mav_put_char_array(buf, 27, callsign, 9);
263 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
265 mavlink_adsb_vehicle_t packet;
266 packet.ICAO_address = ICAO_address;
269 packet.altitude = altitude;
270 packet.heading = heading;
271 packet.hor_velocity = hor_velocity;
272 packet.ver_velocity = ver_velocity;
273 packet.flags = flags;
274 packet.squawk = squawk;
275 packet.altitude_type = altitude_type;
276 packet.emitter_type = emitter_type;
278 mav_array_memcpy(packet.callsign, callsign,
sizeof(
char)*9);
279 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (
const char *)&packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
288static inline void mavlink_msg_adsb_vehicle_send_struct(mavlink_channel_t chan,
const mavlink_adsb_vehicle_t* adsb_vehicle)
290#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
291 mavlink_msg_adsb_vehicle_send(chan, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk);
293 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (
const char *)adsb_vehicle, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
297#if MAVLINK_MSG_ID_ADSB_VEHICLE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
305static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, int32_t altitude, uint16_t heading, uint16_t hor_velocity, int16_t ver_velocity,
const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk)
307#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
308 char *buf = (
char *)msgbuf;
309 _mav_put_uint32_t(buf, 0, ICAO_address);
310 _mav_put_int32_t(buf, 4, lat);
311 _mav_put_int32_t(buf, 8, lon);
312 _mav_put_int32_t(buf, 12, altitude);
313 _mav_put_uint16_t(buf, 16, heading);
314 _mav_put_uint16_t(buf, 18, hor_velocity);
315 _mav_put_int16_t(buf, 20, ver_velocity);
316 _mav_put_uint16_t(buf, 22, flags);
317 _mav_put_uint16_t(buf, 24, squawk);
318 _mav_put_uint8_t(buf, 26, altitude_type);
319 _mav_put_uint8_t(buf, 36, emitter_type);
320 _mav_put_uint8_t(buf, 37, tslc);
321 _mav_put_char_array(buf, 27, callsign, 9);
322 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
324 mavlink_adsb_vehicle_t *packet = (mavlink_adsb_vehicle_t *)msgbuf;
325 packet->ICAO_address = ICAO_address;
328 packet->altitude = altitude;
329 packet->heading = heading;
330 packet->hor_velocity = hor_velocity;
331 packet->ver_velocity = ver_velocity;
332 packet->flags = flags;
333 packet->squawk = squawk;
334 packet->altitude_type = altitude_type;
335 packet->emitter_type = emitter_type;
337 mav_array_memcpy(packet->callsign, callsign,
sizeof(
char)*9);
338 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, (
const char *)packet, MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC);
353static inline uint32_t mavlink_msg_adsb_vehicle_get_ICAO_address(
const mavlink_message_t* msg)
355 return _MAV_RETURN_uint32_t(msg, 0);
363static inline int32_t mavlink_msg_adsb_vehicle_get_lat(
const mavlink_message_t* msg)
365 return _MAV_RETURN_int32_t(msg, 4);
373static inline int32_t mavlink_msg_adsb_vehicle_get_lon(
const mavlink_message_t* msg)
375 return _MAV_RETURN_int32_t(msg, 8);
383static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(
const mavlink_message_t* msg)
385 return _MAV_RETURN_uint8_t(msg, 26);
393static inline int32_t mavlink_msg_adsb_vehicle_get_altitude(
const mavlink_message_t* msg)
395 return _MAV_RETURN_int32_t(msg, 12);
403static inline uint16_t mavlink_msg_adsb_vehicle_get_heading(
const mavlink_message_t* msg)
405 return _MAV_RETURN_uint16_t(msg, 16);
413static inline uint16_t mavlink_msg_adsb_vehicle_get_hor_velocity(
const mavlink_message_t* msg)
415 return _MAV_RETURN_uint16_t(msg, 18);
423static inline int16_t mavlink_msg_adsb_vehicle_get_ver_velocity(
const mavlink_message_t* msg)
425 return _MAV_RETURN_int16_t(msg, 20);
433static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(
const mavlink_message_t* msg,
char *callsign)
435 return _MAV_RETURN_char_array(msg, callsign, 9, 27);
443static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(
const mavlink_message_t* msg)
445 return _MAV_RETURN_uint8_t(msg, 36);
453static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(
const mavlink_message_t* msg)
455 return _MAV_RETURN_uint8_t(msg, 37);
463static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(
const mavlink_message_t* msg)
465 return _MAV_RETURN_uint16_t(msg, 22);
473static inline uint16_t mavlink_msg_adsb_vehicle_get_squawk(
const mavlink_message_t* msg)
475 return _MAV_RETURN_uint16_t(msg, 24);
484static inline void mavlink_msg_adsb_vehicle_decode(
const mavlink_message_t* msg, mavlink_adsb_vehicle_t* adsb_vehicle)
486#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
487 adsb_vehicle->ICAO_address = mavlink_msg_adsb_vehicle_get_ICAO_address(msg);
488 adsb_vehicle->lat = mavlink_msg_adsb_vehicle_get_lat(msg);
489 adsb_vehicle->lon = mavlink_msg_adsb_vehicle_get_lon(msg);
490 adsb_vehicle->altitude = mavlink_msg_adsb_vehicle_get_altitude(msg);
491 adsb_vehicle->heading = mavlink_msg_adsb_vehicle_get_heading(msg);
492 adsb_vehicle->hor_velocity = mavlink_msg_adsb_vehicle_get_hor_velocity(msg);
493 adsb_vehicle->ver_velocity = mavlink_msg_adsb_vehicle_get_ver_velocity(msg);
494 adsb_vehicle->flags = mavlink_msg_adsb_vehicle_get_flags(msg);
495 adsb_vehicle->squawk = mavlink_msg_adsb_vehicle_get_squawk(msg);
496 adsb_vehicle->altitude_type = mavlink_msg_adsb_vehicle_get_altitude_type(msg);
497 mavlink_msg_adsb_vehicle_get_callsign(msg, adsb_vehicle->callsign);
498 adsb_vehicle->emitter_type = mavlink_msg_adsb_vehicle_get_emitter_type(msg);
499 adsb_vehicle->tslc = mavlink_msg_adsb_vehicle_get_tslc(msg);
501 uint8_t len = msg->len < MAVLINK_MSG_ID_ADSB_VEHICLE_LEN? msg->len : MAVLINK_MSG_ID_ADSB_VEHICLE_LEN;
502 memset(adsb_vehicle, 0, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN);
503 memcpy(adsb_vehicle, _MAV_PAYLOAD(msg), len);