|
|
@@ -7,10 +7,10 @@
|
|
|
typedef struct __mavlink_vk_bms_status_t {
|
|
|
uint32_t time_boot_ms; /*< [ms] Timestamp in ms from system boot.*/
|
|
|
uint32_t voltage; /*< [mV] BMS voltage in mV*/
|
|
|
+ int32_t current; /*< [cA] BMS current in cA, negative value means in
|
|
|
+ charging*/
|
|
|
uint32_t err_code; /*< BMS error code,
|
|
|
0 means no error*/
|
|
|
- int16_t current; /*< [cA] BMS current in cA, negative value means in
|
|
|
- charging*/
|
|
|
int16_t temperature; /*< [degC] BMS temperature in degC*/
|
|
|
uint16_t cell_num; /*< BMS cell numbers*/
|
|
|
uint16_t cell_volt[30]; /*< [mV] BMS cell voltage in mV*/
|
|
|
@@ -22,13 +22,13 @@ typedef struct __mavlink_vk_bms_status_t {
|
|
|
percentage*/
|
|
|
} mavlink_vk_bms_status_t;
|
|
|
|
|
|
-#define MAVLINK_MSG_ID_VK_BMS_STATUS_LEN 83
|
|
|
-#define MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN 83
|
|
|
-#define MAVLINK_MSG_ID_53003_LEN 83
|
|
|
-#define MAVLINK_MSG_ID_53003_MIN_LEN 83
|
|
|
+#define MAVLINK_MSG_ID_VK_BMS_STATUS_LEN 85
|
|
|
+#define MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN 85
|
|
|
+#define MAVLINK_MSG_ID_53003_LEN 85
|
|
|
+#define MAVLINK_MSG_ID_53003_MIN_LEN 85
|
|
|
|
|
|
-#define MAVLINK_MSG_ID_VK_BMS_STATUS_CRC 200
|
|
|
-#define MAVLINK_MSG_ID_53003_CRC 200
|
|
|
+#define MAVLINK_MSG_ID_VK_BMS_STATUS_CRC 155
|
|
|
+#define MAVLINK_MSG_ID_53003_CRC 155
|
|
|
|
|
|
#define MAVLINK_MSG_VK_BMS_STATUS_FIELD_CELL_VOLT_LEN 30
|
|
|
|
|
|
@@ -39,15 +39,15 @@ typedef struct __mavlink_vk_bms_status_t {
|
|
|
11, \
|
|
|
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vk_bms_status_t, time_boot_ms) }, \
|
|
|
{ "voltage", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_vk_bms_status_t, voltage) }, \
|
|
|
- { "current", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_vk_bms_status_t, current) }, \
|
|
|
- { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_vk_bms_status_t, temperature) }, \
|
|
|
- { "cap_percent", NULL, MAVLINK_TYPE_INT8_T, 0, 80, offsetof(mavlink_vk_bms_status_t, cap_percent) }, \
|
|
|
- { "bat_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 81, offsetof(mavlink_vk_bms_status_t, bat_id) }, \
|
|
|
- { "err_code", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_vk_bms_status_t, err_code) }, \
|
|
|
- { "cell_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_vk_bms_status_t, cell_num) }, \
|
|
|
- { "cell_volt", NULL, MAVLINK_TYPE_UINT16_T, 30, 18, offsetof(mavlink_vk_bms_status_t, cell_volt) }, \
|
|
|
- { "cyc_cnt", NULL, MAVLINK_TYPE_UINT16_T, 0, 78, offsetof(mavlink_vk_bms_status_t, cyc_cnt) }, \
|
|
|
- { "health", NULL, MAVLINK_TYPE_UINT8_T, 0, 82, offsetof(mavlink_vk_bms_status_t, health) }, \
|
|
|
+ { "current", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_vk_bms_status_t, current) }, \
|
|
|
+ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_vk_bms_status_t, temperature) }, \
|
|
|
+ { "cap_percent", NULL, MAVLINK_TYPE_INT8_T, 0, 82, offsetof(mavlink_vk_bms_status_t, cap_percent) }, \
|
|
|
+ { "bat_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 83, offsetof(mavlink_vk_bms_status_t, bat_id) }, \
|
|
|
+ { "err_code", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_vk_bms_status_t, err_code) }, \
|
|
|
+ { "cell_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_vk_bms_status_t, cell_num) }, \
|
|
|
+ { "cell_volt", NULL, MAVLINK_TYPE_UINT16_T, 30, 20, offsetof(mavlink_vk_bms_status_t, cell_volt) }, \
|
|
|
+ { "cyc_cnt", NULL, MAVLINK_TYPE_UINT16_T, 0, 80, offsetof(mavlink_vk_bms_status_t, cyc_cnt) }, \
|
|
|
+ { "health", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_vk_bms_status_t, health) }, \
|
|
|
} \
|
|
|
}
|
|
|
#else
|
|
|
@@ -56,15 +56,15 @@ typedef struct __mavlink_vk_bms_status_t {
|
|
|
11, \
|
|
|
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vk_bms_status_t, time_boot_ms) }, \
|
|
|
{ "voltage", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_vk_bms_status_t, voltage) }, \
|
|
|
- { "current", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_vk_bms_status_t, current) }, \
|
|
|
- { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_vk_bms_status_t, temperature) }, \
|
|
|
- { "cap_percent", NULL, MAVLINK_TYPE_INT8_T, 0, 80, offsetof(mavlink_vk_bms_status_t, cap_percent) }, \
|
|
|
- { "bat_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 81, offsetof(mavlink_vk_bms_status_t, bat_id) }, \
|
|
|
- { "err_code", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_vk_bms_status_t, err_code) }, \
|
|
|
- { "cell_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_vk_bms_status_t, cell_num) }, \
|
|
|
- { "cell_volt", NULL, MAVLINK_TYPE_UINT16_T, 30, 18, offsetof(mavlink_vk_bms_status_t, cell_volt) }, \
|
|
|
- { "cyc_cnt", NULL, MAVLINK_TYPE_UINT16_T, 0, 78, offsetof(mavlink_vk_bms_status_t, cyc_cnt) }, \
|
|
|
- { "health", NULL, MAVLINK_TYPE_UINT8_T, 0, 82, offsetof(mavlink_vk_bms_status_t, health) }, \
|
|
|
+ { "current", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_vk_bms_status_t, current) }, \
|
|
|
+ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_vk_bms_status_t, temperature) }, \
|
|
|
+ { "cap_percent", NULL, MAVLINK_TYPE_INT8_T, 0, 82, offsetof(mavlink_vk_bms_status_t, cap_percent) }, \
|
|
|
+ { "bat_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 83, offsetof(mavlink_vk_bms_status_t, bat_id) }, \
|
|
|
+ { "err_code", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_vk_bms_status_t, err_code) }, \
|
|
|
+ { "cell_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_vk_bms_status_t, cell_num) }, \
|
|
|
+ { "cell_volt", NULL, MAVLINK_TYPE_UINT16_T, 30, 20, offsetof(mavlink_vk_bms_status_t, cell_volt) }, \
|
|
|
+ { "cyc_cnt", NULL, MAVLINK_TYPE_UINT16_T, 0, 80, offsetof(mavlink_vk_bms_status_t, cyc_cnt) }, \
|
|
|
+ { "health", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_vk_bms_status_t, health) }, \
|
|
|
} \
|
|
|
}
|
|
|
#endif
|
|
|
@@ -93,28 +93,28 @@ typedef struct __mavlink_vk_bms_status_t {
|
|
|
* @return length of the message in bytes (excluding serial stream start sign)
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
|
|
- uint32_t time_boot_ms, uint32_t voltage, int16_t current, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt, uint16_t cyc_cnt, uint8_t health)
|
|
|
+ uint32_t time_boot_ms, uint32_t voltage, int32_t current, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt, uint16_t cyc_cnt, uint8_t health)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char buf[MAVLINK_MSG_ID_VK_BMS_STATUS_LEN];
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
- _mav_put_uint32_t(buf, 8, err_code);
|
|
|
- _mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_int16_t(buf, 14, temperature);
|
|
|
- _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
- _mav_put_uint16_t(buf, 78, cyc_cnt);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint8_t(buf, 82, health);
|
|
|
- _mav_put_uint16_t_array(buf, 18, cell_volt, 30);
|
|
|
+ _mav_put_int32_t(buf, 8, current);
|
|
|
+ _mav_put_uint32_t(buf, 12, err_code);
|
|
|
+ _mav_put_int16_t(buf, 16, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
+ _mav_put_uint16_t(buf, 80, cyc_cnt);
|
|
|
+ _mav_put_int8_t(buf, 82, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 83, bat_id);
|
|
|
+ _mav_put_uint8_t(buf, 84, health);
|
|
|
+ _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN);
|
|
|
#else
|
|
|
mavlink_vk_bms_status_t packet;
|
|
|
packet.time_boot_ms = time_boot_ms;
|
|
|
packet.voltage = voltage;
|
|
|
- packet.err_code = err_code;
|
|
|
packet.current = current;
|
|
|
+ packet.err_code = err_code;
|
|
|
packet.temperature = temperature;
|
|
|
packet.cell_num = cell_num;
|
|
|
packet.cyc_cnt = cyc_cnt;
|
|
|
@@ -154,28 +154,28 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack(uint8_t system_id, uint8_t
|
|
|
* @return length of the message in bytes (excluding serial stream start sign)
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
|
|
|
- uint32_t time_boot_ms, uint32_t voltage, int16_t current, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt, uint16_t cyc_cnt, uint8_t health)
|
|
|
+ uint32_t time_boot_ms, uint32_t voltage, int32_t current, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt, uint16_t cyc_cnt, uint8_t health)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char buf[MAVLINK_MSG_ID_VK_BMS_STATUS_LEN];
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
- _mav_put_uint32_t(buf, 8, err_code);
|
|
|
- _mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_int16_t(buf, 14, temperature);
|
|
|
- _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
- _mav_put_uint16_t(buf, 78, cyc_cnt);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint8_t(buf, 82, health);
|
|
|
- _mav_put_uint16_t_array(buf, 18, cell_volt, 30);
|
|
|
+ _mav_put_int32_t(buf, 8, current);
|
|
|
+ _mav_put_uint32_t(buf, 12, err_code);
|
|
|
+ _mav_put_int16_t(buf, 16, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
+ _mav_put_uint16_t(buf, 80, cyc_cnt);
|
|
|
+ _mav_put_int8_t(buf, 82, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 83, bat_id);
|
|
|
+ _mav_put_uint8_t(buf, 84, health);
|
|
|
+ _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN);
|
|
|
#else
|
|
|
mavlink_vk_bms_status_t packet;
|
|
|
packet.time_boot_ms = time_boot_ms;
|
|
|
packet.voltage = voltage;
|
|
|
- packet.err_code = err_code;
|
|
|
packet.current = current;
|
|
|
+ packet.err_code = err_code;
|
|
|
packet.temperature = temperature;
|
|
|
packet.cell_num = cell_num;
|
|
|
packet.cyc_cnt = cyc_cnt;
|
|
|
@@ -219,28 +219,28 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack_status(uint8_t system_id,
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
|
|
mavlink_message_t* msg,
|
|
|
- uint32_t time_boot_ms,uint32_t voltage,int16_t current,int16_t temperature,int8_t cap_percent,uint8_t bat_id,uint32_t err_code,uint16_t cell_num,const uint16_t *cell_volt,uint16_t cyc_cnt,uint8_t health)
|
|
|
+ uint32_t time_boot_ms,uint32_t voltage,int32_t current,int16_t temperature,int8_t cap_percent,uint8_t bat_id,uint32_t err_code,uint16_t cell_num,const uint16_t *cell_volt,uint16_t cyc_cnt,uint8_t health)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char buf[MAVLINK_MSG_ID_VK_BMS_STATUS_LEN];
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
- _mav_put_uint32_t(buf, 8, err_code);
|
|
|
- _mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_int16_t(buf, 14, temperature);
|
|
|
- _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
- _mav_put_uint16_t(buf, 78, cyc_cnt);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint8_t(buf, 82, health);
|
|
|
- _mav_put_uint16_t_array(buf, 18, cell_volt, 30);
|
|
|
+ _mav_put_int32_t(buf, 8, current);
|
|
|
+ _mav_put_uint32_t(buf, 12, err_code);
|
|
|
+ _mav_put_int16_t(buf, 16, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
+ _mav_put_uint16_t(buf, 80, cyc_cnt);
|
|
|
+ _mav_put_int8_t(buf, 82, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 83, bat_id);
|
|
|
+ _mav_put_uint8_t(buf, 84, health);
|
|
|
+ _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN);
|
|
|
#else
|
|
|
mavlink_vk_bms_status_t packet;
|
|
|
packet.time_boot_ms = time_boot_ms;
|
|
|
packet.voltage = voltage;
|
|
|
- packet.err_code = err_code;
|
|
|
packet.current = current;
|
|
|
+ packet.err_code = err_code;
|
|
|
packet.temperature = temperature;
|
|
|
packet.cell_num = cell_num;
|
|
|
packet.cyc_cnt = cyc_cnt;
|
|
|
@@ -318,28 +318,28 @@ static inline uint16_t mavlink_msg_vk_bms_status_encode_status(uint8_t system_id
|
|
|
*/
|
|
|
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
|
|
|
|
|
-static inline void mavlink_msg_vk_bms_status_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t voltage, int16_t current, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt, uint16_t cyc_cnt, uint8_t health)
|
|
|
+static inline void mavlink_msg_vk_bms_status_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t voltage, int32_t current, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt, uint16_t cyc_cnt, uint8_t health)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char buf[MAVLINK_MSG_ID_VK_BMS_STATUS_LEN];
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
- _mav_put_uint32_t(buf, 8, err_code);
|
|
|
- _mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_int16_t(buf, 14, temperature);
|
|
|
- _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
- _mav_put_uint16_t(buf, 78, cyc_cnt);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint8_t(buf, 82, health);
|
|
|
- _mav_put_uint16_t_array(buf, 18, cell_volt, 30);
|
|
|
+ _mav_put_int32_t(buf, 8, current);
|
|
|
+ _mav_put_uint32_t(buf, 12, err_code);
|
|
|
+ _mav_put_int16_t(buf, 16, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
+ _mav_put_uint16_t(buf, 80, cyc_cnt);
|
|
|
+ _mav_put_int8_t(buf, 82, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 83, bat_id);
|
|
|
+ _mav_put_uint8_t(buf, 84, health);
|
|
|
+ _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_BMS_STATUS, buf, MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN, MAVLINK_MSG_ID_VK_BMS_STATUS_CRC);
|
|
|
#else
|
|
|
mavlink_vk_bms_status_t packet;
|
|
|
packet.time_boot_ms = time_boot_ms;
|
|
|
packet.voltage = voltage;
|
|
|
- packet.err_code = err_code;
|
|
|
packet.current = current;
|
|
|
+ packet.err_code = err_code;
|
|
|
packet.temperature = temperature;
|
|
|
packet.cell_num = cell_num;
|
|
|
packet.cyc_cnt = cyc_cnt;
|
|
|
@@ -373,28 +373,28 @@ static inline void mavlink_msg_vk_bms_status_send_struct(mavlink_channel_t chan,
|
|
|
is usually the receive buffer for the channel, and allows a reply to an
|
|
|
incoming message with minimum stack space usage.
|
|
|
*/
|
|
|
-static inline void mavlink_msg_vk_bms_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t voltage, int16_t current, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt, uint16_t cyc_cnt, uint8_t health)
|
|
|
+static inline void mavlink_msg_vk_bms_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t voltage, int32_t current, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt, uint16_t cyc_cnt, uint8_t health)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char *buf = (char *)msgbuf;
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
- _mav_put_uint32_t(buf, 8, err_code);
|
|
|
- _mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_int16_t(buf, 14, temperature);
|
|
|
- _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
- _mav_put_uint16_t(buf, 78, cyc_cnt);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint8_t(buf, 82, health);
|
|
|
- _mav_put_uint16_t_array(buf, 18, cell_volt, 30);
|
|
|
+ _mav_put_int32_t(buf, 8, current);
|
|
|
+ _mav_put_uint32_t(buf, 12, err_code);
|
|
|
+ _mav_put_int16_t(buf, 16, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
+ _mav_put_uint16_t(buf, 80, cyc_cnt);
|
|
|
+ _mav_put_int8_t(buf, 82, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 83, bat_id);
|
|
|
+ _mav_put_uint8_t(buf, 84, health);
|
|
|
+ _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_BMS_STATUS, buf, MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN, MAVLINK_MSG_ID_VK_BMS_STATUS_CRC);
|
|
|
#else
|
|
|
mavlink_vk_bms_status_t *packet = (mavlink_vk_bms_status_t *)msgbuf;
|
|
|
packet->time_boot_ms = time_boot_ms;
|
|
|
packet->voltage = voltage;
|
|
|
- packet->err_code = err_code;
|
|
|
packet->current = current;
|
|
|
+ packet->err_code = err_code;
|
|
|
packet->temperature = temperature;
|
|
|
packet->cell_num = cell_num;
|
|
|
packet->cyc_cnt = cyc_cnt;
|
|
|
@@ -438,9 +438,9 @@ static inline uint32_t mavlink_msg_vk_bms_status_get_voltage(const mavlink_messa
|
|
|
* @return [cA] BMS current in cA, negative value means in
|
|
|
charging
|
|
|
*/
|
|
|
-static inline int16_t mavlink_msg_vk_bms_status_get_current(const mavlink_message_t* msg)
|
|
|
+static inline int32_t mavlink_msg_vk_bms_status_get_current(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_int16_t(msg, 12);
|
|
|
+ return _MAV_RETURN_int32_t(msg, 8);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -450,7 +450,7 @@ static inline int16_t mavlink_msg_vk_bms_status_get_current(const mavlink_messag
|
|
|
*/
|
|
|
static inline int16_t mavlink_msg_vk_bms_status_get_temperature(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_int16_t(msg, 14);
|
|
|
+ return _MAV_RETURN_int16_t(msg, 16);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -460,7 +460,7 @@ static inline int16_t mavlink_msg_vk_bms_status_get_temperature(const mavlink_me
|
|
|
*/
|
|
|
static inline int8_t mavlink_msg_vk_bms_status_get_cap_percent(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_int8_t(msg, 80);
|
|
|
+ return _MAV_RETURN_int8_t(msg, 82);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -471,7 +471,7 @@ static inline int8_t mavlink_msg_vk_bms_status_get_cap_percent(const mavlink_mes
|
|
|
*/
|
|
|
static inline uint8_t mavlink_msg_vk_bms_status_get_bat_id(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_uint8_t(msg, 81);
|
|
|
+ return _MAV_RETURN_uint8_t(msg, 83);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -482,7 +482,7 @@ static inline uint8_t mavlink_msg_vk_bms_status_get_bat_id(const mavlink_message
|
|
|
*/
|
|
|
static inline uint32_t mavlink_msg_vk_bms_status_get_err_code(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_uint32_t(msg, 8);
|
|
|
+ return _MAV_RETURN_uint32_t(msg, 12);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -492,7 +492,7 @@ static inline uint32_t mavlink_msg_vk_bms_status_get_err_code(const mavlink_mess
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_get_cell_num(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_uint16_t(msg, 16);
|
|
|
+ return _MAV_RETURN_uint16_t(msg, 18);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -502,7 +502,7 @@ static inline uint16_t mavlink_msg_vk_bms_status_get_cell_num(const mavlink_mess
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_get_cell_volt(const mavlink_message_t* msg, uint16_t *cell_volt)
|
|
|
{
|
|
|
- return _MAV_RETURN_uint16_t_array(msg, cell_volt, 30, 18);
|
|
|
+ return _MAV_RETURN_uint16_t_array(msg, cell_volt, 30, 20);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -512,7 +512,7 @@ static inline uint16_t mavlink_msg_vk_bms_status_get_cell_volt(const mavlink_mes
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_get_cyc_cnt(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_uint16_t(msg, 78);
|
|
|
+ return _MAV_RETURN_uint16_t(msg, 80);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -523,7 +523,7 @@ static inline uint16_t mavlink_msg_vk_bms_status_get_cyc_cnt(const mavlink_messa
|
|
|
*/
|
|
|
static inline uint8_t mavlink_msg_vk_bms_status_get_health(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_uint8_t(msg, 82);
|
|
|
+ return _MAV_RETURN_uint8_t(msg, 84);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -537,8 +537,8 @@ static inline void mavlink_msg_vk_bms_status_decode(const mavlink_message_t* msg
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
vk_bms_status->time_boot_ms = mavlink_msg_vk_bms_status_get_time_boot_ms(msg);
|
|
|
vk_bms_status->voltage = mavlink_msg_vk_bms_status_get_voltage(msg);
|
|
|
- vk_bms_status->err_code = mavlink_msg_vk_bms_status_get_err_code(msg);
|
|
|
vk_bms_status->current = mavlink_msg_vk_bms_status_get_current(msg);
|
|
|
+ vk_bms_status->err_code = mavlink_msg_vk_bms_status_get_err_code(msg);
|
|
|
vk_bms_status->temperature = mavlink_msg_vk_bms_status_get_temperature(msg);
|
|
|
vk_bms_status->cell_num = mavlink_msg_vk_bms_status_get_cell_num(msg);
|
|
|
mavlink_msg_vk_bms_status_get_cell_volt(msg, vk_bms_status->cell_volt);
|