Question: allowing connection take-over #744
-
Problem DescriptionIs is possible to allow a new connections (BluetoothA2DPSink) to take over even though a connection is currently esatblished? The (real-world) issue I am having is that there are multiple users to a speaker, previous users device is still in range when another user wants to access the speaker. The speaker is an outdoor ceiling mounted device and thus not placed in a location where a "disconnect/pair" button is easily accessible. This could certainly lead to multiple devices racing for access, but such bad implementations have become rare and are easily solved by set_address_validator and timer logic. Device DescriptionESP32 SketchCode not relevant for the issueOther Steps to ReproduceNo response Provide your Version of the EP32 Arduino Core (or the IDF Version)3.0.1 I have checked existing issues, discussions and online documentation (incl. the Wiki)
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
I don't understand why you report this as a bug? So I converted it to a discussion: If I remember right, when a user is connected, the system automatically set it to not connectable and discoverable. I suggest that you try to set it to connectable and discoverable e.g. after some time after a user has connected. |
Beta Was this translation helpful? Give feedback.
-
|
My apologies, posting in the wrong section was simply a mistake on my end. I have tried:
Each on its own, and both together, a few seconds (up to a minute) after a connection is established. However, it is still not possible to connect to the device. These two lines are logged during such a failed connection attempt:
They correspond to ESP_BT_GAP_ACL_CONN_CMPL_STAT_EVT and ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT. At least on the ACL level, a connection is now allowed. As an ugly hack I added I fully understand that this is not necessarily related to ESP32-A2DP, but the underlying API and drivers. |
Beta Was this translation helpful? Give feedback.
I do not recommend to change the source code directly. I recommend that you create a subclass and overwrite the method where you need some additional functionality as described here.