Add option to use resolvable and non-resolvable private address.

Adds the possibility to configure a resolvable or non-resolvable address (BLE privacy).
This commit is contained in:
Asuki Kono
2021-01-13 18:00:48 -07:00
committed by h2zero
parent 57ba0e583d
commit f61bd5c2df
6 changed files with 36 additions and 6 deletions

View File

@@ -30,7 +30,6 @@ static const char* LOG_TAG = "NimBLEScan";
* @brief Scan constuctor.
*/
NimBLEScan::NimBLEScan() {
m_own_addr_type = 0;
m_scan_params.filter_policy = BLE_HCI_SCAN_FILT_NO_WL;
m_scan_params.passive = 1; // If set, dont send scan requests to advertisers (i.e., dont request additional advertising data).
m_scan_params.itvl = 0; // This is defined as the time interval from when the Controller started its last LE scan until it begins the subsequent LE scan. (units=0.625 msec)
@@ -271,7 +270,7 @@ bool NimBLEScan::start(uint32_t duration, void (*scanCompleteCB)(NimBLEScanResul
m_ignoreResults = true;
}
int rc = ble_gap_disc(m_own_addr_type, duration, &m_scan_params,
int rc = ble_gap_disc(NimBLEDevice::m_own_addr_type, duration, &m_scan_params,
NimBLEScan::handleGapEvent, this);
switch(rc) {