esp32-snippets icon indicating copy to clipboard operation
esp32-snippets copied to clipboard

Can not get BLE to prompt for Pincode on client connect

Open cherbin opened this issue 5 months ago • 0 comments

Hello,

I am using an esp32 and need to connect to the device BLE, and also ask for a pincode. right now I am using the example : https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLETests/Arduino/security/StaticPIN/StaticPIN.ino

And I have added these lines to my BLEServer setup

BLEDevice::setEncryptionLevel(ESP_BLE_SEC_ENCRYPT); BLEDevice::setSecurityCallbacks(new MySecurity());

pService->start();

BLESecurity *pSecurity = new BLESecurity();

pSecurity->setAuthenticationMode(ESP_GATT_PERM_READ_ENC_MITM | ESP_GATT_PERM_WRITE_ENC_MITM); pSecurity->setStaticPIN(123456);

But when I connect using NRF Connect, it is not prompting the Mobile App NRF Connect for a PinCode ?

Can you please let me know what I need to add ?

cherbin avatar Sep 06 '24 19:09 cherbin