Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_cellular_config.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE CELLULAR_CONFIG PACKING
3
4#define MAVLINK_MSG_ID_CELLULAR_CONFIG 336
5
6
8 uint8_t enable_lte; /*< Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.*/
9 uint8_t enable_pin; /*< Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.*/
10 char pin[16]; /*< PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.*/
11 char new_pin[16]; /*< New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.*/
12 char apn[32]; /*< Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.*/
13 char puk[16]; /*< Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.*/
14 uint8_t roaming; /*< Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.*/
15 uint8_t response; /*< Message acceptance response (sent back to GS).*/
16} mavlink_cellular_config_t;
17
18#define MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN 84
19#define MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN 84
20#define MAVLINK_MSG_ID_336_LEN 84
21#define MAVLINK_MSG_ID_336_MIN_LEN 84
22
23#define MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC 245
24#define MAVLINK_MSG_ID_336_CRC 245
25
26#define MAVLINK_MSG_CELLULAR_CONFIG_FIELD_PIN_LEN 16
27#define MAVLINK_MSG_CELLULAR_CONFIG_FIELD_NEW_PIN_LEN 16
28#define MAVLINK_MSG_CELLULAR_CONFIG_FIELD_APN_LEN 32
29#define MAVLINK_MSG_CELLULAR_CONFIG_FIELD_PUK_LEN 16
30
31#if MAVLINK_COMMAND_24BIT
32#define MAVLINK_MESSAGE_INFO_CELLULAR_CONFIG {
33 336,
34 "CELLULAR_CONFIG",
35 8,
36 { { "enable_lte", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_cellular_config_t, enable_lte) },
37 { "enable_pin", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_cellular_config_t, enable_pin) },
38 { "pin", NULL, MAVLINK_TYPE_CHAR, 16, 2, offsetof(mavlink_cellular_config_t, pin) },
39 { "new_pin", NULL, MAVLINK_TYPE_CHAR, 16, 18, offsetof(mavlink_cellular_config_t, new_pin) },
40 { "apn", NULL, MAVLINK_TYPE_CHAR, 32, 34, offsetof(mavlink_cellular_config_t, apn) },
41 { "puk", NULL, MAVLINK_TYPE_CHAR, 16, 66, offsetof(mavlink_cellular_config_t, puk) },
42 { "roaming", NULL, MAVLINK_TYPE_UINT8_T, 0, 82, offsetof(mavlink_cellular_config_t, roaming) },
43 { "response", NULL, MAVLINK_TYPE_UINT8_T, 0, 83, offsetof(mavlink_cellular_config_t, response) },
44 } \
45}
46#else
47#define MAVLINK_MESSAGE_INFO_CELLULAR_CONFIG {
48 "CELLULAR_CONFIG",
49 8,
50 { { "enable_lte", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_cellular_config_t, enable_lte) },
51 { "enable_pin", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_cellular_config_t, enable_pin) },
52 { "pin", NULL, MAVLINK_TYPE_CHAR, 16, 2, offsetof(mavlink_cellular_config_t, pin) },
53 { "new_pin", NULL, MAVLINK_TYPE_CHAR, 16, 18, offsetof(mavlink_cellular_config_t, new_pin) },
54 { "apn", NULL, MAVLINK_TYPE_CHAR, 32, 34, offsetof(mavlink_cellular_config_t, apn) },
55 { "puk", NULL, MAVLINK_TYPE_CHAR, 16, 66, offsetof(mavlink_cellular_config_t, puk) },
56 { "roaming", NULL, MAVLINK_TYPE_UINT8_T, 0, 82, offsetof(mavlink_cellular_config_t, roaming) },
57 { "response", NULL, MAVLINK_TYPE_UINT8_T, 0, 83, offsetof(mavlink_cellular_config_t, response) },
58 } \
59}
60#endif
61
62/**
63 * @brief Pack a cellular_config message
64 * @param system_id ID of this system
65 * @param component_id ID of this component (e.g. 200 for IMU)
66 * @param msg The MAVLink message to compress the data into
67 *
68 * @param enable_lte Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
69 * @param enable_pin Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
70 * @param pin PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
71 * @param new_pin New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
72 * @param apn Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
73 * @param puk Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.
74 * @param roaming Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
75 * @param response Message acceptance response (sent back to GS).
76 * @return length of the message in bytes (excluding serial stream start sign)
77 */
78static inline uint16_t mavlink_msg_cellular_config_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
79 uint8_t enable_lte, uint8_t enable_pin, const char *pin, const char *new_pin, const char *apn, const char *puk, uint8_t roaming, uint8_t response)
80{
81#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
83 _mav_put_uint8_t(buf, 0, enable_lte);
84 _mav_put_uint8_t(buf, 1, enable_pin);
85 _mav_put_uint8_t(buf, 82, roaming);
86 _mav_put_uint8_t(buf, 83, response);
87 _mav_put_char_array(buf, 2, pin, 16);
88 _mav_put_char_array(buf, 18, new_pin, 16);
89 _mav_put_char_array(buf, 34, apn, 32);
90 _mav_put_char_array(buf, 66, puk, 16);
91 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
92#else
93 mavlink_cellular_config_t packet;
94 packet.enable_lte = enable_lte;
95 packet.enable_pin = enable_pin;
96 packet.roaming = roaming;
97 packet.response = response;
98 mav_array_memcpy(packet.pin, pin, sizeof(char)*16);
99 mav_array_memcpy(packet.new_pin, new_pin, sizeof(char)*16);
100 mav_array_memcpy(packet.apn, apn, sizeof(char)*32);
101 mav_array_memcpy(packet.puk, puk, sizeof(char)*16);
102 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
103#endif
104
106 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC);
107}
108
109/**
110 * @brief Pack a cellular_config message
111 * @param system_id ID of this system
112 * @param component_id ID of this component (e.g. 200 for IMU)
113 * @param status MAVLink status structure
114 * @param msg The MAVLink message to compress the data into
115 *
116 * @param enable_lte Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
117 * @param enable_pin Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
118 * @param pin PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
119 * @param new_pin New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
120 * @param apn Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
121 * @param puk Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.
122 * @param roaming Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
123 * @param response Message acceptance response (sent back to GS).
124 * @return length of the message in bytes (excluding serial stream start sign)
125 */
126static inline uint16_t mavlink_msg_cellular_config_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
127 uint8_t enable_lte, uint8_t enable_pin, const char *pin, const char *new_pin, const char *apn, const char *puk, uint8_t roaming, uint8_t response)
128{
129#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
131 _mav_put_uint8_t(buf, 0, enable_lte);
132 _mav_put_uint8_t(buf, 1, enable_pin);
133 _mav_put_uint8_t(buf, 82, roaming);
134 _mav_put_uint8_t(buf, 83, response);
135 _mav_put_char_array(buf, 2, pin, 16);
136 _mav_put_char_array(buf, 18, new_pin, 16);
137 _mav_put_char_array(buf, 34, apn, 32);
138 _mav_put_char_array(buf, 66, puk, 16);
139 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
140#else
141 mavlink_cellular_config_t packet;
142 packet.enable_lte = enable_lte;
143 packet.enable_pin = enable_pin;
144 packet.roaming = roaming;
145 packet.response = response;
146 mav_array_memcpy(packet.pin, pin, sizeof(char)*16);
147 mav_array_memcpy(packet.new_pin, new_pin, sizeof(char)*16);
148 mav_array_memcpy(packet.apn, apn, sizeof(char)*32);
149 mav_array_memcpy(packet.puk, puk, sizeof(char)*16);
150 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
151#endif
152
154#if MAVLINK_CRC_EXTRA
155 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC);
156#else
157 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
158#endif
159}
160
161/**
162 * @brief Pack a cellular_config message on a channel
163 * @param system_id ID of this system
164 * @param component_id ID of this component (e.g. 200 for IMU)
165 * @param chan The MAVLink channel this message will be sent over
166 * @param msg The MAVLink message to compress the data into
167 * @param enable_lte Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
168 * @param enable_pin Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
169 * @param pin PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
170 * @param new_pin New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
171 * @param apn Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
172 * @param puk Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.
173 * @param roaming Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
174 * @param response Message acceptance response (sent back to GS).
175 * @return length of the message in bytes (excluding serial stream start sign)
176 */
177static inline uint16_t mavlink_msg_cellular_config_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
178 mavlink_message_t* msg,
179 uint8_t enable_lte,uint8_t enable_pin,const char *pin,const char *new_pin,const char *apn,const char *puk,uint8_t roaming,uint8_t response)
180{
181#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
183 _mav_put_uint8_t(buf, 0, enable_lte);
184 _mav_put_uint8_t(buf, 1, enable_pin);
185 _mav_put_uint8_t(buf, 82, roaming);
186 _mav_put_uint8_t(buf, 83, response);
187 _mav_put_char_array(buf, 2, pin, 16);
188 _mav_put_char_array(buf, 18, new_pin, 16);
189 _mav_put_char_array(buf, 34, apn, 32);
190 _mav_put_char_array(buf, 66, puk, 16);
191 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
192#else
193 mavlink_cellular_config_t packet;
194 packet.enable_lte = enable_lte;
195 packet.enable_pin = enable_pin;
196 packet.roaming = roaming;
197 packet.response = response;
198 mav_array_memcpy(packet.pin, pin, sizeof(char)*16);
199 mav_array_memcpy(packet.new_pin, new_pin, sizeof(char)*16);
200 mav_array_memcpy(packet.apn, apn, sizeof(char)*32);
201 mav_array_memcpy(packet.puk, puk, sizeof(char)*16);
202 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
203#endif
204
206 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC);
207}
208
209/**
210 * @brief Encode a cellular_config struct
211 *
212 * @param system_id ID of this system
213 * @param component_id ID of this component (e.g. 200 for IMU)
214 * @param msg The MAVLink message to compress the data into
215 * @param cellular_config C-struct to read the message contents from
216 */
217static inline uint16_t mavlink_msg_cellular_config_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_cellular_config_t* cellular_config)
218{
219 return mavlink_msg_cellular_config_pack(system_id, component_id, msg, cellular_config->enable_lte, cellular_config->enable_pin, cellular_config->pin, cellular_config->new_pin, cellular_config->apn, cellular_config->puk, cellular_config->roaming, cellular_config->response);
220}
221
222/**
223 * @brief Encode a cellular_config struct on a channel
224 *
225 * @param system_id ID of this system
226 * @param component_id ID of this component (e.g. 200 for IMU)
227 * @param chan The MAVLink channel this message will be sent over
228 * @param msg The MAVLink message to compress the data into
229 * @param cellular_config C-struct to read the message contents from
230 */
231static inline uint16_t mavlink_msg_cellular_config_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_cellular_config_t* cellular_config)
232{
233 return mavlink_msg_cellular_config_pack_chan(system_id, component_id, chan, msg, cellular_config->enable_lte, cellular_config->enable_pin, cellular_config->pin, cellular_config->new_pin, cellular_config->apn, cellular_config->puk, cellular_config->roaming, cellular_config->response);
234}
235
236/**
237 * @brief Encode a cellular_config struct with provided status structure
238 *
239 * @param system_id ID of this system
240 * @param component_id ID of this component (e.g. 200 for IMU)
241 * @param status MAVLink status structure
242 * @param msg The MAVLink message to compress the data into
243 * @param cellular_config C-struct to read the message contents from
244 */
245static inline uint16_t mavlink_msg_cellular_config_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_cellular_config_t* cellular_config)
246{
247 return mavlink_msg_cellular_config_pack_status(system_id, component_id, _status, msg, cellular_config->enable_lte, cellular_config->enable_pin, cellular_config->pin, cellular_config->new_pin, cellular_config->apn, cellular_config->puk, cellular_config->roaming, cellular_config->response);
248}
249
250/**
251 * @brief Send a cellular_config message
252 * @param chan MAVLink channel to send the message
253 *
254 * @param enable_lte Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
255 * @param enable_pin Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
256 * @param pin PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
257 * @param new_pin New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
258 * @param apn Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
259 * @param puk Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.
260 * @param roaming Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
261 * @param response Message acceptance response (sent back to GS).
262 */
263#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
264
265static inline void mavlink_msg_cellular_config_send(mavlink_channel_t chan, uint8_t enable_lte, uint8_t enable_pin, const char *pin, const char *new_pin, const char *apn, const char *puk, uint8_t roaming, uint8_t response)
266{
267#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
268 char buf[MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN];
269 _mav_put_uint8_t(buf, 0, enable_lte);
270 _mav_put_uint8_t(buf, 1, enable_pin);
271 _mav_put_uint8_t(buf, 82, roaming);
272 _mav_put_uint8_t(buf, 83, response);
273 _mav_put_char_array(buf, 2, pin, 16);
274 _mav_put_char_array(buf, 18, new_pin, 16);
275 _mav_put_char_array(buf, 34, apn, 32);
276 _mav_put_char_array(buf, 66, puk, 16);
277 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CELLULAR_CONFIG, buf, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC);
278#else
279 mavlink_cellular_config_t packet;
280 packet.enable_lte = enable_lte;
281 packet.enable_pin = enable_pin;
282 packet.roaming = roaming;
283 packet.response = response;
284 mav_array_memcpy(packet.pin, pin, sizeof(char)*16);
285 mav_array_memcpy(packet.new_pin, new_pin, sizeof(char)*16);
286 mav_array_memcpy(packet.apn, apn, sizeof(char)*32);
287 mav_array_memcpy(packet.puk, puk, sizeof(char)*16);
288 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CELLULAR_CONFIG, (const char *)&packet, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC);
289#endif
290}
291
292/**
293 * @brief Send a cellular_config message
294 * @param chan MAVLink channel to send the message
295 * @param struct The MAVLink struct to serialize
296 */
297static inline void mavlink_msg_cellular_config_send_struct(mavlink_channel_t chan, const mavlink_cellular_config_t* cellular_config)
298{
299#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
300 mavlink_msg_cellular_config_send(chan, cellular_config->enable_lte, cellular_config->enable_pin, cellular_config->pin, cellular_config->new_pin, cellular_config->apn, cellular_config->puk, cellular_config->roaming, cellular_config->response);
301#else
302 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CELLULAR_CONFIG, (const char *)cellular_config, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC);
303#endif
304}
305
306#if MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
307/*
308 This variant of _send() can be used to save stack space by reusing
309 memory from the receive buffer. The caller provides a
310 mavlink_message_t which is the size of a full mavlink message. This
311 is usually the receive buffer for the channel, and allows a reply to an
312 incoming message with minimum stack space usage.
313 */
314static inline void mavlink_msg_cellular_config_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t enable_lte, uint8_t enable_pin, const char *pin, const char *new_pin, const char *apn, const char *puk, uint8_t roaming, uint8_t response)
315{
316#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
317 char *buf = (char *)msgbuf;
318 _mav_put_uint8_t(buf, 0, enable_lte);
319 _mav_put_uint8_t(buf, 1, enable_pin);
320 _mav_put_uint8_t(buf, 82, roaming);
321 _mav_put_uint8_t(buf, 83, response);
322 _mav_put_char_array(buf, 2, pin, 16);
323 _mav_put_char_array(buf, 18, new_pin, 16);
324 _mav_put_char_array(buf, 34, apn, 32);
325 _mav_put_char_array(buf, 66, puk, 16);
326 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CELLULAR_CONFIG, buf, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC);
327#else
328 mavlink_cellular_config_t *packet = (mavlink_cellular_config_t *)msgbuf;
329 packet->enable_lte = enable_lte;
330 packet->enable_pin = enable_pin;
331 packet->roaming = roaming;
332 packet->response = response;
333 mav_array_memcpy(packet->pin, pin, sizeof(char)*16);
334 mav_array_memcpy(packet->new_pin, new_pin, sizeof(char)*16);
335 mav_array_memcpy(packet->apn, apn, sizeof(char)*32);
336 mav_array_memcpy(packet->puk, puk, sizeof(char)*16);
337 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CELLULAR_CONFIG, (const char *)packet, MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN, MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC);
338#endif
339}
340#endif
341
342#endif
343
344// MESSAGE CELLULAR_CONFIG UNPACKING
345
346
347/**
348 * @brief Get field enable_lte from cellular_config message
349 *
350 * @return Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
351 */
352static inline uint8_t mavlink_msg_cellular_config_get_enable_lte(const mavlink_message_t* msg)
353{
354 return _MAV_RETURN_uint8_t(msg, 0);
355}
356
357/**
358 * @brief Get field enable_pin from cellular_config message
359 *
360 * @return Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
361 */
362static inline uint8_t mavlink_msg_cellular_config_get_enable_pin(const mavlink_message_t* msg)
363{
364 return _MAV_RETURN_uint8_t(msg, 1);
365}
366
367/**
368 * @brief Get field pin from cellular_config message
369 *
370 * @return PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
371 */
372static inline uint16_t mavlink_msg_cellular_config_get_pin(const mavlink_message_t* msg, char *pin)
373{
374 return _MAV_RETURN_char_array(msg, pin, 16, 2);
375}
376
377/**
378 * @brief Get field new_pin from cellular_config message
379 *
380 * @return New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
381 */
382static inline uint16_t mavlink_msg_cellular_config_get_new_pin(const mavlink_message_t* msg, char *new_pin)
383{
384 return _MAV_RETURN_char_array(msg, new_pin, 16, 18);
385}
386
387/**
388 * @brief Get field apn from cellular_config message
389 *
390 * @return Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
391 */
392static inline uint16_t mavlink_msg_cellular_config_get_apn(const mavlink_message_t* msg, char *apn)
393{
394 return _MAV_RETURN_char_array(msg, apn, 32, 34);
395}
396
397/**
398 * @brief Get field puk from cellular_config message
399 *
400 * @return Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.
401 */
402static inline uint16_t mavlink_msg_cellular_config_get_puk(const mavlink_message_t* msg, char *puk)
403{
404 return _MAV_RETURN_char_array(msg, puk, 16, 66);
405}
406
407/**
408 * @brief Get field roaming from cellular_config message
409 *
410 * @return Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
411 */
412static inline uint8_t mavlink_msg_cellular_config_get_roaming(const mavlink_message_t* msg)
413{
414 return _MAV_RETURN_uint8_t(msg, 82);
415}
416
417/**
418 * @brief Get field response from cellular_config message
419 *
420 * @return Message acceptance response (sent back to GS).
421 */
422static inline uint8_t mavlink_msg_cellular_config_get_response(const mavlink_message_t* msg)
423{
424 return _MAV_RETURN_uint8_t(msg, 83);
425}
426
427/**
428 * @brief Decode a cellular_config message into a struct
429 *
430 * @param msg The message to decode
431 * @param cellular_config C-struct to decode the message contents into
432 */
433static inline void mavlink_msg_cellular_config_decode(const mavlink_message_t* msg, mavlink_cellular_config_t* cellular_config)
434{
435#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
436 cellular_config->enable_lte = mavlink_msg_cellular_config_get_enable_lte(msg);
437 cellular_config->enable_pin = mavlink_msg_cellular_config_get_enable_pin(msg);
438 mavlink_msg_cellular_config_get_pin(msg, cellular_config->pin);
439 mavlink_msg_cellular_config_get_new_pin(msg, cellular_config->new_pin);
440 mavlink_msg_cellular_config_get_apn(msg, cellular_config->apn);
441 mavlink_msg_cellular_config_get_puk(msg, cellular_config->puk);
442 cellular_config->roaming = mavlink_msg_cellular_config_get_roaming(msg);
443 cellular_config->response = mavlink_msg_cellular_config_get_response(msg);
444#else
445 uint8_t len = msg->len < MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN? msg->len : MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN;
446 memset(cellular_config, 0, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
447 memcpy(cellular_config, _MAV_PAYLOAD(msg), len);
448#endif
449}