Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ICD] Skip Get RegistrationInfo when parameter is already added #31123

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,6 @@ void PairingCommand::OnCommissioningComplete(NodeId nodeId, CHIP_ERROR err)
SetCommandExitStatus(err);
}

void PairingCommand::OnICDRegistrationInfoRequired()
{
// Since we compute our ICD Registration info up front, we can call ICDRegistrationInfoReady() directly.
CurrentCommissioner().ICDRegistrationInfoReady();
mDeviceIsICD = true;
}

void PairingCommand::OnICDRegistrationComplete(NodeId nodeId, uint32_t icdCounter)
{
char icdSymmetricKeyHex[chip::Crypto::kAES_CCM128_Key_Length * 2 + 1];
Expand Down Expand Up @@ -437,6 +430,8 @@ void PairingCommand::OnICDRegistrationComplete(NodeId nodeId, uint32_t icdCounte
return;
}

mDeviceIsICD = true;

ChipLogProgress(chipTool, "Saved ICD Symmetric key for " ChipLogFormatX64, ChipLogValueX64(nodeId));
ChipLogProgress(chipTool,
"ICD Registration Complete for device " ChipLogFormatX64 " / Check-In NodeID: " ChipLogFormatX64
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ class PairingCommand : public CHIPCommand,
void OnPairingComplete(CHIP_ERROR error) override;
void OnPairingDeleted(CHIP_ERROR error) override;
void OnCommissioningComplete(NodeId deviceId, CHIP_ERROR error) override;
void OnICDRegistrationInfoRequired() override;
void OnICDRegistrationComplete(NodeId deviceId, uint32_t icdCounter) override;

/////////// DeviceDiscoveryDelegate Interface /////////
Expand Down
5 changes: 5 additions & 0 deletions src/controller/AutoCommissioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStageInternal(Commissio
case CommissioningStage::kConfigureTrustedTimeSource:
if (mNeedIcdRegistration)
{
if (mParams.GetICDCheckInNodeId().HasValue() && mParams.GetICDMonitoredSubject().HasValue() &&
mParams.GetICDSymmetricKey().HasValue())
{
return CommissioningStage::kICDRegistration;
}
return CommissioningStage::kICDGetRegistrationInfo;
}
return GetNextCommissioningStageInternal(CommissioningStage::kICDSendStayActive, lastErr);
Expand Down
2 changes: 1 addition & 1 deletion src/controller/DevicePairingDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class DLL_EXPORT DevicePairingDelegate
* using CommissioningDelegate.SetCommissioningParameters(), and then call DeviceCommissioner.ICDRegistrationInfoReady()
* in order to resume the commissioning process.
*
* The implementation may set the credentials before start commissioning, and call ICDRegistrationInfoReady() directly.
joonhaengHeo marked this conversation as resolved.
Show resolved Hide resolved
* Not called if the ICD registration info is provided up front.
*/
virtual void OnICDRegistrationInfoRequired() {}

Expand Down
Loading