Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: conn: Make bt_conn_lookup_addr_br() public #87186

Conversation

lylezhu2012
Copy link
Contributor

@lylezhu2012 lylezhu2012 commented Mar 17, 2025

Move the declaration of the function bt_conn_lookup_addr_br() from conn_internal.h to conn.h.

Copy link
Member

@jhedberg jhedberg left a comment

Choose a reason for hiding this comment

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

Please fix the spelling in the commit message.

Bluetooth: conn: Public the function bt_conn_lookup_addr_br

"Public" cannot be used as a verb. "Make bt_conn_lookup_addr_br() public" would be better.

Move the deceleration of function bt_conn_lookup_addr_br from
conn_internal.h to conn.h.

"Move the declaration of bt_conn_lookup_addr_br()"
or
"Move the declaration of the function bt_conn_lookup_addr_br() ..."

@lylezhu2012 lylezhu2012 force-pushed the br_conn_public_bt_conn_lookup_addr_br branch from db73f98 to eb44983 Compare March 17, 2025 10:15
@lylezhu2012 lylezhu2012 changed the title Bluetooth: conn: Public the function bt_conn_lookup_addr_br Bluetooth: conn: Make bt_conn_lookup_addr_br() public Mar 17, 2025
@lylezhu2012
Copy link
Contributor Author

Please fix the spelling in the commit message.

Bluetooth: conn: Public the function bt_conn_lookup_addr_br

"Public" cannot be used as a verb. "Make bt_conn_lookup_addr_br() public" would be better.

Move the deceleration of function bt_conn_lookup_addr_br from
conn_internal.h to conn.h.

"Move the declaration of bt_conn_lookup_addr_br()" or "Move the declaration of the function bt_conn_lookup_addr_br() ..."

Updated. Thanks a lot.

@jhedberg
Copy link
Member

Updated. Thanks a lot.

Thanks, however you still have "deceleration" misspelled (should be "declaration")

@lylezhu2012 lylezhu2012 force-pushed the br_conn_public_bt_conn_lookup_addr_br branch from eb44983 to cab15f1 Compare March 17, 2025 12:10
@lylezhu2012 lylezhu2012 requested a review from jhedberg March 17, 2025 12:13
@lylezhu2012
Copy link
Contributor Author

lylezhu2012 commented Mar 17, 2025

Thanks, however you still have "deceleration" misspelled (should be "declaration")

Thanks. Updated it.

@lylezhu2012 lylezhu2012 force-pushed the br_conn_public_bt_conn_lookup_addr_br branch from cab15f1 to c1ee921 Compare March 17, 2025 12:34
@lylezhu2012 lylezhu2012 requested a review from Thalley March 17, 2025 12:49
jhedberg
jhedberg previously approved these changes Mar 17, 2025
@lylezhu2012 lylezhu2012 force-pushed the br_conn_public_bt_conn_lookup_addr_br branch from c1ee921 to 4a02cbb Compare March 17, 2025 12:53
@lylezhu2012 lylezhu2012 force-pushed the br_conn_public_bt_conn_lookup_addr_br branch from 4a02cbb to df74211 Compare March 17, 2025 13:07
@lylezhu2012 lylezhu2012 requested review from jhedberg and Thalley March 17, 2025 13:07
@lylezhu2012 lylezhu2012 force-pushed the br_conn_public_bt_conn_lookup_addr_br branch from df74211 to 36bd4d5 Compare March 17, 2025 14:10
*
* @return Connection object or NULL if not found.
*/
struct bt_conn *bt_conn_lookup_addr_br(const bt_addr_t *peer);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Kind of odd that we have both bt_le_<something> and bt_<something>_le naming in our API.

Generally it would make sense to have bt_le_<something> and bt_br_<something> (or bt_classic if we wanted to follow the naming scheme in files and Kconfig...), but since the LE version of this funcion is bt_conn_lookup_addr_le, then I guess it makes sense to continue with that.

As mentioned in my other review, I do think it makes equally / more sense to just use bt_conn_get_info as that already contains this functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However, for purposes that only want to obtain the peer address, calling bt_conn_get_info is too complicated.

Because within the function bt_conn_get_info, not only are memory read and write operations performed, but HCI access is also introduced.

Obviously, this function is not always easy to use.

For LE, I speculate that this may also be the reason for the existence of bt_conn_lookup_ addr_le.

Move the declaration of the function `bt_conn_lookup_addr_br()` from
`conn_internal.h` to `conn.h`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
@lylezhu2012 lylezhu2012 force-pushed the br_conn_public_bt_conn_lookup_addr_br branch from 36bd4d5 to 8e5503f Compare March 18, 2025 05:33
@kartben kartben merged commit 18b0ac9 into zephyrproject-rtos:main Mar 19, 2025
22 checks passed
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 Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants