Commit e604141d authored by 薛小虎's avatar 薛小虎

test: 添加经典蓝牙中

parent b04094c8
...@@ -149,14 +149,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len) ...@@ -149,14 +149,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{ {
if(RecCtrl.Sts == BleRec_Idle) if(RecCtrl.Sts == BleRec_Idle)
{ {
printf("receive data:"); // printf("receive data:");
for(uint16_t i = 0; i< len; i++) // for(uint16_t i = 0; i< len; i++)
{ // {
printf(" %x ", data[i]); // printf(" %x ", data[i]);
} // }
printf("\r\n"); // printf("\r\n");
printf("\r\n"); // printf("\r\n");
RecCtrl.RecLen = 0; RecCtrl.RecLen = 0;
memcpy(( uint8_t * )&BleRecData.Data[RecCtrl.RecLen], data, len); memcpy(( uint8_t * )&BleRecData.Data[RecCtrl.RecLen], data, len);
...@@ -166,14 +166,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len) ...@@ -166,14 +166,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{ {
crc = tp_Ble_Crc(BleRecData.Data, RecCtrl.TotalLen - 2); crc = tp_Ble_Crc(BleRecData.Data, RecCtrl.TotalLen - 2);
printf("receive data:"); // printf("receive data:");
for(uint16_t i = 0; i< RecCtrl.TotalLen; i++) // for(uint16_t i = 0; i< RecCtrl.TotalLen; i++)
{ // {
printf(" %x ", BleRecData.Data[i]); // printf(" %x ", BleRecData.Data[i]);
} // }
printf("\r\n"); // printf("\r\n");
printf("rec crc = %d\r\n", crc); // printf("rec crc = %d\r\n", crc);
if((BleRecData.Data[RecCtrl.TotalLen - 1] != 0x0A) || (crc != BleRecData.Data[RecCtrl.TotalLen - 2])) if((BleRecData.Data[RecCtrl.TotalLen - 1] != 0x0A) || (crc != BleRecData.Data[RecCtrl.TotalLen - 2]))
...@@ -192,7 +192,7 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len) ...@@ -192,7 +192,7 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{ {
RecCtrl.Sts = BleRec_Start; RecCtrl.Sts = BleRec_Start;
printf("BleRec_Start \r\n"); // printf("BleRec_Start \r\n");
} }
} }
} }
...@@ -209,14 +209,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len) ...@@ -209,14 +209,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{ {
crc = tp_Ble_Crc(BleRecData.Data, RecCtrl.TotalLen - 2); crc = tp_Ble_Crc(BleRecData.Data, RecCtrl.TotalLen - 2);
printf("receive data:"); // printf("receive data:");
for(uint16_t i = 0; i< RecCtrl.TotalLen; i++) // for(uint16_t i = 0; i< RecCtrl.TotalLen; i++)
{ // {
printf(" %x ", BleRecData.Data[i]); // printf(" %x ", BleRecData.Data[i]);
} // }
printf("\r\n"); // printf("\r\n");
printf("rec crc = %d\r\n", crc); // printf("rec crc = %d\r\n", crc);
if((BleRecData.Data[RecCtrl.TotalLen - 1] != 0x0A) || (crc != BleRecData.Data[RecCtrl.TotalLen - 2])) if((BleRecData.Data[RecCtrl.TotalLen - 1] != 0x0A) || (crc != BleRecData.Data[RecCtrl.TotalLen - 2]))
{ {
...@@ -287,16 +287,16 @@ void Ble_Msg_Authr_RLY(void ) ...@@ -287,16 +287,16 @@ void Ble_Msg_Authr_RLY(void )
trans_len = (BleTransData.Msg.Lenth+1) - 20*i; trans_len = (BleTransData.Msg.Lenth+1) - 20*i;
} }
printf("trans_len = %d\r\n", trans_len); // printf("trans_len = %d\r\n", trans_len);
printf("trans data:"); // printf("trans data:");
for(uint16_t j = 0; j< trans_len; j++) // for(uint16_t j = 0; j< trans_len; j++)
{ // {
printf(" %x ", BleTransData.Data[j + i*20]); // printf(" %x ", BleTransData.Data[j + i*20]);
} // }
printf("\r\n"); // printf("\r\n");
printf("\r\n"); // printf("\r\n");
err = bsp_Ble_Gatts_Send_Indicate( trans_len, &BleTransData.Data[i*20]); err = bsp_Ble_Gatts_Send_Indicate( trans_len, &BleTransData.Data[i*20]);
...@@ -355,16 +355,16 @@ void Ble_Msg_RequestNavi_RLY(void ) ...@@ -355,16 +355,16 @@ void Ble_Msg_RequestNavi_RLY(void )
trans_len = (BleTransData.Msg.Lenth+1) - 20*i; trans_len = (BleTransData.Msg.Lenth+1) - 20*i;
} }
printf("trans_len = %d\r\n", trans_len); // printf("trans_len = %d\r\n", trans_len);
printf("trans data:"); // printf("trans data:");
for(uint16_t j = 0; j< trans_len; j++) // for(uint16_t j = 0; j< trans_len; j++)
{ // {
printf(" %x ", BleTransData.Data[j + i*20]); // printf(" %x ", BleTransData.Data[j + i*20]);
} // }
printf("\r\n"); // printf("\r\n");
printf("\r\n"); // printf("\r\n");
bsp_Ble_Gatts_Send_Indicate( trans_len, &BleTransData.Data[i*20]); bsp_Ble_Gatts_Send_Indicate( trans_len, &BleTransData.Data[i*20]);
...@@ -388,6 +388,10 @@ void Ble_MsgRec_Navi_Analysis(void ) ...@@ -388,6 +388,10 @@ void Ble_MsgRec_Navi_Analysis(void )
Ble_Navi_Data.Navi_Dte[2] = BleRecData.Msg.Param[4]; Ble_Navi_Data.Navi_Dte[2] = BleRecData.Msg.Param[4];
Ble_Navi_Data.Navi_Dte[3] = BleRecData.Msg.Param[5]; Ble_Navi_Data.Navi_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]);
Ble_Sts_Ctrl.Navi_Updat = 1; Ble_Sts_Ctrl.Navi_Updat = 1;
} }
......
...@@ -59,7 +59,7 @@ typedef struct ...@@ -59,7 +59,7 @@ typedef struct
}app_Ble_Rec_Data_Ctrl_Struct; }app_Ble_Rec_Data_Ctrl_Struct;
extern app_Ble_Rec_Data_Ctrl_Struct RecCtrl;
extern Ble_User_Control_Struct Ble_Sts_Ctrl; extern Ble_User_Control_Struct Ble_Sts_Ctrl;
extern Ble_Navi_Info_Struct Ble_Navi_Data; extern Ble_Navi_Info_Struct Ble_Navi_Data;
extern uint8_t Wifi_OTA_Request; extern uint8_t Wifi_OTA_Request;
...@@ -220,5 +220,6 @@ void Ble_Rec_Msg_Analysis_Process(void ); ...@@ -220,5 +220,6 @@ void Ble_Rec_Msg_Analysis_Process(void );
void Ble_Connect_Event_Pro(void ); void Ble_Connect_Event_Pro(void );
void Ble_DisConnect_Event_Pro(void ); void Ble_DisConnect_Event_Pro(void );
void Ble_User_Init(void ); void Ble_User_Init(void );
void Ble_Msg_RequestNavi_RLY(void );
#endif #endif
\ No newline at end of file
...@@ -71,13 +71,20 @@ static void Sys_Run_Tasks(void *arg) ...@@ -71,13 +71,20 @@ static void Sys_Run_Tasks(void *arg)
if(SYS_RUN_TASK_1000MS) if(SYS_RUN_TASK_1000MS)
{ {
testcnt++; testcnt++;
if(testcnt >= 2) if(testcnt >= 5)
{ {
testcnt = 0; testcnt = 0;
// printf("Ble_Sts_Ctrl.Ble_Sts = %d\r\n", Ble_Sts_Ctrl.Ble_Sts); // printf("Ble_Sts_Ctrl.Ble_Sts = %d\r\n", Ble_Sts_Ctrl.Ble_Sts);
// printf("Ble_Sts_Ctrl.Navi_Updat = %d\r\n", Ble_Sts_Ctrl.Navi_Updat); // // printf("Ble_Sts_Ctrl.Navi_Updat = %d\r\n", Ble_Sts_Ctrl.Navi_Updat);
// printf("RecCtrl.Sts = %d\r\n", RecCtrl.Sts);
// Ble_Msg_RequestNavi_RLY();
} }
simple_ota_service(); simple_ota_service();
......
...@@ -1313,15 +1313,16 @@ CONFIG_HEAP_TRACING_OFF=y ...@@ -1313,15 +1313,16 @@ CONFIG_HEAP_TRACING_OFF=y
# #
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set CONFIG_LOG_DEFAULT_LEVEL_WARN=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=y # CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_LOG_DEFAULT_LEVEL=2
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
CONFIG_LOG_MAXIMUM_LEVEL=3 CONFIG_LOG_MAXIMUM_LEVEL=2
CONFIG_LOG_COLORS=y CONFIG_LOG_COLORS=y
CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set
......
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