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: Host: Improve documentation of bt_le_ext_adv_start_param #87358

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

alwa-nordic
Copy link
Collaborator

This clarifies the documentation of bt_le_ext_adv_start_param and bt_le_ext_adv_cb.sent, and links them by via references.

jhedberg
jhedberg previously approved these changes Mar 19, 2025
@alwa-nordic alwa-nordic requested a review from omkar3141 March 19, 2025 15:26
Copy link
Collaborator

@omkar3141 omkar3141 left a comment

Choose a reason for hiding this comment

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

Some minor alignment comments as per existing pattern

*
* When using high duty cycle directed connectable advertising then
* this parameters must be set to a non-zero value less than or equal
* to the maximum of @ref BT_GAP_ADV_HIGH_DUTY_CYCLE_MAX_TIMEOUT.
*
* If privacy @kconfig{CONFIG_BT_PRIVACY} is enabled then the timeout
* must be less than @kconfig{CONFIG_BT_RPA_TIMEOUT}.
*
* See Core 4.E.7.8.56 parameter "Duration" for background information.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please spell out specific version and other details. This helps in locating the correct thing.

Suggested change
* See Core 4.E.7.8.56 parameter "Duration" for background information.
* See parameter "Duration" in Core Specification Version 5.4 Vol. 4 Part E, Section 7.8.56, for background information.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree (and please use version 6.0 instead of 5.4)

Copy link
Collaborator

Choose a reason for hiding this comment

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

In this file we refer to 5.4, so I suggested 5.4, generally core spec section numbers do not change across revisions.

Copy link
Collaborator

@Thalley Thalley Mar 20, 2025

Choose a reason for hiding this comment

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

Hmm, I always thought we would refer to the newest version of the spec available when adding the reference. We don't have any guidelines on this though

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok. It does not matter that much because section numbers don't change in core specifications across versions. Just FYI this may not be true for other profiles and spec (certainly not true for Mesh).

Copy link
Collaborator

@omkar3141 omkar3141 Mar 20, 2025

Choose a reason for hiding this comment

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

@Thalley will it be worth creatin an issue regarding this and using that issue as basis to update coding guidlines to specifically state this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just FYI this may not be true for other profiles and spec (certainly not true for Mesh).

Yeah, I've noticed, which is also why it's important to provide the version number :) Arguably we could omit it for the BT Core spec, as it doesn't change, but there still needs to be a minimum version where it was added

Comment on lines 139 to 141
* This callback is invoked when the limit set in @ref
* bt_le_ext_adv_start_param.timeout or @ref
* bt_le_ext_adv_start_param.num_events is reached.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* This callback is invoked when the limit set in @ref
* bt_le_ext_adv_start_param.timeout or @ref
* bt_le_ext_adv_start_param.num_events is reached.
* This callback is invoked when the limit set in
* @ref bt_le_ext_adv_start_param.timeout or
* @ref bt_le_ext_adv_start_param.num_events is reached.

Not a blocker, but I do prefer having the @ref on the same line as the value it references

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I will fix it.

I missed that because I used a generic line re-wrap tool. Wrapping text manually is not fun, so I think we should think about how this can be automated. Ideally clang-format or another tool would take care of formatting Doxygen too. But I have not seen anything that can do this job. That's why I think we should maybe start using the #foo instead of @ref foo, so that there is no white space. At least it's a point in favor of it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's why I think we should maybe start using the #foo instead of @ref foo, so that there is no white space. At least it's a point in favor of it.

I wouldn't be opposed to that, given the reasoning

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you want to change style of referencing etc, it will be good to do that as a global change in seperate PR.

*
* When using high duty cycle directed connectable advertising then
* this parameters must be set to a non-zero value less than or equal
* to the maximum of @ref BT_GAP_ADV_HIGH_DUTY_CYCLE_MAX_TIMEOUT.
*
* If privacy @kconfig{CONFIG_BT_PRIVACY} is enabled then the timeout
* must be less than @kconfig{CONFIG_BT_RPA_TIMEOUT}.
*
* See Core 4.E.7.8.56 parameter "Duration" for background information.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree (and please use version 6.0 instead of 5.4)

@alwa-nordic
Copy link
Collaborator Author

I have applied all suggestions. The second push is a rebase on main.

jhedberg
jhedberg previously approved these changes Mar 20, 2025
omkar3141
omkar3141 previously approved these changes Mar 20, 2025
Thalley
Thalley previously approved these changes Mar 20, 2025
@alwa-nordic alwa-nordic added the DNM This PR should not be merged (Do Not Merge) label Mar 21, 2025
This clarifies the documentation of `bt_le_ext_adv_start_param` and
`bt_le_ext_adv_cb.sent`, and links them by via references.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
@alwa-nordic alwa-nordic dismissed stale reviews from Thalley, omkar3141, and jhedberg via 1d3a297 March 21, 2025 09:22
@alwa-nordic alwa-nordic removed the DNM This PR should not be merged (Do Not Merge) label Mar 21, 2025
@alwa-nordic
Copy link
Collaborator Author

I had to update the documentation after I noticed the following section:

If the Max_Extended_Advertising_Events parameter in the HCI_LE_­­Set_­­Extended_­­Advertising_­­Enable command was non-zero, the Num_Completed_­­Extended_­­Advertising_­­Events parameter shall be set to the number of completed extended advertising events the Controller had transmitted when either the duration elapsed or the maximum number of extended advertising events was reached; otherwise it shall be set to zero.

Core 4.E.7.7.65.18

Comment on lines -200 to -201
* The advertising set can either have been stopped by a timeout or
* because the specified number of advertising events has been reached.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I read this as the only two reasons for this callback. But, I'm not sure after looking at the code. It looks like it might also be called when the advertising set spawns a connection. @jhedberg Do you know?

Copy link
Member

Choose a reason for hiding this comment

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

Not off the top of my head, unfortunately. Sounds like a reasonable assumption, though.

@kartben kartben merged commit b2d21f9 into zephyrproject-rtos:main Mar 21, 2025
21 of 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants