test/pts/gap: delete all le bonding information

This commit is contained in:
Matthias Ringwald 2021-05-18 16:47:06 +02:00
parent c50d0fce00
commit f2f8cff2e0
2 changed files with 12 additions and 9 deletions

View File

@ -183,9 +183,9 @@ static uint8_t ui_presentation_format[7];
static uint16_t ui_aggregate_handle; static uint16_t ui_aggregate_handle;
static uint16_t handle = 0; static uint16_t handle = 0;
//static bd_addr_t public_pts_address = {0x00, 0x1B, 0xDC, 0x07, 0x32, 0xef}; static bd_addr_t public_pts_address = {0x00, 0x1B, 0xDC, 0x07, 0x32, 0xef};
//static bd_addr_t public_pts_address = {0x00, 0x1B, 0xDC, 0x08, 0xe2, 0x72}; //static bd_addr_t public_pts_address = {0x00, 0x1B, 0xDC, 0x08, 0xe2, 0x72};
static bd_addr_t public_pts_address = {0x00, 0x1B, 0xDC, 0x08, 0xe2, 0x5C}; //static bd_addr_t public_pts_address = {0x00, 0x1B, 0xDC, 0x08, 0xe2, 0x5C};
static int public_pts_address_type = 0; static int public_pts_address_type = 0;
static bd_addr_t current_pts_address; static bd_addr_t current_pts_address;
@ -1452,6 +1452,7 @@ static int ui_process_data_request(char buffer){
static void ui_process_command(char buffer){ static void ui_process_command(char buffer){
int res; int res;
int i;
switch (buffer){ switch (buffer){
case '1': case '1':
printf("Enabling non-resolvable private address\n"); printf("Enabling non-resolvable private address\n");
@ -1541,7 +1542,9 @@ static void ui_process_command(char buffer){
break; break;
case 'F': case 'F':
printf("Drop bonding information\n"); printf("Drop bonding information\n");
le_device_db_remove(le_device_db_index); for (i=0;i<le_device_db_max_count();i++){
le_device_db_remove(le_device_db_index);
}
gap_drop_link_key_for_bd_addr(public_pts_address); gap_drop_link_key_for_bd_addr(public_pts_address);
break; break;
case 'H': case 'H':

View File

@ -133,9 +133,9 @@ static void show_usage(void);
static void update_advertisements(void); static void update_advertisements(void);
// static bd_addr_t tester_address = {0x00, 0x1B, 0xDC, 0x06, 0x07, 0x5F};
static bd_addr_t tester_address = {0x00, 0x1B, 0xDC, 0x07, 0x32, 0xef}; static bd_addr_t tester_address = {0x00, 0x1B, 0xDC, 0x07, 0x32, 0xef};
static bd_addr_t tester_address2 = {0x00, 0x1B, 0xDC, 0x08, 0xe2, 0x72}; // static bd_addr_t tester_address = {0x00, 0x1B, 0xDC, 0x06, 0x07, 0x5F};
// static bd_addr_t tester_address = {0x00, 0x1B, 0xDC, 0x08, 0xe2, 0x72};
static int tester_address_type = 0; static int tester_address_type = 0;
// general discoverable flags // general discoverable flags
@ -875,7 +875,7 @@ static void stdin_process(char c){
} }
return; return;
} }
int i;
switch (c){ switch (c){
case 'a': case 'a':
printf("a - advertisements off\n"); printf("a - advertisements off\n");
@ -968,7 +968,6 @@ static void stdin_process(char c){
case 'q': case 'q':
printf("Add PTS to whitelist"); printf("Add PTS to whitelist");
gap_whitelist_add(tester_address_type, tester_address); gap_whitelist_add(tester_address_type, tester_address);
gap_whitelist_add(tester_address_type, tester_address2);
break; break;
case '1': case '1':
case '2': case '2':
@ -1132,9 +1131,10 @@ static void stdin_process(char c){
break; break;
case 'F': case 'F':
printf("Drop bonding information\n"); printf("Drop bonding information\n");
le_device_db_remove(le_device_db_index); for (i=0;i<le_device_db_max_count();i++){
le_device_db_remove(le_device_db_index);
}
gap_drop_link_key_for_bd_addr(tester_address); gap_drop_link_key_for_bd_addr(tester_address);
gap_drop_link_key_for_bd_addr(tester_address2);
break; break;
case '\n': case '\n':
case '\r': case '\r':