Commit 00cc12d6 authored by wangxuhui's avatar wangxuhui

Merge branch 'develop' into 'release'

250204合并请求

See merge request !16
parents 8467b916 ec853788
......@@ -276,6 +276,10 @@ static void Protocol_UartHandle(const Protocol_Data_t *pData)
}
// }
}
if (pData->Data[1] == 1)
{
ODO_Clear_BLEinfo();
}
}
else
{
......
......@@ -5,6 +5,9 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "bt_app_main.h"
#include "esp_gap_bt_api.h"
#include <string.h>
#include "app_Ble_User.h"
extern esp_bd_addr_t peer_addr;
#define TAG "APP_BLE_USER"
......@@ -134,6 +137,43 @@ void BT_User_Process(void )
}
}
/* */
uint8_t ODO_Clear_BLEinfo(void )
{
if (Ble_User.Ble_Sts == Ble_Conn)
{
esp_hf_client_disconnect(peer_addr);
}
uint8_t ret = 0;
uint8_t bond_dev_num = esp_bt_gap_get_bond_device_num();
if(bond_dev_num)
{
esp_bd_addr_t *dev_list = (esp_bd_addr_t *)malloc(sizeof(esp_bd_addr_t) * bond_dev_num);
if (dev_list != NULL)
{
esp_bt_gap_get_bond_device_list(&bond_dev_num, dev_list);
if(bond_dev_num > 0)
{
int i = 0;
for(i=0; i<bond_dev_num; i++)
{
esp_bt_gap_remove_bond_device(dev_list[i]);
}
}
ret = 1;
free(dev_list);
}
}
else
{
memset(peer_addr, 0, 6);
ret = 0;
}
return ret;
}
......
......@@ -48,5 +48,6 @@ void BT_Connect_Event_Pro(void );
void BT_DisConnect_Event_Pro(void );
void BT_User_Process(void );
void BT_User_Init(void );
extern uint8_t ODO_Clear_BLEinfo(void );
#endif
\ No newline at end of file
#ifndef _MAIN_USER_H_
#define _MAIN_USER_H_
#define BL_INTERNAL_SW_YEAR 0x24
#define BL_INTERNAL_SW_MONTH 0x12
#define BL_INTERNAL_SW_DAY 0x19
#define BL_INTERNAL_SW_YEAR 0x25
#define BL_INTERNAL_SW_MONTH 0x02
#define BL_INTERNAL_SW_DAY 0x04
#endif
\ No newline at end of file
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