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

test: adf环境首版,编译有问题

parent b04094c8
......@@ -2,6 +2,8 @@
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{ADF_PATH}/CMakeLists.txt)
# (Not part of the boilerplate)
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
......
......@@ -8,5 +8,10 @@ idf_component_register(SRCS "gatts_table_creat_demo.c"
"MCU_Core_Protocol.c"
"app_Ble_User.c"
"main_user.c"
# "a2dp_sink_and_hfp_example.c"
INCLUDE_DIRS "."
EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem)
register_component()
This diff is collapsed.
#ifndef _A2DP_SINK_AND_HFP_EXAMPLE_
#define _A2DP_SINK_AND_HFP_EXAMPLE_
void bt_hf_client_audio_Init(void);
#endif
\ No newline at end of file
......@@ -149,14 +149,14 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{
if(RecCtrl.Sts == BleRec_Idle)
{
printf("receive data:");
for(uint16_t i = 0; i< len; i++)
{
printf(" %x ", data[i]);
}
printf("\r\n");
// printf("receive data:");
// for(uint16_t i = 0; i< len; i++)
// {
// printf(" %x ", data[i]);
// }
// printf("\r\n");
printf("\r\n");
// printf("\r\n");
RecCtrl.RecLen = 0;
memcpy(( uint8_t * )&BleRecData.Data[RecCtrl.RecLen], data, 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);
printf("receive data:");
for(uint16_t i = 0; i< RecCtrl.TotalLen; i++)
{
printf(" %x ", BleRecData.Data[i]);
}
printf("\r\n");
// printf("receive data:");
// for(uint16_t i = 0; i< RecCtrl.TotalLen; i++)
// {
// printf(" %x ", BleRecData.Data[i]);
// }
// 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]))
......@@ -192,7 +192,7 @@ void Get_Ble_Raw_Data(uint8_t *data, uint32_t len)
{
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)
{
crc = tp_Ble_Crc(BleRecData.Data, RecCtrl.TotalLen - 2);
printf("receive data:");
for(uint16_t i = 0; i< RecCtrl.TotalLen; i++)
{
printf(" %x ", BleRecData.Data[i]);
}
printf("\r\n");
// printf("receive data:");
// for(uint16_t i = 0; i< RecCtrl.TotalLen; i++)
// {
// printf(" %x ", BleRecData.Data[i]);
// }
// 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]))
{
......@@ -287,16 +287,16 @@ void Ble_Msg_Authr_RLY(void )
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:");
for(uint16_t j = 0; j< trans_len; j++)
{
printf(" %x ", BleTransData.Data[j + i*20]);
}
printf("\r\n");
// printf("trans data:");
// for(uint16_t j = 0; j< trans_len; j++)
// {
// printf(" %x ", BleTransData.Data[j + i*20]);
// }
// printf("\r\n");
printf("\r\n");
// printf("\r\n");
err = bsp_Ble_Gatts_Send_Indicate( trans_len, &BleTransData.Data[i*20]);
......@@ -355,16 +355,16 @@ void Ble_Msg_RequestNavi_RLY(void )
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:");
for(uint16_t j = 0; j< trans_len; j++)
{
printf(" %x ", BleTransData.Data[j + i*20]);
}
printf("\r\n");
// printf("trans data:");
// for(uint16_t j = 0; j< trans_len; j++)
// {
// printf(" %x ", BleTransData.Data[j + i*20]);
// }
// printf("\r\n");
printf("\r\n");
// printf("\r\n");
bsp_Ble_Gatts_Send_Indicate( trans_len, &BleTransData.Data[i*20]);
......@@ -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[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;
}
......
......@@ -59,7 +59,7 @@ typedef 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_Navi_Info_Struct Ble_Navi_Data;
extern uint8_t Wifi_OTA_Request;
......@@ -220,5 +220,6 @@ void Ble_Rec_Msg_Analysis_Process(void );
void Ble_Connect_Event_Pro(void );
void Ble_DisConnect_Event_Pro(void );
void Ble_User_Init(void );
void Ble_Msg_RequestNavi_RLY(void );
#endif
\ No newline at end of file
......@@ -71,7 +71,7 @@ void init_Uart(void) {
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.source_clk = UART_SCLK_DEFAULT,
.source_clk = UART_SCLK_APB,
};
// We won't use a buffer for sending data.
uart_driver_install(UART_NUM_1, RX_BUF_SIZE * 2, 0, 0, NULL, 0);
......
......@@ -71,13 +71,20 @@ static void Sys_Run_Tasks(void *arg)
if(SYS_RUN_TASK_1000MS)
{
testcnt++;
if(testcnt >= 2)
if(testcnt >= 5)
{
testcnt = 0;
// 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();
......@@ -90,6 +97,7 @@ static void Sys_Run_Tasks(void *arg)
void app_main(void)
{
// bt_hf_client_audio_Init();
Ble_User_Init();
bsp_Ble_Init();
bsp_Uart_Init();
......
......@@ -69,9 +69,9 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
case HTTP_EVENT_DISCONNECTED:
ESP_LOGD(TAG, "HTTP_EVENT_DISCONNECTED");
break;
case HTTP_EVENT_REDIRECT:
ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT");
break;
// case HTTP_EVENT_REDIRECT:
// ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT");
// break;
}
return ESP_OK;
}
......
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