RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_sensor_offsets.h
1#pragma once
2// MESSAGE SENSOR_OFFSETS PACKING
3
4#define MAVLINK_MSG_ID_SENSOR_OFFSETS 150
5
6MAVPACKED(
7typedef struct __mavlink_sensor_offsets_t {
8 float mag_declination; /*< magnetic declination (radians)*/
9 int32_t raw_press; /*< raw pressure from barometer*/
10 int32_t raw_temp; /*< raw temperature from barometer*/
11 float gyro_cal_x; /*< gyro X calibration*/
12 float gyro_cal_y; /*< gyro Y calibration*/
13 float gyro_cal_z; /*< gyro Z calibration*/
14 float accel_cal_x; /*< accel X calibration*/
15 float accel_cal_y; /*< accel Y calibration*/
16 float accel_cal_z; /*< accel Z calibration*/
17 int16_t mag_ofs_x; /*< magnetometer X offset*/
18 int16_t mag_ofs_y; /*< magnetometer Y offset*/
19 int16_t mag_ofs_z; /*< magnetometer Z offset*/
20}) mavlink_sensor_offsets_t;
21
22#define MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN 42
23#define MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN 42
24#define MAVLINK_MSG_ID_150_LEN 42
25#define MAVLINK_MSG_ID_150_MIN_LEN 42
26
27#define MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC 134
28#define MAVLINK_MSG_ID_150_CRC 134
29
30
31
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \
34 150, \
35 "SENSOR_OFFSETS", \
36 12, \
37 { { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \
38 { "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \
39 { "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \
40 { "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \
41 { "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_sensor_offsets_t, raw_press) }, \
42 { "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \
43 { "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \
44 { "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \
45 { "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \
46 { "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \
47 { "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \
48 { "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \
49 } \
50}
51#else
52#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \
53 "SENSOR_OFFSETS", \
54 12, \
55 { { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \
56 { "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \
57 { "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \
58 { "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \
59 { "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_sensor_offsets_t, raw_press) }, \
60 { "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \
61 { "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \
62 { "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \
63 { "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \
64 { "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \
65 { "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \
66 { "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \
67 } \
68}
69#endif
70
91static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
92 int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z)
93{
94#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
96 _mav_put_float(buf, 0, mag_declination);
97 _mav_put_int32_t(buf, 4, raw_press);
98 _mav_put_int32_t(buf, 8, raw_temp);
99 _mav_put_float(buf, 12, gyro_cal_x);
100 _mav_put_float(buf, 16, gyro_cal_y);
101 _mav_put_float(buf, 20, gyro_cal_z);
102 _mav_put_float(buf, 24, accel_cal_x);
103 _mav_put_float(buf, 28, accel_cal_y);
104 _mav_put_float(buf, 32, accel_cal_z);
105 _mav_put_int16_t(buf, 36, mag_ofs_x);
106 _mav_put_int16_t(buf, 38, mag_ofs_y);
107 _mav_put_int16_t(buf, 40, mag_ofs_z);
108
109 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
110#else
111 mavlink_sensor_offsets_t packet;
112 packet.mag_declination = mag_declination;
113 packet.raw_press = raw_press;
114 packet.raw_temp = raw_temp;
115 packet.gyro_cal_x = gyro_cal_x;
116 packet.gyro_cal_y = gyro_cal_y;
117 packet.gyro_cal_z = gyro_cal_z;
118 packet.accel_cal_x = accel_cal_x;
119 packet.accel_cal_y = accel_cal_y;
120 packet.accel_cal_z = accel_cal_z;
121 packet.mag_ofs_x = mag_ofs_x;
122 packet.mag_ofs_y = mag_ofs_y;
123 packet.mag_ofs_z = mag_ofs_z;
124
125 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
126#endif
127
128 msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
129 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
130}
131
152static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
153 mavlink_message_t* msg,
154 int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z,float mag_declination,int32_t raw_press,int32_t raw_temp,float gyro_cal_x,float gyro_cal_y,float gyro_cal_z,float accel_cal_x,float accel_cal_y,float accel_cal_z)
155{
156#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
157 char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
158 _mav_put_float(buf, 0, mag_declination);
159 _mav_put_int32_t(buf, 4, raw_press);
160 _mav_put_int32_t(buf, 8, raw_temp);
161 _mav_put_float(buf, 12, gyro_cal_x);
162 _mav_put_float(buf, 16, gyro_cal_y);
163 _mav_put_float(buf, 20, gyro_cal_z);
164 _mav_put_float(buf, 24, accel_cal_x);
165 _mav_put_float(buf, 28, accel_cal_y);
166 _mav_put_float(buf, 32, accel_cal_z);
167 _mav_put_int16_t(buf, 36, mag_ofs_x);
168 _mav_put_int16_t(buf, 38, mag_ofs_y);
169 _mav_put_int16_t(buf, 40, mag_ofs_z);
170
171 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
172#else
173 mavlink_sensor_offsets_t packet;
174 packet.mag_declination = mag_declination;
175 packet.raw_press = raw_press;
176 packet.raw_temp = raw_temp;
177 packet.gyro_cal_x = gyro_cal_x;
178 packet.gyro_cal_y = gyro_cal_y;
179 packet.gyro_cal_z = gyro_cal_z;
180 packet.accel_cal_x = accel_cal_x;
181 packet.accel_cal_y = accel_cal_y;
182 packet.accel_cal_z = accel_cal_z;
183 packet.mag_ofs_x = mag_ofs_x;
184 packet.mag_ofs_y = mag_ofs_y;
185 packet.mag_ofs_z = mag_ofs_z;
186
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
188#endif
189
190 msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
191 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
192}
193
202static inline uint16_t mavlink_msg_sensor_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sensor_offsets_t* sensor_offsets)
203{
204 return mavlink_msg_sensor_offsets_pack(system_id, component_id, msg, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
205}
206
216static inline uint16_t mavlink_msg_sensor_offsets_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sensor_offsets_t* sensor_offsets)
217{
218 return mavlink_msg_sensor_offsets_pack_chan(system_id, component_id, chan, msg, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
219}
220
238#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
239
240static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z)
241{
242#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 char buf[MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN];
244 _mav_put_float(buf, 0, mag_declination);
245 _mav_put_int32_t(buf, 4, raw_press);
246 _mav_put_int32_t(buf, 8, raw_temp);
247 _mav_put_float(buf, 12, gyro_cal_x);
248 _mav_put_float(buf, 16, gyro_cal_y);
249 _mav_put_float(buf, 20, gyro_cal_z);
250 _mav_put_float(buf, 24, accel_cal_x);
251 _mav_put_float(buf, 28, accel_cal_y);
252 _mav_put_float(buf, 32, accel_cal_z);
253 _mav_put_int16_t(buf, 36, mag_ofs_x);
254 _mav_put_int16_t(buf, 38, mag_ofs_y);
255 _mav_put_int16_t(buf, 40, mag_ofs_z);
256
257 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
258#else
259 mavlink_sensor_offsets_t packet;
260 packet.mag_declination = mag_declination;
261 packet.raw_press = raw_press;
262 packet.raw_temp = raw_temp;
263 packet.gyro_cal_x = gyro_cal_x;
264 packet.gyro_cal_y = gyro_cal_y;
265 packet.gyro_cal_z = gyro_cal_z;
266 packet.accel_cal_x = accel_cal_x;
267 packet.accel_cal_y = accel_cal_y;
268 packet.accel_cal_z = accel_cal_z;
269 packet.mag_ofs_x = mag_ofs_x;
270 packet.mag_ofs_y = mag_ofs_y;
271 packet.mag_ofs_z = mag_ofs_z;
272
273 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)&packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
274#endif
275}
276
282static inline void mavlink_msg_sensor_offsets_send_struct(mavlink_channel_t chan, const mavlink_sensor_offsets_t* sensor_offsets)
283{
284#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
285 mavlink_msg_sensor_offsets_send(chan, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z);
286#else
287 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)sensor_offsets, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
288#endif
289}
290
291#if MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
292/*
293 This varient of _send() can be used to save stack space by re-using
294 memory from the receive buffer. The caller provides a
295 mavlink_message_t which is the size of a full mavlink message. This
296 is usually the receive buffer for the channel, and allows a reply to an
297 incoming message with minimum stack space usage.
298 */
299static inline void mavlink_msg_sensor_offsets_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z)
300{
301#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
302 char *buf = (char *)msgbuf;
303 _mav_put_float(buf, 0, mag_declination);
304 _mav_put_int32_t(buf, 4, raw_press);
305 _mav_put_int32_t(buf, 8, raw_temp);
306 _mav_put_float(buf, 12, gyro_cal_x);
307 _mav_put_float(buf, 16, gyro_cal_y);
308 _mav_put_float(buf, 20, gyro_cal_z);
309 _mav_put_float(buf, 24, accel_cal_x);
310 _mav_put_float(buf, 28, accel_cal_y);
311 _mav_put_float(buf, 32, accel_cal_z);
312 _mav_put_int16_t(buf, 36, mag_ofs_x);
313 _mav_put_int16_t(buf, 38, mag_ofs_y);
314 _mav_put_int16_t(buf, 40, mag_ofs_z);
315
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
317#else
318 mavlink_sensor_offsets_t *packet = (mavlink_sensor_offsets_t *)msgbuf;
319 packet->mag_declination = mag_declination;
320 packet->raw_press = raw_press;
321 packet->raw_temp = raw_temp;
322 packet->gyro_cal_x = gyro_cal_x;
323 packet->gyro_cal_y = gyro_cal_y;
324 packet->gyro_cal_z = gyro_cal_z;
325 packet->accel_cal_x = accel_cal_x;
326 packet->accel_cal_y = accel_cal_y;
327 packet->accel_cal_z = accel_cal_z;
328 packet->mag_ofs_x = mag_ofs_x;
329 packet->mag_ofs_y = mag_ofs_y;
330 packet->mag_ofs_z = mag_ofs_z;
331
332 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)packet, MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN, MAVLINK_MSG_ID_SENSOR_OFFSETS_CRC);
333#endif
334}
335#endif
336
337#endif
338
339// MESSAGE SENSOR_OFFSETS UNPACKING
340
341
347static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_x(const mavlink_message_t* msg)
348{
349 return _MAV_RETURN_int16_t(msg, 36);
350}
351
357static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_y(const mavlink_message_t* msg)
358{
359 return _MAV_RETURN_int16_t(msg, 38);
360}
361
367static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_z(const mavlink_message_t* msg)
368{
369 return _MAV_RETURN_int16_t(msg, 40);
370}
371
377static inline float mavlink_msg_sensor_offsets_get_mag_declination(const mavlink_message_t* msg)
378{
379 return _MAV_RETURN_float(msg, 0);
380}
381
387static inline int32_t mavlink_msg_sensor_offsets_get_raw_press(const mavlink_message_t* msg)
388{
389 return _MAV_RETURN_int32_t(msg, 4);
390}
391
397static inline int32_t mavlink_msg_sensor_offsets_get_raw_temp(const mavlink_message_t* msg)
398{
399 return _MAV_RETURN_int32_t(msg, 8);
400}
401
407static inline float mavlink_msg_sensor_offsets_get_gyro_cal_x(const mavlink_message_t* msg)
408{
409 return _MAV_RETURN_float(msg, 12);
410}
411
417static inline float mavlink_msg_sensor_offsets_get_gyro_cal_y(const mavlink_message_t* msg)
418{
419 return _MAV_RETURN_float(msg, 16);
420}
421
427static inline float mavlink_msg_sensor_offsets_get_gyro_cal_z(const mavlink_message_t* msg)
428{
429 return _MAV_RETURN_float(msg, 20);
430}
431
437static inline float mavlink_msg_sensor_offsets_get_accel_cal_x(const mavlink_message_t* msg)
438{
439 return _MAV_RETURN_float(msg, 24);
440}
441
447static inline float mavlink_msg_sensor_offsets_get_accel_cal_y(const mavlink_message_t* msg)
448{
449 return _MAV_RETURN_float(msg, 28);
450}
451
457static inline float mavlink_msg_sensor_offsets_get_accel_cal_z(const mavlink_message_t* msg)
458{
459 return _MAV_RETURN_float(msg, 32);
460}
461
468static inline void mavlink_msg_sensor_offsets_decode(const mavlink_message_t* msg, mavlink_sensor_offsets_t* sensor_offsets)
469{
470#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
471 sensor_offsets->mag_declination = mavlink_msg_sensor_offsets_get_mag_declination(msg);
472 sensor_offsets->raw_press = mavlink_msg_sensor_offsets_get_raw_press(msg);
473 sensor_offsets->raw_temp = mavlink_msg_sensor_offsets_get_raw_temp(msg);
474 sensor_offsets->gyro_cal_x = mavlink_msg_sensor_offsets_get_gyro_cal_x(msg);
475 sensor_offsets->gyro_cal_y = mavlink_msg_sensor_offsets_get_gyro_cal_y(msg);
476 sensor_offsets->gyro_cal_z = mavlink_msg_sensor_offsets_get_gyro_cal_z(msg);
477 sensor_offsets->accel_cal_x = mavlink_msg_sensor_offsets_get_accel_cal_x(msg);
478 sensor_offsets->accel_cal_y = mavlink_msg_sensor_offsets_get_accel_cal_y(msg);
479 sensor_offsets->accel_cal_z = mavlink_msg_sensor_offsets_get_accel_cal_z(msg);
480 sensor_offsets->mag_ofs_x = mavlink_msg_sensor_offsets_get_mag_ofs_x(msg);
481 sensor_offsets->mag_ofs_y = mavlink_msg_sensor_offsets_get_mag_ofs_y(msg);
482 sensor_offsets->mag_ofs_z = mavlink_msg_sensor_offsets_get_mag_ofs_z(msg);
483#else
484 uint8_t len = msg->len < MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN? msg->len : MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN;
485 memset(sensor_offsets, 0, MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN);
486 memcpy(sensor_offsets, _MAV_PAYLOAD(msg), len);
487#endif
488}