NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_watchdog_process_status.h
Go to the documentation of this file.
1 // MESSAGE WATCHDOG_PROCESS_STATUS PACKING
2 
3 #define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS 182
4 
6 {
7  int32_t pid;
8  uint16_t watchdog_id;
9  uint16_t process_id;
10  uint16_t crashes;
11  uint8_t state;
12  uint8_t muted;
14 
15 #define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN 12
16 #define MAVLINK_MSG_ID_182_LEN 12
17 
18 #define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_CRC 29
19 #define MAVLINK_MSG_ID_182_CRC 29
20 
21 
22 
23 #define MAVLINK_MESSAGE_INFO_WATCHDOG_PROCESS_STATUS { \
24  "WATCHDOG_PROCESS_STATUS", \
25  6, \
26  { { "pid", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_watchdog_process_status_t, pid) }, \
27  { "watchdog_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_watchdog_process_status_t, watchdog_id) }, \
28  { "process_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_watchdog_process_status_t, process_id) }, \
29  { "crashes", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_watchdog_process_status_t, crashes) }, \
30  { "state", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_watchdog_process_status_t, state) }, \
31  { "muted", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_watchdog_process_status_t, muted) }, \
32  } \
33 }
34 
35 
50 static inline uint16_t mavlink_msg_watchdog_process_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
51  uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
52 {
53 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
55  _mav_put_int32_t(buf, 0, pid);
56  _mav_put_uint16_t(buf, 4, watchdog_id);
57  _mav_put_uint16_t(buf, 6, process_id);
58  _mav_put_uint16_t(buf, 8, crashes);
59  _mav_put_uint8_t(buf, 10, state);
60  _mav_put_uint8_t(buf, 11, muted);
61 
63 #else
65  packet.pid = pid;
66  packet.watchdog_id = watchdog_id;
67  packet.process_id = process_id;
68  packet.crashes = crashes;
69  packet.state = state;
70  packet.muted = muted;
71 
73 #endif
74 
76 #if MAVLINK_CRC_EXTRA
78 #else
79  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
80 #endif
81 }
82 
97 static inline uint16_t mavlink_msg_watchdog_process_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
98  mavlink_message_t* msg,
99  uint16_t watchdog_id,uint16_t process_id,uint8_t state,uint8_t muted,int32_t pid,uint16_t crashes)
100 {
101 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
103  _mav_put_int32_t(buf, 0, pid);
104  _mav_put_uint16_t(buf, 4, watchdog_id);
105  _mav_put_uint16_t(buf, 6, process_id);
106  _mav_put_uint16_t(buf, 8, crashes);
107  _mav_put_uint8_t(buf, 10, state);
108  _mav_put_uint8_t(buf, 11, muted);
109 
111 #else
113  packet.pid = pid;
114  packet.watchdog_id = watchdog_id;
115  packet.process_id = process_id;
116  packet.crashes = crashes;
117  packet.state = state;
118  packet.muted = muted;
119 
121 #endif
122 
124 #if MAVLINK_CRC_EXTRA
126 #else
127  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
128 #endif
129 }
130 
139 static inline uint16_t mavlink_msg_watchdog_process_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_watchdog_process_status_t* watchdog_process_status)
140 {
141  return mavlink_msg_watchdog_process_status_pack(system_id, component_id, msg, watchdog_process_status->watchdog_id, watchdog_process_status->process_id, watchdog_process_status->state, watchdog_process_status->muted, watchdog_process_status->pid, watchdog_process_status->crashes);
142 }
143 
153 static inline uint16_t mavlink_msg_watchdog_process_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_watchdog_process_status_t* watchdog_process_status)
154 {
155  return mavlink_msg_watchdog_process_status_pack_chan(system_id, component_id, chan, msg, watchdog_process_status->watchdog_id, watchdog_process_status->process_id, watchdog_process_status->state, watchdog_process_status->muted, watchdog_process_status->pid, watchdog_process_status->crashes);
156 }
157 
169 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
170 
171 static inline void mavlink_msg_watchdog_process_status_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
172 {
173 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
175  _mav_put_int32_t(buf, 0, pid);
176  _mav_put_uint16_t(buf, 4, watchdog_id);
177  _mav_put_uint16_t(buf, 6, process_id);
178  _mav_put_uint16_t(buf, 8, crashes);
179  _mav_put_uint8_t(buf, 10, state);
180  _mav_put_uint8_t(buf, 11, muted);
181 
182 #if MAVLINK_CRC_EXTRA
184 #else
185  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
186 #endif
187 #else
189  packet.pid = pid;
190  packet.watchdog_id = watchdog_id;
191  packet.process_id = process_id;
192  packet.crashes = crashes;
193  packet.state = state;
194  packet.muted = muted;
195 
196 #if MAVLINK_CRC_EXTRA
198 #else
199  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
200 #endif
201 #endif
202 }
203 
204 #if MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
205 /*
206  This varient of _send() can be used to save stack space by re-using
207  memory from the receive buffer. The caller provides a
208  mavlink_message_t which is the size of a full mavlink message. This
209  is usually the receive buffer for the channel, and allows a reply to an
210  incoming message with minimum stack space usage.
211  */
212 static inline void mavlink_msg_watchdog_process_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
213 {
214 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
215  char *buf = (char *)msgbuf;
216  _mav_put_int32_t(buf, 0, pid);
217  _mav_put_uint16_t(buf, 4, watchdog_id);
218  _mav_put_uint16_t(buf, 6, process_id);
219  _mav_put_uint16_t(buf, 8, crashes);
220  _mav_put_uint8_t(buf, 10, state);
221  _mav_put_uint8_t(buf, 11, muted);
222 
223 #if MAVLINK_CRC_EXTRA
225 #else
226  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, buf, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
227 #endif
228 #else
230  packet->pid = pid;
231  packet->watchdog_id = watchdog_id;
232  packet->process_id = process_id;
233  packet->crashes = crashes;
234  packet->state = state;
235  packet->muted = muted;
236 
237 #if MAVLINK_CRC_EXTRA
239 #else
240  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS, (const char *)packet, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
241 #endif
242 #endif
243 }
244 #endif
245 
246 #endif
247 
248 // MESSAGE WATCHDOG_PROCESS_STATUS UNPACKING
249 
250 
256 static inline uint16_t mavlink_msg_watchdog_process_status_get_watchdog_id(const mavlink_message_t* msg)
257 {
258  return _MAV_RETURN_uint16_t(msg, 4);
259 }
260 
266 static inline uint16_t mavlink_msg_watchdog_process_status_get_process_id(const mavlink_message_t* msg)
267 {
268  return _MAV_RETURN_uint16_t(msg, 6);
269 }
270 
276 static inline uint8_t mavlink_msg_watchdog_process_status_get_state(const mavlink_message_t* msg)
277 {
278  return _MAV_RETURN_uint8_t(msg, 10);
279 }
280 
286 static inline uint8_t mavlink_msg_watchdog_process_status_get_muted(const mavlink_message_t* msg)
287 {
288  return _MAV_RETURN_uint8_t(msg, 11);
289 }
290 
296 static inline int32_t mavlink_msg_watchdog_process_status_get_pid(const mavlink_message_t* msg)
297 {
298  return _MAV_RETURN_int32_t(msg, 0);
299 }
300 
306 static inline uint16_t mavlink_msg_watchdog_process_status_get_crashes(const mavlink_message_t* msg)
307 {
308  return _MAV_RETURN_uint16_t(msg, 8);
309 }
310 
317 static inline void mavlink_msg_watchdog_process_status_decode(const mavlink_message_t* msg, mavlink_watchdog_process_status_t* watchdog_process_status)
318 {
319 #if MAVLINK_NEED_BYTE_SWAP
320  watchdog_process_status->pid = mavlink_msg_watchdog_process_status_get_pid(msg);
321  watchdog_process_status->watchdog_id = mavlink_msg_watchdog_process_status_get_watchdog_id(msg);
322  watchdog_process_status->process_id = mavlink_msg_watchdog_process_status_get_process_id(msg);
323  watchdog_process_status->crashes = mavlink_msg_watchdog_process_status_get_crashes(msg);
324  watchdog_process_status->state = mavlink_msg_watchdog_process_status_get_state(msg);
325  watchdog_process_status->muted = mavlink_msg_watchdog_process_status_get_muted(msg);
326 #else
327  memcpy(watchdog_process_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
328 #endif
329 }
#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
#define _mav_put_int32_t(buf, wire_offset, b)
Definition: protocol.h:142
struct pid_config pid
Definition: config.h:92
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139