Skip to content

Commit

Permalink
hook up darwin delegate when commissioning
Browse files Browse the repository at this point in the history
  • Loading branch information
jtung-apple committed Sep 4, 2022
1 parent 18cfcc0 commit 4c1f9d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
chip::Credentials::AttestationVerificationResult attestationResult)
{
dispatch_async(mQueue, ^{
NSLog(@"MTRDeviceAttestationDelegateBridge::OnDeviceAttestationFailed failed with result: %hu", attestationResult);
NSLog(@"MTRDeviceAttestationDelegateBridge::OnDeviceAttestationFailed completed with result: %hu", attestationResult);

mResult = attestationResult;

Expand Down
6 changes: 5 additions & 1 deletion src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,12 @@ - (BOOL)commissionDevice:(uint64_t)deviceId
timeoutSecs
= chip::MakeOptional(static_cast<uint16_t>([commissioningParams.failSafeExpiryTimeoutSecs unsignedIntValue]));
}
BOOL shouldWaitAfterDeviceAttestation = NO;
if ([commissioningParams.deviceAttestationDelegate respondsToSelector:@selector(deviceAttestation:completedForDevice:attestationDeviceInfo:error:)]) {
shouldWaitAfterDeviceAttestation = YES;
}
_deviceAttestationDelegateBridge = new MTRDeviceAttestationDelegateBridge(
self, commissioningParams.deviceAttestationDelegate, _chipWorkQueue, timeoutSecs);
self, commissioningParams.deviceAttestationDelegate, _chipWorkQueue, timeoutSecs, shouldWaitAfterDeviceAttestation);
params.SetDeviceAttestationDelegate(_deviceAttestationDelegateBridge);
}

Expand Down

0 comments on commit 4c1f9d6

Please sign in to comment.