mavlink_msg_cellular_config.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. #pragma once
  2. // MESSAGE CELLULAR_CONFIG PACKING
  3. #define MAVLINK_MSG_ID_CELLULAR_CONFIG 336
  4. typedef struct __mavlink_cellular_config_t {
  5. uint8_t enable_lte; /*< Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.*/
  6. 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.*/
  7. char pin[16]; /*< PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.*/
  8. char new_pin[16]; /*< New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.*/
  9. char apn[32]; /*< Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.*/
  10. 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.*/
  11. uint8_t roaming; /*< Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.*/
  12. uint8_t response; /*< Message acceptance response (sent back to GS).*/
  13. } mavlink_cellular_config_t;
  14. #define MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN 84
  15. #define MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN 84
  16. #define MAVLINK_MSG_ID_336_LEN 84
  17. #define MAVLINK_MSG_ID_336_MIN_LEN 84
  18. #define MAVLINK_MSG_ID_CELLULAR_CONFIG_CRC 245
  19. #define MAVLINK_MSG_ID_336_CRC 245
  20. #define MAVLINK_MSG_CELLULAR_CONFIG_FIELD_PIN_LEN 16
  21. #define MAVLINK_MSG_CELLULAR_CONFIG_FIELD_NEW_PIN_LEN 16
  22. #define MAVLINK_MSG_CELLULAR_CONFIG_FIELD_APN_LEN 32
  23. #define MAVLINK_MSG_CELLULAR_CONFIG_FIELD_PUK_LEN 16
  24. #if MAVLINK_COMMAND_24BIT
  25. #define MAVLINK_MESSAGE_INFO_CELLULAR_CONFIG { \
  26. 336, \
  27. "CELLULAR_CONFIG", \
  28. 8, \
  29. { { "enable_lte", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_cellular_config_t, enable_lte) }, \
  30. { "enable_pin", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_cellular_config_t, enable_pin) }, \
  31. { "pin", NULL, MAVLINK_TYPE_CHAR, 16, 2, offsetof(mavlink_cellular_config_t, pin) }, \
  32. { "new_pin", NULL, MAVLINK_TYPE_CHAR, 16, 18, offsetof(mavlink_cellular_config_t, new_pin) }, \
  33. { "apn", NULL, MAVLINK_TYPE_CHAR, 32, 34, offsetof(mavlink_cellular_config_t, apn) }, \
  34. { "puk", NULL, MAVLINK_TYPE_CHAR, 16, 66, offsetof(mavlink_cellular_config_t, puk) }, \
  35. { "roaming", NULL, MAVLINK_TYPE_UINT8_T, 0, 82, offsetof(mavlink_cellular_config_t, roaming) }, \
  36. { "response", NULL, MAVLINK_TYPE_UINT8_T, 0, 83, offsetof(mavlink_cellular_config_t, response) }, \
  37. } \
  38. }
  39. #else
  40. #define MAVLINK_MESSAGE_INFO_CELLULAR_CONFIG { \
  41. "CELLULAR_CONFIG", \
  42. 8, \
  43. { { "enable_lte", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_cellular_config_t, enable_lte) }, \
  44. { "enable_pin", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_cellular_config_t, enable_pin) }, \
  45. { "pin", NULL, MAVLINK_TYPE_CHAR, 16, 2, offsetof(mavlink_cellular_config_t, pin) }, \
  46. { "new_pin", NULL, MAVLINK_TYPE_CHAR, 16, 18, offsetof(mavlink_cellular_config_t, new_pin) }, \
  47. { "apn", NULL, MAVLINK_TYPE_CHAR, 32, 34, offsetof(mavlink_cellular_config_t, apn) }, \
  48. { "puk", NULL, MAVLINK_TYPE_CHAR, 16, 66, offsetof(mavlink_cellular_config_t, puk) }, \
  49. { "roaming", NULL, MAVLINK_TYPE_UINT8_T, 0, 82, offsetof(mavlink_cellular_config_t, roaming) }, \
  50. { "response", NULL, MAVLINK_TYPE_UINT8_T, 0, 83, offsetof(mavlink_cellular_config_t, response) }, \
  51. } \
  52. }
  53. #endif
  54. /**
  55. * @brief Pack a cellular_config message
  56. * @param system_id ID of this system
  57. * @param component_id ID of this component (e.g. 200 for IMU)
  58. * @param msg The MAVLink message to compress the data into
  59. *
  60. * @param enable_lte Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  61. * @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.
  62. * @param pin PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
  63. * @param new_pin New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
  64. * @param apn Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
  65. * @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.
  66. * @param roaming Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  67. * @param response Message acceptance response (sent back to GS).
  68. * @return length of the message in bytes (excluding serial stream start sign)
  69. */
  70. static inline uint16_t mavlink_msg_cellular_config_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  71. 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)
  72. {
  73. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  74. char buf[MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN];
  75. _mav_put_uint8_t(buf, 0, enable_lte);
  76. _mav_put_uint8_t(buf, 1, enable_pin);
  77. _mav_put_uint8_t(buf, 82, roaming);
  78. _mav_put_uint8_t(buf, 83, response);
  79. _mav_put_char_array(buf, 2, pin, 16);
  80. _mav_put_char_array(buf, 18, new_pin, 16);
  81. _mav_put_char_array(buf, 34, apn, 32);
  82. _mav_put_char_array(buf, 66, puk, 16);
  83. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
  84. #else
  85. mavlink_cellular_config_t packet;
  86. packet.enable_lte = enable_lte;
  87. packet.enable_pin = enable_pin;
  88. packet.roaming = roaming;
  89. packet.response = response;
  90. mav_array_memcpy(packet.pin, pin, sizeof(char)*16);
  91. mav_array_memcpy(packet.new_pin, new_pin, sizeof(char)*16);
  92. mav_array_memcpy(packet.apn, apn, sizeof(char)*32);
  93. mav_array_memcpy(packet.puk, puk, sizeof(char)*16);
  94. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
  95. #endif
  96. msg->msgid = MAVLINK_MSG_ID_CELLULAR_CONFIG;
  97. 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);
  98. }
  99. /**
  100. * @brief Pack a cellular_config message on a channel
  101. * @param system_id ID of this system
  102. * @param component_id ID of this component (e.g. 200 for IMU)
  103. * @param chan The MAVLink channel this message will be sent over
  104. * @param msg The MAVLink message to compress the data into
  105. * @param enable_lte Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  106. * @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.
  107. * @param pin PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
  108. * @param new_pin New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
  109. * @param apn Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
  110. * @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.
  111. * @param roaming Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  112. * @param response Message acceptance response (sent back to GS).
  113. * @return length of the message in bytes (excluding serial stream start sign)
  114. */
  115. static inline uint16_t mavlink_msg_cellular_config_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  116. mavlink_message_t* msg,
  117. 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)
  118. {
  119. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  120. char buf[MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN];
  121. _mav_put_uint8_t(buf, 0, enable_lte);
  122. _mav_put_uint8_t(buf, 1, enable_pin);
  123. _mav_put_uint8_t(buf, 82, roaming);
  124. _mav_put_uint8_t(buf, 83, response);
  125. _mav_put_char_array(buf, 2, pin, 16);
  126. _mav_put_char_array(buf, 18, new_pin, 16);
  127. _mav_put_char_array(buf, 34, apn, 32);
  128. _mav_put_char_array(buf, 66, puk, 16);
  129. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
  130. #else
  131. mavlink_cellular_config_t packet;
  132. packet.enable_lte = enable_lte;
  133. packet.enable_pin = enable_pin;
  134. packet.roaming = roaming;
  135. packet.response = response;
  136. mav_array_memcpy(packet.pin, pin, sizeof(char)*16);
  137. mav_array_memcpy(packet.new_pin, new_pin, sizeof(char)*16);
  138. mav_array_memcpy(packet.apn, apn, sizeof(char)*32);
  139. mav_array_memcpy(packet.puk, puk, sizeof(char)*16);
  140. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
  141. #endif
  142. msg->msgid = MAVLINK_MSG_ID_CELLULAR_CONFIG;
  143. 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);
  144. }
  145. /**
  146. * @brief Encode a cellular_config struct
  147. *
  148. * @param system_id ID of this system
  149. * @param component_id ID of this component (e.g. 200 for IMU)
  150. * @param msg The MAVLink message to compress the data into
  151. * @param cellular_config C-struct to read the message contents from
  152. */
  153. static 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)
  154. {
  155. 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);
  156. }
  157. /**
  158. * @brief Encode a cellular_config struct on a channel
  159. *
  160. * @param system_id ID of this system
  161. * @param component_id ID of this component (e.g. 200 for IMU)
  162. * @param chan The MAVLink channel this message will be sent over
  163. * @param msg The MAVLink message to compress the data into
  164. * @param cellular_config C-struct to read the message contents from
  165. */
  166. static 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)
  167. {
  168. 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);
  169. }
  170. /**
  171. * @brief Send a cellular_config message
  172. * @param chan MAVLink channel to send the message
  173. *
  174. * @param enable_lte Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  175. * @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.
  176. * @param pin PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
  177. * @param new_pin New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
  178. * @param apn Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
  179. * @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.
  180. * @param roaming Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  181. * @param response Message acceptance response (sent back to GS).
  182. */
  183. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  184. static 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)
  185. {
  186. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  187. char buf[MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN];
  188. _mav_put_uint8_t(buf, 0, enable_lte);
  189. _mav_put_uint8_t(buf, 1, enable_pin);
  190. _mav_put_uint8_t(buf, 82, roaming);
  191. _mav_put_uint8_t(buf, 83, response);
  192. _mav_put_char_array(buf, 2, pin, 16);
  193. _mav_put_char_array(buf, 18, new_pin, 16);
  194. _mav_put_char_array(buf, 34, apn, 32);
  195. _mav_put_char_array(buf, 66, puk, 16);
  196. _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);
  197. #else
  198. mavlink_cellular_config_t packet;
  199. packet.enable_lte = enable_lte;
  200. packet.enable_pin = enable_pin;
  201. packet.roaming = roaming;
  202. packet.response = response;
  203. mav_array_memcpy(packet.pin, pin, sizeof(char)*16);
  204. mav_array_memcpy(packet.new_pin, new_pin, sizeof(char)*16);
  205. mav_array_memcpy(packet.apn, apn, sizeof(char)*32);
  206. mav_array_memcpy(packet.puk, puk, sizeof(char)*16);
  207. _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);
  208. #endif
  209. }
  210. /**
  211. * @brief Send a cellular_config message
  212. * @param chan MAVLink channel to send the message
  213. * @param struct The MAVLink struct to serialize
  214. */
  215. static inline void mavlink_msg_cellular_config_send_struct(mavlink_channel_t chan, const mavlink_cellular_config_t* cellular_config)
  216. {
  217. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  218. 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);
  219. #else
  220. _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);
  221. #endif
  222. }
  223. #if MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  224. /*
  225. This variant of _send() can be used to save stack space by re-using
  226. memory from the receive buffer. The caller provides a
  227. mavlink_message_t which is the size of a full mavlink message. This
  228. is usually the receive buffer for the channel, and allows a reply to an
  229. incoming message with minimum stack space usage.
  230. */
  231. static 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)
  232. {
  233. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  234. char *buf = (char *)msgbuf;
  235. _mav_put_uint8_t(buf, 0, enable_lte);
  236. _mav_put_uint8_t(buf, 1, enable_pin);
  237. _mav_put_uint8_t(buf, 82, roaming);
  238. _mav_put_uint8_t(buf, 83, response);
  239. _mav_put_char_array(buf, 2, pin, 16);
  240. _mav_put_char_array(buf, 18, new_pin, 16);
  241. _mav_put_char_array(buf, 34, apn, 32);
  242. _mav_put_char_array(buf, 66, puk, 16);
  243. _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);
  244. #else
  245. mavlink_cellular_config_t *packet = (mavlink_cellular_config_t *)msgbuf;
  246. packet->enable_lte = enable_lte;
  247. packet->enable_pin = enable_pin;
  248. packet->roaming = roaming;
  249. packet->response = response;
  250. mav_array_memcpy(packet->pin, pin, sizeof(char)*16);
  251. mav_array_memcpy(packet->new_pin, new_pin, sizeof(char)*16);
  252. mav_array_memcpy(packet->apn, apn, sizeof(char)*32);
  253. mav_array_memcpy(packet->puk, puk, sizeof(char)*16);
  254. _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);
  255. #endif
  256. }
  257. #endif
  258. #endif
  259. // MESSAGE CELLULAR_CONFIG UNPACKING
  260. /**
  261. * @brief Get field enable_lte from cellular_config message
  262. *
  263. * @return Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  264. */
  265. static inline uint8_t mavlink_msg_cellular_config_get_enable_lte(const mavlink_message_t* msg)
  266. {
  267. return _MAV_RETURN_uint8_t(msg, 0);
  268. }
  269. /**
  270. * @brief Get field enable_pin from cellular_config message
  271. *
  272. * @return Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  273. */
  274. static inline uint8_t mavlink_msg_cellular_config_get_enable_pin(const mavlink_message_t* msg)
  275. {
  276. return _MAV_RETURN_uint8_t(msg, 1);
  277. }
  278. /**
  279. * @brief Get field pin from cellular_config message
  280. *
  281. * @return PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
  282. */
  283. static inline uint16_t mavlink_msg_cellular_config_get_pin(const mavlink_message_t* msg, char *pin)
  284. {
  285. return _MAV_RETURN_char_array(msg, pin, 16, 2);
  286. }
  287. /**
  288. * @brief Get field new_pin from cellular_config message
  289. *
  290. * @return New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
  291. */
  292. static inline uint16_t mavlink_msg_cellular_config_get_new_pin(const mavlink_message_t* msg, char *new_pin)
  293. {
  294. return _MAV_RETURN_char_array(msg, new_pin, 16, 18);
  295. }
  296. /**
  297. * @brief Get field apn from cellular_config message
  298. *
  299. * @return Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
  300. */
  301. static inline uint16_t mavlink_msg_cellular_config_get_apn(const mavlink_message_t* msg, char *apn)
  302. {
  303. return _MAV_RETURN_char_array(msg, apn, 32, 34);
  304. }
  305. /**
  306. * @brief Get field puk from cellular_config message
  307. *
  308. * @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.
  309. */
  310. static inline uint16_t mavlink_msg_cellular_config_get_puk(const mavlink_message_t* msg, char *puk)
  311. {
  312. return _MAV_RETURN_char_array(msg, puk, 16, 66);
  313. }
  314. /**
  315. * @brief Get field roaming from cellular_config message
  316. *
  317. * @return Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
  318. */
  319. static inline uint8_t mavlink_msg_cellular_config_get_roaming(const mavlink_message_t* msg)
  320. {
  321. return _MAV_RETURN_uint8_t(msg, 82);
  322. }
  323. /**
  324. * @brief Get field response from cellular_config message
  325. *
  326. * @return Message acceptance response (sent back to GS).
  327. */
  328. static inline uint8_t mavlink_msg_cellular_config_get_response(const mavlink_message_t* msg)
  329. {
  330. return _MAV_RETURN_uint8_t(msg, 83);
  331. }
  332. /**
  333. * @brief Decode a cellular_config message into a struct
  334. *
  335. * @param msg The message to decode
  336. * @param cellular_config C-struct to decode the message contents into
  337. */
  338. static inline void mavlink_msg_cellular_config_decode(const mavlink_message_t* msg, mavlink_cellular_config_t* cellular_config)
  339. {
  340. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  341. cellular_config->enable_lte = mavlink_msg_cellular_config_get_enable_lte(msg);
  342. cellular_config->enable_pin = mavlink_msg_cellular_config_get_enable_pin(msg);
  343. mavlink_msg_cellular_config_get_pin(msg, cellular_config->pin);
  344. mavlink_msg_cellular_config_get_new_pin(msg, cellular_config->new_pin);
  345. mavlink_msg_cellular_config_get_apn(msg, cellular_config->apn);
  346. mavlink_msg_cellular_config_get_puk(msg, cellular_config->puk);
  347. cellular_config->roaming = mavlink_msg_cellular_config_get_roaming(msg);
  348. cellular_config->response = mavlink_msg_cellular_config_get_response(msg);
  349. #else
  350. uint8_t len = msg->len < MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN? msg->len : MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN;
  351. memset(cellular_config, 0, MAVLINK_MSG_ID_CELLULAR_CONFIG_LEN);
  352. memcpy(cellular_config, _MAV_PAYLOAD(msg), len);
  353. #endif
  354. }