BLE connection Security Mode 1, Level 4
Posted: Thu Feb 17, 2022 7:56 am
I want to connect to a thirdparty device to which I do not have logging access so I can not see what is going on on the device besides a LED which indicates whether or not a connection is established. I have modified this example:
[https://raw.githubusercontent.com/nkolb ... asskey.ino][/https://raw.githubusercontent.com/nkolb ... asskey.ino]
I changed the example to this:
The manufacturer states that:
Have I put the correct combination of flags?
[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?