[https://raw.githubusercontent.com/nkolb ... asskey.ino][/https://raw.githubusercontent.com/nkolb ... asskey.ino]
I changed the example to this:
Code: Select all
uint32_t onPassKeyRequest(){
Serial.println("Got passkey request");
return 111111;
}
Code: Select all
BLEDevice::setEncryptionLevel(ESP_BLE_SEC_ENCRYPT);
BLEDevice::setSecurityCallbacks(new MySecurity());
BLESecurity *pSecurity = new BLESecurity();
pSecurity->setAuthenticationMode(ESP_LE_AUTH_REQ_SC_ONLY);
pSecurity->setCapability(ESP_IO_CAP_KBDISP);
pSecurity->setRespEncryptionKey(ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK);
BLEClient* pClient = BLEDevice::createClient();
I can see that no connection is established and I do not see any incoming passkey request either.The system’s security level is Security Mode 1, Level 4 (Authenticated LE Secure Connections pairing with encryption). Thereby the client I/O capabilities are KeyboardDisplay and the device DisplayOnly, allowing the usage of a fixed passkey to pair the devices. The device is the initiator of the secured connection.
Have I put the correct combination of flags?