Skip to content

Commit ffbc362

Browse files
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
1 parent e75d6da commit ffbc362

File tree

3 files changed

+21
-29
lines changed

3 files changed

+21
-29
lines changed

examples/platform/linux/CommissionerMain.cpp

+9-11
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include <platform/CHIPDeviceLayer.h>
20-
#include <platform/PlatformManager.h>
21-
22-
#include <string>
19+
#include "CommissionerMain.h"
2320

2421
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
2522

@@ -31,6 +28,7 @@
3128
#include <crypto/CHIPCryptoPAL.h>
3229
#include <crypto/RawKeySessionKeystore.h>
3330
#include <lib/core/CHIPError.h>
31+
#include <lib/core/CHIPPersistentStorageDelegate.h>
3432
#include <lib/core/NodeId.h>
3533
#include <lib/support/logging/CHIPLogging.h>
3634

@@ -48,23 +46,23 @@
4846
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4947
#include <setup_payload/SetupPayload.h>
5048

49+
#include <platform/CHIPDeviceLayer.h>
5150
#include <platform/CommissionableDataProvider.h>
5251
#include <platform/DeviceInstanceInfoProvider.h>
5352
#include <platform/DiagnosticDataProvider.h>
53+
#include <platform/KeyValueStoreManager.h>
54+
#include <platform/PlatformManager.h>
5455
#include <platform/TestOnlyCommissionableDataProvider.h>
5556

56-
#include <controller/CHIPDeviceControllerFactory.h>
57-
#include <controller/ExampleOperationalCredentialsIssuer.h>
58-
#include <lib/core/CHIPPersistentStorageDelegate.h>
59-
#include <platform/KeyValueStoreManager.h>
57+
#include <controller/CHIPDeviceControllerFactory.h> // nogncheck
58+
#include <controller/ExampleOperationalCredentialsIssuer.h> // nogncheck
6059

6160
#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
6261
#include "TraceHandlers.h"
6362
#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
6463

6564
#include <signal.h>
66-
67-
#include "CommissionerMain.h"
65+
#include <string>
6866

6967
using namespace chip;
7068
using namespace chip::Credentials;
@@ -459,7 +457,7 @@ CommissionerDiscoveryController * GetCommissionerDiscoveryController()
459457
return &gCommissionerDiscoveryController;
460458
}
461459

462-
SessionKeystore * GetSessionKeystore()
460+
Crypto::SessionKeystore * GetSessionKeystore()
463461
{
464462
return &gSessionKeystore;
465463
}

examples/platform/linux/CommissionerMain.h

+9-14
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,25 @@
1818

1919
#pragma once
2020

21-
#include <controller/CHIPDeviceController.h>
22-
#include <controller/CommissionerDiscoveryController.h>
23-
#include <credentials/DeviceAttestationCredsProvider.h>
24-
#include <lib/core/CHIPError.h>
25-
#include <platform/CHIPDeviceLayer.h>
26-
#include <platform/PlatformManager.h>
27-
#include <transport/TransportMgr.h>
21+
#include <platform/CHIPDeviceConfig.h>
2822

2923
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
3024

31-
using chip::PersistentStorageDelegate;
32-
using chip::Controller::DeviceCommissioner;
33-
using chip::Crypto::SessionKeystore;
34-
using chip::Transport::PeerAddress;
25+
#include <controller/CHIPDeviceController.h> // nogncheck
26+
#include <controller/CommissionerDiscoveryController.h>
27+
#include <credentials/DeviceAttestationCredsProvider.h>
28+
#include <lib/core/CHIPError.h>
29+
#include <lib/core/CHIPPersistentStorageDelegate.h>
3530

3631
CHIP_ERROR CommissionerPairOnNetwork(uint32_t pincode, uint16_t disc, PeerAddress address);
3732
CHIP_ERROR CommissionerPairUDC(uint32_t pincode, size_t index);
3833

3934
CHIP_ERROR InitCommissioner(uint16_t commissionerPort, uint16_t udcListenPort, chip::FabricId fabricId = chip::kUndefinedFabricId);
4035
void ShutdownCommissioner();
4136

42-
DeviceCommissioner * GetDeviceCommissioner();
37+
chip::Controller::DeviceCommissioner * GetDeviceCommissioner();
4338
CommissionerDiscoveryController * GetCommissionerDiscoveryController();
44-
SessionKeystore * GetSessionKeystore();
45-
PersistentStorageDelegate * GetPersistentStorageDelegate();
39+
chip::Crypto::SessionKeystore * GetSessionKeystore();
40+
chip::PersistentStorageDelegate * GetPersistentStorageDelegate();
4641

4742
#endif // CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE

src/app/tests/BUILD.gn

+3-4
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,9 @@ chip_test_suite("tests") {
305305
test_sources += [ "TestClusterStateCache.cpp" ]
306306
}
307307

308-
# On NRF, Open IoT SDK and fake platforms we do not have a realtime clock available, so
309-
# TestEventLogging.cpp would be testing the same thing as
310-
# TestEventLoggingNoUTCTime, but it's not set up to deal with the timestamps
311-
# being that low.
308+
# On NRF, Open IoT SDK and fake platforms we do not have a realtime clock available,
309+
# so TestEventLogging.cpp would be testing the same thing as TestEventLoggingNoUTCTime,
310+
# but it's not set up to deal with the timestamps being that low.
312311
if (chip_device_platform != "nrfconnect" &&
313312
chip_device_platform != "openiotsdk" && chip_device_platform != "fake") {
314313
test_sources += [ "TestEventLogging.cpp" ]

0 commit comments

Comments
 (0)