-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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 error reporting on gatt subscribe #82107
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2076,6 +2076,9 @@ struct bt_gatt_subscribe_params { | |
* notified value. One may then decide whether to unsubscribe directly from | ||
* this callback. Notification callback with NULL data will not be called if | ||
* subscription was removed by this method. | ||
* If a different user/application has already subscribed to the same handle, | ||
* then the callback will contain the values aggregated of all the | ||
* users/applications. | ||
Comment on lines
+2079
to
+2081
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to have an example of this? There are 2 callbacks involved here. The other is the So none of the callbacks actually contain information about whether it was a notification or indication. But the documentation you've added here is wrong since the callback does not contain information about the type. What can happen is that App A subscribes to notifications and App B subscribes to indications, and looking at This is what the documentation should say, unless we want to take it a step further and change the behavior so that App A only gets notifications and App B only gets indications (so that the callback behavior matches the params->value). The change should be fairly trivial. @jhedberg @alwa-nordic what are you thoughts about this? And sorry that this is becoming a bigger thing that you probably intended @Yagoor :D |
||
* | ||
* The Response comes in callback @p params->subscribe. The callback is run from | ||
* the context specified by 'config BT_RECV_CONTEXT'. | ||
|
@@ -2095,6 +2098,8 @@ struct bt_gatt_subscribe_params { | |
* @retval 0 Successfully queued request. Will call @p params->write on | ||
* resolution. | ||
* | ||
* @retval -EINVAL if the @p params->value is out of range | ||
* | ||
* @retval -ENOMEM ATT request queue is full and blocking would cause deadlock. | ||
* Allow a pending request to resolve before retrying, or call this function | ||
* outside the BT RX thread to get blocking behavior. Queue size is controlled | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change also needs to added to the documentation of
bt_gatt_subscribe
if not alreadyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yagoor please be careful about resolving review comments yourself: https://docs.zephyrproject.org/latest/contribute/contributor_expectations.html#workflow-suggestions-that-help-reviewers