4#define MAVLINK_MSG_ID_FENCE_STATUS 162
13} mavlink_fence_status_t;
15#define MAVLINK_MSG_ID_FENCE_STATUS_LEN 9
16#define MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN 8
17#define MAVLINK_MSG_ID_162_LEN 9
18#define MAVLINK_MSG_ID_162_MIN_LEN 8
20#define MAVLINK_MSG_ID_FENCE_STATUS_CRC 189
21#define MAVLINK_MSG_ID_162_CRC 189
25#if MAVLINK_COMMAND_24BIT
26#define MAVLINK_MESSAGE_INFO_FENCE_STATUS {
30 { { "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0
, 6
, offsetof(mavlink_fence_status_t, breach_status) },
31 { "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0
, 4
, offsetof(mavlink_fence_status_t, breach_count) },
32 { "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0
, 7
, offsetof(mavlink_fence_status_t, breach_type) },
33 { "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_fence_status_t, breach_time) },
34 { "breach_mitigation", NULL, MAVLINK_TYPE_UINT8_T, 0
, 8
, offsetof(mavlink_fence_status_t, breach_mitigation) },
36}
38#define MAVLINK_MESSAGE_INFO_FENCE_STATUS {
41 { { "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0
, 6
, offsetof(mavlink_fence_status_t, breach_status) },
42 { "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0
, 4
, offsetof(mavlink_fence_status_t, breach_count) },
43 { "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0
, 7
, offsetof(mavlink_fence_status_t, breach_type) },
44 { "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_fence_status_t, breach_time) },
45 { "breach_mitigation", NULL, MAVLINK_TYPE_UINT8_T, 0
, 8
, offsetof(mavlink_fence_status_t, breach_mitigation) },
47}
51
52
53
54
55
56
57
58
59
60
61
62
63static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
64 uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time, uint8_t breach_mitigation)
66#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
68 _mav_put_uint32_t(buf, 0, breach_time);
69 _mav_put_uint16_t(buf, 4, breach_count);
70 _mav_put_uint8_t(buf, 6, breach_status);
71 _mav_put_uint8_t(buf, 7, breach_type);
72 _mav_put_uint8_t(buf, 8, breach_mitigation);
76 mavlink_fence_status_t packet;
77 packet.breach_time = breach_time;
78 packet.breach_count = breach_count;
79 packet.breach_status = breach_status;
80 packet.breach_type = breach_type;
81 packet.breach_mitigation = breach_mitigation;
83 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
91
92
93
94
95
96
97
98
99
100
101
102
103
104static inline uint16_t mavlink_msg_fence_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
105 uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time, uint8_t breach_mitigation)
107#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
109 _mav_put_uint32_t(buf, 0, breach_time);
110 _mav_put_uint16_t(buf, 4, breach_count);
111 _mav_put_uint8_t(buf, 6, breach_status);
112 _mav_put_uint8_t(buf, 7, breach_type);
113 _mav_put_uint8_t(buf, 8, breach_mitigation);
117 mavlink_fence_status_t packet;
118 packet.breach_time = breach_time;
119 packet.breach_count = breach_count;
120 packet.breach_status = breach_status;
121 packet.breach_type = breach_type;
122 packet.breach_mitigation = breach_mitigation;
124 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
129 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
136
137
138
139
140
141
142
143
144
145
146
147
148static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
149 mavlink_message_t* msg,
150 uint8_t breach_status,uint16_t breach_count,uint8_t breach_type,uint32_t breach_time,uint8_t breach_mitigation)
152#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
154 _mav_put_uint32_t(buf, 0, breach_time);
155 _mav_put_uint16_t(buf, 4, breach_count);
156 _mav_put_uint8_t(buf, 6, breach_status);
157 _mav_put_uint8_t(buf, 7, breach_type);
158 _mav_put_uint8_t(buf, 8, breach_mitigation);
162 mavlink_fence_status_t packet;
163 packet.breach_time = breach_time;
164 packet.breach_count = breach_count;
165 packet.breach_status = breach_status;
166 packet.breach_type = breach_type;
167 packet.breach_mitigation = breach_mitigation;
169 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
177
178
179
180
181
182
183
184static inline uint16_t mavlink_msg_fence_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_fence_status_t* fence_status)
186 return mavlink_msg_fence_status_pack(system_id, component_id, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time, fence_status->breach_mitigation);
190
191
192
193
194
195
196
197
198static inline uint16_t mavlink_msg_fence_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_fence_status_t* fence_status)
200 return mavlink_msg_fence_status_pack_chan(system_id, component_id, chan, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time, fence_status->breach_mitigation);
204
205
206
207
208
209
210
211
212static inline uint16_t mavlink_msg_fence_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_fence_status_t* fence_status)
214 return mavlink_msg_fence_status_pack_status(system_id, component_id, _status, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time, fence_status->breach_mitigation);
218
219
220
221
222
223
224
225
226
227#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
229static inline void mavlink_msg_fence_status_send(mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time, uint8_t breach_mitigation)
231#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
232 char buf[MAVLINK_MSG_ID_FENCE_STATUS_LEN];
233 _mav_put_uint32_t(buf, 0, breach_time);
234 _mav_put_uint16_t(buf, 4, breach_count);
235 _mav_put_uint8_t(buf, 6, breach_status);
236 _mav_put_uint8_t(buf, 7, breach_type);
237 _mav_put_uint8_t(buf, 8, breach_mitigation);
239 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
241 mavlink_fence_status_t packet;
242 packet.breach_time = breach_time;
243 packet.breach_count = breach_count;
244 packet.breach_status = breach_status;
245 packet.breach_type = breach_type;
246 packet.breach_mitigation = breach_mitigation;
248 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (
const char *)&packet, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
253
254
255
256
257static inline void mavlink_msg_fence_status_send_struct(mavlink_channel_t chan,
const mavlink_fence_status_t* fence_status)
259#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
260 mavlink_msg_fence_status_send(chan, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time, fence_status->breach_mitigation);
262 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (
const char *)fence_status, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
266#if MAVLINK_MSG_ID_FENCE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
268
269
270
271
272
273
274static inline void mavlink_msg_fence_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time, uint8_t breach_mitigation)
276#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
277 char *buf = (
char *)msgbuf;
278 _mav_put_uint32_t(buf, 0, breach_time);
279 _mav_put_uint16_t(buf, 4, breach_count);
280 _mav_put_uint8_t(buf, 6, breach_status);
281 _mav_put_uint8_t(buf, 7, breach_type);
282 _mav_put_uint8_t(buf, 8, breach_mitigation);
284 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
286 mavlink_fence_status_t *packet = (mavlink_fence_status_t *)msgbuf;
287 packet->breach_time = breach_time;
288 packet->breach_count = breach_count;
289 packet->breach_status = breach_status;
290 packet->breach_type = breach_type;
291 packet->breach_mitigation = breach_mitigation;
293 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (
const char *)packet, MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN, MAVLINK_MSG_ID_FENCE_STATUS_LEN, MAVLINK_MSG_ID_FENCE_STATUS_CRC);
304
305
306
307
308static inline uint8_t mavlink_msg_fence_status_get_breach_status(
const mavlink_message_t* msg)
310 return _MAV_RETURN_uint8_t(msg, 6);
314
315
316
317
318static inline uint16_t mavlink_msg_fence_status_get_breach_count(
const mavlink_message_t* msg)
320 return _MAV_RETURN_uint16_t(msg, 4);
324
325
326
327
328static inline uint8_t mavlink_msg_fence_status_get_breach_type(
const mavlink_message_t* msg)
330 return _MAV_RETURN_uint8_t(msg, 7);
334
335
336
337
338static inline uint32_t mavlink_msg_fence_status_get_breach_time(
const mavlink_message_t* msg)
340 return _MAV_RETURN_uint32_t(msg, 0);
344
345
346
347
348static inline uint8_t mavlink_msg_fence_status_get_breach_mitigation(
const mavlink_message_t* msg)
350 return _MAV_RETURN_uint8_t(msg, 8);
354
355
356
357
358
359static inline void mavlink_msg_fence_status_decode(
const mavlink_message_t* msg, mavlink_fence_status_t* fence_status)
361#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
362 fence_status->breach_time = mavlink_msg_fence_status_get_breach_time(msg);
363 fence_status->breach_count = mavlink_msg_fence_status_get_breach_count(msg);
364 fence_status->breach_status = mavlink_msg_fence_status_get_breach_status(msg);
365 fence_status->breach_type = mavlink_msg_fence_status_get_breach_type(msg);
366 fence_status->breach_mitigation = mavlink_msg_fence_status_get_breach_mitigation(msg);
368 uint8_t len = msg->len < MAVLINK_MSG_ID_FENCE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_FENCE_STATUS_LEN;
369 memset(fence_status, 0, MAVLINK_MSG_ID_FENCE_STATUS_LEN);
370 memcpy(fence_status, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_FENCE_STATUS_CRC
Definition: mavlink_msg_fence_status.h:20
#define MAVLINK_MSG_ID_FENCE_STATUS
Definition: mavlink_msg_fence_status.h:4
#define MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN
Definition: mavlink_msg_fence_status.h:16
#define MAVLINK_MSG_ID_FENCE_STATUS_LEN
Definition: mavlink_msg_fence_status.h:15
Definition: mavlink_msg_fence_status.h:7
uint8_t breach_status
Definition: mavlink_msg_fence_status.h:10
uint32_t breach_time
Definition: mavlink_msg_fence_status.h:8
uint8_t breach_mitigation
Definition: mavlink_msg_fence_status.h:12
uint16_t breach_count
Definition: mavlink_msg_fence_status.h:9
uint8_t breach_type
Definition: mavlink_msg_fence_status.h:11