Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and woody-apple committed Feb 10, 2024
1 parent f87e100 commit 96cb167
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ - (void)_setupSubscription
CHIP_ERROR err = readClient->SendAutoResubscribeRequest(std::move(readParams));

if (err != CHIP_NO_ERROR) {
NSError * error = [MTRError errorForCHIPErrorCode:err logContext: self];
NSError * error = [MTRError errorForCHIPErrorCode:err logContext:self];
MTR_LOG_ERROR("%@ SendAutoResubscribeRequest error %@", self, error);
dispatch_async(self.queue, ^{
[self _handleSubscriptionError:error];
Expand Down
3 changes: 2 additions & 1 deletion src/darwin/Framework/CHIP/MTRError.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ - (instancetype)initWithError:(CHIP_ERROR)error;

@implementation MTRError

+ (NSError *)errorForCHIPErrorCode:(CHIP_ERROR)errorCode {
+ (NSError *)errorForCHIPErrorCode:(CHIP_ERROR)errorCode
{
return [MTRError errorForCHIPErrorCode:errorCode logContext:nil];
}

Expand Down
8 changes: 4 additions & 4 deletions src/darwin/Framework/CHIP/MTRSetupPayload.mm
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ + (MTRSetupPayload * _Nullable)setupPayloadWithOnboardingPayload:(NSString *)onb

if (!validPayload) {
if (error) {
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT logContext: onboardingPayload];
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT logContext:onboardingPayload];
}
return nil;
}
Expand Down Expand Up @@ -336,23 +336,23 @@ - (NSString * _Nullable)qrCodeString:(NSError * __autoreleasing *)error
if (self.commissioningFlow == MTRCommissioningFlowInvalid) {
// No idea how to map this to the standard codes.
if (error != nil) {
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE: @"MTRCommissioningFlowInvalid"];
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE:@"MTRCommissioningFlowInvalid"];
}
return nil;
}

if (self.hasShortDiscriminator) {
// Can't create a QR code with a short discriminator.
if (error != nil) {
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE logContext: @"hasShortDiscriminator"];
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE logContext:@"hasShortDiscriminator"];
}
return nil;
}

if (self.discoveryCapabilities == MTRDiscoveryCapabilitiesUnknown) {
// Can't create a QR code if we don't know the discovery capabilities.
if (error != nil) {
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE logContext: @"MTRDiscoveryCapabilitiesUnknown"];
*error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE logContext:@"MTRDiscoveryCapabilitiesUnknown"];
}
return nil;
}
Expand Down

0 comments on commit 96cb167

Please sign in to comment.