|
@@ -10,8 +10,6 @@ typedef struct __mavlink_vk_bms_status_t {
|
|
|
uint32_t err_code; /*< BMS error code,
|
|
|
0 means no error*/
|
|
|
int16_t current; /*< [cA] BMS current in cA, negative value means in charging*/
|
|
|
- uint16_t cyc_cnt; /*< BMS change and discharge
|
|
|
- cycle times*/
|
|
|
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*/
|
|
@@ -20,13 +18,13 @@ typedef struct __mavlink_vk_bms_status_t {
|
|
|
0*/
|
|
|
} mavlink_vk_bms_status_t;
|
|
|
|
|
|
-#define MAVLINK_MSG_ID_VK_BMS_STATUS_LEN 82
|
|
|
-#define MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN 82
|
|
|
-#define MAVLINK_MSG_ID_53003_LEN 82
|
|
|
-#define MAVLINK_MSG_ID_53003_MIN_LEN 82
|
|
|
+#define MAVLINK_MSG_ID_VK_BMS_STATUS_LEN 80
|
|
|
+#define MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN 80
|
|
|
+#define MAVLINK_MSG_ID_53003_LEN 80
|
|
|
+#define MAVLINK_MSG_ID_53003_MIN_LEN 80
|
|
|
|
|
|
-#define MAVLINK_MSG_ID_VK_BMS_STATUS_CRC 13
|
|
|
-#define MAVLINK_MSG_ID_53003_CRC 13
|
|
|
+#define MAVLINK_MSG_ID_VK_BMS_STATUS_CRC 43
|
|
|
+#define MAVLINK_MSG_ID_53003_CRC 43
|
|
|
|
|
|
#define MAVLINK_MSG_VK_BMS_STATUS_FIELD_CELL_VOLT_LEN 30
|
|
|
|
|
@@ -34,33 +32,31 @@ typedef struct __mavlink_vk_bms_status_t {
|
|
|
#define MAVLINK_MESSAGE_INFO_VK_BMS_STATUS { \
|
|
|
53003, \
|
|
|
"VK_BMS_STATUS", \
|
|
|
- 10, \
|
|
|
+ 9, \
|
|
|
{ { "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) }, \
|
|
|
- { "cyc_cnt", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_vk_bms_status_t, cyc_cnt) }, \
|
|
|
- { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 16, 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) }, \
|
|
|
+ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_vk_bms_status_t, temperature) }, \
|
|
|
+ { "cap_percent", NULL, MAVLINK_TYPE_INT8_T, 0, 78, offsetof(mavlink_vk_bms_status_t, cap_percent) }, \
|
|
|
+ { "bat_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 79, 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, 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) }, \
|
|
|
+ { "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) }, \
|
|
|
} \
|
|
|
}
|
|
|
#else
|
|
|
#define MAVLINK_MESSAGE_INFO_VK_BMS_STATUS { \
|
|
|
"VK_BMS_STATUS", \
|
|
|
- 10, \
|
|
|
+ 9, \
|
|
|
{ { "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) }, \
|
|
|
- { "cyc_cnt", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_vk_bms_status_t, cyc_cnt) }, \
|
|
|
- { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 16, 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) }, \
|
|
|
+ { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_vk_bms_status_t, temperature) }, \
|
|
|
+ { "cap_percent", NULL, MAVLINK_TYPE_INT8_T, 0, 78, offsetof(mavlink_vk_bms_status_t, cap_percent) }, \
|
|
|
+ { "bat_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 79, 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, 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) }, \
|
|
|
+ { "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) }, \
|
|
|
} \
|
|
|
}
|
|
|
#endif
|
|
@@ -74,8 +70,6 @@ typedef struct __mavlink_vk_bms_status_t {
|
|
|
* @param time_boot_ms [ms] Timestamp in ms from system boot.
|
|
|
* @param voltage [mV] BMS voltage in mV
|
|
|
* @param current [cA] BMS current in cA, negative value means in charging
|
|
|
- * @param cyc_cnt BMS change and discharge
|
|
|
- cycle times
|
|
|
* @param temperature [degC] BMS temperature in degC
|
|
|
* @param cap_percent [%] BMS remaining power in percentage
|
|
|
* @param bat_id BMS id, start from
|
|
@@ -87,7 +81,7 @@ 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, uint16_t cyc_cnt, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt)
|
|
|
+ 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)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char buf[MAVLINK_MSG_ID_VK_BMS_STATUS_LEN];
|
|
@@ -95,12 +89,11 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack(uint8_t system_id, uint8_t
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
_mav_put_uint32_t(buf, 8, err_code);
|
|
|
_mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_uint16_t(buf, 14, cyc_cnt);
|
|
|
- _mav_put_int16_t(buf, 16, temperature);
|
|
|
- _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
+ _mav_put_int16_t(buf, 14, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
+ _mav_put_int8_t(buf, 78, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 79, bat_id);
|
|
|
+ _mav_put_uint16_t_array(buf, 18, cell_volt, 30);
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN);
|
|
|
#else
|
|
|
mavlink_vk_bms_status_t packet;
|
|
@@ -108,7 +101,6 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack(uint8_t system_id, uint8_t
|
|
|
packet.voltage = voltage;
|
|
|
packet.err_code = err_code;
|
|
|
packet.current = current;
|
|
|
- packet.cyc_cnt = cyc_cnt;
|
|
|
packet.temperature = temperature;
|
|
|
packet.cell_num = cell_num;
|
|
|
packet.cap_percent = cap_percent;
|
|
@@ -131,8 +123,6 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack(uint8_t system_id, uint8_t
|
|
|
* @param time_boot_ms [ms] Timestamp in ms from system boot.
|
|
|
* @param voltage [mV] BMS voltage in mV
|
|
|
* @param current [cA] BMS current in cA, negative value means in charging
|
|
|
- * @param cyc_cnt BMS change and discharge
|
|
|
- cycle times
|
|
|
* @param temperature [degC] BMS temperature in degC
|
|
|
* @param cap_percent [%] BMS remaining power in percentage
|
|
|
* @param bat_id BMS id, start from
|
|
@@ -144,7 +134,7 @@ 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, uint16_t cyc_cnt, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt)
|
|
|
+ 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)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char buf[MAVLINK_MSG_ID_VK_BMS_STATUS_LEN];
|
|
@@ -152,12 +142,11 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack_status(uint8_t system_id,
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
_mav_put_uint32_t(buf, 8, err_code);
|
|
|
_mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_uint16_t(buf, 14, cyc_cnt);
|
|
|
- _mav_put_int16_t(buf, 16, temperature);
|
|
|
- _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
+ _mav_put_int16_t(buf, 14, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
+ _mav_put_int8_t(buf, 78, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 79, bat_id);
|
|
|
+ _mav_put_uint16_t_array(buf, 18, cell_volt, 30);
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN);
|
|
|
#else
|
|
|
mavlink_vk_bms_status_t packet;
|
|
@@ -165,7 +154,6 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack_status(uint8_t system_id,
|
|
|
packet.voltage = voltage;
|
|
|
packet.err_code = err_code;
|
|
|
packet.current = current;
|
|
|
- packet.cyc_cnt = cyc_cnt;
|
|
|
packet.temperature = temperature;
|
|
|
packet.cell_num = cell_num;
|
|
|
packet.cap_percent = cap_percent;
|
|
@@ -191,8 +179,6 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack_status(uint8_t system_id,
|
|
|
* @param time_boot_ms [ms] Timestamp in ms from system boot.
|
|
|
* @param voltage [mV] BMS voltage in mV
|
|
|
* @param current [cA] BMS current in cA, negative value means in charging
|
|
|
- * @param cyc_cnt BMS change and discharge
|
|
|
- cycle times
|
|
|
* @param temperature [degC] BMS temperature in degC
|
|
|
* @param cap_percent [%] BMS remaining power in percentage
|
|
|
* @param bat_id BMS id, start from
|
|
@@ -205,7 +191,7 @@ 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,uint16_t cyc_cnt,int16_t temperature,int8_t cap_percent,uint8_t bat_id,uint32_t err_code,uint16_t cell_num,const uint16_t *cell_volt)
|
|
|
+ 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)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char buf[MAVLINK_MSG_ID_VK_BMS_STATUS_LEN];
|
|
@@ -213,12 +199,11 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack_chan(uint8_t system_id, ui
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
_mav_put_uint32_t(buf, 8, err_code);
|
|
|
_mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_uint16_t(buf, 14, cyc_cnt);
|
|
|
- _mav_put_int16_t(buf, 16, temperature);
|
|
|
- _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
+ _mav_put_int16_t(buf, 14, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
+ _mav_put_int8_t(buf, 78, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 79, bat_id);
|
|
|
+ _mav_put_uint16_t_array(buf, 18, cell_volt, 30);
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN);
|
|
|
#else
|
|
|
mavlink_vk_bms_status_t packet;
|
|
@@ -226,7 +211,6 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack_chan(uint8_t system_id, ui
|
|
|
packet.voltage = voltage;
|
|
|
packet.err_code = err_code;
|
|
|
packet.current = current;
|
|
|
- packet.cyc_cnt = cyc_cnt;
|
|
|
packet.temperature = temperature;
|
|
|
packet.cell_num = cell_num;
|
|
|
packet.cap_percent = cap_percent;
|
|
@@ -249,7 +233,7 @@ static inline uint16_t mavlink_msg_vk_bms_status_pack_chan(uint8_t system_id, ui
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vk_bms_status_t* vk_bms_status)
|
|
|
{
|
|
|
- return mavlink_msg_vk_bms_status_pack(system_id, component_id, msg, vk_bms_status->time_boot_ms, vk_bms_status->voltage, vk_bms_status->current, vk_bms_status->cyc_cnt, vk_bms_status->temperature, vk_bms_status->cap_percent, vk_bms_status->bat_id, vk_bms_status->err_code, vk_bms_status->cell_num, vk_bms_status->cell_volt);
|
|
|
+ return mavlink_msg_vk_bms_status_pack(system_id, component_id, msg, vk_bms_status->time_boot_ms, vk_bms_status->voltage, vk_bms_status->current, vk_bms_status->temperature, vk_bms_status->cap_percent, vk_bms_status->bat_id, vk_bms_status->err_code, vk_bms_status->cell_num, vk_bms_status->cell_volt);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -263,7 +247,7 @@ static inline uint16_t mavlink_msg_vk_bms_status_encode(uint8_t system_id, uint8
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vk_bms_status_t* vk_bms_status)
|
|
|
{
|
|
|
- return mavlink_msg_vk_bms_status_pack_chan(system_id, component_id, chan, msg, vk_bms_status->time_boot_ms, vk_bms_status->voltage, vk_bms_status->current, vk_bms_status->cyc_cnt, vk_bms_status->temperature, vk_bms_status->cap_percent, vk_bms_status->bat_id, vk_bms_status->err_code, vk_bms_status->cell_num, vk_bms_status->cell_volt);
|
|
|
+ return mavlink_msg_vk_bms_status_pack_chan(system_id, component_id, chan, msg, vk_bms_status->time_boot_ms, vk_bms_status->voltage, vk_bms_status->current, vk_bms_status->temperature, vk_bms_status->cap_percent, vk_bms_status->bat_id, vk_bms_status->err_code, vk_bms_status->cell_num, vk_bms_status->cell_volt);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -277,7 +261,7 @@ static inline uint16_t mavlink_msg_vk_bms_status_encode_chan(uint8_t system_id,
|
|
|
*/
|
|
|
static inline uint16_t mavlink_msg_vk_bms_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_vk_bms_status_t* vk_bms_status)
|
|
|
{
|
|
|
- return mavlink_msg_vk_bms_status_pack_status(system_id, component_id, _status, msg, vk_bms_status->time_boot_ms, vk_bms_status->voltage, vk_bms_status->current, vk_bms_status->cyc_cnt, vk_bms_status->temperature, vk_bms_status->cap_percent, vk_bms_status->bat_id, vk_bms_status->err_code, vk_bms_status->cell_num, vk_bms_status->cell_volt);
|
|
|
+ return mavlink_msg_vk_bms_status_pack_status(system_id, component_id, _status, msg, vk_bms_status->time_boot_ms, vk_bms_status->voltage, vk_bms_status->current, vk_bms_status->temperature, vk_bms_status->cap_percent, vk_bms_status->bat_id, vk_bms_status->err_code, vk_bms_status->cell_num, vk_bms_status->cell_volt);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -287,8 +271,6 @@ static inline uint16_t mavlink_msg_vk_bms_status_encode_status(uint8_t system_id
|
|
|
* @param time_boot_ms [ms] Timestamp in ms from system boot.
|
|
|
* @param voltage [mV] BMS voltage in mV
|
|
|
* @param current [cA] BMS current in cA, negative value means in charging
|
|
|
- * @param cyc_cnt BMS change and discharge
|
|
|
- cycle times
|
|
|
* @param temperature [degC] BMS temperature in degC
|
|
|
* @param cap_percent [%] BMS remaining power in percentage
|
|
|
* @param bat_id BMS id, start from
|
|
@@ -300,7 +282,7 @@ 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, uint16_t cyc_cnt, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt)
|
|
|
+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)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char buf[MAVLINK_MSG_ID_VK_BMS_STATUS_LEN];
|
|
@@ -308,12 +290,11 @@ static inline void mavlink_msg_vk_bms_status_send(mavlink_channel_t chan, uint32
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
_mav_put_uint32_t(buf, 8, err_code);
|
|
|
_mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_uint16_t(buf, 14, cyc_cnt);
|
|
|
- _mav_put_int16_t(buf, 16, temperature);
|
|
|
- _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
+ _mav_put_int16_t(buf, 14, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
+ _mav_put_int8_t(buf, 78, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 79, bat_id);
|
|
|
+ _mav_put_uint16_t_array(buf, 18, 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;
|
|
@@ -321,7 +302,6 @@ static inline void mavlink_msg_vk_bms_status_send(mavlink_channel_t chan, uint32
|
|
|
packet.voltage = voltage;
|
|
|
packet.err_code = err_code;
|
|
|
packet.current = current;
|
|
|
- packet.cyc_cnt = cyc_cnt;
|
|
|
packet.temperature = temperature;
|
|
|
packet.cell_num = cell_num;
|
|
|
packet.cap_percent = cap_percent;
|
|
@@ -339,7 +319,7 @@ static inline void mavlink_msg_vk_bms_status_send(mavlink_channel_t chan, uint32
|
|
|
static inline void mavlink_msg_vk_bms_status_send_struct(mavlink_channel_t chan, const mavlink_vk_bms_status_t* vk_bms_status)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
- mavlink_msg_vk_bms_status_send(chan, vk_bms_status->time_boot_ms, vk_bms_status->voltage, vk_bms_status->current, vk_bms_status->cyc_cnt, vk_bms_status->temperature, vk_bms_status->cap_percent, vk_bms_status->bat_id, vk_bms_status->err_code, vk_bms_status->cell_num, vk_bms_status->cell_volt);
|
|
|
+ mavlink_msg_vk_bms_status_send(chan, vk_bms_status->time_boot_ms, vk_bms_status->voltage, vk_bms_status->current, vk_bms_status->temperature, vk_bms_status->cap_percent, vk_bms_status->bat_id, vk_bms_status->err_code, vk_bms_status->cell_num, vk_bms_status->cell_volt);
|
|
|
#else
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_BMS_STATUS, (const char *)vk_bms_status, MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN, MAVLINK_MSG_ID_VK_BMS_STATUS_LEN, MAVLINK_MSG_ID_VK_BMS_STATUS_CRC);
|
|
|
#endif
|
|
@@ -353,7 +333,7 @@ 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, uint16_t cyc_cnt, int16_t temperature, int8_t cap_percent, uint8_t bat_id, uint32_t err_code, uint16_t cell_num, const uint16_t *cell_volt)
|
|
|
+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)
|
|
|
{
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
char *buf = (char *)msgbuf;
|
|
@@ -361,12 +341,11 @@ static inline void mavlink_msg_vk_bms_status_send_buf(mavlink_message_t *msgbuf,
|
|
|
_mav_put_uint32_t(buf, 4, voltage);
|
|
|
_mav_put_uint32_t(buf, 8, err_code);
|
|
|
_mav_put_int16_t(buf, 12, current);
|
|
|
- _mav_put_uint16_t(buf, 14, cyc_cnt);
|
|
|
- _mav_put_int16_t(buf, 16, temperature);
|
|
|
- _mav_put_uint16_t(buf, 18, cell_num);
|
|
|
- _mav_put_int8_t(buf, 80, cap_percent);
|
|
|
- _mav_put_uint8_t(buf, 81, bat_id);
|
|
|
- _mav_put_uint16_t_array(buf, 20, cell_volt, 30);
|
|
|
+ _mav_put_int16_t(buf, 14, temperature);
|
|
|
+ _mav_put_uint16_t(buf, 16, cell_num);
|
|
|
+ _mav_put_int8_t(buf, 78, cap_percent);
|
|
|
+ _mav_put_uint8_t(buf, 79, bat_id);
|
|
|
+ _mav_put_uint16_t_array(buf, 18, 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;
|
|
@@ -374,7 +353,6 @@ static inline void mavlink_msg_vk_bms_status_send_buf(mavlink_message_t *msgbuf,
|
|
|
packet->voltage = voltage;
|
|
|
packet->err_code = err_code;
|
|
|
packet->current = current;
|
|
|
- packet->cyc_cnt = cyc_cnt;
|
|
|
packet->temperature = temperature;
|
|
|
packet->cell_num = cell_num;
|
|
|
packet->cap_percent = cap_percent;
|
|
@@ -420,17 +398,6 @@ static inline int16_t mavlink_msg_vk_bms_status_get_current(const mavlink_messag
|
|
|
return _MAV_RETURN_int16_t(msg, 12);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * @brief Get field cyc_cnt from vk_bms_status message
|
|
|
- *
|
|
|
- * @return BMS change and discharge
|
|
|
- cycle times
|
|
|
- */
|
|
|
-static inline uint16_t mavlink_msg_vk_bms_status_get_cyc_cnt(const mavlink_message_t* msg)
|
|
|
-{
|
|
|
- return _MAV_RETURN_uint16_t(msg, 14);
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* @brief Get field temperature from vk_bms_status message
|
|
|
*
|
|
@@ -438,7 +405,7 @@ static inline uint16_t mavlink_msg_vk_bms_status_get_cyc_cnt(const mavlink_messa
|
|
|
*/
|
|
|
static inline int16_t mavlink_msg_vk_bms_status_get_temperature(const mavlink_message_t* msg)
|
|
|
{
|
|
|
- return _MAV_RETURN_int16_t(msg, 16);
|
|
|
+ return _MAV_RETURN_int16_t(msg, 14);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -448,7 +415,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, 78);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -459,7 +426,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, 79);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -480,7 +447,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, 18);
|
|
|
+ return _MAV_RETURN_uint16_t(msg, 16);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -490,7 +457,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, 20);
|
|
|
+ return _MAV_RETURN_uint16_t_array(msg, cell_volt, 30, 18);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -506,7 +473,6 @@ static inline void mavlink_msg_vk_bms_status_decode(const mavlink_message_t* 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->cyc_cnt = mavlink_msg_vk_bms_status_get_cyc_cnt(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);
|