diff --git a/libraries/Bluefruit52Lib/src/utility/bonding.cpp b/libraries/Bluefruit52Lib/src/utility/bonding.cpp index b9dd7dfd..2db8ef71 100644 --- a/libraries/Bluefruit52Lib/src/utility/bonding.cpp +++ b/libraries/Bluefruit52Lib/src/utility/bonding.cpp @@ -318,44 +318,6 @@ void bond_print_list(uint8_t role) dir.close(); } - -bool bond_find_cntr(ble_gap_addr_t const * addr, bond_keys_t* bkeys) -{ - bool found = false; - - File dir(BOND_DIR_CNTR, FILE_O_READ, InternalFS); - File file(InternalFS); - - while ( (file = dir.openNextFile(FILE_O_READ)) ) - { - // Read bond data of each stored file - int keylen = file.read(); - if ( keylen == sizeof(bond_keys_t) ) - { - file.read((uint8_t*) bkeys, keylen); - - // Compare static address - if ( !memcmp(addr->addr, bkeys->peer_id.id_addr_info.addr, 6) ) - { - found = true; - } - else if ( addr->addr_type == BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE ) - { - // Resolving private address - } - } - - file.close(); - - if ( found ) break; - } - - file.close(); - dir.close(); - - return found; -} - /*------------------------------------------------------------------*/ /* DELETE *------------------------------------------------------------------*/ diff --git a/libraries/Bluefruit52Lib/src/utility/bonding.h b/libraries/Bluefruit52Lib/src/utility/bonding.h index 27bbb15f..f6c4dfb9 100644 --- a/libraries/Bluefruit52Lib/src/utility/bonding.h +++ b/libraries/Bluefruit52Lib/src/utility/bonding.h @@ -60,15 +60,11 @@ void bond_clear_all(void); void bond_remove_key(uint8_t role, ble_gap_addr_t const* id_addr); bool bond_save_keys (uint8_t role, uint16_t conn_hdl, bond_keys_t const* bkeys); -bool bond_load_keys(uint8_t role, ble_gap_addr_t*, bond_keys_t* bkeys); +bool bond_load_keys(uint8_t role, ble_gap_addr_t* peer_addr, bond_keys_t* bkeys); bool bond_save_cccd (uint8_t role, uint16_t conn_hdl, ble_gap_addr_t const* id_addr); bool bond_load_cccd (uint8_t role, uint16_t conn_hdl, ble_gap_addr_t const* id_addr); void bond_print_list(uint8_t role); -bool bond_find_cntr(ble_gap_addr_t const * addr, bond_keys_t* bkeys); - - - #endif /* BONDING_H_ */