taks / esp32-nimble

A wrapper for the ESP32 NimBLE Bluetooth stack.
Apache License 2.0
118 stars 35 forks source link

Configuring for iOS Auto-Reconnect #56

Closed oleander closed 9 months ago

oleander commented 11 months ago

The configuration options mentioned in the README work reliably for iOS devices. Unfortunately, I don't have any sources to back up my statements, but it works for all my iOS 16 & 17 devices against ESP32 and ESP32C3.

oleander commented 11 months ago

I did some testing using resolve_rpa. I must enable CONFIG_BT_NIMBLE_NVS_PERSIST; otherwise, I cannot reconnect, regardless of the other settings. It doesn't matter if I use set_own_addr_type_to_non_resolvable_random before connecting to an iOS device.

What's new for me is that I can now use AuthReq::all() combined with CONFIG_BT_NIMBLE_NVS_PERSIST to allow my iOS devices to reconnect. That just started working as before I could not use AuthReq::Sc.

Do we need more devices to test against, or am I doing something wrong?

taks commented 11 months ago

Thank you for testing. I think there is no wrong with the content you tested. And, I think that additional testing is not necessary.

oleander commented 10 months ago

Is there anything else I can do to get this merged?

taks commented 10 months ago

I would like to change the last section to use resolve_rpa(). What do you think?

oleander commented 10 months ago

I added resolve_rpa and cleaned up the language a bit.

taks commented 10 months ago
- **Caution**: Avoid `.set_auth(AuthReq::Sc)` (Secure Connections), as it can interfere with the ability of iOS devices to reconnect.

Regarding the above statement, I'm guessing that using .set_auth(AuthReq::Sc) is not a problem if .resolve_rpa() is used. Is it wrong? Sorry, I don't have iOS device, so I can't test it.

oleander commented 10 months ago

Let me test later tonight

oleander commented 9 months ago

I couldn't get my failing code to … fail using Auth::Sc, so this took a while to test. I, therefore, removed the warning about using Auth::Sc with iOS.

taks commented 9 months ago

Thank you for testing.