mavlink_msg_debug_vect.h
Go to the documentation of this file.
1 // MESSAGE DEBUG_VECT PACKING
2 
3 #define MAVLINK_MSG_ID_DEBUG_VECT 250
4 
5 typedef struct __mavlink_debug_vect_t
6 {
7  uint64_t time_usec; /*< Timestamp*/
8  float x; /*< x*/
9  float y; /*< y*/
10  float z; /*< z*/
11  char name[10]; /*< Name*/
13 
14 #define MAVLINK_MSG_ID_DEBUG_VECT_LEN 30
15 #define MAVLINK_MSG_ID_250_LEN 30
16 
17 #define MAVLINK_MSG_ID_DEBUG_VECT_CRC 49
18 #define MAVLINK_MSG_ID_250_CRC 49
19 
20 #define MAVLINK_MSG_DEBUG_VECT_FIELD_NAME_LEN 10
21 
22 #define MAVLINK_MESSAGE_INFO_DEBUG_VECT { \
23  "DEBUG_VECT", \
24  5, \
25  { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_debug_vect_t, time_usec) }, \
26  { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_debug_vect_t, x) }, \
27  { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_debug_vect_t, y) }, \
28  { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_debug_vect_t, z) }, \
29  { "name", NULL, MAVLINK_TYPE_CHAR, 10, 20, offsetof(mavlink_debug_vect_t, name) }, \
30  } \
31 }
32 
33 
47 static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
48  const char *name, uint64_t time_usec, float x, float y, float z)
49 {
50 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
52  _mav_put_uint64_t(buf, 0, time_usec);
53  _mav_put_float(buf, 8, x);
54  _mav_put_float(buf, 12, y);
55  _mav_put_float(buf, 16, z);
56  _mav_put_char_array(buf, 20, name, 10);
58 #else
59  mavlink_debug_vect_t packet;
60  packet.time_usec = time_usec;
61  packet.x = x;
62  packet.y = y;
63  packet.z = z;
64  mav_array_memcpy(packet.name, name, sizeof(char)*10);
66 #endif
67 
68  msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
69 #if MAVLINK_CRC_EXTRA
71 #else
72  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
73 #endif
74 }
75 
89 static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
90  mavlink_message_t* msg,
91  const char *name,uint64_t time_usec,float x,float y,float z)
92 {
93 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95  _mav_put_uint64_t(buf, 0, time_usec);
96  _mav_put_float(buf, 8, x);
97  _mav_put_float(buf, 12, y);
98  _mav_put_float(buf, 16, z);
99  _mav_put_char_array(buf, 20, name, 10);
101 #else
102  mavlink_debug_vect_t packet;
103  packet.time_usec = time_usec;
104  packet.x = x;
105  packet.y = y;
106  packet.z = z;
107  mav_array_memcpy(packet.name, name, sizeof(char)*10);
109 #endif
110 
111  msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
112 #if MAVLINK_CRC_EXTRA
114 #else
115  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
116 #endif
117 }
118 
127 static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect)
128 {
129  return mavlink_msg_debug_vect_pack(system_id, component_id, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
130 }
131 
141 static inline uint16_t mavlink_msg_debug_vect_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_debug_vect_t* debug_vect)
142 {
143  return mavlink_msg_debug_vect_pack_chan(system_id, component_id, chan, msg, debug_vect->name, debug_vect->time_usec, debug_vect->x, debug_vect->y, debug_vect->z);
144 }
145 
156 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
157 
158 static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z)
159 {
160 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
162  _mav_put_uint64_t(buf, 0, time_usec);
163  _mav_put_float(buf, 8, x);
164  _mav_put_float(buf, 12, y);
165  _mav_put_float(buf, 16, z);
166  _mav_put_char_array(buf, 20, name, 10);
167 #if MAVLINK_CRC_EXTRA
168  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
169 #else
170  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
171 #endif
172 #else
173  mavlink_debug_vect_t packet;
174  packet.time_usec = time_usec;
175  packet.x = x;
176  packet.y = y;
177  packet.z = z;
178  mav_array_memcpy(packet.name, name, sizeof(char)*10);
179 #if MAVLINK_CRC_EXTRA
180  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
181 #else
182  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
183 #endif
184 #endif
185 }
186 
187 #if MAVLINK_MSG_ID_DEBUG_VECT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
188 /*
189  This varient of _send() can be used to save stack space by re-using
190  memory from the receive buffer. The caller provides a
191  mavlink_message_t which is the size of a full mavlink message. This
192  is usually the receive buffer for the channel, and allows a reply to an
193  incoming message with minimum stack space usage.
194  */
195 static inline void mavlink_msg_debug_vect_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z)
196 {
197 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
198  char *buf = (char *)msgbuf;
199  _mav_put_uint64_t(buf, 0, time_usec);
200  _mav_put_float(buf, 8, x);
201  _mav_put_float(buf, 12, y);
202  _mav_put_float(buf, 16, z);
203  _mav_put_char_array(buf, 20, name, 10);
204 #if MAVLINK_CRC_EXTRA
205  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
206 #else
207  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
208 #endif
209 #else
210  mavlink_debug_vect_t *packet = (mavlink_debug_vect_t *)msgbuf;
211  packet->time_usec = time_usec;
212  packet->x = x;
213  packet->y = y;
214  packet->z = z;
215  mav_array_memcpy(packet->name, name, sizeof(char)*10);
216 #if MAVLINK_CRC_EXTRA
217  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN, MAVLINK_MSG_ID_DEBUG_VECT_CRC);
218 #else
219  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)packet, MAVLINK_MSG_ID_DEBUG_VECT_LEN);
220 #endif
221 #endif
222 }
223 #endif
224 
225 #endif
226 
227 // MESSAGE DEBUG_VECT UNPACKING
228 
229 
235 static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* msg, char *name)
236 {
237  return _MAV_RETURN_char_array(msg, name, 10, 20);
238 }
239 
245 static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_message_t* msg)
246 {
247  return _MAV_RETURN_uint64_t(msg, 0);
248 }
249 
255 static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg)
256 {
257  return _MAV_RETURN_float(msg, 8);
258 }
259 
265 static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg)
266 {
267  return _MAV_RETURN_float(msg, 12);
268 }
269 
275 static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg)
276 {
277  return _MAV_RETURN_float(msg, 16);
278 }
279 
286 static inline void mavlink_msg_debug_vect_decode(const mavlink_message_t* msg, mavlink_debug_vect_t* debug_vect)
287 {
288 #if MAVLINK_NEED_BYTE_SWAP
290  debug_vect->x = mavlink_msg_debug_vect_get_x(msg);
291  debug_vect->y = mavlink_msg_debug_vect_get_y(msg);
292  debug_vect->z = mavlink_msg_debug_vect_get_z(msg);
293  mavlink_msg_debug_vect_get_name(msg, debug_vect->name);
294 #else
295  memcpy(debug_vect, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DEBUG_VECT_LEN);
296 #endif
297 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:151
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:149
static void mav_array_memcpy(void *dest, const void *src, size_t n)
Definition: protocol.h:176
static uint16_t _MAV_RETURN_char_array(const mavlink_message_t *msg, char *value, uint8_t array_length, uint8_t wire_offset)
Definition: protocol.h:288
static void _mav_put_char_array(char *buf, uint8_t wire_offset, const char *b, uint8_t array_length)
Definition: protocol.h:188


rosflight
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 20:00:12