Skip to content

Commit

Permalink
Fix iOS CHIPTool compilation (#15394)
Browse files Browse the repository at this point in the history
* Fix iOS CHIPTool compilation

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
sagar-apple and restyled-commits authored Feb 22, 2022
1 parent 3666c5b commit 314c597
Showing 1 changed file with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,28 @@ - (void)fetchFabricsList
CHIPOperationalCredentials * cluster =
[[CHIPOperationalCredentials alloc] initWithDevice:chipDevice endpoint:0 queue:dispatch_get_main_queue()];
[self updateResult:[NSString stringWithFormat:@"readAttributeFabrics command sent."] isError:NO];
[cluster readAttributeFabricsWithCompletionHandler:^(
NSArray<CHIPOperationalCredentialsClusterFabricDescriptor *> * _Nullable fabricsList,
NSError * _Nullable error) {
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[self updateResult:[NSString stringWithFormat:@"readAttributeFabrics command failed: %@.", error]
isError:YES];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[self updateResult:[NSString stringWithFormat:@"Command readAttributeFabrics command succeeded."]
isError:NO];
});
}
NSLog(@"Got back fabrics list: %@ error %@", fabricsList, error);
[self updateFabricsListUIWithFabrics:fabricsList error:error];
}];
CHIPReadParams * params = [[CHIPReadParams alloc] init];
params.fabricFiltered = @NO;
[cluster
readAttributeFabricsWithParams:params
completionHandler:^(NSArray * _Nullable fabricsList, NSError * _Nullable error) {
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[self updateResult:[NSString
stringWithFormat:@"readAttributeFabrics command failed: %@.",
error]
isError:YES];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[self updateResult:[NSString stringWithFormat:
@"Command readAttributeFabrics command succeeded."]
isError:NO];
});
}
NSLog(@"Got back fabrics list: %@ error %@", fabricsList, error);
[self updateFabricsListUIWithFabrics:fabricsList error:error];
}];
} else {
[self updateResult:[NSString stringWithFormat:@"Failed to establish a connection with the device"] isError:YES];
}
Expand Down

0 comments on commit 314c597

Please sign in to comment.