diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index ecf97505c331fe..be612efa637bd9 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -451,7 +451,7 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(CommissionerIdentity & identity, // TODO: Initialize IPK epoch key in ExampleOperationalCredentials issuer rather than relying on DefaultIpkValue commissionerParams.operationalCredentialsDelegate = mCredIssuerCmds->GetCredentialIssuer(); - commissionerParams.controllerVendorId = chip::VendorId::TestVendor1; + commissionerParams.controllerVendorId = mCommissionerVendorId.ValueOr(chip::VendorId::TestVendor1); ReturnLogErrorOnFailure(DeviceControllerFactory::GetInstance().SetupCommissioner(commissionerParams, *(commissioner.get()))); diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index da0183aed04d89..a50fded4432244 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -88,6 +88,9 @@ class CHIPCommand : public Command AddArgument("ble-adapter", 0, UINT16_MAX, &mBleAdapterId); AddArgument("storage-directory", &mStorageDirectory, "Directory to place chip-tool's storage files in. Defaults to $TMPDIR, with fallback to /tmp"); + AddArgument( + "commissioner-vendor-id", 0, UINT16_MAX, &mCommissionerVendorId, + "The vendor id to use for chip-tool. If not provided, chip::VendorId::TestVendor1 (65521, 0xFFF1) will be used."); } /////////// Command Interface ///////// @@ -203,6 +206,7 @@ class CHIPCommand : public Command chip::Optional mCommissionerName; chip::Optional mCommissionerNodeId; + chip::Optional mCommissionerVendorId; chip::Optional mBleAdapterId; chip::Optional mPaaTrustStorePath; chip::Optional mCDTrustStorePath; diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h index bf5e7b49fce0fd..2280f71e141a28 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h @@ -41,6 +41,9 @@ class CHIPCommandBridge : public Command { AddArgument("paa-trust-store-path", &mPaaTrustStorePath, "Path to directory holding PAA certificate information. Can be absolute or relative to the current working " "directory."); + AddArgument("commissioner-vendor-id", 0, UINT16_MAX, &mCommissionerVendorId, + "The vendor id to use for darwin-framework-tool. If not provided, chip::VendorId::TestVendor1 (65521, 0xFFF1) will be " + "used."); } /////////// Command Interface ///////// @@ -134,4 +137,5 @@ class CHIPCommandBridge : public Command { bool mWaitingForResponse { true }; static dispatch_queue_t mOTAProviderCallbackQueue; chip::Optional mPaaTrustStorePath; + chip::Optional mCommissionerVendorId; }; diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm index 5a70f15a1c0b33..6c1cd92a32ed48 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm @@ -145,7 +145,7 @@ auto controller = [factory createControllerOnExistingFabric:controllerParams error:&error]; if (controller == nil) { // Maybe we didn't have this fabric yet. - controllerParams.vendorID = @(chip::VendorId::TestVendor1); + controllerParams.vendorID = @(mCommissionerVendorId.ValueOr(chip::VendorId::TestVendor1)); controller = [factory createControllerOnNewFabric:controllerParams error:&error]; } if (controller == nil) {