4#define MAVLINK_MSG_ID_MAG_CAL_PROGRESS 191
7typedef struct __mavlink_mag_cal_progress_t {
15 uint8_t completion_pct;
16 uint8_t completion_mask[10];
17}) mavlink_mag_cal_progress_t;
19#define MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN 27
20#define MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN 27
21#define MAVLINK_MSG_ID_191_LEN 27
22#define MAVLINK_MSG_ID_191_MIN_LEN 27
24#define MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC 92
25#define MAVLINK_MSG_ID_191_CRC 92
27#define MAVLINK_MSG_MAG_CAL_PROGRESS_FIELD_COMPLETION_MASK_LEN 10
29#if MAVLINK_COMMAND_24BIT
30#define MAVLINK_MESSAGE_INFO_MAG_CAL_PROGRESS { \
34 { { "compass_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mag_cal_progress_t, compass_id) }, \
35 { "cal_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mag_cal_progress_t, cal_mask) }, \
36 { "cal_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mag_cal_progress_t, cal_status) }, \
37 { "attempt", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_mag_cal_progress_t, attempt) }, \
38 { "completion_pct", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_mag_cal_progress_t, completion_pct) }, \
39 { "completion_mask", NULL, MAVLINK_TYPE_UINT8_T, 10, 17, offsetof(mavlink_mag_cal_progress_t, completion_mask) }, \
40 { "direction_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mag_cal_progress_t, direction_x) }, \
41 { "direction_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mag_cal_progress_t, direction_y) }, \
42 { "direction_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mag_cal_progress_t, direction_z) }, \
46#define MAVLINK_MESSAGE_INFO_MAG_CAL_PROGRESS { \
49 { { "compass_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mag_cal_progress_t, compass_id) }, \
50 { "cal_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mag_cal_progress_t, cal_mask) }, \
51 { "cal_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mag_cal_progress_t, cal_status) }, \
52 { "attempt", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_mag_cal_progress_t, attempt) }, \
53 { "completion_pct", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_mag_cal_progress_t, completion_pct) }, \
54 { "completion_mask", NULL, MAVLINK_TYPE_UINT8_T, 10, 17, offsetof(mavlink_mag_cal_progress_t, completion_mask) }, \
55 { "direction_x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mag_cal_progress_t, direction_x) }, \
56 { "direction_y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mag_cal_progress_t, direction_y) }, \
57 { "direction_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mag_cal_progress_t, direction_z) }, \
79static inline uint16_t mavlink_msg_mag_cal_progress_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t attempt, uint8_t completion_pct,
const uint8_t *completion_mask,
float direction_x,
float direction_y,
float direction_z)
82#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
83 char buf[MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN];
84 _mav_put_float(buf, 0, direction_x);
85 _mav_put_float(buf, 4, direction_y);
86 _mav_put_float(buf, 8, direction_z);
87 _mav_put_uint8_t(buf, 12, compass_id);
88 _mav_put_uint8_t(buf, 13, cal_mask);
89 _mav_put_uint8_t(buf, 14, cal_status);
90 _mav_put_uint8_t(buf, 15, attempt);
91 _mav_put_uint8_t(buf, 16, completion_pct);
92 _mav_put_uint8_t_array(buf, 17, completion_mask, 10);
93 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
95 mavlink_mag_cal_progress_t packet;
96 packet.direction_x = direction_x;
97 packet.direction_y = direction_y;
98 packet.direction_z = direction_z;
99 packet.compass_id = compass_id;
100 packet.cal_mask = cal_mask;
101 packet.cal_status = cal_status;
102 packet.attempt = attempt;
103 packet.completion_pct = completion_pct;
104 mav_array_memcpy(packet.completion_mask, completion_mask,
sizeof(uint8_t)*10);
105 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
108 msg->msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS;
109 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
129static inline uint16_t mavlink_msg_mag_cal_progress_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
130 mavlink_message_t* msg,
131 uint8_t compass_id,uint8_t cal_mask,uint8_t cal_status,uint8_t attempt,uint8_t completion_pct,
const uint8_t *completion_mask,
float direction_x,
float direction_y,
float direction_z)
133#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
134 char buf[MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN];
135 _mav_put_float(buf, 0, direction_x);
136 _mav_put_float(buf, 4, direction_y);
137 _mav_put_float(buf, 8, direction_z);
138 _mav_put_uint8_t(buf, 12, compass_id);
139 _mav_put_uint8_t(buf, 13, cal_mask);
140 _mav_put_uint8_t(buf, 14, cal_status);
141 _mav_put_uint8_t(buf, 15, attempt);
142 _mav_put_uint8_t(buf, 16, completion_pct);
143 _mav_put_uint8_t_array(buf, 17, completion_mask, 10);
144 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
146 mavlink_mag_cal_progress_t packet;
147 packet.direction_x = direction_x;
148 packet.direction_y = direction_y;
149 packet.direction_z = direction_z;
150 packet.compass_id = compass_id;
151 packet.cal_mask = cal_mask;
152 packet.cal_status = cal_status;
153 packet.attempt = attempt;
154 packet.completion_pct = completion_pct;
155 mav_array_memcpy(packet.completion_mask, completion_mask,
sizeof(uint8_t)*10);
156 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
159 msg->msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS;
160 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
171static inline uint16_t mavlink_msg_mag_cal_progress_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_mag_cal_progress_t* mag_cal_progress)
173 return mavlink_msg_mag_cal_progress_pack(system_id, component_id, msg, mag_cal_progress->compass_id, mag_cal_progress->cal_mask, mag_cal_progress->cal_status, mag_cal_progress->attempt, mag_cal_progress->completion_pct, mag_cal_progress->completion_mask, mag_cal_progress->direction_x, mag_cal_progress->direction_y, mag_cal_progress->direction_z);
185static inline uint16_t mavlink_msg_mag_cal_progress_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_mag_cal_progress_t* mag_cal_progress)
187 return mavlink_msg_mag_cal_progress_pack_chan(system_id, component_id, chan, msg, mag_cal_progress->compass_id, mag_cal_progress->cal_mask, mag_cal_progress->cal_status, mag_cal_progress->attempt, mag_cal_progress->completion_pct, mag_cal_progress->completion_mask, mag_cal_progress->direction_x, mag_cal_progress->direction_y, mag_cal_progress->direction_z);
204#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
206static inline void mavlink_msg_mag_cal_progress_send(mavlink_channel_t chan, uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t attempt, uint8_t completion_pct,
const uint8_t *completion_mask,
float direction_x,
float direction_y,
float direction_z)
208#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
209 char buf[MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN];
210 _mav_put_float(buf, 0, direction_x);
211 _mav_put_float(buf, 4, direction_y);
212 _mav_put_float(buf, 8, direction_z);
213 _mav_put_uint8_t(buf, 12, compass_id);
214 _mav_put_uint8_t(buf, 13, cal_mask);
215 _mav_put_uint8_t(buf, 14, cal_status);
216 _mav_put_uint8_t(buf, 15, attempt);
217 _mav_put_uint8_t(buf, 16, completion_pct);
218 _mav_put_uint8_t_array(buf, 17, completion_mask, 10);
219 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, buf, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
221 mavlink_mag_cal_progress_t packet;
222 packet.direction_x = direction_x;
223 packet.direction_y = direction_y;
224 packet.direction_z = direction_z;
225 packet.compass_id = compass_id;
226 packet.cal_mask = cal_mask;
227 packet.cal_status = cal_status;
228 packet.attempt = attempt;
229 packet.completion_pct = completion_pct;
230 mav_array_memcpy(packet.completion_mask, completion_mask,
sizeof(uint8_t)*10);
231 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, (
const char *)&packet, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
240static inline void mavlink_msg_mag_cal_progress_send_struct(mavlink_channel_t chan,
const mavlink_mag_cal_progress_t* mag_cal_progress)
242#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 mavlink_msg_mag_cal_progress_send(chan, mag_cal_progress->compass_id, mag_cal_progress->cal_mask, mag_cal_progress->cal_status, mag_cal_progress->attempt, mag_cal_progress->completion_pct, mag_cal_progress->completion_mask, mag_cal_progress->direction_x, mag_cal_progress->direction_y, mag_cal_progress->direction_z);
245 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, (
const char *)mag_cal_progress, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
249#if MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
257static inline void mavlink_msg_mag_cal_progress_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t attempt, uint8_t completion_pct,
const uint8_t *completion_mask,
float direction_x,
float direction_y,
float direction_z)
259#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
260 char *buf = (
char *)msgbuf;
261 _mav_put_float(buf, 0, direction_x);
262 _mav_put_float(buf, 4, direction_y);
263 _mav_put_float(buf, 8, direction_z);
264 _mav_put_uint8_t(buf, 12, compass_id);
265 _mav_put_uint8_t(buf, 13, cal_mask);
266 _mav_put_uint8_t(buf, 14, cal_status);
267 _mav_put_uint8_t(buf, 15, attempt);
268 _mav_put_uint8_t(buf, 16, completion_pct);
269 _mav_put_uint8_t_array(buf, 17, completion_mask, 10);
270 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, buf, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
272 mavlink_mag_cal_progress_t *packet = (mavlink_mag_cal_progress_t *)msgbuf;
273 packet->direction_x = direction_x;
274 packet->direction_y = direction_y;
275 packet->direction_z = direction_z;
276 packet->compass_id = compass_id;
277 packet->cal_mask = cal_mask;
278 packet->cal_status = cal_status;
279 packet->attempt = attempt;
280 packet->completion_pct = completion_pct;
281 mav_array_memcpy(packet->completion_mask, completion_mask,
sizeof(uint8_t)*10);
282 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_PROGRESS, (
const char *)packet, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_CRC);
297static inline uint8_t mavlink_msg_mag_cal_progress_get_compass_id(
const mavlink_message_t* msg)
299 return _MAV_RETURN_uint8_t(msg, 12);
307static inline uint8_t mavlink_msg_mag_cal_progress_get_cal_mask(
const mavlink_message_t* msg)
309 return _MAV_RETURN_uint8_t(msg, 13);
317static inline uint8_t mavlink_msg_mag_cal_progress_get_cal_status(
const mavlink_message_t* msg)
319 return _MAV_RETURN_uint8_t(msg, 14);
327static inline uint8_t mavlink_msg_mag_cal_progress_get_attempt(
const mavlink_message_t* msg)
329 return _MAV_RETURN_uint8_t(msg, 15);
337static inline uint8_t mavlink_msg_mag_cal_progress_get_completion_pct(
const mavlink_message_t* msg)
339 return _MAV_RETURN_uint8_t(msg, 16);
347static inline uint16_t mavlink_msg_mag_cal_progress_get_completion_mask(
const mavlink_message_t* msg, uint8_t *completion_mask)
349 return _MAV_RETURN_uint8_t_array(msg, completion_mask, 10, 17);
357static inline float mavlink_msg_mag_cal_progress_get_direction_x(
const mavlink_message_t* msg)
359 return _MAV_RETURN_float(msg, 0);
367static inline float mavlink_msg_mag_cal_progress_get_direction_y(
const mavlink_message_t* msg)
369 return _MAV_RETURN_float(msg, 4);
377static inline float mavlink_msg_mag_cal_progress_get_direction_z(
const mavlink_message_t* msg)
379 return _MAV_RETURN_float(msg, 8);
388static inline void mavlink_msg_mag_cal_progress_decode(
const mavlink_message_t* msg, mavlink_mag_cal_progress_t* mag_cal_progress)
390#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
391 mag_cal_progress->direction_x = mavlink_msg_mag_cal_progress_get_direction_x(msg);
392 mag_cal_progress->direction_y = mavlink_msg_mag_cal_progress_get_direction_y(msg);
393 mag_cal_progress->direction_z = mavlink_msg_mag_cal_progress_get_direction_z(msg);
394 mag_cal_progress->compass_id = mavlink_msg_mag_cal_progress_get_compass_id(msg);
395 mag_cal_progress->cal_mask = mavlink_msg_mag_cal_progress_get_cal_mask(msg);
396 mag_cal_progress->cal_status = mavlink_msg_mag_cal_progress_get_cal_status(msg);
397 mag_cal_progress->attempt = mavlink_msg_mag_cal_progress_get_attempt(msg);
398 mag_cal_progress->completion_pct = mavlink_msg_mag_cal_progress_get_completion_pct(msg);
399 mavlink_msg_mag_cal_progress_get_completion_mask(msg, mag_cal_progress->completion_mask);
401 uint8_t len = msg->len < MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN? msg->len : MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN;
402 memset(mag_cal_progress, 0, MAVLINK_MSG_ID_MAG_CAL_PROGRESS_LEN);
403 memcpy(mag_cal_progress, _MAV_PAYLOAD(msg), len);