-
-
Notifications
You must be signed in to change notification settings - Fork 203
Pairing callback not invoked #151
Description
Hi! I'm implementing a BLE client connecting to a BLE server requiring pairing to write some characteristics (not very expert in BLE, though...). I'm working on NimBLE_Client example, and I successfully discovered the service and listed the characteristics I need.
What I don't see is the onPassKeyRequest callback invoked, and the characteristics result to be not writeable, so I presume that the security is not correctly configured. BLE server uses 123456 as passkey, and works fine using a BLE app on my phone.
I used the following:
NimBLEDevice::setSecurityIOCap(BLE_HS_IO_KEYBOARD_ONLY); // Should use the passkey
NimBLEDevice::setSecurityAuth(false, false, true); // Default
I also added pClient->secureConnection() after connecting the client to the server (it returns true) as I read something about it in a previous issue.
The onAuthenticationComplete() callback finds the following:
desc->sec_state.authenticated = 0
desc->sec_state.bonded = 1
desc->sec_state.encrypted = 1
As some characteristics can be notified, they are successfully subscribed, but I can't read the result as I need to send a command to start the notifications.
Project is developed in Visual Studio Code, platform is espressif32, framework arduino.
Any suggestion will be appreciated!