diff --git a/src/app/icd/ICDStateObserver.h b/src/app/icd/ICDStateObserver.h index 7c71d4b3c5b463..b9f7dc363f6993 100644 --- a/src/app/icd/ICDStateObserver.h +++ b/src/app/icd/ICDStateObserver.h @@ -17,7 +17,7 @@ #pragma once #ifndef ICD_SLEEP_TIME_JITTER_MS -#define ICD_SLEEP_TIME_JITTER_MS (CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL * 0.75) +#define ICD_SLEEP_TIME_JITTER_MS (CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC * 0.75) #endif #ifndef ICD_ACTIVE_TIME_JITTER_MS diff --git a/src/app/icd/IcdManagementServer.h b/src/app/icd/IcdManagementServer.h index 185731b5257387..0f24cd43ef3995 100644 --- a/src/app/icd/IcdManagementServer.h +++ b/src/app/icd/IcdManagementServer.h @@ -30,21 +30,11 @@ using chip::Protocols::InteractionModel::Status; class IcdManagementServer { public: - void Init(uint32_t idle_interval, uint32_t active_interval, uint16_t active_threshold, uint32_t count, - uint16_t fabric_clients_supported) - { - mIdleInterval = idle_interval; - mActiveInterval = active_interval; - mActiveThreshold = active_threshold; - mIcdCounter = count; - mFabricClientsSupported = fabric_clients_supported; - } + uint32_t GetIdleModeInterval() { return mIdleInterval_s; } - uint32_t GetIdleModeInterval() { return mIdleInterval; } + uint32_t GetActiveModeInterval() { return mActiveInterval_ms; } - uint32_t GetActiveModeInterval() { return mActiveInterval; } - - uint16_t GetActiveModeThreshold() { return mActiveThreshold; } + uint16_t GetActiveModeThreshold() { return mActiveThreshold_ms; } uint32_t GetICDCounter() { return mIcdCounter; } @@ -67,20 +57,20 @@ class IcdManagementServer static IcdManagementServer mInstance; - static_assert((CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL) <= 64800, + static_assert((CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC) <= 64800, "Spec requires the IdleModeInterval to be equal or inferior to 64800s."); - static_assert((CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL) >= 1, "Spec requires the IdleModeInterval to be equal or greater to 1s."); - uint32_t mIdleInterval = CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL; // in seconds. + static_assert((CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC) >= 1, "Spec requires the IdleModeInterval to be equal or greater to 1s."); + uint32_t mIdleInterval_s = CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC; // in seconds. - static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL) <= (CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL * 1000), + static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS) <= (CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC * 1000), "Spec requires the IdleModeInterval be equal or greater to the ActiveModeInterval."); - static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL) >= 300, + static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS) >= 300, "Spec requires the ActiveModeThreshold to be equal or greater to 300ms"); - uint32_t mActiveInterval = CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL; // in milliseconds + uint32_t mActiveInterval_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS; // in milliseconds - static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD) >= 300, + static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS) >= 300, "Spec requires the ActiveModeThreshold to be equal or greater to 300ms."); - uint16_t mActiveThreshold = CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD; // in milliseconds + uint16_t mActiveThreshold_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS; // in milliseconds uint32_t mIcdCounter = 0; diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index da5e3c9aebca97..30d6d6b8a65b36 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1498,30 +1498,30 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #endif /** - * @def CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL + * @def CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC * * @brief Default value for the ICD Management cluster IdleModeInterval attribute, in seconds */ -#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL -#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL 2 +#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC +#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC 2 #endif /** - * @def CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL + * @def CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS * * @brief Default value for the ICD Management cluster ActiveModeInterval attribute, in milliseconds */ -#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL -#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL 300 +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS +#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS 300 #endif /** - * @def CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD + * @def CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS * * @brief Default value for the ICD Management cluster ActiveModeThreshold attribute, in milliseconds */ -#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD -#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD 300 +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS +#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 300 #endif /** diff --git a/src/platform/nrfconnect/CHIPPlatformConfig.h b/src/platform/nrfconnect/CHIPPlatformConfig.h index d3c7b965217f04..078ab065c5897c 100644 --- a/src/platform/nrfconnect/CHIPPlatformConfig.h +++ b/src/platform/nrfconnect/CHIPPlatformConfig.h @@ -112,23 +112,23 @@ #endif // CHIP_ENABLE_OPENTHREAD #endif // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL -#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL +#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC #ifdef CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL -#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL +#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL #endif // CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL -#endif // CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL +#endif // CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC -#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS #ifdef CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL -#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL +#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL #endif // CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL -#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL +#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS -#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS #ifdef CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD -#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD +#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD #endif // CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD -#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD +#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS #ifndef CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC #ifdef CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC diff --git a/src/platform/silabs/CHIPPlatformConfig.h b/src/platform/silabs/CHIPPlatformConfig.h index 49e2bb59454658..e31aa9557b2f73 100644 --- a/src/platform/silabs/CHIPPlatformConfig.h +++ b/src/platform/silabs/CHIPPlatformConfig.h @@ -94,17 +94,17 @@ #ifdef SL_ICD_ENABLED -#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL -#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL SL_IDLE_MODE_INTERVAL -#endif // CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL +#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC +#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC SL_IDLE_MODE_INTERVAL +#endif // CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC -#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL -#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL SL_ACTIVE_MODE_INTERVAL -#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS +#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS SL_ACTIVE_MODE_INTERVAL +#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS -#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD -#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD SL_ACTIVE_MODE_THRESHOLD -#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS +#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS SL_ACTIVE_MODE_THRESHOLD +#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS #ifndef CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC #define CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC SL_ICD_SUPPORTED_CLIENTS_PER_FABRIC