rename Bluefruit.Pairing to Bluefruit.Security

This commit is contained in:
hathach committed 2020-03-19 17:39:40 +07:00
1 parent 5e78aa3a73
commit c322f4c834
14 files changed
+22 -22

No files matched your search

+1 -1
View File
@@ -145,7 +145,7 @@ void BLECentral::_eventHandler(ble_evt_t* evt)
bond_keys_t ltkey;
if ( conn->loadBondKey(&ltkey) )
{
Bluefruit.Pairing._encrypt(conn_hdl, &ltkey);
Bluefruit.Security._encrypt(conn_hdl, &ltkey);
}
}
break;
@@ -120,7 +120,7 @@ uint8_t BLEConnection::getPHY(void)
ble_gap_addr_t BLEConnection::getPeerAddr (void)
{
return _peer_addr;
return _bonded ? _bond_id_addr : _peer_addr;
}
uint16_t BLEConnection::getPeerName(char* buf, uint16_t bufsize)
@@ -270,7 +270,7 @@ bool BLEConnection::requestPairing(void)
// skip if already paired
if ( secured() ) return true;
return Bluefruit.Pairing._authenticate(_conn_hdl);
return Bluefruit.Security._authenticate(_conn_hdl);
}
bool BLEConnection::waitForIndicateConfirm(void)
+2 -2
View File
@@ -437,7 +437,7 @@ bool AdafruitBluefruit::begin(uint8_t prph_count, uint8_t central_count)
// Init Peripheral role
VERIFY( Periph.begin() );
Pairing.begin();
Security.begin();
// Default device name
ble_gap_conn_sec_mode_t sec_mode = BLE_SECMODE_OPEN;
@@ -748,7 +748,7 @@ void AdafruitBluefruit::_ble_handler(ble_evt_t* evt)
if ( conn )
{
conn->_eventHandler(evt);
Pairing._eventHandler(evt);
Security._eventHandler(evt);
}
switch(evt->header.evt_id)
+1 -1
View File
@@ -111,7 +111,7 @@ class AdafruitBluefruit
*------------------------------------------------------------------*/
BLEPeriph Periph;
BLECentral Central;
BLESecurity Pairing;
BLESecurity Security;
BLEGatt Gatt;
BLEAdvertising Advertising;
@@ -182,7 +182,7 @@ bool bond_load_keys(uint8_t role, ble_gap_addr_t* addr, bond_keys_t* bkeys)
if ( keylen == sizeof(bond_keys_t) )
{
file.read((uint8_t*) bkeys, keylen);
if ( Bluefruit.Pairing.resolveAddress(addr, &bkeys->peer_id.id_info) )
if ( Bluefruit.Security.resolveAddress(addr, &bkeys->peer_id.id_info) )
{
ret = true;
BOND_LOG("Loaded keys from file %s/%s", dpath, file.name());