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 GATT documentation #86359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KyraLengfeld
Copy link
Collaborator

The gatt docs are very sparce, this commit adds imrpovements for the GATT server API part. Others will follow.

@zephyrbot zephyrbot added area: Bluetooth area: Bluetooth Host Bluetooth Host (excluding BR/EDR) labels Feb 26, 2025
@KyraLengfeld KyraLengfeld added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label Feb 26, 2025
@Thalley
Copy link
Collaborator

Thalley commented Feb 26, 2025

Great! Will do a proper review once it passes CI.

Did you use https://docs.zephyrproject.org/api-coverage/latest/zephyr/bluetooth/gatt.h.gcov.html to find the missing parts?

The gatt docs are very sparce, this commit adds imrpovements for the
GATT server API part. Others will follow.

Signed-off-by: Kyra Lengfeld <[email protected]>
@KyraLengfeld
Copy link
Collaborator Author

KyraLengfeld commented Feb 26, 2025

Great! Will do a proper review once it passes CI.

Did you use https://docs.zephyrproject.org/api-coverage/latest/zephyr/bluetooth/gatt.h.gcov.html to find the missing parts?

Nope :) but we should probably use that once all our planned additions are in to double check. (We tried splitting our planned doc improvements into trivial chunks. So there will be a handful more small PRs coming anyway.)

Copy link
Collaborator

@Thalley Thalley left a comment

Choose a reason for hiding this comment

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

Overall looks OK; some non-blocking comments

@@ -645,7 +648,7 @@ typedef uint8_t (*bt_gatt_attr_func_t)(const struct bt_gatt_attr *attr,
* Iterate attributes in the given range matching given UUID and/or data.
*
* @param start_handle Start handle.
* @param end_handle End handle.
* @param end_handle End handle. Often set to start_handle + attr_count or 0xFFFF.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could consider referring to BT_ATT_LAST_ATTRIBUTE_HANDLE instead of 0xFFFF

Comment on lines +899 to +900
/**
* @brief Gatt Characterisitc Initialization Macro.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The style in this file seems to be to have @brief on the same line as /**

Comment on lines +1026 to +1029
* \internal
* @note Only use this with attributes which user_data is a _bt_gatt_ccc.
* _bt_gatt_ccc being the internal representation of CCC value.
* \endinternal
Copy link
Collaborator

Choose a reason for hiding this comment

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

AFAIK the way to make things internal is to use @cond INTERNAL_HIDDEN + @endcond. @kartben please verify

Comment on lines +1256 to +1258
* See also @ref bt_gatt_notify_cb and @ref bt_gatt_notify_multiple, using this parameter.
*
*/
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
* See also @ref bt_gatt_notify_cb and @ref bt_gatt_notify_multiple, using this parameter.
*
*/
* See also @ref bt_gatt_notify_cb and @ref bt_gatt_notify_multiple, using this parameter.
*/

Comment on lines 1746 to 1749
#if defined(CONFIG_BT_EATT)
/** Att channel options. Only available if @kconfig{CONFIG_BT_EATT} is set. */
enum bt_att_chan_opt chan_opt;
#endif /* CONFIG_BT_EATT */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe outside the scope of this PR, but AFAIk we need to do something like

#if defined(CONFIG_BT_EATT) || defined(__DOXYGEN__)

to ensure that they are in the Doxygen documentation when they are otherwise guarded. @kartben please verify

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 Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants