ESP32 Bluetooth - How to remember the last device?

saif_iot
Posts: 12
Joined: Fri Mar 27, 2020 12:59 pm

ESP32 Bluetooth - How to remember the last device?

Postby saif_iot » Thu May 07, 2020 12:52 pm

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,

saif_iot
Posts: 12
Joined: Fri Mar 27, 2020 12:59 pm

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

Postby saif_iot » Fri May 08, 2020 11:12 am

I still searching.. no idea? :D

txrossi
Posts: 3
Joined: Tue Oct 29, 2019 6:06 pm

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

Postby txrossi » Wed May 13, 2020 7:08 pm

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.

Who is online

Users browsing this forum: Bing [Bot] and 124 guests