Page 1 of 1

ESP32 Bluetooth - How to remember the last device?

Posted: Thu May 07, 2020 12:52 pm
by saif_iot
Hello,

I'm using ESP32 Classic Bluetooth based on this examples:
https://github.com/espressif/esp-idf/tr ... p_acceptor
I modified the code to Send/Receive data using serial (SPP), and allow only ONE Connection at a time, everything work fine.

The challenge:

Client A paire.
Client A connect.
Client A disconnect.
...
Client A connect.
Client A disconnect.

Client B paire.
Client A connect.
Client B can't connect...

How to block all connections except for the last Paired device?

I tried using the device name, but I can get only while pairing, not while SPP connection.

Thank you,

Re: ESP32 Bluetooth - How to remember the last device?

Posted: Fri May 08, 2020 11:12 am
by saif_iot
I still searching.. no idea? :D

Re: ESP32 Bluetooth - How to remember the last device?

Posted: Wed May 13, 2020 7:08 pm
by txrossi
Maybe u need to save the "address" of the last connection in a global variable, and then, include a "if(address == old_addres ||old_addres == NULL) " in cb connection function.