Skip to content

Commit eab5b79

Browse files
authored
[Chef] Create a ContactSensor to support LIT ICD (Linux Only) (#37123)
* Add chef icd contact sensor with zap only * Enable Chef to build ICD LIT device type * Enable Check-In timer when CHIP_CONFIG_ENABLE_ICD_CIP enabled * Fix Chef ContacSensor comformance issues * Argumentize the ICD variables * Set ICD Active/Idle Mode duration to linux cmdline * Fix cmdline description * Not build ICD devices * Fix zap comformance issue * Fix restyle issue * Disable icd from Chef.py CI since it requires extra compilation arguments * Rename notifyIcdActive to NotifyIcdActive * Rename chef.py to --enable_lit_icd * Fix cmdline help * Implement RPC to send check-in in chef (not timer) * Remove unused macro * Fix log message * Fix description * Fix description * Check ICD duration arguments or exit * Add chip_persist_subscriptions and chip_subscription_timeout_resumption
1 parent f217707 commit eab5b79

File tree

9 files changed

+6184
-7
lines changed

9 files changed

+6184
-7
lines changed

examples/chef/chef.py

+26-5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
_CD_STAGING_DIR = os.path.join(_CHEF_SCRIPT_PATH, "staging")
4343
_EXCLUDE_DEVICE_FROM_LINUX_CI = [ # These do not compile / deprecated.
4444
"noip_rootnode_dimmablelight_bCwGYSDpoe",
45+
"icd_rootnode_contactsensor_ed3b19ec55",
4546
"rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680",
4647
]
4748

@@ -328,6 +329,8 @@ def main() -> int:
328329
action="store_true", dest="do_erase")
329330
parser.add_option("-i", "--terminal", help="opens terminal to interact with with device",
330331
action="store_true", dest="do_interact")
332+
parser.add_option("-I", "--enable_lit_icd", help="enable LIT ICD (Long Idle Time Intermittently Connected Device) mode",
333+
action="store_true", default=False)
331334
parser.add_option("-m", "--menuconfig", help="runs menuconfig on platforms that support it",
332335
action="store_true", dest="do_menuconfig")
333336
parser.add_option("-z", "--zap", help="runs zap to generate data model & interaction model artifacts",
@@ -390,11 +393,18 @@ def main() -> int:
390393
help=("Builds Chef Examples defined in cicd_config under ci_allow_list_linux. "
391394
"Devices are built without -c for faster compilation."),
392395
dest="ci_linux", action="store_true")
393-
parser.add_option(
394-
"", "--enable_ipv4", help="Enable IPv4 mDNS. Only applicable to platforms that can support IPV4 (e.g, Linux, ESP32)",
395-
action="store_true", default=False)
396-
parser.add_option(
397-
"", "--cpu_type", help="CPU type to compile for. Linux only.", choices=["arm64", "arm", "x64"])
396+
parser.add_option("", "--cpu_type",
397+
help="CPU type to compile for. Linux only.",
398+
choices=["arm64", "arm", "x64"])
399+
parser.add_option("", "--enable_ipv4",
400+
help="Enable IPv4 mDNS. Only applicable to platforms that can support IPV4 (e.g, Linux, ESP32)",
401+
action="store_true", default=False)
402+
parser.add_option("", "--icd_persist_subscription",
403+
help="Enable ICD persistent subscription and re-establish subscriptions from the server side after reboot",
404+
action="store_true", default=False)
405+
parser.add_option("", "--icd_subscription_resumption",
406+
help="Enable subscription resumption after timeout",
407+
action="store_true", default=False)
398408

399409
options, _ = parser.parse_args(sys.argv[1:])
400410

@@ -894,6 +904,17 @@ def main() -> int:
894904
else:
895905
linux_args.append("chip_inet_config_enable_ipv4=false")
896906

907+
if options.enable_lit_icd:
908+
linux_args.append("chip_enable_icd_server = true")
909+
linux_args.append("chip_icd_report_on_active_mode = true")
910+
linux_args.append("chip_enable_icd_lit = true")
911+
linux_args.append("chip_enable_icd_dsls = true")
912+
if options.icd_subscription_resumption:
913+
options.icd_persist_subscription = True
914+
linux_args.append("chip_subscription_timeout_resumption = true")
915+
if options.icd_persist_subscription:
916+
linux_args.append("chip_persist_subscriptions = true")
917+
897918
if sw_ver_string:
898919
linux_args.append(
899920
f'chip_device_config_device_software_version_string = "{sw_ver_string}"')

0 commit comments

Comments
 (0)