Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_open_drone_id_arm_status.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE OPEN_DRONE_ID_ARM_STATUS PACKING
3
4#define MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS 12918
5
6
8 uint8_t status; /*< Status level indicating if arming is allowed.*/
9 char error[50]; /*< Text error message, should be empty if status is good to arm. Fill with nulls in unused portion.*/
10} mavlink_open_drone_id_arm_status_t;
11
12#define MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN 51
13#define MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN 51
14#define MAVLINK_MSG_ID_12918_LEN 51
15#define MAVLINK_MSG_ID_12918_MIN_LEN 51
16
17#define MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_CRC 139
18#define MAVLINK_MSG_ID_12918_CRC 139
19
20#define MAVLINK_MSG_OPEN_DRONE_ID_ARM_STATUS_FIELD_ERROR_LEN 50
21
22#if MAVLINK_COMMAND_24BIT
23#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_ARM_STATUS {
24 12918,
25 "OPEN_DRONE_ID_ARM_STATUS",
26 2,
27 { { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_open_drone_id_arm_status_t, status) },
28 { "error", NULL, MAVLINK_TYPE_CHAR, 50, 1, offsetof(mavlink_open_drone_id_arm_status_t, error) },
29 } \
30}
31#else
32#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_ARM_STATUS {
33 "OPEN_DRONE_ID_ARM_STATUS",
34 2,
35 { { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_open_drone_id_arm_status_t, status) },
36 { "error", NULL, MAVLINK_TYPE_CHAR, 50, 1, offsetof(mavlink_open_drone_id_arm_status_t, error) },
37 } \
38}
39#endif
40
41/**
42 * @brief Pack a open_drone_id_arm_status message
43 * @param system_id ID of this system
44 * @param component_id ID of this component (e.g. 200 for IMU)
45 * @param msg The MAVLink message to compress the data into
46 *
47 * @param status Status level indicating if arming is allowed.
48 * @param error Text error message, should be empty if status is good to arm. Fill with nulls in unused portion.
49 * @return length of the message in bytes (excluding serial stream start sign)
50 */
51static inline uint16_t mavlink_msg_open_drone_id_arm_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
52 uint8_t status, const char *error)
53{
54#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
56 _mav_put_uint8_t(buf, 0, status);
57 _mav_put_char_array(buf, 1, error, 50);
58 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN);
59#else
60 mavlink_open_drone_id_arm_status_t packet;
61 packet.status = status;
62 mav_array_memcpy(packet.error, error, sizeof(char)*50);
63 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN);
64#endif
65
68}
69
70/**
71 * @brief Pack a open_drone_id_arm_status message
72 * @param system_id ID of this system
73 * @param component_id ID of this component (e.g. 200 for IMU)
74 * @param status MAVLink status structure
75 * @param msg The MAVLink message to compress the data into
76 *
77 * @param status Status level indicating if arming is allowed.
78 * @param error Text error message, should be empty if status is good to arm. Fill with nulls in unused portion.
79 * @return length of the message in bytes (excluding serial stream start sign)
80 */
81static inline uint16_t mavlink_msg_open_drone_id_arm_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
82 uint8_t status, const char *error)
83{
84#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
86 _mav_put_uint8_t(buf, 0, status);
87 _mav_put_char_array(buf, 1, error, 50);
88 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN);
89#else
90 mavlink_open_drone_id_arm_status_t packet;
91 packet.status = status;
92 mav_array_memcpy(packet.error, error, sizeof(char)*50);
93 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN);
94#endif
95
97#if MAVLINK_CRC_EXTRA
98 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_CRC);
99#else
100 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN);
101#endif
102}
103
104/**
105 * @brief Pack a open_drone_id_arm_status message on a channel
106 * @param system_id ID of this system
107 * @param component_id ID of this component (e.g. 200 for IMU)
108 * @param chan The MAVLink channel this message will be sent over
109 * @param msg The MAVLink message to compress the data into
110 * @param status Status level indicating if arming is allowed.
111 * @param error Text error message, should be empty if status is good to arm. Fill with nulls in unused portion.
112 * @return length of the message in bytes (excluding serial stream start sign)
113 */
114static inline uint16_t mavlink_msg_open_drone_id_arm_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
115 mavlink_message_t* msg,
116 uint8_t status,const char *error)
117{
118#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
120 _mav_put_uint8_t(buf, 0, status);
121 _mav_put_char_array(buf, 1, error, 50);
122 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN);
123#else
124 mavlink_open_drone_id_arm_status_t packet;
125 packet.status = status;
126 mav_array_memcpy(packet.error, error, sizeof(char)*50);
127 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN);
128#endif
129
132}
133
134/**
135 * @brief Encode a open_drone_id_arm_status struct
136 *
137 * @param system_id ID of this system
138 * @param component_id ID of this component (e.g. 200 for IMU)
139 * @param msg The MAVLink message to compress the data into
140 * @param open_drone_id_arm_status C-struct to read the message contents from
141 */
142static inline uint16_t mavlink_msg_open_drone_id_arm_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_open_drone_id_arm_status_t* open_drone_id_arm_status)
143{
144 return mavlink_msg_open_drone_id_arm_status_pack(system_id, component_id, msg, open_drone_id_arm_status->status, open_drone_id_arm_status->error);
145}
146
147/**
148 * @brief Encode a open_drone_id_arm_status struct on a channel
149 *
150 * @param system_id ID of this system
151 * @param component_id ID of this component (e.g. 200 for IMU)
152 * @param chan The MAVLink channel this message will be sent over
153 * @param msg The MAVLink message to compress the data into
154 * @param open_drone_id_arm_status C-struct to read the message contents from
155 */
156static inline uint16_t mavlink_msg_open_drone_id_arm_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_open_drone_id_arm_status_t* open_drone_id_arm_status)
157{
158 return mavlink_msg_open_drone_id_arm_status_pack_chan(system_id, component_id, chan, msg, open_drone_id_arm_status->status, open_drone_id_arm_status->error);
159}
160
161/**
162 * @brief Encode a open_drone_id_arm_status struct with provided status structure
163 *
164 * @param system_id ID of this system
165 * @param component_id ID of this component (e.g. 200 for IMU)
166 * @param status MAVLink status structure
167 * @param msg The MAVLink message to compress the data into
168 * @param open_drone_id_arm_status C-struct to read the message contents from
169 */
170static inline uint16_t mavlink_msg_open_drone_id_arm_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_open_drone_id_arm_status_t* open_drone_id_arm_status)
171{
172 return mavlink_msg_open_drone_id_arm_status_pack_status(system_id, component_id, _status, msg, open_drone_id_arm_status->status, open_drone_id_arm_status->error);
173}
174
175/**
176 * @brief Send a open_drone_id_arm_status message
177 * @param chan MAVLink channel to send the message
178 *
179 * @param status Status level indicating if arming is allowed.
180 * @param error Text error message, should be empty if status is good to arm. Fill with nulls in unused portion.
181 */
182#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
183
184static inline void mavlink_msg_open_drone_id_arm_status_send(mavlink_channel_t chan, uint8_t status, const char *error)
185{
186#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
187 char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN];
188 _mav_put_uint8_t(buf, 0, status);
189 _mav_put_char_array(buf, 1, error, 50);
190 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_CRC);
191#else
192 mavlink_open_drone_id_arm_status_t packet;
193 packet.status = status;
194 mav_array_memcpy(packet.error, error, sizeof(char)*50);
195 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS, (const char *)&packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_CRC);
196#endif
197}
198
199/**
200 * @brief Send a open_drone_id_arm_status message
201 * @param chan MAVLink channel to send the message
202 * @param struct The MAVLink struct to serialize
203 */
204static inline void mavlink_msg_open_drone_id_arm_status_send_struct(mavlink_channel_t chan, const mavlink_open_drone_id_arm_status_t* open_drone_id_arm_status)
205{
206#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
207 mavlink_msg_open_drone_id_arm_status_send(chan, open_drone_id_arm_status->status, open_drone_id_arm_status->error);
208#else
209 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS, (const char *)open_drone_id_arm_status, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_CRC);
210#endif
211}
212
213#if MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
214/*
215 This variant of _send() can be used to save stack space by reusing
216 memory from the receive buffer. The caller provides a
217 mavlink_message_t which is the size of a full mavlink message. This
218 is usually the receive buffer for the channel, and allows a reply to an
219 incoming message with minimum stack space usage.
220 */
221static inline void mavlink_msg_open_drone_id_arm_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t status, const char *error)
222{
223#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
224 char *buf = (char *)msgbuf;
225 _mav_put_uint8_t(buf, 0, status);
226 _mav_put_char_array(buf, 1, error, 50);
227 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_CRC);
228#else
229 mavlink_open_drone_id_arm_status_t *packet = (mavlink_open_drone_id_arm_status_t *)msgbuf;
230 packet->status = status;
231 mav_array_memcpy(packet->error, error, sizeof(char)*50);
232 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS, (const char *)packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_CRC);
233#endif
234}
235#endif
236
237#endif
238
239// MESSAGE OPEN_DRONE_ID_ARM_STATUS UNPACKING
240
241
242/**
243 * @brief Get field status from open_drone_id_arm_status message
244 *
245 * @return Status level indicating if arming is allowed.
246 */
247static inline uint8_t mavlink_msg_open_drone_id_arm_status_get_status(const mavlink_message_t* msg)
248{
249 return _MAV_RETURN_uint8_t(msg, 0);
250}
251
252/**
253 * @brief Get field error from open_drone_id_arm_status message
254 *
255 * @return Text error message, should be empty if status is good to arm. Fill with nulls in unused portion.
256 */
257static inline uint16_t mavlink_msg_open_drone_id_arm_status_get_error(const mavlink_message_t* msg, char *error)
258{
259 return _MAV_RETURN_char_array(msg, error, 50, 1);
260}
261
262/**
263 * @brief Decode a open_drone_id_arm_status message into a struct
264 *
265 * @param msg The message to decode
266 * @param open_drone_id_arm_status C-struct to decode the message contents into
267 */
268static inline void mavlink_msg_open_drone_id_arm_status_decode(const mavlink_message_t* msg, mavlink_open_drone_id_arm_status_t* open_drone_id_arm_status)
269{
270#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
271 open_drone_id_arm_status->status = mavlink_msg_open_drone_id_arm_status_get_status(msg);
272 mavlink_msg_open_drone_id_arm_status_get_error(msg, open_drone_id_arm_status->error);
273#else
274 uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN;
275 memset(open_drone_id_arm_status, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_LEN);
276 memcpy(open_drone_id_arm_status, _MAV_PAYLOAD(msg), len);
277#endif
278}