WIP: Analysing correct use of private resolvable addresses

This commit is contained in:
Joe Finney 2015-12-17 14:27:57 +00:00
parent 6d610f049a
commit c7ea0af6fe
2 changed files with 5 additions and 1 deletions

View file

@ -141,7 +141,7 @@
// Enable/Disable the use of private resolvable addresses.
// Set '1' to enable.
#ifndef MICROBIT_BLE_PRIVATE_ADDRESSES
#define MICROBIT_BLE_PRIVATE_ADDRESSES 0
#define MICROBIT_BLE_PRIVATE_ADDRESSES 1
#endif
// Enable/Disable BLE Service: MicroBitDFU

View file

@ -232,6 +232,10 @@ void MicroBitBLEManager::pairingMode(MicroBitDisplay &display)
// Update the advertised name of this micro:bit to include the device name
ble->clearAdvertisingPayload();
// Always configure for public addresses in pairing mode...
ble->setAddress(Gap::ADDR_TYPE_PUBLIC, NULL);
ble->accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
ble->accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)BLEName.toCharArray(), BLEName.length());
ble->setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);