mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Prevent BLE bonding
This commit is contained in:
parent
19690cada7
commit
f3443ab8f8
1 changed files with 7 additions and 0 deletions
|
|
@ -55,6 +55,13 @@ public:
|
|||
void begin(const char* device_name) {
|
||||
BLEDevice::init(device_name);
|
||||
|
||||
// Explicitly disable bonding so the ESP32 does not send security requests.
|
||||
// Without this the BLE stack initiates Just Works pairing by default, which
|
||||
// fails with AUTH FAILED when no security callbacks are registered.
|
||||
BLESecurity* pSecurity = new BLESecurity();
|
||||
pSecurity->setAuthenticationMode(ESP_LE_AUTH_NO_BOND);
|
||||
pSecurity->setCapability(ESP_IO_CAP_NONE);
|
||||
|
||||
_server = BLEDevice::createServer();
|
||||
_server->setCallbacks(this);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue