4#define MAVLINK_MSG_ID_CURRENT_MODE 436
11} mavlink_current_mode_t;
13#define MAVLINK_MSG_ID_CURRENT_MODE_LEN 9
14#define MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN 9
15#define MAVLINK_MSG_ID_436_LEN 9
16#define MAVLINK_MSG_ID_436_MIN_LEN 9
18#define MAVLINK_MSG_ID_CURRENT_MODE_CRC 193
19#define MAVLINK_MSG_ID_436_CRC 193
23#if MAVLINK_COMMAND_24BIT
24#define MAVLINK_MESSAGE_INFO_CURRENT_MODE {
28 { { "standard_mode", NULL, MAVLINK_TYPE_UINT8_T, 0
, 8
, offsetof(mavlink_current_mode_t, standard_mode) },
29 { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_current_mode_t, custom_mode) },
30 { "intended_custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0
, 4
, offsetof(mavlink_current_mode_t, intended_custom_mode) },
32}
34#define MAVLINK_MESSAGE_INFO_CURRENT_MODE {
37 { { "standard_mode", NULL, MAVLINK_TYPE_UINT8_T, 0
, 8
, offsetof(mavlink_current_mode_t, standard_mode) },
38 { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_current_mode_t, custom_mode) },
39 { "intended_custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0
, 4
, offsetof(mavlink_current_mode_t, intended_custom_mode) },
41}
45
46
47
48
49
50
51
52
53
54
55static inline uint16_t mavlink_msg_current_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
56 uint8_t standard_mode, uint32_t custom_mode, uint32_t intended_custom_mode)
58#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
60 _mav_put_uint32_t(buf, 0, custom_mode);
61 _mav_put_uint32_t(buf, 4, intended_custom_mode);
62 _mav_put_uint8_t(buf, 8, standard_mode);
66 mavlink_current_mode_t packet;
67 packet.custom_mode = custom_mode;
68 packet.intended_custom_mode = intended_custom_mode;
69 packet.standard_mode = standard_mode;
71 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CURRENT_MODE_LEN);
79
80
81
82
83
84
85
86
87
88
89
90static inline uint16_t mavlink_msg_current_mode_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
91 uint8_t standard_mode, uint32_t custom_mode, uint32_t intended_custom_mode)
93#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 _mav_put_uint32_t(buf, 0, custom_mode);
96 _mav_put_uint32_t(buf, 4, intended_custom_mode);
97 _mav_put_uint8_t(buf, 8, standard_mode);
101 mavlink_current_mode_t packet;
102 packet.custom_mode = custom_mode;
103 packet.intended_custom_mode = intended_custom_mode;
104 packet.standard_mode = standard_mode;
106 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CURRENT_MODE_LEN);
111 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN, MAVLINK_MSG_ID_CURRENT_MODE_LEN, MAVLINK_MSG_ID_CURRENT_MODE_CRC);
118
119
120
121
122
123
124
125
126
127
128static inline uint16_t mavlink_msg_current_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
129 mavlink_message_t* msg,
130 uint8_t standard_mode,uint32_t custom_mode,uint32_t intended_custom_mode)
132#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
134 _mav_put_uint32_t(buf, 0, custom_mode);
135 _mav_put_uint32_t(buf, 4, intended_custom_mode);
136 _mav_put_uint8_t(buf, 8, standard_mode);
140 mavlink_current_mode_t packet;
141 packet.custom_mode = custom_mode;
142 packet.intended_custom_mode = intended_custom_mode;
143 packet.standard_mode = standard_mode;
145 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CURRENT_MODE_LEN);
153
154
155
156
157
158
159
160static inline uint16_t mavlink_msg_current_mode_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_current_mode_t* current_mode)
162 return mavlink_msg_current_mode_pack(system_id, component_id, msg, current_mode->standard_mode, current_mode->custom_mode, current_mode->intended_custom_mode);
166
167
168
169
170
171
172
173
174static inline uint16_t mavlink_msg_current_mode_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_current_mode_t* current_mode)
176 return mavlink_msg_current_mode_pack_chan(system_id, component_id, chan, msg, current_mode->standard_mode, current_mode->custom_mode, current_mode->intended_custom_mode);
180
181
182
183
184
185
186
187
188static inline uint16_t mavlink_msg_current_mode_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_current_mode_t* current_mode)
190 return mavlink_msg_current_mode_pack_status(system_id, component_id, _status, msg, current_mode->standard_mode, current_mode->custom_mode, current_mode->intended_custom_mode);
194
195
196
197
198
199
200
201#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
203static inline void mavlink_msg_current_mode_send(mavlink_channel_t chan, uint8_t standard_mode, uint32_t custom_mode, uint32_t intended_custom_mode)
205#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
206 char buf[MAVLINK_MSG_ID_CURRENT_MODE_LEN];
207 _mav_put_uint32_t(buf, 0, custom_mode);
208 _mav_put_uint32_t(buf, 4, intended_custom_mode);
209 _mav_put_uint8_t(buf, 8, standard_mode);
211 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CURRENT_MODE, buf, MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN, MAVLINK_MSG_ID_CURRENT_MODE_LEN, MAVLINK_MSG_ID_CURRENT_MODE_CRC);
213 mavlink_current_mode_t packet;
214 packet.custom_mode = custom_mode;
215 packet.intended_custom_mode = intended_custom_mode;
216 packet.standard_mode = standard_mode;
218 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CURRENT_MODE, (
const char *)&packet, MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN, MAVLINK_MSG_ID_CURRENT_MODE_LEN, MAVLINK_MSG_ID_CURRENT_MODE_CRC);
223
224
225
226
227static inline void mavlink_msg_current_mode_send_struct(mavlink_channel_t chan,
const mavlink_current_mode_t* current_mode)
229#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
230 mavlink_msg_current_mode_send(chan, current_mode->standard_mode, current_mode->custom_mode, current_mode->intended_custom_mode);
232 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CURRENT_MODE, (
const char *)current_mode, MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN, MAVLINK_MSG_ID_CURRENT_MODE_LEN, MAVLINK_MSG_ID_CURRENT_MODE_CRC);
236#if MAVLINK_MSG_ID_CURRENT_MODE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
238
239
240
241
242
243
244static inline void mavlink_msg_current_mode_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t standard_mode, uint32_t custom_mode, uint32_t intended_custom_mode)
246#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
247 char *buf = (
char *)msgbuf;
248 _mav_put_uint32_t(buf, 0, custom_mode);
249 _mav_put_uint32_t(buf, 4, intended_custom_mode);
250 _mav_put_uint8_t(buf, 8, standard_mode);
252 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CURRENT_MODE, buf, MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN, MAVLINK_MSG_ID_CURRENT_MODE_LEN, MAVLINK_MSG_ID_CURRENT_MODE_CRC);
254 mavlink_current_mode_t *packet = (mavlink_current_mode_t *)msgbuf;
255 packet->custom_mode = custom_mode;
256 packet->intended_custom_mode = intended_custom_mode;
257 packet->standard_mode = standard_mode;
259 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CURRENT_MODE, (
const char *)packet, MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN, MAVLINK_MSG_ID_CURRENT_MODE_LEN, MAVLINK_MSG_ID_CURRENT_MODE_CRC);
270
271
272
273
274static inline uint8_t mavlink_msg_current_mode_get_standard_mode(
const mavlink_message_t* msg)
276 return _MAV_RETURN_uint8_t(msg, 8);
280
281
282
283
284static inline uint32_t mavlink_msg_current_mode_get_custom_mode(
const mavlink_message_t* msg)
286 return _MAV_RETURN_uint32_t(msg, 0);
290
291
292
293
294static inline uint32_t mavlink_msg_current_mode_get_intended_custom_mode(
const mavlink_message_t* msg)
296 return _MAV_RETURN_uint32_t(msg, 4);
300
301
302
303
304
305static inline void mavlink_msg_current_mode_decode(
const mavlink_message_t* msg, mavlink_current_mode_t* current_mode)
307#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
308 current_mode->custom_mode = mavlink_msg_current_mode_get_custom_mode(msg);
309 current_mode->intended_custom_mode = mavlink_msg_current_mode_get_intended_custom_mode(msg);
310 current_mode->standard_mode = mavlink_msg_current_mode_get_standard_mode(msg);
312 uint8_t len = msg->len < MAVLINK_MSG_ID_CURRENT_MODE_LEN? msg->len : MAVLINK_MSG_ID_CURRENT_MODE_LEN;
313 memset(current_mode, 0, MAVLINK_MSG_ID_CURRENT_MODE_LEN);
314 memcpy(current_mode, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_CURRENT_MODE_CRC
Definition: mavlink_msg_current_mode.h:18
#define MAVLINK_MSG_ID_CURRENT_MODE_LEN
Definition: mavlink_msg_current_mode.h:13
#define MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN
Definition: mavlink_msg_current_mode.h:14
#define MAVLINK_MSG_ID_CURRENT_MODE
Definition: mavlink_msg_current_mode.h:4
Definition: mavlink_msg_current_mode.h:7
uint32_t intended_custom_mode
Definition: mavlink_msg_current_mode.h:9
uint32_t custom_mode
Definition: mavlink_msg_current_mode.h:8
uint8_t standard_mode
Definition: mavlink_msg_current_mode.h:10