|
@@ -43,7 +43,7 @@ uint16_t _checksum(uint8_t *data, uint16_t size) {
|
|
|
static int get_response_data(uint8_t *data, uint8_t operate, uint8_t result){
|
|
static int get_response_data(uint8_t *data, uint8_t operate, uint8_t result){
|
|
|
comm_head_t *head = (comm_head_t *)data;
|
|
comm_head_t *head = (comm_head_t *)data;
|
|
|
head->size = sizeof(comm_head_t);
|
|
head->size = sizeof(comm_head_t);
|
|
|
- head->type = 0x30;
|
|
|
|
|
|
|
+ head->type = bms_state_get()->bms_addr;
|
|
|
head->dir = 0x16;
|
|
head->dir = 0x16;
|
|
|
head->bStatus = 1;
|
|
head->bStatus = 1;
|
|
|
head->cmd = 0x10;
|
|
head->cmd = 0x10;
|
|
@@ -111,7 +111,7 @@ static int get_response_data(uint8_t *data, uint8_t operate, uint8_t result){
|
|
|
static int protocol_old_process_binary(uart_enum_t uart_no, uint8_t *data, int len){
|
|
static int protocol_old_process_binary(uart_enum_t uart_no, uint8_t *data, int len){
|
|
|
current_uart = uart_no;
|
|
current_uart = uart_no;
|
|
|
comm_head_t *head = (comm_head_t *)data;
|
|
comm_head_t *head = (comm_head_t *)data;
|
|
|
- if (/*head->type != 0x30 || */head->dir != 0x16 || head->bStatus == 1 || head->size < sizeof(comm_head_t)){
|
|
|
|
|
|
|
+ if (head->type != bms_state_get()->bms_addr || head->dir != 0x16 || head->bStatus == 1 || head->size < sizeof(comm_head_t)){
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|
|
|
uint16_t checksum = head->checksum;
|
|
uint16_t checksum = head->checksum;
|