-
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)
|
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)
|
examples/chef/linux/main.cpp
Outdated
@@ -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?
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.
For Linux we don't have a hardware button to trigger the wake up to send Check-in message. So the simplest way is setting a timer periodically wake up and do that.
PR #37123: Size comparison from 652f786 to 4ccb849 Full report (58 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #37123: Size comparison from b56134c to aa2cae7 Full report (3 builds for cc32xx, stm32)
|
PR #37123: Size comparison from c0e580c to 02b04ca Full report (20 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, qpg, stm32, tizen)
|
compilation arguments
@@ -32,3 +32,6 @@ | |||
|
|||
// Allows app options (ports) to be configured on launch of app | |||
#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 | |||
|
|||
// Enable subscriptions synchronization | |||
#define CHIP_CONFIG_SYNCHRONOUS_REPORTS_ENABLED 1 |
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.
SHould this only be enabled for LIT ICD?
examples/chef/linux/main.cpp
Outdated
|
||
ChipLogDetail(Shell, "Periodic wakeup to notify ICD active"); | ||
DeviceLayer::SystemLayer().StartTimer( | ||
chip::System::Clock::Milliseconds32(LinuxDeviceOptions::GetInstance().icdPeriodicWakeupDurationMs), notifyIcdActive, |
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 can only be sent if the device has no subscriber.
examples/chef/linux/main.cpp
Outdated
#if CHIP_CONFIG_ENABLE_ICD_CIP | ||
// Send notification right away after init | ||
DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(0), notifyIcdActive, nullptr); | ||
#endif // CHIP_CONFIG_ENABLE_ICD_CIP |
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 does not belong in main.cpp. Please create a new LIT ICD management file under chef/linux/
#if CHIP_CONFIG_ENABLE_ICD_SERVER | ||
" --icdActiveModeDurationMs <icdActiveModeDurationMs>\n" | ||
" Sets the ICD active mode threshold (in milliseconds). (Default: 300) \n" | ||
" This defines the how long the the server typically will stay in active mode after \n" | ||
" initial transition out of idle mode.\n" | ||
" --icdIdleModeDuration <icdIdleModeDuration>\n" | ||
" Sets the ICD idle mode durations (in seconds). (Default: 300) \n" | ||
" This defines the how long the ICD server can stay in idle mode.\n" | ||
" --icdPeriodicWakeupDurationMs <icdPeriodicWakupDurationMs>\n" | ||
" Sets the ICD periodic wakeup (in milliseconds). (Default: 60000)\n" | ||
" This is for testing purpose on Linux which defines the internal to wakeup periodically to send \n" | ||
" Check-In messages since Linux application doesn't have a physical button to trigger wakeup\n" |
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 button to trigger wake should not be simulated periodically.
Also please clarify between LIT ICD and SIT ICD. The features enabled here are LIT ICD specific for our purposes.
PR #37123: Size comparison from c0e580c to 0c37543 Full report (3 builds for cc32xx, stm32)
|
PR #37123: Size comparison from c0e580c to 359366a Full report (75 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Description
Create a Chef ContactSensor to support LIT ICD .
Testing
For example: the following command to build and run ICD