NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_watchdog_process_info.h
Go to the documentation of this file.
1 // MESSAGE WATCHDOG_PROCESS_INFO PACKING
2 
3 #define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO 181
4 
6 {
7  int32_t timeout;
8  uint16_t watchdog_id;
9  uint16_t process_id;
10  char name[100];
11  char arguments[147];
13 
14 #define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN 255
15 #define MAVLINK_MSG_ID_181_LEN 255
16 
17 #define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_CRC 16
18 #define MAVLINK_MSG_ID_181_CRC 16
19 
20 #define MAVLINK_MSG_WATCHDOG_PROCESS_INFO_FIELD_NAME_LEN 100
21 #define MAVLINK_MSG_WATCHDOG_PROCESS_INFO_FIELD_ARGUMENTS_LEN 147
22 
23 #define MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_INFO { \
24  "WATCHDOG_PROCESS_INFO", \
25  5, \
26  { { "timeout", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_watchdog_process_info_t, timeout) }, \
27  { "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_watchdog_process_info_t, watchdog_id) }, \
28  { "process_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_watchdog_process_info_t, process_id) }, \
29  { "name", NULL, MAVLINK_TYPE_CHAR, 100, 8, offsetof(mavlink_watchdog_process_info_t, name) }, \
30  { "arguments", NULL, MAVLINK_TYPE_CHAR, 147, 108, offsetof(mavlink_watchdog_process_info_t, arguments) }, \
31  } \
32 }
33 
34 
48 static inline uint16_t mavlink_msg_watchdog_process_info_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
49  uint16_t watchdog_id, uint16_t process_id, const char *name, const char *arguments, int32_t timeout)
50 {
51 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
53  _mav_put_int32_t(buf, 0, timeout);
54  _mav_put_uint16_t(buf, 4, watchdog_id);
55  _mav_put_uint16_t(buf, 6, process_id);
56  _mav_put_char_array(buf, 8, name, 100);
57  _mav_put_char_array(buf, 108, arguments, 147);
59 #else
61  packet.timeout = timeout;
62  packet.watchdog_id = watchdog_id;
63  packet.process_id = process_id;
64  mav_array_memcpy(packet.name, name, sizeof(char)*100);
65  mav_array_memcpy(packet.arguments, arguments, sizeof(char)*147);
67 #endif
68 
70 #if MAVLINK_CRC_EXTRA
72 #else
73  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
74 #endif
75 }
76 
90 static inline uint16_t mavlink_msg_watchdog_process_info_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
91  mavlink_message_t* msg,
92  uint16_t watchdog_id,uint16_t process_id,const char *name,const char *arguments,int32_t timeout)
93 {
94 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
96  _mav_put_int32_t(buf, 0, timeout);
97  _mav_put_uint16_t(buf, 4, watchdog_id);
98  _mav_put_uint16_t(buf, 6, process_id);
99  _mav_put_char_array(buf, 8, name, 100);
100  _mav_put_char_array(buf, 108, arguments, 147);
102 #else
104  packet.timeout = timeout;
105  packet.watchdog_id = watchdog_id;
106  packet.process_id = process_id;
107  mav_array_memcpy(packet.name, name, sizeof(char)*100);
108  mav_array_memcpy(packet.arguments, arguments, sizeof(char)*147);
110 #endif
111 
113 #if MAVLINK_CRC_EXTRA
115 #else
116  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
117 #endif
118 }
119 
128 static inline uint16_t mavlink_msg_watchdog_process_info_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_process_info_t* watchdog_process_info)
129 {
130  return mavlink_msg_watchdog_process_info_pack(system_id, component_id, msg, watchdog_process_info->watchdog_id, watchdog_process_info->process_id, watchdog_process_info->name, watchdog_process_info->arguments, watchdog_process_info->timeout);
131 }
132 
142 static inline uint16_t mavlink_msg_watchdog_process_info_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_watchdog_process_info_t* watchdog_process_info)
143 {
144  return mavlink_msg_watchdog_process_info_pack_chan(system_id, component_id, chan, msg, watchdog_process_info->watchdog_id, watchdog_process_info->process_id, watchdog_process_info->name, watchdog_process_info->arguments, watchdog_process_info->timeout);
145 }
146 
157 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
158 
159 static inline void mavlink_msg_watchdog_process_info_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, const char *name, const char *arguments, int32_t timeout)
160 {
161 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
163  _mav_put_int32_t(buf, 0, timeout);
164  _mav_put_uint16_t(buf, 4, watchdog_id);
165  _mav_put_uint16_t(buf, 6, process_id);
166  _mav_put_char_array(buf, 8, name, 100);
167  _mav_put_char_array(buf, 108, arguments, 147);
168 #if MAVLINK_CRC_EXTRA
170 #else
171  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
172 #endif
173 #else
175  packet.timeout = timeout;
176  packet.watchdog_id = watchdog_id;
177  packet.process_id = process_id;
178  mav_array_memcpy(packet.name, name, sizeof(char)*100);
179  mav_array_memcpy(packet.arguments, arguments, sizeof(char)*147);
180 #if MAVLINK_CRC_EXTRA
182 #else
183  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
184 #endif
185 #endif
186 }
187 
188 #if MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN <= MAVLINK_MAX_PAYLOAD_LEN
189 /*
190  This varient of _send() can be used to save stack space by re-using
191  memory from the receive buffer. The caller provides a
192  mavlink_message_t which is the size of a full mavlink message. This
193  is usually the receive buffer for the channel, and allows a reply to an
194  incoming message with minimum stack space usage.
195  */
196 static inline void mavlink_msg_watchdog_process_info_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, const char *name, const char *arguments, int32_t timeout)
197 {
198 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
199  char *buf = (char *)msgbuf;
200  _mav_put_int32_t(buf, 0, timeout);
201  _mav_put_uint16_t(buf, 4, watchdog_id);
202  _mav_put_uint16_t(buf, 6, process_id);
203  _mav_put_char_array(buf, 8, name, 100);
204  _mav_put_char_array(buf, 108, arguments, 147);
205 #if MAVLINK_CRC_EXTRA
207 #else
208  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
209 #endif
210 #else
212  packet->timeout = timeout;
213  packet->watchdog_id = watchdog_id;
214  packet->process_id = process_id;
215  mav_array_memcpy(packet->name, name, sizeof(char)*100);
216  mav_array_memcpy(packet->arguments, arguments, sizeof(char)*147);
217 #if MAVLINK_CRC_EXTRA
219 #else
220  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
221 #endif
222 #endif
223 }
224 #endif
225 
226 #endif
227 
228 // MESSAGE WATCHDOG_PROCESS_INFO UNPACKING
229 
230 
236 static inline uint16_t mavlink_msg_watchdog_process_info_get_watchdog_id(const mavlink_message_t* msg)
237 {
238  return _MAV_RETURN_uint16_t(msg, 4);
239 }
240 
246 static inline uint16_t mavlink_msg_watchdog_process_info_get_process_id(const mavlink_message_t* msg)
247 {
248  return _MAV_RETURN_uint16_t(msg, 6);
249 }
250 
256 static inline uint16_t mavlink_msg_watchdog_process_info_get_name(const mavlink_message_t* msg, char *name)
257 {
258  return _MAV_RETURN_char_array(msg, name, 100, 8);
259 }
260 
266 static inline uint16_t mavlink_msg_watchdog_process_info_get_arguments(const mavlink_message_t* msg, char *arguments)
267 {
268  return _MAV_RETURN_char_array(msg, arguments, 147, 108);
269 }
270 
276 static inline int32_t mavlink_msg_watchdog_process_info_get_timeout(const mavlink_message_t* msg)
277 {
278  return _MAV_RETURN_int32_t(msg, 0);
279 }
280 
287 static inline void mavlink_msg_watchdog_process_info_decode(const mavlink_message_t* msg, mavlink_watchdog_process_info_t* watchdog_process_info)
288 {
289 #if MAVLINK_NEED_BYTE_SWAP
290  watchdog_process_info->timeout = mavlink_msg_watchdog_process_info_get_timeout(msg);
291  watchdog_process_info->watchdog_id = mavlink_msg_watchdog_process_info_get_watchdog_id(msg);
292  watchdog_process_info->process_id = mavlink_msg_watchdog_process_info_get_process_id(msg);
293  mavlink_msg_watchdog_process_info_get_name(msg, watchdog_process_info->name);
294  mavlink_msg_watchdog_process_info_get_arguments(msg, watchdog_process_info->arguments);
295 #else
296  memcpy(watchdog_process_info, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
297 #endif
298 }
#define _mav_put_int32_t(buf, wire_offset, b)
Definition: protocol.h:142
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139