-
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
[Chef] Create a ContactSensor to support LIT ICD (Linux Only) #37123
base: master
Are you sure you want to change the base?
Conversation
Changed Files
|
PR #37123: Size comparison from b02badf to 91317d1 Full report (20 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, qpg, stm32, tizen)
|
PR #37123: Size comparison from b02badf to ef66372 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
@@ -29,7 +29,7 @@ steps: | |||
args: | |||
- >- | |||
perl -i -pe 's/^gdbgui==/# gdbgui==/' /opt/espressif/esp-idf/requirements.txt && | |||
./examples/chef/chef.py --build_all --build_exclude "noip|temperaturecontrolledcabinet" | |||
./examples/chef/chef.py --build_all --build_exclude "noip|temperaturecontrolledcabinet|ed3b19ec55" |
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.
ed3b...
is not that friendly for users to read. Could we rename it as ICD maybe or use some different description?
Could we explain in comments why these are excluded?
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.
@andy31415 The icd is an cluster instead of a device type of an endpoint that we put it in the Chef's filename. So I just add some comments in the description. PTAL.
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 description comment doesn't help understand. I don't understand why we are keeping using the weird hashes in the device names. Nobody has actually done anything to keep track of those.
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.
It should not say ed3b19ec55
... it should look like icd
or something like that. An I want to exclude 12acb3d
statement for example is not human reviewable and maintainable. It has no meaning as a number/hex code. Please use human readable strings.
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.
You can change the naming conventions if need be and mark things for ICD if that is important. However do not use hex "signatures" to identify things.
examples/chef/linux/main.cpp
Outdated
void notifyIcdActive(System::Layer * layer, void *) | ||
{ | ||
ICDNotifier::GetInstance().NotifyNetworkActivityNotification(); | ||
DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(10000), notifyIcdActive, 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.
10s is not representative of real ICD devices.
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 need clear comments here, and make it runtime configurable. thanks
#define CHIP_CONFIG_SYNCHRONOUS_REPORTS_ENABLED 1 | ||
|
||
// ICD configurations | ||
#define CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC 30 |
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 is a very short interval. This should be configurable on the command line to allow flexibility.
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 method ICDConfigurationData::SetModeDurations
allows to do that. It should be overridable from command line parameters beyond the starting default of this config.
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.
CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC is better to be handled with runtime configuration. thanks
PR #37123: Size comparison from 577b3f2 to 0cc62c4 Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #37123: Size comparison from 94a47ad to 387f7f2 Full report (14 builds for cc13x4_26x4, cc32xx, nrfconnect, qpg, stm32, tizen)
|
@@ -49,6 +57,10 @@ int main(int argc, char * argv[]) | |||
cmd_app_server_init(); | |||
#endif | |||
|
|||
#if CHIP_CONFIG_ENABLE_ICD_CIP | |||
DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC*1000), notifyIcdActive, 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.
Having this timer here feels 100% wrong. Why is this in main? Why does it notify forever?
Description
Create a Chef ContactSensor to support LIT ICD .
Testing
For example: the following command are setting ICD:
And it will send Check-In message every 15 seconds
The extra
I
is for enabling ICDThis Chef device
rootnode_contactsensor_ed3b19ec55
is excluded from the build all script integrations/cloudbuild/chef.yaml since it requires additional compilation argument to enable ICD features.