Skip to content

Commit

Permalink
Fix reporting in CHIPTool (project-chip#14917)
Browse files Browse the repository at this point in the history
* Fix reporting in CHIPTool

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
sagar-apple and restyled-commits authored Feb 9, 2022
1 parent 41b2347 commit 052ce8d
Showing 1 changed file with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,18 @@ - (void)reportFromUserEnteredSettings
if (chipDevice) {
CHIPTemperatureMeasurement * cluster =
[[CHIPTemperatureMeasurement alloc] initWithDevice:chipDevice endpoint:1 queue:dispatch_get_main_queue()];
// TODO - Fix temperature reporting in iOS CHIPTool
/*
[cluster
subscribeAttributeMeasuredValueWithMinInterval:minIntervalSeconds
maxInterval:maxIntervalSeconds
responseHandler:^(NSError * error, NSDictionary * values) {
if (error == nil)
return;
NSLog(@"Status: update reportAttributeMeasuredValue completed with error %@",
[error description]);
}];
[cluster reportAttributeMeasuredValueWithResponseHandler:^(NSError * error, NSDictionary * values) {
if (error != nil)
return;
NSNumber * value = values[@"value"];
[self updateTempInUI:value.shortValue];
}];
*/
[cluster subscribeAttributeMeasuredValueWithMinInterval:minIntervalSeconds
maxInterval:maxIntervalSeconds
subscriptionEstablished:^{

}
reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) {
if (error) {
NSLog(@"Status: update reportAttributeMeasuredValue completed with error %@", [error description]);
return;
}
[self updateTempInUI:value.shortValue];
}];
} else {
NSLog(@"Status: Failed to establish a connection with the device");
}
Expand Down

0 comments on commit 052ce8d

Please sign in to comment.