Skip to content

Conversation

@ivaniushkov
Copy link
Member

bt_le_set_auto_conn() doesn't work as expected.
When it is used notify_disconnected() is not called, also reconnection doesn't work.
I didn't find easy way to fix it and I think it was broken for a long time.
Instead of using this function, a user application can implement reconnecting to the disconnected device by starting scanner again and connecting manually

fixes #81230

bt_le_set_auto_conn() doesn't work as expected.
When it is used notify_disconnected() is not called,
also reconnection doesn't work.
I didn't find easy way to fix it and I think it was
broken for a long time.
Instead of using this function, a user application
can implement reconnecting to the disconnected device
by starting scanner again and connecting manually

Signed-off-by: Ivan Iushkov <[email protected]>
Copy link
Contributor

@cvinayak cvinayak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot directly remove a public API, it needs be deprecated first. https://docs.zephyrproject.org/latest/develop/api/api_lifecycle.html#api-lifecycle

@ivaniushkov
Copy link
Member Author

You cannot directly remove a public API, it needs be deprecated first. https://docs.zephyrproject.org/latest/develop/api/api_lifecycle.html#api-lifecycle

Thank you, it is a good point.
I see at the page you linked that unstable API can be removed without deprecation:

Unstable APIs can be removed without deprecation at any time. Deprecation and removal of APIs will be announced in the “API Changes” section of the release notes.

I guess, this API can be treated as unstable since there are no tests or samples using it, and it is practically not working

@Thalley
Copy link
Contributor

Thalley commented Nov 12, 2024

I guess, this API can be treated as unstable since there are no tests or samples using it, and it is practically not working

Stable/unstable here refers to the API and not the implementation. Unless specified as unstable or experimental, APIs are considered stable. It's described in more detail at https://docs.zephyrproject.org/latest/develop/api/api_lifecycle.html

@rugeGerritsen
Copy link
Contributor

Sounds like we should anyways deprecate the API now. There is no point in keeping it if it doesn't work.

@Thalley
Copy link
Contributor

Thalley commented Nov 12, 2024

Sounds like we should anyways deprecate the API now. There is no point in keeping it if it doesn't work.

The alternative is of course also to fix it :)

I have no idea how many uses it, but ideally we would hear from users if we follow the deprecation procedure.

If I understand correctly, this is the functionality used to use the filter accept list during connection. Looks like this is the only way for applications to use the FAL, so if we remove this function, we should offer the functionality in another way.

@ivaniushkov
Copy link
Member Author

Sounds like we should anyways deprecate the API now. There is no point in keeping it if it doesn't work.

The alternative is of course also to fix it :)

I have no idea how many uses it, but ideally we would hear from users if we follow the deprecation procedure.

If I understand correctly, this is the functionality used to use the filter accept list during connection. Looks like this is the only way for applications to use the FAL, so if we remove this function, we should offer the functionality in another way.

but the implementation of this function is compiled only when CONFIG_BT_FILTER_ACCEPT_LIST is disabled so it should not affect FAL users

#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
int bt_le_set_auto_conn(const bt_addr_le_t *addr,
			const struct bt_le_conn_param *param)
...
#endif  /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */

@Thalley
Copy link
Contributor

Thalley commented Nov 12, 2024

Sounds like we should anyways deprecate the API now. There is no point in keeping it if it doesn't work.

The alternative is of course also to fix it :)
I have no idea how many uses it, but ideally we would hear from users if we follow the deprecation procedure.
If I understand correctly, this is the functionality used to use the filter accept list during connection. Looks like this is the only way for applications to use the FAL, so if we remove this function, we should offer the functionality in another way.

but the implementation of this function is compiled only when CONFIG_BT_FILTER_ACCEPT_LIST is disabled so it should not affect FAL users

#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
int bt_le_set_auto_conn(const bt_addr_le_t *addr,
			const struct bt_le_conn_param *param)
...
#endif  /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */

Sorry yes, I had confused it with bt_conn_le_create_auto :)

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jan 12, 2025
@github-actions github-actions bot closed this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bluetooth: Host: bt_le_set_auto_conn() doesn't work

7 participants