NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_brief_feature.h
Go to the documentation of this file.
1 // MESSAGE BRIEF_FEATURE PACKING
2 
3 #define MAVLINK_MSG_ID_BRIEF_FEATURE 195
4 
6 {
7  float x;
8  float y;
9  float z;
10  float response;
11  uint16_t size;
12  uint16_t orientation;
14  uint8_t descriptor[32];
16 
17 #define MAVLINK_MSG_ID_BRIEF_FEATURE_LEN 53
18 #define MAVLINK_MSG_ID_195_LEN 53
19 
20 #define MAVLINK_MSG_ID_BRIEF_FEATURE_CRC 88
21 #define MAVLINK_MSG_ID_195_CRC 88
22 
23 #define MAVLINK_MSG_BRIEF_FEATURE_FIELD_DESCRIPTOR_LEN 32
24 
25 #define MAVLINK_MESSAGE_INFO_BRIEF_FEATURE { \
26  "BRIEF_FEATURE", \
27  8, \
28  { { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_brief_feature_t, x) }, \
29  { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_brief_feature_t, y) }, \
30  { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_brief_feature_t, z) }, \
31  { "response", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_brief_feature_t, response) }, \
32  { "size", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_brief_feature_t, size) }, \
33  { "orientation", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_brief_feature_t, orientation) }, \
34  { "orientation_assignment", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_brief_feature_t, orientation_assignment) }, \
35  { "descriptor", NULL, MAVLINK_TYPE_UINT8_T, 32, 21, offsetof(mavlink_brief_feature_t, descriptor) }, \
36  } \
37 }
38 
39 
56 static inline uint16_t mavlink_msg_brief_feature_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
57  float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t *descriptor, float response)
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_float(buf, 12, response);
65  _mav_put_uint16_t(buf, 16, size);
66  _mav_put_uint16_t(buf, 18, orientation);
67  _mav_put_uint8_t(buf, 20, orientation_assignment);
68  _mav_put_uint8_t_array(buf, 21, descriptor, 32);
70 #else
72  packet.x = x;
73  packet.y = y;
74  packet.z = z;
75  packet.response = response;
76  packet.size = size;
77  packet.orientation = orientation;
78  packet.orientation_assignment = orientation_assignment;
79  mav_array_memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
81 #endif
82 
83  msg->msgid = MAVLINK_MSG_ID_BRIEF_FEATURE;
84 #if MAVLINK_CRC_EXTRA
86 #else
87  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
88 #endif
89 }
90 
107 static inline uint16_t mavlink_msg_brief_feature_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
108  mavlink_message_t* msg,
109  float x,float y,float z,uint8_t orientation_assignment,uint16_t size,uint16_t orientation,const uint8_t *descriptor,float response)
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_float(buf, 12, response);
117  _mav_put_uint16_t(buf, 16, size);
118  _mav_put_uint16_t(buf, 18, orientation);
119  _mav_put_uint8_t(buf, 20, orientation_assignment);
120  _mav_put_uint8_t_array(buf, 21, descriptor, 32);
122 #else
124  packet.x = x;
125  packet.y = y;
126  packet.z = z;
127  packet.response = response;
128  packet.size = size;
129  packet.orientation = orientation;
130  packet.orientation_assignment = orientation_assignment;
131  mav_array_memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
133 #endif
134 
135  msg->msgid = MAVLINK_MSG_ID_BRIEF_FEATURE;
136 #if MAVLINK_CRC_EXTRA
138 #else
139  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
140 #endif
141 }
142 
151 static inline uint16_t mavlink_msg_brief_feature_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_brief_feature_t* brief_feature)
152 {
153  return mavlink_msg_brief_feature_pack(system_id, component_id, msg, brief_feature->x, brief_feature->y, brief_feature->z, brief_feature->orientation_assignment, brief_feature->size, brief_feature->orientation, brief_feature->descriptor, brief_feature->response);
154 }
155 
165 static inline uint16_t mavlink_msg_brief_feature_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_brief_feature_t* brief_feature)
166 {
167  return mavlink_msg_brief_feature_pack_chan(system_id, component_id, chan, msg, brief_feature->x, brief_feature->y, brief_feature->z, brief_feature->orientation_assignment, brief_feature->size, brief_feature->orientation, brief_feature->descriptor, brief_feature->response);
168 }
169 
183 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
184 
185 static inline void mavlink_msg_brief_feature_send(mavlink_channel_t chan, float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t *descriptor, float response)
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_float(buf, 12, response);
193  _mav_put_uint16_t(buf, 16, size);
194  _mav_put_uint16_t(buf, 18, orientation);
195  _mav_put_uint8_t(buf, 20, orientation_assignment);
196  _mav_put_uint8_t_array(buf, 21, descriptor, 32);
197 #if MAVLINK_CRC_EXTRA
199 #else
200  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, buf, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
201 #endif
202 #else
204  packet.x = x;
205  packet.y = y;
206  packet.z = z;
207  packet.response = response;
208  packet.size = size;
209  packet.orientation = orientation;
210  packet.orientation_assignment = orientation_assignment;
211  mav_array_memcpy(packet.descriptor, descriptor, sizeof(uint8_t)*32);
212 #if MAVLINK_CRC_EXTRA
213  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)&packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN, MAVLINK_MSG_ID_BRIEF_FEATURE_CRC);
214 #else
215  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)&packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
216 #endif
217 #endif
218 }
219 
220 #if MAVLINK_MSG_ID_BRIEF_FEATURE_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_brief_feature_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t *descriptor, float response)
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_float(buf, 12, response);
236  _mav_put_uint16_t(buf, 16, size);
237  _mav_put_uint16_t(buf, 18, orientation);
238  _mav_put_uint8_t(buf, 20, orientation_assignment);
239  _mav_put_uint8_t_array(buf, 21, descriptor, 32);
240 #if MAVLINK_CRC_EXTRA
242 #else
243  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, buf, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
244 #endif
245 #else
247  packet->x = x;
248  packet->y = y;
249  packet->z = z;
250  packet->response = response;
251  packet->size = size;
252  packet->orientation = orientation;
253  packet->orientation_assignment = orientation_assignment;
254  mav_array_memcpy(packet->descriptor, descriptor, sizeof(uint8_t)*32);
255 #if MAVLINK_CRC_EXTRA
256  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN, MAVLINK_MSG_ID_BRIEF_FEATURE_CRC);
257 #else
258  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BRIEF_FEATURE, (const char *)packet, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
259 #endif
260 #endif
261 }
262 #endif
263 
264 #endif
265 
266 // MESSAGE BRIEF_FEATURE UNPACKING
267 
268 
274 static inline float mavlink_msg_brief_feature_get_x(const mavlink_message_t* msg)
275 {
276  return _MAV_RETURN_float(msg, 0);
277 }
278 
284 static inline float mavlink_msg_brief_feature_get_y(const mavlink_message_t* msg)
285 {
286  return _MAV_RETURN_float(msg, 4);
287 }
288 
294 static inline float mavlink_msg_brief_feature_get_z(const mavlink_message_t* msg)
295 {
296  return _MAV_RETURN_float(msg, 8);
297 }
298 
304 static inline uint8_t mavlink_msg_brief_feature_get_orientation_assignment(const mavlink_message_t* msg)
305 {
306  return _MAV_RETURN_uint8_t(msg, 20);
307 }
308 
314 static inline uint16_t mavlink_msg_brief_feature_get_size(const mavlink_message_t* msg)
315 {
316  return _MAV_RETURN_uint16_t(msg, 16);
317 }
318 
324 static inline uint16_t mavlink_msg_brief_feature_get_orientation(const mavlink_message_t* msg)
325 {
326  return _MAV_RETURN_uint16_t(msg, 18);
327 }
328 
334 static inline uint16_t mavlink_msg_brief_feature_get_descriptor(const mavlink_message_t* msg, uint8_t *descriptor)
335 {
336  return _MAV_RETURN_uint8_t_array(msg, descriptor, 32, 21);
337 }
338 
344 static inline float mavlink_msg_brief_feature_get_response(const mavlink_message_t* msg)
345 {
346  return _MAV_RETURN_float(msg, 12);
347 }
348 
355 static inline void mavlink_msg_brief_feature_decode(const mavlink_message_t* msg, mavlink_brief_feature_t* brief_feature)
356 {
357 #if MAVLINK_NEED_BYTE_SWAP
358  brief_feature->x = mavlink_msg_brief_feature_get_x(msg);
359  brief_feature->y = mavlink_msg_brief_feature_get_y(msg);
360  brief_feature->z = mavlink_msg_brief_feature_get_z(msg);
361  brief_feature->response = mavlink_msg_brief_feature_get_response(msg);
362  brief_feature->size = mavlink_msg_brief_feature_get_size(msg);
363  brief_feature->orientation = mavlink_msg_brief_feature_get_orientation(msg);
364  brief_feature->orientation_assignment = mavlink_msg_brief_feature_get_orientation_assignment(msg);
365  mavlink_msg_brief_feature_get_descriptor(msg, brief_feature->descriptor);
366 #else
367  memcpy(brief_feature, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
368 #endif
369 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:145
#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
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139