Hi everyone
I've been recently trying to add SPP support to my ESP32 project based on
Bluepad32
So what I've done includes just adding the code from spp_counter example to the Arduino sketch. And this works, so my PC (Windows) is able to connect to the ESP32 and I'm able to send/receive text messages via the COM port.
But I've encountered a very strange behaviour of the btstack internals: every RFCOMM connection is terminated by the ESP32 exactly 20-second after opening, even if I keep sending and receiveng data packets.
I've also tested this under Linux and got the same results - so I think this timeout is somewhere in ESP32 or in btstack.
What I've found in btstack manual just tells that there're some timeouts, but it's unclear if they can be changed and what API calls need to be used. Or this is even unrelated to RFCOMM channels ?
Single threaded design
BTstack does not use or require multi-threading. It uses a single run
loop to handle data sources and timers. Data sources represent
communication interfaces like an UART or an USB driver. Timers are
used by BTstack to implement various Bluetooth-related timeouts. For
example, to disconnect a Bluetooth baseband channel without an
active L2CAP channel after 20 seconds.
Any help on solving this issue with the SPP would be appreciated.
Regards,
Dmitry