mavlink_msg_rosflight_version.h
Go to the documentation of this file.
1 // MESSAGE ROSFLIGHT_VERSION PACKING
2 
3 #define MAVLINK_MSG_ID_ROSFLIGHT_VERSION 192
4 
6 {
7  char version[50]; /*< */
9 
10 #define MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN 50
11 #define MAVLINK_MSG_ID_192_LEN 50
12 
13 #define MAVLINK_MSG_ID_ROSFLIGHT_VERSION_CRC 134
14 #define MAVLINK_MSG_ID_192_CRC 134
15 
16 #define MAVLINK_MSG_ROSFLIGHT_VERSION_FIELD_VERSION_LEN 50
17 
18 #define MAVLINK_MESSAGE_INFO_ROSFLIGHT_VERSION { \
19  "ROSFLIGHT_VERSION", \
20  1, \
21  { { "version", NULL, MAVLINK_TYPE_CHAR, 50, 0, offsetof(mavlink_rosflight_version_t, version) }, \
22  } \
23 }
24 
25 
35 static inline uint16_t mavlink_msg_rosflight_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
36  const char *version)
37 {
38 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
40 
41  _mav_put_char_array(buf, 0, version, 50);
43 #else
45 
46  mav_array_memcpy(packet.version, version, sizeof(char)*50);
48 #endif
49 
51 #if MAVLINK_CRC_EXTRA
53 #else
54  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN);
55 #endif
56 }
57 
67 static inline uint16_t mavlink_msg_rosflight_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
68  mavlink_message_t* msg,
69  const char *version)
70 {
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
73 
74  _mav_put_char_array(buf, 0, version, 50);
76 #else
78 
79  mav_array_memcpy(packet.version, version, sizeof(char)*50);
81 #endif
82 
84 #if MAVLINK_CRC_EXTRA
86 #else
87  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN);
88 #endif
89 }
90 
99 static inline uint16_t mavlink_msg_rosflight_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rosflight_version_t* rosflight_version)
100 {
101  return mavlink_msg_rosflight_version_pack(system_id, component_id, msg, rosflight_version->version);
102 }
103 
113 static inline uint16_t mavlink_msg_rosflight_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rosflight_version_t* rosflight_version)
114 {
115  return mavlink_msg_rosflight_version_pack_chan(system_id, component_id, chan, msg, rosflight_version->version);
116 }
117 
124 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
125 
126 static inline void mavlink_msg_rosflight_version_send(mavlink_channel_t chan, const char *version)
127 {
128 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
130 
131  _mav_put_char_array(buf, 0, version, 50);
132 #if MAVLINK_CRC_EXTRA
134 #else
135  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_VERSION, buf, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN);
136 #endif
137 #else
139 
140  mav_array_memcpy(packet.version, version, sizeof(char)*50);
141 #if MAVLINK_CRC_EXTRA
142  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_VERSION, (const char *)&packet, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_CRC);
143 #else
144  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_VERSION, (const char *)&packet, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN);
145 #endif
146 #endif
147 }
148 
149 #if MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
150 /*
151  This varient of _send() can be used to save stack space by re-using
152  memory from the receive buffer. The caller provides a
153  mavlink_message_t which is the size of a full mavlink message. This
154  is usually the receive buffer for the channel, and allows a reply to an
155  incoming message with minimum stack space usage.
156  */
157 static inline void mavlink_msg_rosflight_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, const char *version)
158 {
159 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
160  char *buf = (char *)msgbuf;
161 
162  _mav_put_char_array(buf, 0, version, 50);
163 #if MAVLINK_CRC_EXTRA
165 #else
166  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_VERSION, buf, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN);
167 #endif
168 #else
170 
171  mav_array_memcpy(packet->version, version, sizeof(char)*50);
172 #if MAVLINK_CRC_EXTRA
173  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_VERSION, (const char *)packet, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_CRC);
174 #else
175  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_VERSION, (const char *)packet, MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN);
176 #endif
177 #endif
178 }
179 #endif
180 
181 #endif
182 
183 // MESSAGE ROSFLIGHT_VERSION UNPACKING
184 
185 
191 static inline uint16_t mavlink_msg_rosflight_version_get_version(const mavlink_message_t* msg, char *version)
192 {
193  return _MAV_RETURN_char_array(msg, version, 50, 0);
194 }
195 
202 static inline void mavlink_msg_rosflight_version_decode(const mavlink_message_t* msg, mavlink_rosflight_version_t* rosflight_version)
203 {
204 #if MAVLINK_NEED_BYTE_SWAP
205  mavlink_msg_rosflight_version_get_version(msg, rosflight_version->version);
206 #else
207  memcpy(rosflight_version, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ROSFLIGHT_VERSION_LEN);
208 #endif
209 }
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_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:25