diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h index bf5e7b49fce0fd..e088162294b0fd 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h @@ -38,6 +38,7 @@ class CHIPCommandBridge : public Command { : Command(commandName) { AddArgument("commissioner-name", &mCommissionerName); + AddArgument("commissioner-nodeId", 0, UINT64_MAX, &mCommissionerNodeId); AddArgument("paa-trust-store-path", &mPaaTrustStorePath, "Path to directory holding PAA certificate information. Can be absolute or relative to the current working " "directory."); @@ -131,6 +132,7 @@ class CHIPCommandBridge : public Command { std::condition_variable cvWaitingForResponse; std::mutex cvWaitingForResponseMutex; chip::Optional mCommissionerName; + chip::Optional mCommissionerNodeId; bool mWaitingForResponse { true }; static dispatch_queue_t mOTAProviderCallbackQueue; chip::Optional mPaaTrustStorePath; diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm index 5a70f15a1c0b33..b51a31b8abb621 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm @@ -137,9 +137,13 @@ ipk = [gNocSigner getIPK]; constexpr const char * identities[] = { kIdentityAlpha, kIdentityBeta, kIdentityGamma }; + std::string commissionerName = mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha; for (size_t i = 0; i < ArraySize(identities); ++i) { auto controllerParams = [[MTRDeviceControllerStartupParams alloc] initWithIPK:ipk fabricID:@(i + 1) nocSigner:gNocSigner]; + if (commissionerName.compare(identities[i]) == 0 && mCommissionerNodeId.HasValue()) { + controllerParams.nodeId = @(mCommissionerNodeId.Value()); + } // We're not sure whether we're creating a new fabric or using an // existing one, so just try both. auto controller = [factory createControllerOnExistingFabric:controllerParams error:&error]; diff --git a/examples/darwin-framework-tool/commands/provider/OTASoftwareUpdateInteractive.mm b/examples/darwin-framework-tool/commands/provider/OTASoftwareUpdateInteractive.mm index 77ca8d51a022a5..318696b6ce374e 100644 --- a/examples/darwin-framework-tool/commands/provider/OTASoftwareUpdateInteractive.mm +++ b/examples/darwin-framework-tool/commands/provider/OTASoftwareUpdateInteractive.mm @@ -222,10 +222,10 @@ static bool ParseJsonFileAndPopulateCandidates( CHIP_ERROR error = CHIP_NO_ERROR; if (userConsentNeeded == 0) { mOTADelegate.userConsentNeeded = @(0); - ChipLogDetail(chipTool, "Successfully set User Consent to: OTAProviderUserGranted"); + ChipLogDetail(chipTool, "Successfully set User Consent Needed to: OTAProviderUserGranted"); } else if (userConsentNeeded == 1) { mOTADelegate.userConsentNeeded = @(1); - ChipLogDetail(chipTool, "Successfully set User Consent to: OTAProviderUserObtaining"); + ChipLogDetail(chipTool, "Successfully set User Consent Needed to: OTAProviderUserObtaining"); } else { ChipLogError(chipTool, "Only accepts the following: 0 (Not Needed), and 1 (Needed)."); error = CHIP_ERROR_INTERNAL;