NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_data_transmission_handshake.h
Go to the documentation of this file.
1 // MESSAGE DATA_TRANSMISSION_HANDSHAKE PACKING
2 
3 #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 130
4 
6 {
7  uint32_t size;
8  uint16_t width;
9  uint16_t height;
10  uint16_t packets;
11  uint8_t type;
12  uint8_t payload;
13  uint8_t jpg_quality;
15 
16 #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 13
17 #define MAVLINK_MSG_ID_130_LEN 13
18 
19 #define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_CRC 29
20 #define MAVLINK_MSG_ID_130_CRC 29
21 
22 
23 
24 #define MAVLINK_MESSAGE_INFO_DATA_TRANSMISSION_HANDSHAKE { \
25  "DATA_TRANSMISSION_HANDSHAKE", \
26  7, \
27  { { "size", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_data_transmission_handshake_t, size) }, \
28  { "width", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_data_transmission_handshake_t, width) }, \
29  { "height", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_data_transmission_handshake_t, height) }, \
30  { "packets", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_data_transmission_handshake_t, packets) }, \
31  { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_data_transmission_handshake_t, type) }, \
32  { "payload", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_data_transmission_handshake_t, payload) }, \
33  { "jpg_quality", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_data_transmission_handshake_t, jpg_quality) }, \
34  } \
35 }
36 
37 
53 static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
54  uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
55 {
56 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
58  _mav_put_uint32_t(buf, 0, size);
59  _mav_put_uint16_t(buf, 4, width);
60  _mav_put_uint16_t(buf, 6, height);
61  _mav_put_uint16_t(buf, 8, packets);
62  _mav_put_uint8_t(buf, 10, type);
63  _mav_put_uint8_t(buf, 11, payload);
64  _mav_put_uint8_t(buf, 12, jpg_quality);
65 
67 #else
69  packet.size = size;
70  packet.width = width;
71  packet.height = height;
72  packet.packets = packets;
73  packet.type = type;
74  packet.payload = payload;
75  packet.jpg_quality = jpg_quality;
76 
78 #endif
79 
81 #if MAVLINK_CRC_EXTRA
83 #else
85 #endif
86 }
87 
103 static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
104  mavlink_message_t* msg,
105  uint8_t type,uint32_t size,uint16_t width,uint16_t height,uint16_t packets,uint8_t payload,uint8_t jpg_quality)
106 {
107 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
109  _mav_put_uint32_t(buf, 0, size);
110  _mav_put_uint16_t(buf, 4, width);
111  _mav_put_uint16_t(buf, 6, height);
112  _mav_put_uint16_t(buf, 8, packets);
113  _mav_put_uint8_t(buf, 10, type);
114  _mav_put_uint8_t(buf, 11, payload);
115  _mav_put_uint8_t(buf, 12, jpg_quality);
116 
118 #else
120  packet.size = size;
121  packet.width = width;
122  packet.height = height;
123  packet.packets = packets;
124  packet.type = type;
125  packet.payload = payload;
126  packet.jpg_quality = jpg_quality;
127 
129 #endif
130 
132 #if MAVLINK_CRC_EXTRA
134 #else
135  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
136 #endif
137 }
138 
147 static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
148 {
149  return mavlink_msg_data_transmission_handshake_pack(system_id, component_id, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
150 }
151 
161 static inline uint16_t mavlink_msg_data_transmission_handshake_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_data_transmission_handshake_t* data_transmission_handshake)
162 {
163  return mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, chan, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->width, data_transmission_handshake->height, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
164 }
165 
178 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
179 
180 static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
181 {
182 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
184  _mav_put_uint32_t(buf, 0, size);
185  _mav_put_uint16_t(buf, 4, width);
186  _mav_put_uint16_t(buf, 6, height);
187  _mav_put_uint16_t(buf, 8, packets);
188  _mav_put_uint8_t(buf, 10, type);
189  _mav_put_uint8_t(buf, 11, payload);
190  _mav_put_uint8_t(buf, 12, jpg_quality);
191 
192 #if MAVLINK_CRC_EXTRA
194 #else
196 #endif
197 #else
199  packet.size = size;
200  packet.width = width;
201  packet.height = height;
202  packet.packets = packets;
203  packet.type = type;
204  packet.payload = payload;
205  packet.jpg_quality = jpg_quality;
206 
207 #if MAVLINK_CRC_EXTRA
209 #else
210  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)&packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
211 #endif
212 #endif
213 }
214 
215 #if MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
216 /*
217  This varient of _send() can be used to save stack space by re-using
218  memory from the receive buffer. The caller provides a
219  mavlink_message_t which is the size of a full mavlink message. This
220  is usually the receive buffer for the channel, and allows a reply to an
221  incoming message with minimum stack space usage.
222  */
223 static inline void mavlink_msg_data_transmission_handshake_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint32_t size, uint16_t width, uint16_t height, uint16_t packets, uint8_t payload, uint8_t jpg_quality)
224 {
225 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
226  char *buf = (char *)msgbuf;
227  _mav_put_uint32_t(buf, 0, size);
228  _mav_put_uint16_t(buf, 4, width);
229  _mav_put_uint16_t(buf, 6, height);
230  _mav_put_uint16_t(buf, 8, packets);
231  _mav_put_uint8_t(buf, 10, type);
232  _mav_put_uint8_t(buf, 11, payload);
233  _mav_put_uint8_t(buf, 12, jpg_quality);
234 
235 #if MAVLINK_CRC_EXTRA
237 #else
239 #endif
240 #else
242  packet->size = size;
243  packet->width = width;
244  packet->height = height;
245  packet->packets = packets;
246  packet->type = type;
247  packet->payload = payload;
248  packet->jpg_quality = jpg_quality;
249 
250 #if MAVLINK_CRC_EXTRA
252 #else
253  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE, (const char *)packet, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
254 #endif
255 #endif
256 }
257 #endif
258 
259 #endif
260 
261 // MESSAGE DATA_TRANSMISSION_HANDSHAKE UNPACKING
262 
263 
269 static inline uint8_t mavlink_msg_data_transmission_handshake_get_type(const mavlink_message_t* msg)
270 {
271  return _MAV_RETURN_uint8_t(msg, 10);
272 }
273 
279 static inline uint32_t mavlink_msg_data_transmission_handshake_get_size(const mavlink_message_t* msg)
280 {
281  return _MAV_RETURN_uint32_t(msg, 0);
282 }
283 
289 static inline uint16_t mavlink_msg_data_transmission_handshake_get_width(const mavlink_message_t* msg)
290 {
291  return _MAV_RETURN_uint16_t(msg, 4);
292 }
293 
299 static inline uint16_t mavlink_msg_data_transmission_handshake_get_height(const mavlink_message_t* msg)
300 {
301  return _MAV_RETURN_uint16_t(msg, 6);
302 }
303 
309 static inline uint16_t mavlink_msg_data_transmission_handshake_get_packets(const mavlink_message_t* msg)
310 {
311  return _MAV_RETURN_uint16_t(msg, 8);
312 }
313 
319 static inline uint8_t mavlink_msg_data_transmission_handshake_get_payload(const mavlink_message_t* msg)
320 {
321  return _MAV_RETURN_uint8_t(msg, 11);
322 }
323 
329 static inline uint8_t mavlink_msg_data_transmission_handshake_get_jpg_quality(const mavlink_message_t* msg)
330 {
331  return _MAV_RETURN_uint8_t(msg, 12);
332 }
333 
340 static inline void mavlink_msg_data_transmission_handshake_decode(const mavlink_message_t* msg, mavlink_data_transmission_handshake_t* data_transmission_handshake)
341 {
342 #if MAVLINK_NEED_BYTE_SWAP
343  data_transmission_handshake->size = mavlink_msg_data_transmission_handshake_get_size(msg);
344  data_transmission_handshake->width = mavlink_msg_data_transmission_handshake_get_width(msg);
345  data_transmission_handshake->height = mavlink_msg_data_transmission_handshake_get_height(msg);
346  data_transmission_handshake->packets = mavlink_msg_data_transmission_handshake_get_packets(msg);
347  data_transmission_handshake->type = mavlink_msg_data_transmission_handshake_get_type(msg);
348  data_transmission_handshake->payload = mavlink_msg_data_transmission_handshake_get_payload(msg);
349  data_transmission_handshake->jpg_quality = mavlink_msg_data_transmission_handshake_get_jpg_quality(msg);
350 #else
351  memcpy(data_transmission_handshake, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
352 #endif
353 }
uint8_t type
Definition: fat_standard.h:67
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139
#define _mav_put_uint32_t(buf, wire_offset, b)
Definition: protocol.h:141