NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_point_of_interest_connection.h
Go to the documentation of this file.
1 // MESSAGE POINT_OF_INTEREST_CONNECTION PACKING
2 
3 #define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION 192
4 
6 {
7  float xp1;
8  float yp1;
9  float zp1;
10  float xp2;
11  float yp2;
12  float zp2;
13  uint16_t timeout;
14  uint8_t type;
15  uint8_t color;
17  char name[26];
19 
20 #define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN 55
21 #define MAVLINK_MSG_ID_192_LEN 55
22 
23 #define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_CRC 36
24 #define MAVLINK_MSG_ID_192_CRC 36
25 
26 #define MAVLINK_MSG_POINT_OF_INTEREST_CONNECTION_FIELD_NAME_LEN 26
27 
28 #define MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST_CONNECTION { \
29  "POINT_OF_INTEREST_CONNECTION", \
30  11, \
31  { { "xp1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_point_of_interest_connection_t, xp1) }, \
32  { "yp1", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_point_of_interest_connection_t, yp1) }, \
33  { "zp1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_point_of_interest_connection_t, zp1) }, \
34  { "xp2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_point_of_interest_connection_t, xp2) }, \
35  { "yp2", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_point_of_interest_connection_t, yp2) }, \
36  { "zp2", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_point_of_interest_connection_t, zp2) }, \
37  { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_point_of_interest_connection_t, timeout) }, \
38  { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_point_of_interest_connection_t, type) }, \
39  { "color", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_point_of_interest_connection_t, color) }, \
40  { "coordinate_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_point_of_interest_connection_t, coordinate_system) }, \
41  { "name", NULL, MAVLINK_TYPE_CHAR, 26, 29, offsetof(mavlink_point_of_interest_connection_t, name) }, \
42  } \
43 }
44 
45 
65 static inline uint16_t mavlink_msg_point_of_interest_connection_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
66  uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char *name)
67 {
68 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
70  _mav_put_float(buf, 0, xp1);
71  _mav_put_float(buf, 4, yp1);
72  _mav_put_float(buf, 8, zp1);
73  _mav_put_float(buf, 12, xp2);
74  _mav_put_float(buf, 16, yp2);
75  _mav_put_float(buf, 20, zp2);
76  _mav_put_uint16_t(buf, 24, timeout);
77  _mav_put_uint8_t(buf, 26, type);
78  _mav_put_uint8_t(buf, 27, color);
79  _mav_put_uint8_t(buf, 28, coordinate_system);
80  _mav_put_char_array(buf, 29, name, 26);
82 #else
84  packet.xp1 = xp1;
85  packet.yp1 = yp1;
86  packet.zp1 = zp1;
87  packet.xp2 = xp2;
88  packet.yp2 = yp2;
89  packet.zp2 = zp2;
90  packet.timeout = timeout;
91  packet.type = type;
92  packet.color = color;
93  packet.coordinate_system = coordinate_system;
94  mav_array_memcpy(packet.name, name, sizeof(char)*26);
96 #endif
97 
99 #if MAVLINK_CRC_EXTRA
101 #else
103 #endif
104 }
105 
125 static inline uint16_t mavlink_msg_point_of_interest_connection_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
126  mavlink_message_t* msg,
127  uint8_t type,uint8_t color,uint8_t coordinate_system,uint16_t timeout,float xp1,float yp1,float zp1,float xp2,float yp2,float zp2,const char *name)
128 {
129 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
131  _mav_put_float(buf, 0, xp1);
132  _mav_put_float(buf, 4, yp1);
133  _mav_put_float(buf, 8, zp1);
134  _mav_put_float(buf, 12, xp2);
135  _mav_put_float(buf, 16, yp2);
136  _mav_put_float(buf, 20, zp2);
137  _mav_put_uint16_t(buf, 24, timeout);
138  _mav_put_uint8_t(buf, 26, type);
139  _mav_put_uint8_t(buf, 27, color);
140  _mav_put_uint8_t(buf, 28, coordinate_system);
141  _mav_put_char_array(buf, 29, name, 26);
143 #else
145  packet.xp1 = xp1;
146  packet.yp1 = yp1;
147  packet.zp1 = zp1;
148  packet.xp2 = xp2;
149  packet.yp2 = yp2;
150  packet.zp2 = zp2;
151  packet.timeout = timeout;
152  packet.type = type;
153  packet.color = color;
154  packet.coordinate_system = coordinate_system;
155  mav_array_memcpy(packet.name, name, sizeof(char)*26);
157 #endif
158 
160 #if MAVLINK_CRC_EXTRA
162 #else
163  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
164 #endif
165 }
166 
175 static inline uint16_t mavlink_msg_point_of_interest_connection_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_point_of_interest_connection_t* point_of_interest_connection)
176 {
177  return mavlink_msg_point_of_interest_connection_pack(system_id, component_id, msg, point_of_interest_connection->type, point_of_interest_connection->color, point_of_interest_connection->coordinate_system, point_of_interest_connection->timeout, point_of_interest_connection->xp1, point_of_interest_connection->yp1, point_of_interest_connection->zp1, point_of_interest_connection->xp2, point_of_interest_connection->yp2, point_of_interest_connection->zp2, point_of_interest_connection->name);
178 }
179 
189 static inline uint16_t mavlink_msg_point_of_interest_connection_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_point_of_interest_connection_t* point_of_interest_connection)
190 {
191  return mavlink_msg_point_of_interest_connection_pack_chan(system_id, component_id, chan, msg, point_of_interest_connection->type, point_of_interest_connection->color, point_of_interest_connection->coordinate_system, point_of_interest_connection->timeout, point_of_interest_connection->xp1, point_of_interest_connection->yp1, point_of_interest_connection->zp1, point_of_interest_connection->xp2, point_of_interest_connection->yp2, point_of_interest_connection->zp2, point_of_interest_connection->name);
192 }
193 
210 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
211 
212 static inline void mavlink_msg_point_of_interest_connection_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char *name)
213 {
214 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
216  _mav_put_float(buf, 0, xp1);
217  _mav_put_float(buf, 4, yp1);
218  _mav_put_float(buf, 8, zp1);
219  _mav_put_float(buf, 12, xp2);
220  _mav_put_float(buf, 16, yp2);
221  _mav_put_float(buf, 20, zp2);
222  _mav_put_uint16_t(buf, 24, timeout);
223  _mav_put_uint8_t(buf, 26, type);
224  _mav_put_uint8_t(buf, 27, color);
225  _mav_put_uint8_t(buf, 28, coordinate_system);
226  _mav_put_char_array(buf, 29, name, 26);
227 #if MAVLINK_CRC_EXTRA
229 #else
231 #endif
232 #else
234  packet.xp1 = xp1;
235  packet.yp1 = yp1;
236  packet.zp1 = zp1;
237  packet.xp2 = xp2;
238  packet.yp2 = yp2;
239  packet.zp2 = zp2;
240  packet.timeout = timeout;
241  packet.type = type;
242  packet.color = color;
243  packet.coordinate_system = coordinate_system;
244  mav_array_memcpy(packet.name, name, sizeof(char)*26);
245 #if MAVLINK_CRC_EXTRA
247 #else
248  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, (const char *)&packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
249 #endif
250 #endif
251 }
252 
253 #if MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
254 /*
255  This varient of _send() can be used to save stack space by re-using
256  memory from the receive buffer. The caller provides a
257  mavlink_message_t which is the size of a full mavlink message. This
258  is usually the receive buffer for the channel, and allows a reply to an
259  incoming message with minimum stack space usage.
260  */
261 static inline void mavlink_msg_point_of_interest_connection_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char *name)
262 {
263 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
264  char *buf = (char *)msgbuf;
265  _mav_put_float(buf, 0, xp1);
266  _mav_put_float(buf, 4, yp1);
267  _mav_put_float(buf, 8, zp1);
268  _mav_put_float(buf, 12, xp2);
269  _mav_put_float(buf, 16, yp2);
270  _mav_put_float(buf, 20, zp2);
271  _mav_put_uint16_t(buf, 24, timeout);
272  _mav_put_uint8_t(buf, 26, type);
273  _mav_put_uint8_t(buf, 27, color);
274  _mav_put_uint8_t(buf, 28, coordinate_system);
275  _mav_put_char_array(buf, 29, name, 26);
276 #if MAVLINK_CRC_EXTRA
278 #else
280 #endif
281 #else
283  packet->xp1 = xp1;
284  packet->yp1 = yp1;
285  packet->zp1 = zp1;
286  packet->xp2 = xp2;
287  packet->yp2 = yp2;
288  packet->zp2 = zp2;
289  packet->timeout = timeout;
290  packet->type = type;
291  packet->color = color;
292  packet->coordinate_system = coordinate_system;
293  mav_array_memcpy(packet->name, name, sizeof(char)*26);
294 #if MAVLINK_CRC_EXTRA
296 #else
297  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION, (const char *)packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
298 #endif
299 #endif
300 }
301 #endif
302 
303 #endif
304 
305 // MESSAGE POINT_OF_INTEREST_CONNECTION UNPACKING
306 
307 
313 static inline uint8_t mavlink_msg_point_of_interest_connection_get_type(const mavlink_message_t* msg)
314 {
315  return _MAV_RETURN_uint8_t(msg, 26);
316 }
317 
323 static inline uint8_t mavlink_msg_point_of_interest_connection_get_color(const mavlink_message_t* msg)
324 {
325  return _MAV_RETURN_uint8_t(msg, 27);
326 }
327 
333 static inline uint8_t mavlink_msg_point_of_interest_connection_get_coordinate_system(const mavlink_message_t* msg)
334 {
335  return _MAV_RETURN_uint8_t(msg, 28);
336 }
337 
343 static inline uint16_t mavlink_msg_point_of_interest_connection_get_timeout(const mavlink_message_t* msg)
344 {
345  return _MAV_RETURN_uint16_t(msg, 24);
346 }
347 
353 static inline float mavlink_msg_point_of_interest_connection_get_xp1(const mavlink_message_t* msg)
354 {
355  return _MAV_RETURN_float(msg, 0);
356 }
357 
363 static inline float mavlink_msg_point_of_interest_connection_get_yp1(const mavlink_message_t* msg)
364 {
365  return _MAV_RETURN_float(msg, 4);
366 }
367 
373 static inline float mavlink_msg_point_of_interest_connection_get_zp1(const mavlink_message_t* msg)
374 {
375  return _MAV_RETURN_float(msg, 8);
376 }
377 
383 static inline float mavlink_msg_point_of_interest_connection_get_xp2(const mavlink_message_t* msg)
384 {
385  return _MAV_RETURN_float(msg, 12);
386 }
387 
393 static inline float mavlink_msg_point_of_interest_connection_get_yp2(const mavlink_message_t* msg)
394 {
395  return _MAV_RETURN_float(msg, 16);
396 }
397 
403 static inline float mavlink_msg_point_of_interest_connection_get_zp2(const mavlink_message_t* msg)
404 {
405  return _MAV_RETURN_float(msg, 20);
406 }
407 
413 static inline uint16_t mavlink_msg_point_of_interest_connection_get_name(const mavlink_message_t* msg, char *name)
414 {
415  return _MAV_RETURN_char_array(msg, name, 26, 29);
416 }
417 
424 static inline void mavlink_msg_point_of_interest_connection_decode(const mavlink_message_t* msg, mavlink_point_of_interest_connection_t* point_of_interest_connection)
425 {
426 #if MAVLINK_NEED_BYTE_SWAP
427  point_of_interest_connection->xp1 = mavlink_msg_point_of_interest_connection_get_xp1(msg);
428  point_of_interest_connection->yp1 = mavlink_msg_point_of_interest_connection_get_yp1(msg);
429  point_of_interest_connection->zp1 = mavlink_msg_point_of_interest_connection_get_zp1(msg);
430  point_of_interest_connection->xp2 = mavlink_msg_point_of_interest_connection_get_xp2(msg);
431  point_of_interest_connection->yp2 = mavlink_msg_point_of_interest_connection_get_yp2(msg);
432  point_of_interest_connection->zp2 = mavlink_msg_point_of_interest_connection_get_zp2(msg);
433  point_of_interest_connection->timeout = mavlink_msg_point_of_interest_connection_get_timeout(msg);
434  point_of_interest_connection->type = mavlink_msg_point_of_interest_connection_get_type(msg);
435  point_of_interest_connection->color = mavlink_msg_point_of_interest_connection_get_color(msg);
436  point_of_interest_connection->coordinate_system = mavlink_msg_point_of_interest_connection_get_coordinate_system(msg);
437  mavlink_msg_point_of_interest_connection_get_name(msg, point_of_interest_connection->name);
438 #else
439  memcpy(point_of_interest_connection, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
440 #endif
441 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:145
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
uint8_t color[LED_SPECIAL_COLOR_COUNT]
Definition: ledstrip.h:9
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139