NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_point_of_interest.h
Go to the documentation of this file.
1 // MESSAGE POINT_OF_INTEREST PACKING
2 
3 #define MAVLINK_MSG_ID_POINT_OF_INTEREST 191
4 
6 {
7  float x;
8  float y;
9  float z;
10  uint16_t timeout;
11  uint8_t type;
12  uint8_t color;
14  char name[26];
16 
17 #define MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN 43
18 #define MAVLINK_MSG_ID_191_LEN 43
19 
20 #define MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC 95
21 #define MAVLINK_MSG_ID_191_CRC 95
22 
23 #define MAVLINK_MSG_POINT_OF_INTEREST_FIELD_NAME_LEN 26
24 
25 #define MAVLINK_MESSAGE_INFO_POINT_OF_INTEREST { \
26  "POINT_OF_INTEREST", \
27  8, \
28  { { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_point_of_interest_t, x) }, \
29  { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_point_of_interest_t, y) }, \
30  { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_point_of_interest_t, z) }, \
31  { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_point_of_interest_t, timeout) }, \
32  { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_point_of_interest_t, type) }, \
33  { "color", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_point_of_interest_t, color) }, \
34  { "coordinate_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_point_of_interest_t, coordinate_system) }, \
35  { "name", NULL, MAVLINK_TYPE_CHAR, 26, 17, offsetof(mavlink_point_of_interest_t, name) }, \
36  } \
37 }
38 
39 
56 static inline uint16_t mavlink_msg_point_of_interest_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
57  uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char *name)
58 {
59 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
61  _mav_put_float(buf, 0, x);
62  _mav_put_float(buf, 4, y);
63  _mav_put_float(buf, 8, z);
64  _mav_put_uint16_t(buf, 12, timeout);
65  _mav_put_uint8_t(buf, 14, type);
66  _mav_put_uint8_t(buf, 15, color);
67  _mav_put_uint8_t(buf, 16, coordinate_system);
68  _mav_put_char_array(buf, 17, name, 26);
70 #else
72  packet.x = x;
73  packet.y = y;
74  packet.z = z;
75  packet.timeout = timeout;
76  packet.type = type;
77  packet.color = color;
78  packet.coordinate_system = coordinate_system;
79  mav_array_memcpy(packet.name, name, sizeof(char)*26);
81 #endif
82 
84 #if MAVLINK_CRC_EXTRA
86 #else
87  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
88 #endif
89 }
90 
107 static inline uint16_t mavlink_msg_point_of_interest_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
108  mavlink_message_t* msg,
109  uint8_t type,uint8_t color,uint8_t coordinate_system,uint16_t timeout,float x,float y,float z,const char *name)
110 {
111 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
113  _mav_put_float(buf, 0, x);
114  _mav_put_float(buf, 4, y);
115  _mav_put_float(buf, 8, z);
116  _mav_put_uint16_t(buf, 12, timeout);
117  _mav_put_uint8_t(buf, 14, type);
118  _mav_put_uint8_t(buf, 15, color);
119  _mav_put_uint8_t(buf, 16, coordinate_system);
120  _mav_put_char_array(buf, 17, name, 26);
122 #else
124  packet.x = x;
125  packet.y = y;
126  packet.z = z;
127  packet.timeout = timeout;
128  packet.type = type;
129  packet.color = color;
130  packet.coordinate_system = coordinate_system;
131  mav_array_memcpy(packet.name, name, sizeof(char)*26);
133 #endif
134 
136 #if MAVLINK_CRC_EXTRA
138 #else
139  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
140 #endif
141 }
142 
151 static inline uint16_t mavlink_msg_point_of_interest_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_point_of_interest_t* point_of_interest)
152 {
153  return mavlink_msg_point_of_interest_pack(system_id, component_id, msg, point_of_interest->type, point_of_interest->color, point_of_interest->coordinate_system, point_of_interest->timeout, point_of_interest->x, point_of_interest->y, point_of_interest->z, point_of_interest->name);
154 }
155 
165 static inline uint16_t mavlink_msg_point_of_interest_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_point_of_interest_t* point_of_interest)
166 {
167  return mavlink_msg_point_of_interest_pack_chan(system_id, component_id, chan, msg, point_of_interest->type, point_of_interest->color, point_of_interest->coordinate_system, point_of_interest->timeout, point_of_interest->x, point_of_interest->y, point_of_interest->z, point_of_interest->name);
168 }
169 
183 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
184 
185 static inline void mavlink_msg_point_of_interest_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char *name)
186 {
187 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
189  _mav_put_float(buf, 0, x);
190  _mav_put_float(buf, 4, y);
191  _mav_put_float(buf, 8, z);
192  _mav_put_uint16_t(buf, 12, timeout);
193  _mav_put_uint8_t(buf, 14, type);
194  _mav_put_uint8_t(buf, 15, color);
195  _mav_put_uint8_t(buf, 16, coordinate_system);
196  _mav_put_char_array(buf, 17, name, 26);
197 #if MAVLINK_CRC_EXTRA
199 #else
200  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
201 #endif
202 #else
204  packet.x = x;
205  packet.y = y;
206  packet.z = z;
207  packet.timeout = timeout;
208  packet.type = type;
209  packet.color = color;
210  packet.coordinate_system = coordinate_system;
211  mav_array_memcpy(packet.name, name, sizeof(char)*26);
212 #if MAVLINK_CRC_EXTRA
213  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)&packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC);
214 #else
215  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)&packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
216 #endif
217 #endif
218 }
219 
220 #if MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
221 /*
222  This varient of _send() can be used to save stack space by re-using
223  memory from the receive buffer. The caller provides a
224  mavlink_message_t which is the size of a full mavlink message. This
225  is usually the receive buffer for the channel, and allows a reply to an
226  incoming message with minimum stack space usage.
227  */
228 static inline void mavlink_msg_point_of_interest_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char *name)
229 {
230 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
231  char *buf = (char *)msgbuf;
232  _mav_put_float(buf, 0, x);
233  _mav_put_float(buf, 4, y);
234  _mav_put_float(buf, 8, z);
235  _mav_put_uint16_t(buf, 12, timeout);
236  _mav_put_uint8_t(buf, 14, type);
237  _mav_put_uint8_t(buf, 15, color);
238  _mav_put_uint8_t(buf, 16, coordinate_system);
239  _mav_put_char_array(buf, 17, name, 26);
240 #if MAVLINK_CRC_EXTRA
242 #else
243  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, buf, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
244 #endif
245 #else
247  packet->x = x;
248  packet->y = y;
249  packet->z = z;
250  packet->timeout = timeout;
251  packet->type = type;
252  packet->color = color;
253  packet->coordinate_system = coordinate_system;
254  mav_array_memcpy(packet->name, name, sizeof(char)*26);
255 #if MAVLINK_CRC_EXTRA
256  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN, MAVLINK_MSG_ID_POINT_OF_INTEREST_CRC);
257 #else
258  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POINT_OF_INTEREST, (const char *)packet, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
259 #endif
260 #endif
261 }
262 #endif
263 
264 #endif
265 
266 // MESSAGE POINT_OF_INTEREST UNPACKING
267 
268 
274 static inline uint8_t mavlink_msg_point_of_interest_get_type(const mavlink_message_t* msg)
275 {
276  return _MAV_RETURN_uint8_t(msg, 14);
277 }
278 
284 static inline uint8_t mavlink_msg_point_of_interest_get_color(const mavlink_message_t* msg)
285 {
286  return _MAV_RETURN_uint8_t(msg, 15);
287 }
288 
294 static inline uint8_t mavlink_msg_point_of_interest_get_coordinate_system(const mavlink_message_t* msg)
295 {
296  return _MAV_RETURN_uint8_t(msg, 16);
297 }
298 
304 static inline uint16_t mavlink_msg_point_of_interest_get_timeout(const mavlink_message_t* msg)
305 {
306  return _MAV_RETURN_uint16_t(msg, 12);
307 }
308 
314 static inline float mavlink_msg_point_of_interest_get_x(const mavlink_message_t* msg)
315 {
316  return _MAV_RETURN_float(msg, 0);
317 }
318 
324 static inline float mavlink_msg_point_of_interest_get_y(const mavlink_message_t* msg)
325 {
326  return _MAV_RETURN_float(msg, 4);
327 }
328 
334 static inline float mavlink_msg_point_of_interest_get_z(const mavlink_message_t* msg)
335 {
336  return _MAV_RETURN_float(msg, 8);
337 }
338 
344 static inline uint16_t mavlink_msg_point_of_interest_get_name(const mavlink_message_t* msg, char *name)
345 {
346  return _MAV_RETURN_char_array(msg, name, 26, 17);
347 }
348 
355 static inline void mavlink_msg_point_of_interest_decode(const mavlink_message_t* msg, mavlink_point_of_interest_t* point_of_interest)
356 {
357 #if MAVLINK_NEED_BYTE_SWAP
358  point_of_interest->x = mavlink_msg_point_of_interest_get_x(msg);
359  point_of_interest->y = mavlink_msg_point_of_interest_get_y(msg);
360  point_of_interest->z = mavlink_msg_point_of_interest_get_z(msg);
361  point_of_interest->timeout = mavlink_msg_point_of_interest_get_timeout(msg);
362  point_of_interest->type = mavlink_msg_point_of_interest_get_type(msg);
363  point_of_interest->color = mavlink_msg_point_of_interest_get_color(msg);
364  point_of_interest->coordinate_system = mavlink_msg_point_of_interest_get_coordinate_system(msg);
365  mavlink_msg_point_of_interest_get_name(msg, point_of_interest->name);
366 #else
367  memcpy(point_of_interest, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
368 #endif
369 }
#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 z
set the acc deadband for z-Axis, this ignores small accelerations
Definition: accelerometer.h:52
uint8_t color[LED_SPECIAL_COLOR_COUNT]
Definition: ledstrip.h:9
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139