From 8aa01b5b1986f34ab47ec7e9882a7369d6b8e135 Mon Sep 17 00:00:00 2001 From: doru91 Date: Thu, 25 Nov 2021 16:23:10 +0200 Subject: [PATCH] [K32W0] Check module type (#12162) Make sure that the application runs on K32W061 (Thread + BLE). Signed-off-by: Doru Gucea --- src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp index 354550e805d144..434bd07b8cfe93 100644 --- a/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/PlatformManagerImpl.cpp @@ -34,6 +34,8 @@ #include +#include "K32W061.h" + namespace chip { namespace DeviceLayer { @@ -59,6 +61,15 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) // Initialize the configuration system. err = Internal::K32WConfig::Init(); SuccessOrExit(err); + + if (Chip_GetType() != CHIP_K32W061) + { + err = CHIP_ERROR_INTERNAL; + ChipLogError(DeviceLayer, "Invalid chip type, expected K32W061"); + + goto exit; + } + SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance()); SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance());