From 8021b9118268e81f9371dc39cde0e87a2070ef42 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri, 23 Aug 2024 18:37:45 -0400 Subject: [PATCH] [SL-Only]Add Matter+zigbee cmp logic On matter commissioning complete --- examples/platform/silabs/BaseApplication.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index 37efb09fe5..46c0d6ea89 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -74,6 +74,13 @@ #include #endif // PERFORMANCE_TEST_ENABLED +// SL-Only +#include "sl_component_catalog.h" +#ifdef SL_CATALOG_ZIGBEE_STACK_COMMON_PRESENT +#include "ZigbeeCallbacks.h" +#include "sl_cmp_config.h" +#endif + /********************************************************** * Defines and Constants *********************************************************/ @@ -873,6 +880,7 @@ void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t) AppTask::GetLCD().SetScreen(screen); } #endif // DISPLAY_ENABLED + if ((event->ThreadConnectivityChange.Result == kConnectivity_Established) || (event->InternetConnectivityChange.IPv6 == kConnectivity_Established)) { @@ -916,6 +924,15 @@ void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t) ChipLogError(AppServer, "wfx_power_save failed: 0x%lx", err); } #endif /* CHIP_CONFIG_ENABLE_ICD_SERVER && RS911X_WIFI */ +// SL-Only +#ifdef SL_CATALOG_ZIGBEE_STACK_COMMON_PRESENT +#if defined(SL_MATTER_ZIGBEE_CMP) + uint8_t channel = otLinkGetChannel(DeviceLayer::ThreadStackMgrImpl().OTInstance()); + Zigbee::RequestStart(channel); // leave handle internally +#elif defined(SL_MATTER_ZIGBEE_SEQUENTIAL) // Matter Zigbee sequential + Zigbee::RequestLeave(); +#endif // SL_MATTER_ZIGBEE_CMP +#endif // SL_CATALOG_ZIGBEE_STACK_COMMON_PRESENT } break; default: