Commit 4a77af30 authored by 时昊's avatar 时昊

feat:替换名字

parent 62b011ae
......@@ -258,7 +258,7 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)//esp接收底板
}
}
}
else if(pData->CmdID == 0x21 )
else if(pData->CmdID == 0x21 )//esp32收到底板发送的是1,则esp32需要升级
{
//printf("Wifi_OTA_Request is %d\r\n",Wifi_OTA_Request);
if(pData->Data[0] == 1)
......@@ -332,16 +332,16 @@ void Uart_Send_Id12_Pro(void )//收到底板回复的0x20后,发送蓝牙类型
void Uart_Send_Id01_Pro(void)
{
uint8_t ID01[6] = {0x00,0x00,0x00,0x00,0x00,0x00};
if(Ble_User.Navi_Updat)
if(Ble_User.Tpms_Updat)
{
ID01[0] = Ble_Navi_Data.Navi_Sts;
ID01[1] = Ble_Navi_Data.Navi_Turn;
ID01[2] = Ble_Navi_Data.Navi_Dte[0];
ID01[3] = Ble_Navi_Data.Navi_Dte[1];
ID01[4] = Ble_Navi_Data.Navi_Dte[2];
ID01[5] = Ble_Navi_Data.Navi_Dte[3];
ID01[0] = Ble_Tpms_Data.Tpms_Sts;
ID01[1] = Ble_Tpms_Data.Tpms_Turn;
ID01[2] = Ble_Tpms_Data.Tpms_Dte[0];
ID01[3] = Ble_Tpms_Data.Tpms_Dte[1];
ID01[4] = Ble_Tpms_Data.Tpms_Dte[2];
ID01[5] = Ble_Tpms_Data.Tpms_Dte[3];
//printf("转向编码:%d\r\n",Ble_Navi_Data.Navi_Turn);
//printf("转向编码:%d\r\n",Ble_Tpms_Data.Tpms_Turn);
}
Protocol_Send(0x01,ID01,6);
}
......
......@@ -4,15 +4,6 @@
#include "Protocol_Lib.h"
#define BLE_START_STA 0x10
#define MCU_REPLY 0x20
#define BLE_NAVIGATION 0x01
#define BLE_WEATHER 0x02
#define BLE_LOCATION 0x03
#define BLE_STA 0x12
#define MCU_TO_BLE_INFO 0x21
void Protocol_KL30_Wakeup_Init(void);
void Protocol_Send_Service(void); // 10ms任务调用
void UART_Put(Protocol_uint16_t Data);
......
......@@ -34,7 +34,7 @@ SemaphoreHandle_t BleRecSuc_Semaphore;
Ble_User_Control_Struct Ble_User;
Ble_Navi_Info_Struct Ble_Navi_Data;
Ble_Tpms_Info_Struct Ble_Tpms_Data;
uint8_t tp_Ble_Crc(uint8_t *data, uint32_t len )
......@@ -320,7 +320,7 @@ void Ble_MsgRec_Authr_Result_Analysis(void )
if(BleRecData.Msg.Param[0] == 0)
{
Ble_User.Ble_Sts = Ble_Authr;
Ble_User.Request_Navi = 1;
Ble_User.Request_Tpms = 1;
printf("Authr suc\n");
}
......@@ -328,12 +328,12 @@ void Ble_MsgRec_Authr_Result_Analysis(void )
void Ble_Msg_RequestNavi_RLY(void )
void Ble_Msg_RequestTpms_RLY(void )
{
uint8_t total_frame = 0;
uint8_t trans_len = 0;
if(Ble_User.Request_Navi)
if(Ble_User.Request_Tpms)
{
BleTransData.Msg.FrameHeader = 0x24;
BleTransData.Msg.Cmd = 0x14;
......@@ -383,45 +383,45 @@ void Ble_Msg_RequestNavi_RLY(void )
// vTaskDelay(1);
}
Ble_User.Request_Navi = 0;
Ble_User.Request_Tpms = 0;
}
}
void Ble_MsgRec_Navi_Analysis(void )
void Ble_MsgRec_Tpms_Analysis(void )
{
//Navi data
Ble_Navi_Data.Navi_Sts = BleRecData.Msg.Param[0];
Ble_Navi_Data.Navi_Turn = BleRecData.Msg.Param[1];
Ble_Navi_Data.Navi_Dte[0] = BleRecData.Msg.Param[2];
Ble_Navi_Data.Navi_Dte[1] = BleRecData.Msg.Param[3];
Ble_Navi_Data.Navi_Dte[2] = BleRecData.Msg.Param[4];
Ble_Navi_Data.Navi_Dte[3] = BleRecData.Msg.Param[5];
//Tpms data
Ble_Tpms_Data.Tpms_Sts = BleRecData.Msg.Param[0];
Ble_Tpms_Data.Tpms_Turn = BleRecData.Msg.Param[1];
Ble_Tpms_Data.Tpms_Dte[0] = BleRecData.Msg.Param[2];
Ble_Tpms_Data.Tpms_Dte[1] = BleRecData.Msg.Param[3];
Ble_Tpms_Data.Tpms_Dte[2] = BleRecData.Msg.Param[4];
Ble_Tpms_Data.Tpms_Dte[3] = BleRecData.Msg.Param[5];
printf("Navi sts %d Navi_Turn %x Navi_Dte0 %x Navi_Dte1 %x Navi_Dte2 %x Navi_Dte3 %x\r\n", \
Ble_Navi_Data.Navi_Sts, Ble_Navi_Data.Navi_Turn, Ble_Navi_Data.Navi_Dte[0], Ble_Navi_Data.Navi_Dte[1], Ble_Navi_Data.Navi_Dte[2],Ble_Navi_Data.Navi_Dte[3]);
printf("Tpms sts %d Tpms_Turn %x Tpms_Dte0 %x Tpms_Dte1 %x Tpms_Dte2 %x Tpms_Dte3 %x\r\n", \
Ble_Tpms_Data.Tpms_Sts, Ble_Tpms_Data.Tpms_Turn, Ble_Tpms_Data.Tpms_Dte[0], Ble_Tpms_Data.Tpms_Dte[1], Ble_Tpms_Data.Tpms_Dte[2],Ble_Tpms_Data.Tpms_Dte[3]);
Ble_User.Navi_Updat = 1;
Ble_User.Navi_T = 0;
Ble_User.Tpms_Updat = 1;
Ble_User.Tpms_T = 0;
}
void Ble_MsgRec_Navi_Timeout(void )
void Ble_MsgRec_Tpms_Timeout(void )
{
if(Ble_User.Navi_Updat)
if(Ble_User.Tpms_Updat)
{
Ble_User.Navi_T++;
if(Ble_User.Navi_T >= 100)
Ble_User.Tpms_T++;
if(Ble_User.Tpms_T >= 100)
{
Ble_User.Navi_Updat = 0;
Ble_User.Navi_T = 0;
Ble_User.Tpms_Updat = 0;
Ble_User.Tpms_T = 0;
}
}
else
{
Ble_User.Navi_T = 0;
Ble_User.Tpms_T = 0;
}
}
......@@ -437,9 +437,9 @@ void Ble_Rec_Msg_Analysis_Process(void )
void Ble_Connect_Event_Pro(void )
{
Ble_User.Ble_Sts = Ble_Conn;
Ble_User.Request_Navi = 0;
Ble_User.Navi_Updat = 0;
Ble_User.Navi_T = 0;
Ble_User.Request_Tpms = 0;
Ble_User.Tpms_Updat = 0;
Ble_User.Tpms_T = 0;
Ble_Clear_Tx_Buffer();
Ble_Clear_Rx_Buffer();
......@@ -449,19 +449,19 @@ void Ble_Connect_Event_Pro(void )
void Ble_DisConnect_Event_Pro(void )
{
Ble_User.Ble_Sts = Ble_Idle;
Ble_User.Request_Navi = 0;
Ble_User.Navi_Updat = 0;
Ble_User.Navi_T = 0;
Ble_User.Request_Tpms = 0;
Ble_User.Tpms_Updat = 0;
Ble_User.Tpms_T = 0;
RecCtrl.RecLen = 0;
RecCtrl.TotalLen = 0;
RecCtrl.Sts = BleRec_Idle;
Ble_Navi_Data.Navi_Sts = 0;
Ble_Navi_Data.Navi_Turn = 0;
for(uint8_t i=0; i<sizeof(Ble_Navi_Data.Navi_Dte); i++)
Ble_Tpms_Data.Tpms_Sts = 0;
Ble_Tpms_Data.Tpms_Turn = 0;
for(uint8_t i=0; i<sizeof(Ble_Tpms_Data.Tpms_Dte); i++)
{
Ble_Navi_Data.Navi_Dte[i] = 0;
Ble_Tpms_Data.Tpms_Dte[i] = 0;
}
......@@ -487,11 +487,11 @@ void Ble_User_Task(void *pvParameter)
else if(BleRecData.Msg.Cmd == EC_BTP_P2C_CHECK_AUTH_RESULT)
{
Ble_MsgRec_Authr_Result_Analysis();
Ble_Msg_RequestNavi_RLY();
Ble_Msg_RequestTpms_RLY();
}
else if(BleRecData.Msg.Cmd == EC_BTP_P2C_HUD)
{
Ble_MsgRec_Navi_Analysis();
Ble_MsgRec_Tpms_Analysis();
}
Ble_Clear_Tx_Buffer();
......@@ -508,20 +508,20 @@ void Ble_User_Init(void )
BleRecSuc_Semaphore = xSemaphoreCreateBinary();
Ble_User.Ble_Sts = Ble_Idle;
Ble_User.Request_Navi = 0;
Ble_User.Navi_Updat = 0;
Ble_User.Navi_T = 0;
Ble_User.Request_Tpms = 0;
Ble_User.Tpms_Updat = 0;
Ble_User.Tpms_T = 0;
Ble_User.UseridUpdate = 0;
RecCtrl.RecLen = 0;
RecCtrl.TotalLen = 0;
RecCtrl.Sts = BleRec_Idle;
Ble_Navi_Data.Navi_Sts = 0;
Ble_Navi_Data.Navi_Turn = 0;
for(uint8_t i=0; i<sizeof(Ble_Navi_Data.Navi_Dte); i++)
Ble_Tpms_Data.Tpms_Sts = 0;
Ble_Tpms_Data.Tpms_Turn = 0;
for(uint8_t i=0; i<sizeof(Ble_Tpms_Data.Tpms_Dte); i++)
{
Ble_Navi_Data.Navi_Dte[i] = 0;
Ble_Tpms_Data.Tpms_Dte[i] = 0;
}
......
This diff is collapsed.
......@@ -80,7 +80,7 @@ static void Sys_Run_Tasks(void *arg)
if(SYS_RUN_TASK_100MS)
{
Ble_MsgRec_Navi_Timeout();
Ble_MsgRec_Tpms_Timeout();
}
if(SYS_RUN_TASK_1000MS)
......@@ -98,12 +98,12 @@ static void Sys_Run_Tasks(void *arg)
// esp_log_buffer_hex(TAG, peer_addr, 6);
// printf("Ble_User.Navi_Updat = %d\r\n", Ble_User.Navi_Updat);
// printf("Ble_User.Tpms_Updat = %d\r\n", Ble_User.Tpms_Updat);
// printf("RecCtrl.Sts = %d\r\n", RecCtrl.Sts);
// Ble_Msg_RequestNavi_RLY();
// Ble_Msg_RequestTpms_RLY();
......
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