Skip to content

Commit 07c08e3

Browse files
committed
fix(ble): Fix client security example
1 parent 631216a commit 07c08e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/BLE/examples/Client_secure_static_passkey/Client_secure_static_passkey.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ void setup() {
195195
// Enable secure connection and MITM (for password prompts) for this example
196196
pSecurity->setAuthenticationMode(false, true, true);
197197

198+
// Set IO capability to KeyboardOnly
199+
// We need the proper IO capability for MITM authentication even
200+
// if the passkey is static and won't be entered by the user
201+
// See https://www.bluetooth.com/blog/bluetooth-pairing-part-2-key-generation-methods/
202+
pSecurity->setCapability(ESP_IO_CAP_IN);
203+
198204
// Retrieve a Scanner and set the callback we want to use to be informed when we
199205
// have detected a new device. Specify that we want active scanning and start the
200206
// scan to run for 5 seconds.

0 commit comments

Comments
 (0)