Commit 0b213abf authored by 时昊's avatar 时昊

feat:修改蓝牙手动断开后不会在自动连接

parent 068d4eb1
...@@ -12,14 +12,14 @@ extern esp_bd_addr_t peer_addr; ...@@ -12,14 +12,14 @@ extern esp_bd_addr_t peer_addr;
BT_User_Control_Struct BT_User; BT_User_Control_Struct BT_User;
#define BT_ReConn_T 3000 #define BT_ReConn_T 3000
uint8_t BTConnectFlag = 0;
void BT_User_Init(void ) void BT_User_Init(void )
{ {
BT_User.BT_Sts = BT_Idle; BT_User.BT_Sts = BT_Idle;
BT_User.Call_Sts = Call_Idle; BT_User.Call_Sts = Call_Idle;
BT_User.ReconnTime = BT_ReConn_T - 500; BT_User.ReconnTime = BT_ReConn_T - 500;
BT_User.HF_Ctrl = HF_Idle; BT_User.HF_Ctrl = HF_Idle;
BTConnectFlag = 0;
} }
void BT_Connect_Event_Pro(void ) void BT_Connect_Event_Pro(void )
...@@ -89,10 +89,14 @@ void BT_User_Process(void ) ...@@ -89,10 +89,14 @@ void BT_User_Process(void )
if(BT_User.ReconnTime >= BT_ReConn_T) if(BT_User.ReconnTime >= BT_ReConn_T)
{ {
printf("Connect Start.................\n"); printf("Connect Start.................\n");
if(BTConnectFlag == 0)
{
BTConnectFlag = 1;
if(app_BT_Get_BondDev() == 1) if(app_BT_Get_BondDev() == 1)
{ {
esp_hf_client_connect(peer_addr); esp_hf_client_connect(peer_addr);
} }
}
printf("Connect Over\n"); printf("Connect Over\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