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

@@ -476,12 +476,12 @@ void NimBLEAdvertising::start(uint32_t duration, void (*advCompleteCB)(NimBLEAdv
}
#if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
rc = ble_gap_adv_start(0, NULL, duration,
rc = ble_gap_adv_start(NimBLEDevice::m_own_addr_type, NULL, duration,
&m_advParams,
(pServer != nullptr) ? NimBLEServer::handleGapEvent : NimBLEAdvertising::handleGapEvent,
(pServer != nullptr) ? (void*)pServer : (void*)this);
#else
rc = ble_gap_adv_start(0, NULL, duration,
rc = ble_gap_adv_start(NimBLEDevice::m_own_addr_type, NULL, duration,
&m_advParams, NimBLEAdvertising::handleGapEvent, this);
#endif
if (rc != 0) {