Commit 81aee157 authored by 时昊's avatar 时昊

feat:增加胎压数据调试代码,增加串口打印

parent 035afd54
...@@ -211,7 +211,7 @@ static Protocol_uint32_t Protocol_UartSend(const Protocol_uint8_t *pData, Protoc ...@@ -211,7 +211,7 @@ static Protocol_uint32_t Protocol_UartSend(const Protocol_uint8_t *pData, Protoc
static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板数据 static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板数据
{ {
if ( pData->CmdID == 0x20 )//收到底板发送的数据后,传状态 if ( pData->CmdID == 0x20 )//收到底板发送的数据后,才会发送0x12,0x01,0x02的id
{ {
//printf("0x20 is get\r\n"); //printf("0x20 is get\r\n");
if(Prot_User.State < Prot_Start) if(Prot_User.State < Prot_Start)
...@@ -328,19 +328,26 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型 ...@@ -328,19 +328,26 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
void Uart_Send_Id01_Pro(void) void Uart_Send_Id01_Pro(void)
{ {
uint8_t ID01[6] = {0x00,0x00,0x00,0x00,0x00,0x00}; uint8_t ID01[7] = {0x00,0x00,0x00,0x00,0x00,0x00};
if(Ble_User.Tpms_Updat) //if(Ble_User.Tpms_Updat)
{ {
ID01[0] = Ble_Tpms_Data.Tpms_Sts; // ID01[0] = Ble_Tpms_Data.Tpms_Sts;
ID01[1] = Ble_Tpms_Data.Tpms_Turn; // ID01[1] = Ble_Tpms_Data.Tpms_Turn;
ID01[2] = Ble_Tpms_Data.Tpms_Dte[0]; // ID01[2] = Ble_Tpms_Data.Tpms_Dte[0];
ID01[3] = Ble_Tpms_Data.Tpms_Dte[1]; // ID01[3] = Ble_Tpms_Data.Tpms_Dte[1];
ID01[4] = Ble_Tpms_Data.Tpms_Dte[2]; // ID01[4] = Ble_Tpms_Data.Tpms_Dte[2];
ID01[5] = Ble_Tpms_Data.Tpms_Dte[3]; // ID01[5] = Ble_Tpms_Data.Tpms_Dte[3];
ID01[0] = 0xFF;//胎压状态
ID01[1] = 1;//前轮高字节气压值
ID01[2] = 200;//前轮低字节气压值
ID01[3] = 0x28;//前轮胎压温度
ID01[4] = 1;//后轮高字节气压值
ID01[5] = 45;//后轮低字节气压值
ID01[6] = 0xAB;//后轮胎压温度
//printf("转向编码:%d\r\n",Ble_Tpms_Data.Tpms_Turn); //printf("转向编码:%d\r\n",Ble_Tpms_Data.Tpms_Turn);
} }
Protocol_Send(0x01,ID01,6); Protocol_Send(0x01,ID01,7);
} }
...@@ -363,20 +370,21 @@ void Prot_Send_Msg_Process(void ) ...@@ -363,20 +370,21 @@ void Prot_Send_Msg_Process(void )
// printf("send 0x10 \r\n"); // printf("send 0x10 \r\n");
} }
if(Prot_User.State >= Prot_Start) //printf("Prot_User.State = %d\r\n",Prot_User.State);
if(Prot_User.State >= Prot_Start)//收到底板发送的0x20后,才执行
{ {
if(Prot_User.TimeDelay == 0) if(Prot_User.TimeDelay == 0)
{ {
Uart_Send_Id12_Pro(); Uart_Send_Id12_Pro();
Prot_User.TimeDelay++; Prot_User.TimeDelay++;
// printf("send 0x12 \r\n"); //printf("send 0x12 \r\n");
} }
else else
{ {
Uart_Send_Id01_Pro(); Uart_Send_Id01_Pro();
Uart_Send_Id02_Pro(); Uart_Send_Id02_Pro();
Prot_User.TimeDelay = 0; Prot_User.TimeDelay = 0;
//printf("send 0x01 0x02 \r\n"); //printf("send 0x01 0x02 \r\n");
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment