From d1b526d1a7046ff9b1e521be15808553437afaf3 Mon Sep 17 00:00:00 2001 From: Vijay Selvaraj Date: Thu, 21 Jul 2022 14:49:04 -0400 Subject: [PATCH] VID/PID override in Linux Examples --- examples/chip-tool/BUILD.gn | 12 ++++-------- src/platform/Linux/ConfigurationManagerImpl.cpp | 3 +++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 2c5880cea2d9a0..f7340a3fb3f00b 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -61,6 +61,7 @@ static_library("chip-tool-utils") { "commands/discover/DiscoverCommand.cpp", "commands/discover/DiscoverCommissionablesCommand.cpp", "commands/discover/DiscoverCommissionersCommand.cpp", + "commands/pairing/PairingCommand.cpp", # TODO - enable CommissionedListCommand once DNS Cache is implemented # "commands/pairing/CommissionedListCommand.cpp", @@ -97,6 +98,7 @@ static_library("chip-tool-utils") { "${chip_root}/src/app/tests/suites/commands/log", "${chip_root}/src/app/tests/suites/commands/system", "${chip_root}/src/app/tests/suites/pics", + "${chip_root}/src/controller/data_model", "${chip_root}/src/credentials:file_attestation_trust_store", "${chip_root}/src/lib", "${chip_root}/src/platform", @@ -115,15 +117,9 @@ static_library("chip-tool-utils") { } executable("chip-tool") { - sources = [ - "commands/pairing/PairingCommand.cpp", - "main.cpp", - ] + sources = [ "main.cpp" ] - deps = [ - ":chip-tool-utils", - "${chip_root}/src/controller/data_model", - ] + deps = [ ":chip-tool-utils" ] output_dir = root_out_dir } diff --git a/src/platform/Linux/ConfigurationManagerImpl.cpp b/src/platform/Linux/ConfigurationManagerImpl.cpp index 68a624ae3ce066..d733df051531f3 100644 --- a/src/platform/Linux/ConfigurationManagerImpl.cpp +++ b/src/platform/Linux/ConfigurationManagerImpl.cpp @@ -67,6 +67,9 @@ CHIP_ERROR ConfigurationManagerImpl::Init() err = Internal::GenericConfigurationManagerImpl::Init(); SuccessOrExit(err); + // undo GenericDeviceInstanceInfoProvider being set as default DeviceInstanceInfoProvider + SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl()); + if (!PosixConfig::ConfigValueExists(PosixConfig::kConfigKey_VendorId)) { err = StoreVendorId(CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID);