mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-06 12:39:51 +00:00
auto-pts: delete bonding information on start
This commit is contained in:
parent
6914a89114
commit
378d424dd4
@ -105,6 +105,8 @@ static uint8_t gap_scan_response[31];
|
|||||||
static uint16_t gap_scan_response_len;
|
static uint16_t gap_scan_response_len;
|
||||||
static uint8_t gap_inquriy_scan_active;
|
static uint8_t gap_inquriy_scan_active;
|
||||||
|
|
||||||
|
static bool gap_delete_bonding;
|
||||||
|
|
||||||
static uint32_t current_settings;
|
static uint32_t current_settings;
|
||||||
|
|
||||||
// GATT
|
// GATT
|
||||||
@ -209,6 +211,17 @@ static void btstack_packet_handler (uint8_t packet_type, uint16_t channel, uint8
|
|||||||
current_settings |= BTP_GAP_SETTING_POWERED;
|
current_settings |= BTP_GAP_SETTING_POWERED;
|
||||||
btp_send_gap_settings(BTP_GAP_OP_SET_POWERED);
|
btp_send_gap_settings(BTP_GAP_OP_SET_POWERED);
|
||||||
}
|
}
|
||||||
|
if (gap_delete_bonding){
|
||||||
|
MESSAGE("Delete all bonding information");
|
||||||
|
gap_delete_bonding = false;
|
||||||
|
gap_delete_all_link_keys();
|
||||||
|
uint16_t max_count = le_device_db_max_count();
|
||||||
|
uint16_t i;
|
||||||
|
for (i=0;i<max_count;i++){
|
||||||
|
le_device_db_remove(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// reset state and services
|
// reset state and services
|
||||||
reset_gap();
|
reset_gap();
|
||||||
reset_gatt();
|
reset_gatt();
|
||||||
@ -688,7 +701,7 @@ static void btp_gap_handler(uint8_t opcode, uint8_t controller_index, uint16_t l
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BTP_GAP_OP_SET_CONNECTABLE:
|
case BTP_GAP_OP_SET_CONNECTABLE:
|
||||||
MESSAGE("BTP_GAP_OP_SET_CONNECTABLE - NOP");
|
MESSAGE("BTP_GAP_OP_SET_CONNECTABLE");
|
||||||
if (controller_index == 0){
|
if (controller_index == 0){
|
||||||
uint8_t connectable = data[0];
|
uint8_t connectable = data[0];
|
||||||
if (connectable) {
|
if (connectable) {
|
||||||
@ -1728,6 +1741,9 @@ int btstack_main(int argc, const char * argv[])
|
|||||||
gap_cod = 0x007a020c; // smartphone
|
gap_cod = 0x007a020c; // smartphone
|
||||||
gap_set_class_of_device(gap_cod);
|
gap_set_class_of_device(gap_cod);
|
||||||
|
|
||||||
|
// delete all bonding information on start
|
||||||
|
gap_delete_bonding = true;
|
||||||
|
|
||||||
// configure GAP LE
|
// configure GAP LE
|
||||||
|
|
||||||
// LE Legacy Pairing, Passkey entry initiator enter, responder (us) displays
|
// LE Legacy Pairing, Passkey entry initiator enter, responder (us) displays
|
||||||
|
Loading…
x
Reference in New Issue
Block a user