(small) Improvement for reconnect after "out of range" disconnect #142
Replies: 8 comments 8 replies
-
I think you missed the following #108 |
Beta Was this translation helpful? Give feedback.
-
My mistake I was meaning #97 |
Beta Was this translation helpful? Give feedback.
-
I just made some tests and I think it is possible to have both - retries and being connectable from other devices. |
Beta Was this translation helpful? Give feedback.
-
I committed a small change: After the 2nd retry I switch on the discoverability again. |
Beta Was this translation helpful? Give feedback.
-
The default retry count is 10. You can increase it ..
|
Beta Was this translation helpful? Give feedback.
-
With which Arduino-ESP version are you testing ? Currently if you switch off phone1 and on again it reconnects - and you can not connect from another phone And I am afraid that this is still another case from the move out of range: switching off is sending a notification - moving out of range not... |
Beta Was this translation helpful? Give feedback.
-
I assume you selected 2.0.1 in Tools -> Boards -> Board Manager - Enter ESP32 |
Beta Was this translation helpful? Give feedback.
-
I noticed that aggressive reconnect quite some time ago and it was disturbing me as well. I took the opportunity to streamline things a bit: |
Beta Was this translation helpful? Give feedback.
-
I'm very happy with this library ! It does, what I needed.
I'm using it for a speaker-like DEVICE, which has no manual controls. The problem is, when I'm connected to my DEVICE and move with my phone out of range, the DEVICE tries to reconnect AUTOCONNECT_TRY_NUM. After that, I have to connect manually my phone to my DEVICE (because of clear_last_connection). That's annoying.
So I've done this:
Introduced (in BluetoothA2DPSink.h protected:)
bool hasConnection = false;
In BluetoothA2DPSink::av_hdl_a2d_evt I added after
and later (same method) I modified
The behavior is as expected: If DEVICE ist connected, it tries forever to reconnect. But if you power the DEVICE on and there is no connection (after AUTOCONNECT_TRY_NUM) it is awaiting a connection for a different phone.
I hope, you know, what I mean and it is helpful for other users.
Keep coding :-)
Beta Was this translation helpful? Give feedback.
All reactions