-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
feat(split): Add peripheral is bonded/connected to central #2033
base: main
Are you sure you want to change the base?
Conversation
Nice, it might be useful for a single display (on central) setup on splits. |
Is there an existing event to hook up to in order to listen to peripheral changes? If not, might be a good opportunity to add one here. |
There is but it doesn't work quite right. This gets addressed in #2036 as it's needed for that functionality |
bool zmk_split_bt_central_peripheral_is_bonded(uint8_t index); |
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.
Thoughts on a single API that returns an enum with the state? The "is connected" makes no sense if we don't even have an address bonded to that index, for example, so a single API to just query the "peripheral state" makes more sense, IMHO.
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.
I think that's a good idea in general, my only concern would be that's a divergence from how it's currently handled for central->host connections and peripheral->central connections which both use a pair of bool return functions. Would it be better to change all of them over to a consistent API with one BLE_CONN_STATE
enum with connected, bonded but not connected and unbounded values?
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.
Thinking about this more i'm concerned changing the other functions would leak to breakage of module and config repo custom display implementations. A stopgap would be implement enum return, then change the bool return functions to reference that enum return function for some period of time then remove them, similar to how the encoder changes were handled
62f3593
to
f1017f3
Compare
f1017f3
to
5047340
Compare
For easy use by displays and indicators it would be helpful to be able to see if any peripheral at an index is connected and bonded
5047340
to
5007f17
Compare
For easy use by displays and indicators it would be helpful to be able to see if any peripheral at an index is connected and bonded, follow on from #2032