RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_mag_cal_report.h
1#pragma once
2// MESSAGE MAG_CAL_REPORT PACKING
3
4#define MAVLINK_MSG_ID_MAG_CAL_REPORT 192
5
6MAVPACKED(
7typedef struct __mavlink_mag_cal_report_t {
8 float fitness; /*< RMS milligauss residuals*/
9 float ofs_x; /*< X offset*/
10 float ofs_y; /*< Y offset*/
11 float ofs_z; /*< Z offset*/
12 float diag_x; /*< X diagonal (matrix 11)*/
13 float diag_y; /*< Y diagonal (matrix 22)*/
14 float diag_z; /*< Z diagonal (matrix 33)*/
15 float offdiag_x; /*< X off-diagonal (matrix 12 and 21)*/
16 float offdiag_y; /*< Y off-diagonal (matrix 13 and 31)*/
17 float offdiag_z; /*< Z off-diagonal (matrix 32 and 23)*/
18 uint8_t compass_id; /*< Compass being calibrated*/
19 uint8_t cal_mask; /*< Bitmask of compasses being calibrated*/
20 uint8_t cal_status; /*< Status (see MAG_CAL_STATUS enum)*/
21 uint8_t autosaved; /*< 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters*/
22}) mavlink_mag_cal_report_t;
23
24#define MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN 44
25#define MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN 44
26#define MAVLINK_MSG_ID_192_LEN 44
27#define MAVLINK_MSG_ID_192_MIN_LEN 44
28
29#define MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC 36
30#define MAVLINK_MSG_ID_192_CRC 36
31
32
33
34#if MAVLINK_COMMAND_24BIT
35#define MAVLINK_MESSAGE_INFO_MAG_CAL_REPORT { \
36 192, \
37 "MAG_CAL_REPORT", \
38 14, \
39 { { "compass_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_mag_cal_report_t, compass_id) }, \
40 { "cal_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_mag_cal_report_t, cal_mask) }, \
41 { "cal_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_mag_cal_report_t, cal_status) }, \
42 { "autosaved", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_mag_cal_report_t, autosaved) }, \
43 { "fitness", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mag_cal_report_t, fitness) }, \
44 { "ofs_x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mag_cal_report_t, ofs_x) }, \
45 { "ofs_y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mag_cal_report_t, ofs_y) }, \
46 { "ofs_z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mag_cal_report_t, ofs_z) }, \
47 { "diag_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mag_cal_report_t, diag_x) }, \
48 { "diag_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mag_cal_report_t, diag_y) }, \
49 { "diag_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mag_cal_report_t, diag_z) }, \
50 { "offdiag_x", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_mag_cal_report_t, offdiag_x) }, \
51 { "offdiag_y", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_mag_cal_report_t, offdiag_y) }, \
52 { "offdiag_z", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_mag_cal_report_t, offdiag_z) }, \
53 } \
54}
55#else
56#define MAVLINK_MESSAGE_INFO_MAG_CAL_REPORT { \
57 "MAG_CAL_REPORT", \
58 14, \
59 { { "compass_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_mag_cal_report_t, compass_id) }, \
60 { "cal_mask", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_mag_cal_report_t, cal_mask) }, \
61 { "cal_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_mag_cal_report_t, cal_status) }, \
62 { "autosaved", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_mag_cal_report_t, autosaved) }, \
63 { "fitness", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mag_cal_report_t, fitness) }, \
64 { "ofs_x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mag_cal_report_t, ofs_x) }, \
65 { "ofs_y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mag_cal_report_t, ofs_y) }, \
66 { "ofs_z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mag_cal_report_t, ofs_z) }, \
67 { "diag_x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mag_cal_report_t, diag_x) }, \
68 { "diag_y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mag_cal_report_t, diag_y) }, \
69 { "diag_z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mag_cal_report_t, diag_z) }, \
70 { "offdiag_x", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_mag_cal_report_t, offdiag_x) }, \
71 { "offdiag_y", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_mag_cal_report_t, offdiag_y) }, \
72 { "offdiag_z", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_mag_cal_report_t, offdiag_z) }, \
73 } \
74}
75#endif
76
99static inline uint16_t mavlink_msg_mag_cal_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
100 uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t autosaved, float fitness, float ofs_x, float ofs_y, float ofs_z, float diag_x, float diag_y, float diag_z, float offdiag_x, float offdiag_y, float offdiag_z)
101{
102#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
103 char buf[MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN];
104 _mav_put_float(buf, 0, fitness);
105 _mav_put_float(buf, 4, ofs_x);
106 _mav_put_float(buf, 8, ofs_y);
107 _mav_put_float(buf, 12, ofs_z);
108 _mav_put_float(buf, 16, diag_x);
109 _mav_put_float(buf, 20, diag_y);
110 _mav_put_float(buf, 24, diag_z);
111 _mav_put_float(buf, 28, offdiag_x);
112 _mav_put_float(buf, 32, offdiag_y);
113 _mav_put_float(buf, 36, offdiag_z);
114 _mav_put_uint8_t(buf, 40, compass_id);
115 _mav_put_uint8_t(buf, 41, cal_mask);
116 _mav_put_uint8_t(buf, 42, cal_status);
117 _mav_put_uint8_t(buf, 43, autosaved);
118
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
120#else
121 mavlink_mag_cal_report_t packet;
122 packet.fitness = fitness;
123 packet.ofs_x = ofs_x;
124 packet.ofs_y = ofs_y;
125 packet.ofs_z = ofs_z;
126 packet.diag_x = diag_x;
127 packet.diag_y = diag_y;
128 packet.diag_z = diag_z;
129 packet.offdiag_x = offdiag_x;
130 packet.offdiag_y = offdiag_y;
131 packet.offdiag_z = offdiag_z;
132 packet.compass_id = compass_id;
133 packet.cal_mask = cal_mask;
134 packet.cal_status = cal_status;
135 packet.autosaved = autosaved;
136
137 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
138#endif
139
140 msg->msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT;
141 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
142}
143
166static inline uint16_t mavlink_msg_mag_cal_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
167 mavlink_message_t* msg,
168 uint8_t compass_id,uint8_t cal_mask,uint8_t cal_status,uint8_t autosaved,float fitness,float ofs_x,float ofs_y,float ofs_z,float diag_x,float diag_y,float diag_z,float offdiag_x,float offdiag_y,float offdiag_z)
169{
170#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171 char buf[MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN];
172 _mav_put_float(buf, 0, fitness);
173 _mav_put_float(buf, 4, ofs_x);
174 _mav_put_float(buf, 8, ofs_y);
175 _mav_put_float(buf, 12, ofs_z);
176 _mav_put_float(buf, 16, diag_x);
177 _mav_put_float(buf, 20, diag_y);
178 _mav_put_float(buf, 24, diag_z);
179 _mav_put_float(buf, 28, offdiag_x);
180 _mav_put_float(buf, 32, offdiag_y);
181 _mav_put_float(buf, 36, offdiag_z);
182 _mav_put_uint8_t(buf, 40, compass_id);
183 _mav_put_uint8_t(buf, 41, cal_mask);
184 _mav_put_uint8_t(buf, 42, cal_status);
185 _mav_put_uint8_t(buf, 43, autosaved);
186
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
188#else
189 mavlink_mag_cal_report_t packet;
190 packet.fitness = fitness;
191 packet.ofs_x = ofs_x;
192 packet.ofs_y = ofs_y;
193 packet.ofs_z = ofs_z;
194 packet.diag_x = diag_x;
195 packet.diag_y = diag_y;
196 packet.diag_z = diag_z;
197 packet.offdiag_x = offdiag_x;
198 packet.offdiag_y = offdiag_y;
199 packet.offdiag_z = offdiag_z;
200 packet.compass_id = compass_id;
201 packet.cal_mask = cal_mask;
202 packet.cal_status = cal_status;
203 packet.autosaved = autosaved;
204
205 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
206#endif
207
208 msg->msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT;
209 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
210}
211
220static inline uint16_t mavlink_msg_mag_cal_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mag_cal_report_t* mag_cal_report)
221{
222 return mavlink_msg_mag_cal_report_pack(system_id, component_id, msg, mag_cal_report->compass_id, mag_cal_report->cal_mask, mag_cal_report->cal_status, mag_cal_report->autosaved, mag_cal_report->fitness, mag_cal_report->ofs_x, mag_cal_report->ofs_y, mag_cal_report->ofs_z, mag_cal_report->diag_x, mag_cal_report->diag_y, mag_cal_report->diag_z, mag_cal_report->offdiag_x, mag_cal_report->offdiag_y, mag_cal_report->offdiag_z);
223}
224
234static inline uint16_t mavlink_msg_mag_cal_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mag_cal_report_t* mag_cal_report)
235{
236 return mavlink_msg_mag_cal_report_pack_chan(system_id, component_id, chan, msg, mag_cal_report->compass_id, mag_cal_report->cal_mask, mag_cal_report->cal_status, mag_cal_report->autosaved, mag_cal_report->fitness, mag_cal_report->ofs_x, mag_cal_report->ofs_y, mag_cal_report->ofs_z, mag_cal_report->diag_x, mag_cal_report->diag_y, mag_cal_report->diag_z, mag_cal_report->offdiag_x, mag_cal_report->offdiag_y, mag_cal_report->offdiag_z);
237}
238
258#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
259
260static inline void mavlink_msg_mag_cal_report_send(mavlink_channel_t chan, uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t autosaved, float fitness, float ofs_x, float ofs_y, float ofs_z, float diag_x, float diag_y, float diag_z, float offdiag_x, float offdiag_y, float offdiag_z)
261{
262#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
263 char buf[MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN];
264 _mav_put_float(buf, 0, fitness);
265 _mav_put_float(buf, 4, ofs_x);
266 _mav_put_float(buf, 8, ofs_y);
267 _mav_put_float(buf, 12, ofs_z);
268 _mav_put_float(buf, 16, diag_x);
269 _mav_put_float(buf, 20, diag_y);
270 _mav_put_float(buf, 24, diag_z);
271 _mav_put_float(buf, 28, offdiag_x);
272 _mav_put_float(buf, 32, offdiag_y);
273 _mav_put_float(buf, 36, offdiag_z);
274 _mav_put_uint8_t(buf, 40, compass_id);
275 _mav_put_uint8_t(buf, 41, cal_mask);
276 _mav_put_uint8_t(buf, 42, cal_status);
277 _mav_put_uint8_t(buf, 43, autosaved);
278
279 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, buf, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
280#else
281 mavlink_mag_cal_report_t packet;
282 packet.fitness = fitness;
283 packet.ofs_x = ofs_x;
284 packet.ofs_y = ofs_y;
285 packet.ofs_z = ofs_z;
286 packet.diag_x = diag_x;
287 packet.diag_y = diag_y;
288 packet.diag_z = diag_z;
289 packet.offdiag_x = offdiag_x;
290 packet.offdiag_y = offdiag_y;
291 packet.offdiag_z = offdiag_z;
292 packet.compass_id = compass_id;
293 packet.cal_mask = cal_mask;
294 packet.cal_status = cal_status;
295 packet.autosaved = autosaved;
296
297 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, (const char *)&packet, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
298#endif
299}
300
306static inline void mavlink_msg_mag_cal_report_send_struct(mavlink_channel_t chan, const mavlink_mag_cal_report_t* mag_cal_report)
307{
308#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
309 mavlink_msg_mag_cal_report_send(chan, mag_cal_report->compass_id, mag_cal_report->cal_mask, mag_cal_report->cal_status, mag_cal_report->autosaved, mag_cal_report->fitness, mag_cal_report->ofs_x, mag_cal_report->ofs_y, mag_cal_report->ofs_z, mag_cal_report->diag_x, mag_cal_report->diag_y, mag_cal_report->diag_z, mag_cal_report->offdiag_x, mag_cal_report->offdiag_y, mag_cal_report->offdiag_z);
310#else
311 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, (const char *)mag_cal_report, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
312#endif
313}
314
315#if MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
316/*
317 This varient of _send() can be used to save stack space by re-using
318 memory from the receive buffer. The caller provides a
319 mavlink_message_t which is the size of a full mavlink message. This
320 is usually the receive buffer for the channel, and allows a reply to an
321 incoming message with minimum stack space usage.
322 */
323static inline void mavlink_msg_mag_cal_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t compass_id, uint8_t cal_mask, uint8_t cal_status, uint8_t autosaved, float fitness, float ofs_x, float ofs_y, float ofs_z, float diag_x, float diag_y, float diag_z, float offdiag_x, float offdiag_y, float offdiag_z)
324{
325#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
326 char *buf = (char *)msgbuf;
327 _mav_put_float(buf, 0, fitness);
328 _mav_put_float(buf, 4, ofs_x);
329 _mav_put_float(buf, 8, ofs_y);
330 _mav_put_float(buf, 12, ofs_z);
331 _mav_put_float(buf, 16, diag_x);
332 _mav_put_float(buf, 20, diag_y);
333 _mav_put_float(buf, 24, diag_z);
334 _mav_put_float(buf, 28, offdiag_x);
335 _mav_put_float(buf, 32, offdiag_y);
336 _mav_put_float(buf, 36, offdiag_z);
337 _mav_put_uint8_t(buf, 40, compass_id);
338 _mav_put_uint8_t(buf, 41, cal_mask);
339 _mav_put_uint8_t(buf, 42, cal_status);
340 _mav_put_uint8_t(buf, 43, autosaved);
341
342 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, buf, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
343#else
344 mavlink_mag_cal_report_t *packet = (mavlink_mag_cal_report_t *)msgbuf;
345 packet->fitness = fitness;
346 packet->ofs_x = ofs_x;
347 packet->ofs_y = ofs_y;
348 packet->ofs_z = ofs_z;
349 packet->diag_x = diag_x;
350 packet->diag_y = diag_y;
351 packet->diag_z = diag_z;
352 packet->offdiag_x = offdiag_x;
353 packet->offdiag_y = offdiag_y;
354 packet->offdiag_z = offdiag_z;
355 packet->compass_id = compass_id;
356 packet->cal_mask = cal_mask;
357 packet->cal_status = cal_status;
358 packet->autosaved = autosaved;
359
360 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MAG_CAL_REPORT, (const char *)packet, MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN, MAVLINK_MSG_ID_MAG_CAL_REPORT_CRC);
361#endif
362}
363#endif
364
365#endif
366
367// MESSAGE MAG_CAL_REPORT UNPACKING
368
369
375static inline uint8_t mavlink_msg_mag_cal_report_get_compass_id(const mavlink_message_t* msg)
376{
377 return _MAV_RETURN_uint8_t(msg, 40);
378}
379
385static inline uint8_t mavlink_msg_mag_cal_report_get_cal_mask(const mavlink_message_t* msg)
386{
387 return _MAV_RETURN_uint8_t(msg, 41);
388}
389
395static inline uint8_t mavlink_msg_mag_cal_report_get_cal_status(const mavlink_message_t* msg)
396{
397 return _MAV_RETURN_uint8_t(msg, 42);
398}
399
405static inline uint8_t mavlink_msg_mag_cal_report_get_autosaved(const mavlink_message_t* msg)
406{
407 return _MAV_RETURN_uint8_t(msg, 43);
408}
409
415static inline float mavlink_msg_mag_cal_report_get_fitness(const mavlink_message_t* msg)
416{
417 return _MAV_RETURN_float(msg, 0);
418}
419
425static inline float mavlink_msg_mag_cal_report_get_ofs_x(const mavlink_message_t* msg)
426{
427 return _MAV_RETURN_float(msg, 4);
428}
429
435static inline float mavlink_msg_mag_cal_report_get_ofs_y(const mavlink_message_t* msg)
436{
437 return _MAV_RETURN_float(msg, 8);
438}
439
445static inline float mavlink_msg_mag_cal_report_get_ofs_z(const mavlink_message_t* msg)
446{
447 return _MAV_RETURN_float(msg, 12);
448}
449
455static inline float mavlink_msg_mag_cal_report_get_diag_x(const mavlink_message_t* msg)
456{
457 return _MAV_RETURN_float(msg, 16);
458}
459
465static inline float mavlink_msg_mag_cal_report_get_diag_y(const mavlink_message_t* msg)
466{
467 return _MAV_RETURN_float(msg, 20);
468}
469
475static inline float mavlink_msg_mag_cal_report_get_diag_z(const mavlink_message_t* msg)
476{
477 return _MAV_RETURN_float(msg, 24);
478}
479
485static inline float mavlink_msg_mag_cal_report_get_offdiag_x(const mavlink_message_t* msg)
486{
487 return _MAV_RETURN_float(msg, 28);
488}
489
495static inline float mavlink_msg_mag_cal_report_get_offdiag_y(const mavlink_message_t* msg)
496{
497 return _MAV_RETURN_float(msg, 32);
498}
499
505static inline float mavlink_msg_mag_cal_report_get_offdiag_z(const mavlink_message_t* msg)
506{
507 return _MAV_RETURN_float(msg, 36);
508}
509
516static inline void mavlink_msg_mag_cal_report_decode(const mavlink_message_t* msg, mavlink_mag_cal_report_t* mag_cal_report)
517{
518#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
519 mag_cal_report->fitness = mavlink_msg_mag_cal_report_get_fitness(msg);
520 mag_cal_report->ofs_x = mavlink_msg_mag_cal_report_get_ofs_x(msg);
521 mag_cal_report->ofs_y = mavlink_msg_mag_cal_report_get_ofs_y(msg);
522 mag_cal_report->ofs_z = mavlink_msg_mag_cal_report_get_ofs_z(msg);
523 mag_cal_report->diag_x = mavlink_msg_mag_cal_report_get_diag_x(msg);
524 mag_cal_report->diag_y = mavlink_msg_mag_cal_report_get_diag_y(msg);
525 mag_cal_report->diag_z = mavlink_msg_mag_cal_report_get_diag_z(msg);
526 mag_cal_report->offdiag_x = mavlink_msg_mag_cal_report_get_offdiag_x(msg);
527 mag_cal_report->offdiag_y = mavlink_msg_mag_cal_report_get_offdiag_y(msg);
528 mag_cal_report->offdiag_z = mavlink_msg_mag_cal_report_get_offdiag_z(msg);
529 mag_cal_report->compass_id = mavlink_msg_mag_cal_report_get_compass_id(msg);
530 mag_cal_report->cal_mask = mavlink_msg_mag_cal_report_get_cal_mask(msg);
531 mag_cal_report->cal_status = mavlink_msg_mag_cal_report_get_cal_status(msg);
532 mag_cal_report->autosaved = mavlink_msg_mag_cal_report_get_autosaved(msg);
533#else
534 uint8_t len = msg->len < MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN? msg->len : MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN;
535 memset(mag_cal_report, 0, MAVLINK_MSG_ID_MAG_CAL_REPORT_LEN);
536 memcpy(mag_cal_report, _MAV_PAYLOAD(msg), len);
537#endif
538}