Skip to content

Commit

Permalink
Add a "country-code" argument to darwin-framework-tool pairing comman…
Browse files Browse the repository at this point in the history
…ds. (#27951)
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Feb 14, 2024
1 parent 3cf8eaf commit a46b0b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ class PairingCommandBridge : public CHIPCommandBridge
break;
}

if (mode != PairingMode::None)
{
AddArgument("country-code", &mCountryCode,
"Country code to use to set the Basic Information cluster's Location attribute");
}

AddArgument("use-device-attestation-delegate", 0, 1, &mUseDeviceAttestationDelegate,
"If true, use a device attestation delegate that always wants to be notified about attestation results. "
"Defaults to false.");
Expand Down Expand Up @@ -104,4 +110,5 @@ class PairingCommandBridge : public CHIPCommandBridge
char * mOnboardingPayload;
chip::Optional<bool> mUseDeviceAttestationDelegate;
chip::Optional<uint16_t> mDeviceAttestationFailsafeTime;
chip::Optional<char *> mCountryCode;
};
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ - (void)deviceAttestationCompletedForController:(MTRDeviceController *)controlle
}
}

if (mCountryCode.HasValue()) {
params.countryCode = [NSString stringWithUTF8String:mCountryCode.Value()];
}

[deviceControllerDelegate setCommandBridge:this];
[deviceControllerDelegate setParams:params];
[deviceControllerDelegate setCommissioner:commissioner];
Expand Down

0 comments on commit a46b0b7

Please sign in to comment.