-
Notifications
You must be signed in to change notification settings - Fork 221
Open
Labels
topic: documentationRelated to documentation for the projectRelated to documentation for the projecttype: enhancementProposed improvementProposed improvement
Description
Created topic:
https://forum.arduino.cc/t/arduinoble-clarification-and-examples-about-ble-security/1093188
But no response for this moment. Currently I'm stuck with this issue.
I've spend couple days on analyzing ArduinoBLE and can't create solution for requesting pin when ble connecting.
Lets create example for future developers. It additionally unblock me to finish work at open source BLE firmware uploads library.
For NimBLE-Arduino library I'm using:
BLEDevice::setSecurityPasskey(123456);
BLEDevice::setSecurityAuth(true, true, true); // bonding, mitm, sc
BLEDevice::setSecurityIOCap(BLE_HS_IO_DISPLAY_ONLY);
And start security on connected callback:
void ArduinoBleOTAClass::onConnect(BLEServer* pServer, ble_gap_conn_desc* desc)
{
BLEDevice::startSecurity(desc->conn_handle);
}
Initially at ArduinoBLE, as I see, to achieve BLE_HS_IO_DISPLAY_ONLY
we shoud BLE.setDisplayCode()
and not BLE.setBinaryConfirmPairing()
.
How to start security when ble connecting?
Metadata
Metadata
Assignees
Labels
topic: documentationRelated to documentation for the projectRelated to documentation for the projecttype: enhancementProposed improvementProposed improvement