Skip to content

BLE Static Password ー During an ESP32 ⇔ iPhone pairing, even if wrong password the connection is not terminated #1003

Open
@d0natz

Description

@d0natz

Hi people,

I am a newbie, and I am using Adruino IDE to test ESP32 Bluetooth .

Currently, I am using the codes here: #793 (comment). Based on my test observations:

  • In an "ESP32 ⇔ Android" bluetooth test connection,

There are no problems.
If a wrong password is intentionally keyed-in during bluetooth pairing, the initial bluetooth connection will eventually be terminated.

  • However, In an "ESP32 ⇔ iPhone" bluetooth test connection,

Even if a wrong password is intentionally keyed-in during bluetooth pairing, the initial bluetooth connection will continue and not be automatically terminated.

With this...
I would like to know, if there is a flag or a function that would tell that the password authentication / pairing is not successful.
My idea is to terminate the connect once the pairing is not successful. Below is a onConnect/onDisconnect sample sketch, and I am assuming there is a some sort of PasswordAuthenticationSuccessful version of this.

bool deviceConnected = false;

class MyServerCallbacks : public BLEServerCallbacks {
void onConnect (BLEserver* pServer) { deviceConnected = true; };
void onDisconnect (BLEserver* pServer) { deviceConnected = false; };
}

void loop () {
if (deviceConnected) { //write code here
}
else if (!deviceConnected) { //write code here
}
}

Hoping for someone's advice...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions