[icd] Introduced define to configure the slow poll limit for SIT (#35350)

The slow poll interval limit for SIT is by spec set to 15 s.
This value is used for LIT device working as a SIT, but in
some cases it could be beneficial to be able to change this
limit to the smaller value.
diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt
index 20c5c69..ee16910 100644
--- a/config/nrfconnect/chip-module/CMakeLists.txt
+++ b/config/nrfconnect/chip-module/CMakeLists.txt
@@ -147,6 +147,7 @@
     matter_add_gn_arg_bool  ("chip_enable_icd_lit"                       CONFIG_CHIP_ICD_LIT_SUPPORT)
     matter_add_gn_arg_bool  ("chip_enable_icd_checkin"                   CONFIG_CHIP_ICD_CHECK_IN_SUPPORT)
     matter_add_gn_arg_bool  ("chip_enable_icd_user_active_mode_trigger"  CONFIG_CHIP_ICD_UAT_SUPPORT)
+    matter_add_gn_arg_bool  ("icd_enforce_sit_slow_poll_limit"           TRUE)
 endif()
 
 if (CONFIG_CHIP_FACTORY_DATA OR CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)
diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig
index fb06e10..62efe30 100644
--- a/config/zephyr/Kconfig
+++ b/config/zephyr/Kconfig
@@ -354,6 +354,15 @@
 	  device is in the idle mode. It determines the fastest frequency at which the device will be able
 	  to receive the messages in the idle mode.
 
+config CHIP_ICD_SIT_SLOW_POLL_LIMIT
+	int "Intermittently Connected Device slow polling interval limit for device in SIT mode (ms)"
+	default 15000
+	range 0 15000
+	help
+	  Provides the limit for Intermittently Connected Device slow polling interval in milliseconds while the
+	  device is in the SIT mode. By spec, this value cannot exceed 15 s (spec 9.16.1.5). This value can be
+	  used for the LIT device, to limit the slow poll interval used while temporarily working in the SIT mode.
+
 config CHIP_ICD_FAST_POLLING_INTERVAL
 	int "Intermittently Connected Device fast polling interval (ms)"
 	default 200
diff --git a/src/app/icd/server/ICDConfigurationData.h b/src/app/icd/server/ICDConfigurationData.h
index 937b08b..0d6e17e 100644
--- a/src/app/icd/server/ICDConfigurationData.h
+++ b/src/app/icd/server/ICDConfigurationData.h
@@ -159,7 +159,9 @@
     System::Clock::Seconds32 mMaximumCheckInBackOff = System::Clock::Seconds32(CHIP_CONFIG_ICD_MAXIMUM_CHECK_IN_BACKOFF_SEC);
 
     // SIT ICDs should have a SlowPollingThreshold shorter than or equal to 15s (spec 9.16.1.5)
-    static constexpr System::Clock::Milliseconds32 kSITPollingThreshold = System::Clock::Milliseconds32(15000);
+    static_assert((CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT).count() <= 15000,
+                  "Spec requires the maximum slow poll interval for the SIT device to be smaller or equal than 15 s.");
+    static constexpr System::Clock::Milliseconds32 kSITPollingThreshold = CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT;
     System::Clock::Milliseconds32 mSlowPollingInterval                  = CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL;
     System::Clock::Milliseconds32 mFastPollingInterval                  = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL;
 
diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h
index bc13696..f4b5fbd 100644
--- a/src/include/platform/CHIPDeviceConfig.h
+++ b/src/include/platform/CHIPDeviceConfig.h
@@ -147,6 +147,19 @@
 #endif
 
 /**
+ * CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT
+ *
+ * The maximum value of time in milliseconds that the sleepy end device can use as an idle interval in the SIT mode.
+ * The Matter spec does not allow this value to exceed 15s (spec 9.16.1.5).
+ * For the SIT device, the usability of this value is arguable, as slow poll interval can be configured using
+ * CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL. This value can be used for the LIT device, to limit the slow poll interval used while
+ * temporarily working in the SIT mode.
+ */
+#ifndef CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT
+#define CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT System::Clock::Milliseconds32(15000)
+#endif
+
+/**
  * CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL
  *
  * The default amount of time in milliseconds that the sleepy end device will use as an active interval.
diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h
index d0d3125..c05dfb1 100644
--- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h
+++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h
@@ -221,6 +221,12 @@
 #endif // CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL
 #endif // CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL
 
+#ifndef CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT
+#ifdef CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT
+#define CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT)
+#endif // CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT
+#endif // CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT
+
 #ifndef CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL
 #ifdef CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL
 #define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL)