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

test: 底板串口接收丢帧,添加打印测试

parent 6ed34a29
......@@ -23,7 +23,7 @@ app_Ble_Rec_Data_Ctrl_Struct RecCtrl;
uint8_t Wifi_OTA_Request = 0;
uint8_t ble_key[32] = "1BJ7J8S";
uint8_t ble_uerid[32] = {0};
uint8_t ble_uerid[33] = "tywtywtywtywtywtywtywtywtywtyw01";
uint8_t ble_pwd[32] = {0};
uint8_t flavor[4] = {0x33, 0, 0, 0};
......@@ -392,6 +392,7 @@ void Ble_Msg_RequestNavi_RLY(void )
void Ble_MsgRec_Navi_Analysis(void )
{
uint32_t aaa = 0;
//Navi data
Ble_Navi_Data.Navi_Sts = BleRecData.Msg.Param[0];
Ble_Navi_Data.Navi_Turn = BleRecData.Msg.Param[1];
......@@ -401,8 +402,20 @@ void Ble_MsgRec_Navi_Analysis(void )
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]);
aaa = Ble_Navi_Data.Navi_Dte[3];
aaa <<= 8;
aaa |= Ble_Navi_Data.Navi_Dte[2];
aaa <<= 8;
aaa |= Ble_Navi_Data.Navi_Dte[1];
aaa <<= 8;
aaa |= Ble_Navi_Data.Navi_Dte[0];
// printf("navi sts = %x; navi turn = %d; navi dest = %ld\n", Ble_Navi_Data.Navi_Sts, Ble_Navi_Data.Navi_Turn, aaa);
// 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_User.Navi_Updat = 1;
Ble_User.Navi_T = 0;
......
......@@ -3,7 +3,7 @@
#include <stdlib.h>
extern uint8_t ble_uerid[32];
extern uint8_t ble_uerid[33];
typedef enum
{
Ble_Idle = 0,
......
......@@ -81,6 +81,37 @@ void init_Uart(void) {
int bsp_Uart_Send_Data(uint8_t * data , unsigned int len)
{
uint32_t aaa = 0;
if(data[4] == 0x01 && data[5] == 0x33)
{
printf("data[5] = %x ", data[5]);
printf("data[6] = %x ", data[6]);
printf("data[7] = %x ", data[7]);
printf("data[8] = %x ", data[8]);
printf("data[9] = %x ", data[9]);
printf("data[10] = %x ", data[10]);
printf("\n");
printf("navi sts data[5] = %x ", data[5]);
printf("navi turn data[6] = %d ", data[6]);
aaa = data[10];
aaa <<= 8;
aaa |= data[9];
aaa <<= 8;
aaa |= data[8];
aaa <<= 8;
aaa |= data[7];
printf("navi dest = %ld \n", aaa);
printf("\n");
printf("\n");
}
int txBytes = uart_write_bytes(UART_NUM_1, data, len);
uart_wait_tx_idle_polling(UART_NUM_1);
return txBytes;
......
......@@ -93,8 +93,8 @@ static void Sys_Run_Tasks(void *arg)
{
testcnt = 0;
printf("BT_User.BT_Sts = %d\r\n", BT_User.BT_Sts);
printf("Ble_User.Ble_Sts = %d\r\n", Ble_User.Ble_Sts);
// printf("BT_User.BT_Sts = %d\r\n", BT_User.BT_Sts);
// printf("Ble_User.Ble_Sts = %d\r\n", Ble_User.Ble_Sts);
// esp_log_buffer_hex(TAG, peer_addr, 6);
......
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