mavlink_msg_rosflight_device_info.h
Go to the documentation of this file.
1 // MESSAGE ROSFLIGHT_DEVICE_INFO PACKING
2 
3 #define MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO 202
4 
6 {
7  uint8_t device; /*< */
8  uint8_t max_config; /*< */
9  uint8_t name[20]; /*< */
10  uint8_t num_devices; /*< */
12 
13 #define MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN 23
14 #define MAVLINK_MSG_ID_202_LEN 23
15 
16 #define MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_CRC 236
17 #define MAVLINK_MSG_ID_202_CRC 236
18 
19 #define MAVLINK_MSG_ROSFLIGHT_DEVICE_INFO_FIELD_NAME_LEN 20
20 
21 #define MAVLINK_MESSAGE_INFO_ROSFLIGHT_DEVICE_INFO { \
22  "ROSFLIGHT_DEVICE_INFO", \
23  4, \
24  { { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_rosflight_device_info_t, device) }, \
25  { "max_config", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_rosflight_device_info_t, max_config) }, \
26  { "name", NULL, MAVLINK_TYPE_UINT8_T, 20, 2, offsetof(mavlink_rosflight_device_info_t, name) }, \
27  { "num_devices", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_rosflight_device_info_t, num_devices) }, \
28  } \
29 }
30 
31 
44 static inline uint16_t mavlink_msg_rosflight_device_info_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
45  uint8_t device, uint8_t max_config, const uint8_t *name, uint8_t num_devices)
46 {
47 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
49  _mav_put_uint8_t(buf, 0, device);
50  _mav_put_uint8_t(buf, 1, max_config);
51  _mav_put_uint8_t(buf, 22, num_devices);
52  _mav_put_uint8_t_array(buf, 2, name, 20);
54 #else
56  packet.device = device;
57  packet.max_config = max_config;
58  packet.num_devices = num_devices;
59  mav_array_memcpy(packet.name, name, sizeof(uint8_t)*20);
61 #endif
62 
64 #if MAVLINK_CRC_EXTRA
66 #else
67  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN);
68 #endif
69 }
70 
83 static inline uint16_t mavlink_msg_rosflight_device_info_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
84  mavlink_message_t* msg,
85  uint8_t device,uint8_t max_config,const uint8_t *name,uint8_t num_devices)
86 {
87 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
89  _mav_put_uint8_t(buf, 0, device);
90  _mav_put_uint8_t(buf, 1, max_config);
91  _mav_put_uint8_t(buf, 22, num_devices);
92  _mav_put_uint8_t_array(buf, 2, name, 20);
94 #else
96  packet.device = device;
97  packet.max_config = max_config;
98  packet.num_devices = num_devices;
99  mav_array_memcpy(packet.name, name, sizeof(uint8_t)*20);
101 #endif
102 
104 #if MAVLINK_CRC_EXTRA
106 #else
107  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN);
108 #endif
109 }
110 
119 static inline uint16_t mavlink_msg_rosflight_device_info_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rosflight_device_info_t* rosflight_device_info)
120 {
121  return mavlink_msg_rosflight_device_info_pack(system_id, component_id, msg, rosflight_device_info->device, rosflight_device_info->max_config, rosflight_device_info->name, rosflight_device_info->num_devices);
122 }
123 
133 static inline uint16_t mavlink_msg_rosflight_device_info_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rosflight_device_info_t* rosflight_device_info)
134 {
135  return mavlink_msg_rosflight_device_info_pack_chan(system_id, component_id, chan, msg, rosflight_device_info->device, rosflight_device_info->max_config, rosflight_device_info->name, rosflight_device_info->num_devices);
136 }
137 
147 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
148 
149 static inline void mavlink_msg_rosflight_device_info_send(mavlink_channel_t chan, uint8_t device, uint8_t max_config, const uint8_t *name, uint8_t num_devices)
150 {
151 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
153  _mav_put_uint8_t(buf, 0, device);
154  _mav_put_uint8_t(buf, 1, max_config);
155  _mav_put_uint8_t(buf, 22, num_devices);
156  _mav_put_uint8_t_array(buf, 2, name, 20);
157 #if MAVLINK_CRC_EXTRA
159 #else
160  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO, buf, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN);
161 #endif
162 #else
164  packet.device = device;
165  packet.max_config = max_config;
166  packet.num_devices = num_devices;
167  mav_array_memcpy(packet.name, name, sizeof(uint8_t)*20);
168 #if MAVLINK_CRC_EXTRA
170 #else
171  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO, (const char *)&packet, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN);
172 #endif
173 #endif
174 }
175 
176 #if MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN <= MAVLINK_MAX_PAYLOAD_LEN
177 /*
178  This varient of _send() can be used to save stack space by re-using
179  memory from the receive buffer. The caller provides a
180  mavlink_message_t which is the size of a full mavlink message. This
181  is usually the receive buffer for the channel, and allows a reply to an
182  incoming message with minimum stack space usage.
183  */
184 static inline void mavlink_msg_rosflight_device_info_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t device, uint8_t max_config, const uint8_t *name, uint8_t num_devices)
185 {
186 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
187  char *buf = (char *)msgbuf;
188  _mav_put_uint8_t(buf, 0, device);
189  _mav_put_uint8_t(buf, 1, max_config);
190  _mav_put_uint8_t(buf, 22, num_devices);
191  _mav_put_uint8_t_array(buf, 2, name, 20);
192 #if MAVLINK_CRC_EXTRA
194 #else
195  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO, buf, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN);
196 #endif
197 #else
199  packet->device = device;
200  packet->max_config = max_config;
201  packet->num_devices = num_devices;
202  mav_array_memcpy(packet->name, name, sizeof(uint8_t)*20);
203 #if MAVLINK_CRC_EXTRA
205 #else
206  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO, (const char *)packet, MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN);
207 #endif
208 #endif
209 }
210 #endif
211 
212 #endif
213 
214 // MESSAGE ROSFLIGHT_DEVICE_INFO UNPACKING
215 
216 
222 static inline uint8_t mavlink_msg_rosflight_device_info_get_device(const mavlink_message_t* msg)
223 {
224  return _MAV_RETURN_uint8_t(msg, 0);
225 }
226 
232 static inline uint8_t mavlink_msg_rosflight_device_info_get_max_config(const mavlink_message_t* msg)
233 {
234  return _MAV_RETURN_uint8_t(msg, 1);
235 }
236 
242 static inline uint16_t mavlink_msg_rosflight_device_info_get_name(const mavlink_message_t* msg, uint8_t *name)
243 {
244  return _MAV_RETURN_uint8_t_array(msg, name, 20, 2);
245 }
246 
252 static inline uint8_t mavlink_msg_rosflight_device_info_get_num_devices(const mavlink_message_t* msg)
253 {
254  return _MAV_RETURN_uint8_t(msg, 22);
255 }
256 
263 static inline void mavlink_msg_rosflight_device_info_decode(const mavlink_message_t* msg, mavlink_rosflight_device_info_t* rosflight_device_info)
264 {
265 #if MAVLINK_NEED_BYTE_SWAP
266  rosflight_device_info->device = mavlink_msg_rosflight_device_info_get_device(msg);
267  rosflight_device_info->max_config = mavlink_msg_rosflight_device_info_get_max_config(msg);
268  mavlink_msg_rosflight_device_info_get_name(msg, rosflight_device_info->name);
270 #else
271  memcpy(rosflight_device_info, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ROSFLIGHT_DEVICE_INFO_LEN);
272 #endif
273 }
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:244
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:140
static void _mav_put_uint8_t_array(char *buf, uint8_t wire_offset, const uint8_t *b, uint8_t array_length)
Definition: protocol.h:197
static void mav_array_memcpy(void *dest, const void *src, size_t n)
Definition: protocol.h:176
static uint16_t _MAV_RETURN_uint8_t_array(const mavlink_message_t *msg, uint8_t *value, uint8_t array_length, uint8_t wire_offset)
Definition: protocol.h:295


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:47