-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[app] add binding cluster support #12981
Conversation
2fab02a
to
0af24be
Compare
PR #12981: Size comparison from 628d7ba to a9aafb3 Increases above 0.2%:
Increases (11 builds for esp32, k32w, linux, mbed, p6, qpg, telink)
Decreases (17 builds for efr32, k32w, nrfconnect, p6, qpg)
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
PR #12981: Size comparison from 628d7ba to d93edf7 Increases above 0.2%:
Increases (11 builds for esp32, k32w, linux, mbed, p6, qpg, telink)
Decreases (17 builds for efr32, k32w, nrfconnect, p6, qpg)
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
Re-review was requested after code changes.
The change adds `BindingManager` class for managing the connections to bound devices and forward events on bound clusters to the application.
d93edf7
to
9ad1478
Compare
PR #12981: Size comparison from 3853608 to 9ad1478 Increases above 0.2%:
Increases (7 builds for k32w, linux, mbed, p6, qpg, telink)
Decreases (23 builds for efr32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
Full report (30 builds for efr32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
PR #12981: Size comparison from 3853608 to b58253f Increases above 0.2%:
Increases (3 builds for linux, telink)
Decreases (6 builds for k32w, linux, qpg, telink)
Full report (8 builds for k32w, linux, qpg, telink)
|
b58253f
to
88864ff
Compare
PR #12981: Size comparison from b700fb8 to 88864ff Increases above 0.2%:
Increases (11 builds for esp32, k32w, linux, mbed, p6, qpg, telink)
Decreases (17 builds for efr32, k32w, nrfconnect, p6, qpg)
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
|
{ | ||
// Release the least recently used entry | ||
// TODO: Some reference counting mechanism shall be added the CASESessionManager | ||
// so that other session clients don't get accidentally closed. |
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.
The actual logic to decide which CASE sessions to evict won't be here right? i.e this is just short term?
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.
Yes, we'll submit follow up PRs about the CASE session management.
static void ToggleSwitchOnOff(bool newState) | ||
{ | ||
sSwitchOnOffState = newState; | ||
chip::BindingManager::GetInstance().NotifyBoundClusterChanged(1, chip::app::Clusters::OnOff::Id, nullptr); |
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.
What happens if the switch is toggled quickly 'N' times in succession, and before BoundDeviceChangedHandler
can be called? Does it result in N calls being made to BoundDeviceChangedHandler
from the Binding manager?
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.
If we need to connect to the unicast binding first, we'll check for duplication when pushing to the pending nofication queue. Only one call will be made under such circumstance.
If the binding is ready, we'll directly call the handler. It will be up to the application to do anti-jittering.
* [app] add binding cluster support The change adds `BindingManager` class for managing the connections to bound devices and forward events on bound clusters to the application. * fix review comments & add docs * decouple client from server attributes * Use interaction engine to send On/Off commands * add group to the callback signature * fix review comments * add docs for binding callback arguments * fix unbind * modify callback signature * make BindingManager instance optional * Modify struct layout to save RAM
Problem
Binding cluster is missing in the current SDK
Change overview
The change adds
BindingManager
class for managing the connections tobound devices and forward events on bound clusters to the application.
TODOs
Following tasks need to be accomplished to fully support binding in the future PRs
bind/unbind
comand.Testing
Build
all-cluster-app
with gn argschip_build_libshell=true
Run two linux all-cluster-app in different docker containers or ip namespaces.
Now in the second device's shell: