mavlink_msg_vk_bms_info.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. #pragma once
  2. // MESSAGE VK_BMS_INFO PACKING
  3. #define MAVLINK_MSG_ID_VK_BMS_INFO 53004
  4. typedef struct __mavlink_vk_bms_info_t {
  5. uint32_t time_boot_ms; /*< [ms] Timestamp in ms from system boot.*/
  6. uint8_t man_name[20]; /*< BMS manufactor string*/
  7. uint8_t model_name[20]; /*< BMS equpment model name string*/
  8. uint8_t sn_id[20]; /*< BMS SN id string*/
  9. uint8_t hw_ver[10]; /*< BMS hardware version string*/
  10. uint8_t fw_ver[10]; /*< BMS firmware version string*/
  11. } mavlink_vk_bms_info_t;
  12. #define MAVLINK_MSG_ID_VK_BMS_INFO_LEN 84
  13. #define MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN 84
  14. #define MAVLINK_MSG_ID_53004_LEN 84
  15. #define MAVLINK_MSG_ID_53004_MIN_LEN 84
  16. #define MAVLINK_MSG_ID_VK_BMS_INFO_CRC 205
  17. #define MAVLINK_MSG_ID_53004_CRC 205
  18. #define MAVLINK_MSG_VK_BMS_INFO_FIELD_MAN_NAME_LEN 20
  19. #define MAVLINK_MSG_VK_BMS_INFO_FIELD_MODEL_NAME_LEN 20
  20. #define MAVLINK_MSG_VK_BMS_INFO_FIELD_SN_ID_LEN 20
  21. #define MAVLINK_MSG_VK_BMS_INFO_FIELD_HW_VER_LEN 10
  22. #define MAVLINK_MSG_VK_BMS_INFO_FIELD_FW_VER_LEN 10
  23. #if MAVLINK_COMMAND_24BIT
  24. #define MAVLINK_MESSAGE_INFO_VK_BMS_INFO { \
  25. 53004, \
  26. "VK_BMS_INFO", \
  27. 6, \
  28. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vk_bms_info_t, time_boot_ms) }, \
  29. { "man_name", NULL, MAVLINK_TYPE_UINT8_T, 20, 4, offsetof(mavlink_vk_bms_info_t, man_name) }, \
  30. { "model_name", NULL, MAVLINK_TYPE_UINT8_T, 20, 24, offsetof(mavlink_vk_bms_info_t, model_name) }, \
  31. { "sn_id", NULL, MAVLINK_TYPE_UINT8_T, 20, 44, offsetof(mavlink_vk_bms_info_t, sn_id) }, \
  32. { "hw_ver", NULL, MAVLINK_TYPE_UINT8_T, 10, 64, offsetof(mavlink_vk_bms_info_t, hw_ver) }, \
  33. { "fw_ver", NULL, MAVLINK_TYPE_UINT8_T, 10, 74, offsetof(mavlink_vk_bms_info_t, fw_ver) }, \
  34. } \
  35. }
  36. #else
  37. #define MAVLINK_MESSAGE_INFO_VK_BMS_INFO { \
  38. "VK_BMS_INFO", \
  39. 6, \
  40. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vk_bms_info_t, time_boot_ms) }, \
  41. { "man_name", NULL, MAVLINK_TYPE_UINT8_T, 20, 4, offsetof(mavlink_vk_bms_info_t, man_name) }, \
  42. { "model_name", NULL, MAVLINK_TYPE_UINT8_T, 20, 24, offsetof(mavlink_vk_bms_info_t, model_name) }, \
  43. { "sn_id", NULL, MAVLINK_TYPE_UINT8_T, 20, 44, offsetof(mavlink_vk_bms_info_t, sn_id) }, \
  44. { "hw_ver", NULL, MAVLINK_TYPE_UINT8_T, 10, 64, offsetof(mavlink_vk_bms_info_t, hw_ver) }, \
  45. { "fw_ver", NULL, MAVLINK_TYPE_UINT8_T, 10, 74, offsetof(mavlink_vk_bms_info_t, fw_ver) }, \
  46. } \
  47. }
  48. #endif
  49. /**
  50. * @brief Pack a vk_bms_info message
  51. * @param system_id ID of this system
  52. * @param component_id ID of this component (e.g. 200 for IMU)
  53. * @param msg The MAVLink message to compress the data into
  54. *
  55. * @param time_boot_ms [ms] Timestamp in ms from system boot.
  56. * @param man_name BMS manufactor string
  57. * @param model_name BMS equpment model name string
  58. * @param sn_id BMS SN id string
  59. * @param hw_ver BMS hardware version string
  60. * @param fw_ver BMS firmware version string
  61. * @return length of the message in bytes (excluding serial stream start sign)
  62. */
  63. static inline uint16_t mavlink_msg_vk_bms_info_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  64. uint32_t time_boot_ms, const uint8_t *man_name, const uint8_t *model_name, const uint8_t *sn_id, const uint8_t *hw_ver, const uint8_t *fw_ver)
  65. {
  66. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  67. char buf[MAVLINK_MSG_ID_VK_BMS_INFO_LEN];
  68. _mav_put_uint32_t(buf, 0, time_boot_ms);
  69. _mav_put_uint8_t_array(buf, 4, man_name, 20);
  70. _mav_put_uint8_t_array(buf, 24, model_name, 20);
  71. _mav_put_uint8_t_array(buf, 44, sn_id, 20);
  72. _mav_put_uint8_t_array(buf, 64, hw_ver, 10);
  73. _mav_put_uint8_t_array(buf, 74, fw_ver, 10);
  74. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_INFO_LEN);
  75. #else
  76. mavlink_vk_bms_info_t packet;
  77. packet.time_boot_ms = time_boot_ms;
  78. mav_array_memcpy(packet.man_name, man_name, sizeof(uint8_t)*20);
  79. mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*20);
  80. mav_array_memcpy(packet.sn_id, sn_id, sizeof(uint8_t)*20);
  81. mav_array_memcpy(packet.hw_ver, hw_ver, sizeof(uint8_t)*10);
  82. mav_array_memcpy(packet.fw_ver, fw_ver, sizeof(uint8_t)*10);
  83. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_BMS_INFO_LEN);
  84. #endif
  85. msg->msgid = MAVLINK_MSG_ID_VK_BMS_INFO;
  86. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_CRC);
  87. }
  88. /**
  89. * @brief Pack a vk_bms_info message
  90. * @param system_id ID of this system
  91. * @param component_id ID of this component (e.g. 200 for IMU)
  92. * @param status MAVLink status structure
  93. * @param msg The MAVLink message to compress the data into
  94. *
  95. * @param time_boot_ms [ms] Timestamp in ms from system boot.
  96. * @param man_name BMS manufactor string
  97. * @param model_name BMS equpment model name string
  98. * @param sn_id BMS SN id string
  99. * @param hw_ver BMS hardware version string
  100. * @param fw_ver BMS firmware version string
  101. * @return length of the message in bytes (excluding serial stream start sign)
  102. */
  103. static inline uint16_t mavlink_msg_vk_bms_info_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  104. uint32_t time_boot_ms, const uint8_t *man_name, const uint8_t *model_name, const uint8_t *sn_id, const uint8_t *hw_ver, const uint8_t *fw_ver)
  105. {
  106. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  107. char buf[MAVLINK_MSG_ID_VK_BMS_INFO_LEN];
  108. _mav_put_uint32_t(buf, 0, time_boot_ms);
  109. _mav_put_uint8_t_array(buf, 4, man_name, 20);
  110. _mav_put_uint8_t_array(buf, 24, model_name, 20);
  111. _mav_put_uint8_t_array(buf, 44, sn_id, 20);
  112. _mav_put_uint8_t_array(buf, 64, hw_ver, 10);
  113. _mav_put_uint8_t_array(buf, 74, fw_ver, 10);
  114. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_INFO_LEN);
  115. #else
  116. mavlink_vk_bms_info_t packet;
  117. packet.time_boot_ms = time_boot_ms;
  118. mav_array_memcpy(packet.man_name, man_name, sizeof(uint8_t)*20);
  119. mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*20);
  120. mav_array_memcpy(packet.sn_id, sn_id, sizeof(uint8_t)*20);
  121. mav_array_memcpy(packet.hw_ver, hw_ver, sizeof(uint8_t)*10);
  122. mav_array_memcpy(packet.fw_ver, fw_ver, sizeof(uint8_t)*10);
  123. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_BMS_INFO_LEN);
  124. #endif
  125. msg->msgid = MAVLINK_MSG_ID_VK_BMS_INFO;
  126. #if MAVLINK_CRC_EXTRA
  127. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_CRC);
  128. #else
  129. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN);
  130. #endif
  131. }
  132. /**
  133. * @brief Pack a vk_bms_info message on a channel
  134. * @param system_id ID of this system
  135. * @param component_id ID of this component (e.g. 200 for IMU)
  136. * @param chan The MAVLink channel this message will be sent over
  137. * @param msg The MAVLink message to compress the data into
  138. * @param time_boot_ms [ms] Timestamp in ms from system boot.
  139. * @param man_name BMS manufactor string
  140. * @param model_name BMS equpment model name string
  141. * @param sn_id BMS SN id string
  142. * @param hw_ver BMS hardware version string
  143. * @param fw_ver BMS firmware version string
  144. * @return length of the message in bytes (excluding serial stream start sign)
  145. */
  146. static inline uint16_t mavlink_msg_vk_bms_info_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  147. mavlink_message_t* msg,
  148. uint32_t time_boot_ms,const uint8_t *man_name,const uint8_t *model_name,const uint8_t *sn_id,const uint8_t *hw_ver,const uint8_t *fw_ver)
  149. {
  150. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  151. char buf[MAVLINK_MSG_ID_VK_BMS_INFO_LEN];
  152. _mav_put_uint32_t(buf, 0, time_boot_ms);
  153. _mav_put_uint8_t_array(buf, 4, man_name, 20);
  154. _mav_put_uint8_t_array(buf, 24, model_name, 20);
  155. _mav_put_uint8_t_array(buf, 44, sn_id, 20);
  156. _mav_put_uint8_t_array(buf, 64, hw_ver, 10);
  157. _mav_put_uint8_t_array(buf, 74, fw_ver, 10);
  158. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_INFO_LEN);
  159. #else
  160. mavlink_vk_bms_info_t packet;
  161. packet.time_boot_ms = time_boot_ms;
  162. mav_array_memcpy(packet.man_name, man_name, sizeof(uint8_t)*20);
  163. mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*20);
  164. mav_array_memcpy(packet.sn_id, sn_id, sizeof(uint8_t)*20);
  165. mav_array_memcpy(packet.hw_ver, hw_ver, sizeof(uint8_t)*10);
  166. mav_array_memcpy(packet.fw_ver, fw_ver, sizeof(uint8_t)*10);
  167. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_BMS_INFO_LEN);
  168. #endif
  169. msg->msgid = MAVLINK_MSG_ID_VK_BMS_INFO;
  170. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_CRC);
  171. }
  172. /**
  173. * @brief Encode a vk_bms_info struct
  174. *
  175. * @param system_id ID of this system
  176. * @param component_id ID of this component (e.g. 200 for IMU)
  177. * @param msg The MAVLink message to compress the data into
  178. * @param vk_bms_info C-struct to read the message contents from
  179. */
  180. static inline uint16_t mavlink_msg_vk_bms_info_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vk_bms_info_t* vk_bms_info)
  181. {
  182. return mavlink_msg_vk_bms_info_pack(system_id, component_id, msg, vk_bms_info->time_boot_ms, vk_bms_info->man_name, vk_bms_info->model_name, vk_bms_info->sn_id, vk_bms_info->hw_ver, vk_bms_info->fw_ver);
  183. }
  184. /**
  185. * @brief Encode a vk_bms_info struct on a channel
  186. *
  187. * @param system_id ID of this system
  188. * @param component_id ID of this component (e.g. 200 for IMU)
  189. * @param chan The MAVLink channel this message will be sent over
  190. * @param msg The MAVLink message to compress the data into
  191. * @param vk_bms_info C-struct to read the message contents from
  192. */
  193. static inline uint16_t mavlink_msg_vk_bms_info_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vk_bms_info_t* vk_bms_info)
  194. {
  195. return mavlink_msg_vk_bms_info_pack_chan(system_id, component_id, chan, msg, vk_bms_info->time_boot_ms, vk_bms_info->man_name, vk_bms_info->model_name, vk_bms_info->sn_id, vk_bms_info->hw_ver, vk_bms_info->fw_ver);
  196. }
  197. /**
  198. * @brief Encode a vk_bms_info struct with provided status structure
  199. *
  200. * @param system_id ID of this system
  201. * @param component_id ID of this component (e.g. 200 for IMU)
  202. * @param status MAVLink status structure
  203. * @param msg The MAVLink message to compress the data into
  204. * @param vk_bms_info C-struct to read the message contents from
  205. */
  206. static inline uint16_t mavlink_msg_vk_bms_info_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_vk_bms_info_t* vk_bms_info)
  207. {
  208. return mavlink_msg_vk_bms_info_pack_status(system_id, component_id, _status, msg, vk_bms_info->time_boot_ms, vk_bms_info->man_name, vk_bms_info->model_name, vk_bms_info->sn_id, vk_bms_info->hw_ver, vk_bms_info->fw_ver);
  209. }
  210. /**
  211. * @brief Send a vk_bms_info message
  212. * @param chan MAVLink channel to send the message
  213. *
  214. * @param time_boot_ms [ms] Timestamp in ms from system boot.
  215. * @param man_name BMS manufactor string
  216. * @param model_name BMS equpment model name string
  217. * @param sn_id BMS SN id string
  218. * @param hw_ver BMS hardware version string
  219. * @param fw_ver BMS firmware version string
  220. */
  221. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  222. static inline void mavlink_msg_vk_bms_info_send(mavlink_channel_t chan, uint32_t time_boot_ms, const uint8_t *man_name, const uint8_t *model_name, const uint8_t *sn_id, const uint8_t *hw_ver, const uint8_t *fw_ver)
  223. {
  224. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  225. char buf[MAVLINK_MSG_ID_VK_BMS_INFO_LEN];
  226. _mav_put_uint32_t(buf, 0, time_boot_ms);
  227. _mav_put_uint8_t_array(buf, 4, man_name, 20);
  228. _mav_put_uint8_t_array(buf, 24, model_name, 20);
  229. _mav_put_uint8_t_array(buf, 44, sn_id, 20);
  230. _mav_put_uint8_t_array(buf, 64, hw_ver, 10);
  231. _mav_put_uint8_t_array(buf, 74, fw_ver, 10);
  232. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_BMS_INFO, buf, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_CRC);
  233. #else
  234. mavlink_vk_bms_info_t packet;
  235. packet.time_boot_ms = time_boot_ms;
  236. mav_array_memcpy(packet.man_name, man_name, sizeof(uint8_t)*20);
  237. mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*20);
  238. mav_array_memcpy(packet.sn_id, sn_id, sizeof(uint8_t)*20);
  239. mav_array_memcpy(packet.hw_ver, hw_ver, sizeof(uint8_t)*10);
  240. mav_array_memcpy(packet.fw_ver, fw_ver, sizeof(uint8_t)*10);
  241. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_BMS_INFO, (const char *)&packet, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_CRC);
  242. #endif
  243. }
  244. /**
  245. * @brief Send a vk_bms_info message
  246. * @param chan MAVLink channel to send the message
  247. * @param struct The MAVLink struct to serialize
  248. */
  249. static inline void mavlink_msg_vk_bms_info_send_struct(mavlink_channel_t chan, const mavlink_vk_bms_info_t* vk_bms_info)
  250. {
  251. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  252. mavlink_msg_vk_bms_info_send(chan, vk_bms_info->time_boot_ms, vk_bms_info->man_name, vk_bms_info->model_name, vk_bms_info->sn_id, vk_bms_info->hw_ver, vk_bms_info->fw_ver);
  253. #else
  254. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_BMS_INFO, (const char *)vk_bms_info, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_CRC);
  255. #endif
  256. }
  257. #if MAVLINK_MSG_ID_VK_BMS_INFO_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  258. /*
  259. This variant of _send() can be used to save stack space by re-using
  260. memory from the receive buffer. The caller provides a
  261. mavlink_message_t which is the size of a full mavlink message. This
  262. is usually the receive buffer for the channel, and allows a reply to an
  263. incoming message with minimum stack space usage.
  264. */
  265. static inline void mavlink_msg_vk_bms_info_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const uint8_t *man_name, const uint8_t *model_name, const uint8_t *sn_id, const uint8_t *hw_ver, const uint8_t *fw_ver)
  266. {
  267. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  268. char *buf = (char *)msgbuf;
  269. _mav_put_uint32_t(buf, 0, time_boot_ms);
  270. _mav_put_uint8_t_array(buf, 4, man_name, 20);
  271. _mav_put_uint8_t_array(buf, 24, model_name, 20);
  272. _mav_put_uint8_t_array(buf, 44, sn_id, 20);
  273. _mav_put_uint8_t_array(buf, 64, hw_ver, 10);
  274. _mav_put_uint8_t_array(buf, 74, fw_ver, 10);
  275. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_BMS_INFO, buf, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_CRC);
  276. #else
  277. mavlink_vk_bms_info_t *packet = (mavlink_vk_bms_info_t *)msgbuf;
  278. packet->time_boot_ms = time_boot_ms;
  279. mav_array_memcpy(packet->man_name, man_name, sizeof(uint8_t)*20);
  280. mav_array_memcpy(packet->model_name, model_name, sizeof(uint8_t)*20);
  281. mav_array_memcpy(packet->sn_id, sn_id, sizeof(uint8_t)*20);
  282. mav_array_memcpy(packet->hw_ver, hw_ver, sizeof(uint8_t)*10);
  283. mav_array_memcpy(packet->fw_ver, fw_ver, sizeof(uint8_t)*10);
  284. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_BMS_INFO, (const char *)packet, MAVLINK_MSG_ID_VK_BMS_INFO_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_LEN, MAVLINK_MSG_ID_VK_BMS_INFO_CRC);
  285. #endif
  286. }
  287. #endif
  288. #endif
  289. // MESSAGE VK_BMS_INFO UNPACKING
  290. /**
  291. * @brief Get field time_boot_ms from vk_bms_info message
  292. *
  293. * @return [ms] Timestamp in ms from system boot.
  294. */
  295. static inline uint32_t mavlink_msg_vk_bms_info_get_time_boot_ms(const mavlink_message_t* msg)
  296. {
  297. return _MAV_RETURN_uint32_t(msg, 0);
  298. }
  299. /**
  300. * @brief Get field man_name from vk_bms_info message
  301. *
  302. * @return BMS manufactor string
  303. */
  304. static inline uint16_t mavlink_msg_vk_bms_info_get_man_name(const mavlink_message_t* msg, uint8_t *man_name)
  305. {
  306. return _MAV_RETURN_uint8_t_array(msg, man_name, 20, 4);
  307. }
  308. /**
  309. * @brief Get field model_name from vk_bms_info message
  310. *
  311. * @return BMS equpment model name string
  312. */
  313. static inline uint16_t mavlink_msg_vk_bms_info_get_model_name(const mavlink_message_t* msg, uint8_t *model_name)
  314. {
  315. return _MAV_RETURN_uint8_t_array(msg, model_name, 20, 24);
  316. }
  317. /**
  318. * @brief Get field sn_id from vk_bms_info message
  319. *
  320. * @return BMS SN id string
  321. */
  322. static inline uint16_t mavlink_msg_vk_bms_info_get_sn_id(const mavlink_message_t* msg, uint8_t *sn_id)
  323. {
  324. return _MAV_RETURN_uint8_t_array(msg, sn_id, 20, 44);
  325. }
  326. /**
  327. * @brief Get field hw_ver from vk_bms_info message
  328. *
  329. * @return BMS hardware version string
  330. */
  331. static inline uint16_t mavlink_msg_vk_bms_info_get_hw_ver(const mavlink_message_t* msg, uint8_t *hw_ver)
  332. {
  333. return _MAV_RETURN_uint8_t_array(msg, hw_ver, 10, 64);
  334. }
  335. /**
  336. * @brief Get field fw_ver from vk_bms_info message
  337. *
  338. * @return BMS firmware version string
  339. */
  340. static inline uint16_t mavlink_msg_vk_bms_info_get_fw_ver(const mavlink_message_t* msg, uint8_t *fw_ver)
  341. {
  342. return _MAV_RETURN_uint8_t_array(msg, fw_ver, 10, 74);
  343. }
  344. /**
  345. * @brief Decode a vk_bms_info message into a struct
  346. *
  347. * @param msg The message to decode
  348. * @param vk_bms_info C-struct to decode the message contents into
  349. */
  350. static inline void mavlink_msg_vk_bms_info_decode(const mavlink_message_t* msg, mavlink_vk_bms_info_t* vk_bms_info)
  351. {
  352. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  353. vk_bms_info->time_boot_ms = mavlink_msg_vk_bms_info_get_time_boot_ms(msg);
  354. mavlink_msg_vk_bms_info_get_man_name(msg, vk_bms_info->man_name);
  355. mavlink_msg_vk_bms_info_get_model_name(msg, vk_bms_info->model_name);
  356. mavlink_msg_vk_bms_info_get_sn_id(msg, vk_bms_info->sn_id);
  357. mavlink_msg_vk_bms_info_get_hw_ver(msg, vk_bms_info->hw_ver);
  358. mavlink_msg_vk_bms_info_get_fw_ver(msg, vk_bms_info->fw_ver);
  359. #else
  360. uint8_t len = msg->len < MAVLINK_MSG_ID_VK_BMS_INFO_LEN? msg->len : MAVLINK_MSG_ID_VK_BMS_INFO_LEN;
  361. memset(vk_bms_info, 0, MAVLINK_MSG_ID_VK_BMS_INFO_LEN);
  362. memcpy(vk_bms_info, _MAV_PAYLOAD(msg), len);
  363. #endif
  364. }