From ffbc362200b60380114a3e136a44343c0de5e64d Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:23:34 +1300 Subject: [PATCH] Resolve CommissionerMain dependency issues (#36632) * Resolve CommissionerMain dependency issues Note that CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE=1 requires chip_build_controller=true at the GN level, otherwise `lib` does not pull in `controller`. * Touch something in /tests/ to force NRF native_posix_64 tests to run * Add nogncheck to conditional controller imports --- examples/platform/linux/CommissionerMain.cpp | 20 ++++++++--------- examples/platform/linux/CommissionerMain.h | 23 ++++++++------------ src/app/tests/BUILD.gn | 7 +++--- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/examples/platform/linux/CommissionerMain.cpp b/examples/platform/linux/CommissionerMain.cpp index 54ad104c012e4b..f54cfc4bd15d3b 100644 --- a/examples/platform/linux/CommissionerMain.cpp +++ b/examples/platform/linux/CommissionerMain.cpp @@ -16,10 +16,7 @@ * limitations under the License. */ -#include -#include - -#include +#include "CommissionerMain.h" #if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE @@ -31,6 +28,7 @@ #include #include #include +#include #include #include @@ -48,23 +46,23 @@ #include #include +#include #include #include #include +#include +#include #include -#include -#include -#include -#include +#include // nogncheck +#include // nogncheck #if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED #include "TraceHandlers.h" #endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED #include - -#include "CommissionerMain.h" +#include using namespace chip; using namespace chip::Credentials; @@ -459,7 +457,7 @@ CommissionerDiscoveryController * GetCommissionerDiscoveryController() return &gCommissionerDiscoveryController; } -SessionKeystore * GetSessionKeystore() +Crypto::SessionKeystore * GetSessionKeystore() { return &gSessionKeystore; } diff --git a/examples/platform/linux/CommissionerMain.h b/examples/platform/linux/CommissionerMain.h index 106e94b0edcb31..64855b55708086 100644 --- a/examples/platform/linux/CommissionerMain.h +++ b/examples/platform/linux/CommissionerMain.h @@ -18,20 +18,15 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include +#include #if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE -using chip::PersistentStorageDelegate; -using chip::Controller::DeviceCommissioner; -using chip::Crypto::SessionKeystore; -using chip::Transport::PeerAddress; +#include // nogncheck +#include +#include +#include +#include CHIP_ERROR CommissionerPairOnNetwork(uint32_t pincode, uint16_t disc, PeerAddress address); CHIP_ERROR CommissionerPairUDC(uint32_t pincode, size_t index); @@ -39,9 +34,9 @@ CHIP_ERROR CommissionerPairUDC(uint32_t pincode, size_t index); CHIP_ERROR InitCommissioner(uint16_t commissionerPort, uint16_t udcListenPort, chip::FabricId fabricId = chip::kUndefinedFabricId); void ShutdownCommissioner(); -DeviceCommissioner * GetDeviceCommissioner(); +chip::Controller::DeviceCommissioner * GetDeviceCommissioner(); CommissionerDiscoveryController * GetCommissionerDiscoveryController(); -SessionKeystore * GetSessionKeystore(); -PersistentStorageDelegate * GetPersistentStorageDelegate(); +chip::Crypto::SessionKeystore * GetSessionKeystore(); +chip::PersistentStorageDelegate * GetPersistentStorageDelegate(); #endif // CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 105d09f7ad6fc8..18856d40a12f1f 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -305,10 +305,9 @@ chip_test_suite("tests") { test_sources += [ "TestClusterStateCache.cpp" ] } - # On NRF, Open IoT SDK and fake platforms we do not have a realtime clock available, so - # TestEventLogging.cpp would be testing the same thing as - # TestEventLoggingNoUTCTime, but it's not set up to deal with the timestamps - # being that low. + # On NRF, Open IoT SDK and fake platforms we do not have a realtime clock available, + # so TestEventLogging.cpp would be testing the same thing as TestEventLoggingNoUTCTime, + # but it's not set up to deal with the timestamps being that low. if (chip_device_platform != "nrfconnect" && chip_device_platform != "openiotsdk" && chip_device_platform != "fake") { test_sources += [ "TestEventLogging.cpp" ]