Skip to content

Commit

Permalink
ESP32: add more ICD kconfig options (#29371)
Browse files Browse the repository at this point in the history
* ESP32: add more ICD kconfig options

* ESP32: Add unit suffixes for the intervals and threshold
  • Loading branch information
wqx6 authored and pull[bot] committed Oct 31, 2023
1 parent ddb5e46 commit 4351a64
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
40 changes: 36 additions & 4 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -310,24 +310,56 @@ menu "CHIP Device Layer"
help
Enables or Disables ICD server

config ICD_SLOW_POLL_INTERVAL
int "ICD Slow Polling Interval"
config ICD_SLOW_POLL_INTERVAL_MS
int "ICD Slow Polling Interval(ms)"
depends on ENABLE_ICD_SERVER
default 5000
help
The value defines the fastest frequency at which the device will typically receive
messages in Idle Mode. The Slow Polling interval MAY be the same as the Idle Mode
Interval.

config ICD_FAST_POLL_INTERVAL
int "ICD Fast Polling Interval"
config ICD_FAST_POLL_INTERVAL_MS
int "ICD Fast Polling Interval(ms)"
depends on ENABLE_ICD_SERVER
default 200
help
Fast Polling defines the fastest frequency at which the device can receive messages
in Active Mode. The Fast Polling interval SHALL be smaller than the Active Mode
Interval.

config ICD_IDLE_MODE_INTERVAL_SEC
int "ICD Idle Mode Interval(sec)"
depends on ENABLE_ICD_SERVER
default 2
help
This value indicates the maximum interval in seconds the server can stay in idle
mode.

config ICD_ACTIVE_MODE_INTERVAL_MS
int "ICD Active Mode Interval(ms)"
depends on ENABLE_ICD_SERVER
default 300
help
This value indicates the minimum interval in milliseconds the server can stay in
active mode.

config ICD_ACTIVE_MODE_THRESHOLD_MS
int "ICD Active Mode Threshold(ms)"
depends on ENABLE_ICD_SERVER
default 300
help
This value indicates the minimum amount of time in milliseconds the server typically
will stay active after network activity when in active mode.

config ICD_CLIENTS_SUPPORTED_PER_FABRIC
int "ICD Clients Number Supported Per Fabric"
depends on ENABLE_ICD_SERVER
default 1
help
This value indicates the maximum number of entries that the ICD server is able to store
for each fabric in the RegisteredClients attribute.

config ENABLE_BG_EVENT_PROCESSING
bool "Enable Background event processing"
default n
Expand Down
1 change: 1 addition & 0 deletions config/esp32/components/chip/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ dependencies:
# Issue: https://github.com/project-chip/connectedhomeip/issues/29125
rules:
- if: "idf_version >=5.0"
- if: "target != esp32h2"
4 changes: 2 additions & 2 deletions src/platform/ESP32/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
#endif // CONFIG_IDF_TARGET_ESP32H2

#if CONFIG_ENABLE_ICD_SERVER
#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_ICD_SLOW_POLL_INTERVAL)
#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_ICD_FAST_POLL_INTERVAL)
#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_ICD_SLOW_POLL_INTERVAL_MS)
#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_ICD_FAST_POLL_INTERVAL_MS)
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER

#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE CONFIG_ENABLE_CHIPOBLE
Expand Down
20 changes: 20 additions & 0 deletions src/platform/ESP32/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,23 @@
#else
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0
#endif

#if CONFIG_ENABLE_ICD_SERVER

#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC
#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC CONFIG_ICD_IDLE_MODE_INTERVAL_SEC
#endif // CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC

#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS
#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS
#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS

#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS
#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS

#ifndef CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC
#define CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC
#endif // CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC

#endif // CONFIG_ENABLE_ICD_SERVER

0 comments on commit 4351a64

Please sign in to comment.