-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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: CCC connected change event #81056
Comments
Not sure I understand the use case. Can you elaborate or give an example? |
I was trying to motivate something like the change you propose in #80988 (comment). Let's see if we can characterize this problem together, and come up with a concrete use case. Do you have one in mind? Otherwise I will try to invent one. |
I see :) That comment was an alternative to getting the max of Notify and Indicate (or a bitfield of all the clients' values). The callback seems to be based on the assumption that these will all be the same, hence why the The issue itself is already solved by However if I should try to motivate the change, it would be something like: |
Can we say that we need an event for when |
Maybe, but not sure what value that adds. But I'm not sure it adds any value to the application to get more information via callbacks and store information itself, rather than just calling Do we have any examples of applications using the |
I'm envisioning an application that needs to send a single "hello" indication to every peer that connects, when they subscribe or are bonded and already subscribed. It has to work with concurrent connections. How would I implement this? Is this even a valid use-case? Arguably it's simpler that the client reads the "hello" instead. |
In that case, wouldn't there be a call guarded by
Arguably it is, but it's a use case already supported by The way that most GATT services work is that
For that use case, the For the case where a service has to notify on (bonded) device reconnects, it is as easy to use the connected/security changed callbacks where you also get the I think the main reason why I think the |
This behavior makes sense, if we define that |
We load CCC values from flash as a reaction to the connected event, so I'm was not sure value I think we can close this issue, at least until someone asks for it. I also noticed that |
Agreed. I don't think we have a use case for it that isn't covered by
That is arguably explicit given that it takes a |
As a developer of a GATT service making use of notifications, I may need to send notifications continuously when a client is connected and subscribed. The notifications may be tailored to the connections.
I would like a signal telling me when a client is connected and subscribed to notifications, and likewise for indications.
Alternatives:
_bt_gatt_ccc.cfg
periodically. There may be some happens-to-work solution to avoid the periodic scanning by listening for_bt_gatt_ccc.write
,bt_conn_cb.connected
,bt_conn_cb.disconnected
, but AFAIK these are not ordered with respect to the change in_bt_gatt_ccc.cfg
.Non-alternatives:
_bt_gatt_ccc.cfg_changed
: Signals a change to_bt_gatt_ccc.value
, which is a summary._bt_gatt_ccc.cfg_write
: Callback for the ATT write. Does not react to a bonded subscribed client connecting. Does not react to disconnection.Possibly relevant discussion: #79822
The text was updated successfully, but these errors were encountered: