Skip to content

Commit

Permalink
Commiting (project-chip#30186)
Browse files Browse the repository at this point in the history
  • Loading branch information
woody-apple authored Nov 3, 2023
1 parent e574fd8 commit 2c5fa26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/darwin/Framework/CHIP/MTRDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ typedef NS_ENUM(NSUInteger, MTRDeviceState) {
- (void)setDelegate:(id<MTRDeviceDelegate>)delegate queue:(dispatch_queue_t)queue;

/**
* Read attribute in a designated attribute path
* Read attribute in a designated attribute path. If there is no value available
* for the attribute, whether because the device does not implement it or
* because the subscription priming read has not yet gotten to this attribute,
* nil will be returned.
*
* TODO: Need to document that this returns "the system's best guess" of attribute values.
* TODO: Need to fully document that this returns "the system's best guess" of attribute values.
*
* @return a data-value dictionary of the attribute as described in MTRDeviceResponseHandler
* @return a data-value dictionary of the attribute as described in MTRDeviceResponseHandler,
* or nil if there is no value.
*/
- (NSDictionary<NSString *, id> * _Nullable)readAttributeWithEndpointID:(NSNumber *)endpointID
clusterID:(NSNumber *)clusterID
Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,8 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath)
// 1. The attribute is not in the specification (so we don't know whether hasChangesOmittedQuality can be trusted).
// 2. Subscription not in a state we can expect reports
// 3. There is subscription but attribute has Changes Omitted quality
// 4. Cache has no entry
// TODO: add option for BaseSubscriptionCallback to report during priming, to reduce when case 4 is hit
if (!attributeIsSpecified || ![self _subscriptionAbleToReport] || hasChangesOmittedQuality || !attributeValueToReturn) {
if (!attributeIsSpecified || ![self _subscriptionAbleToReport] || hasChangesOmittedQuality) {
// Read requests container will be a mutable array of items, each being an array containing:
// [attribute request path, params]
// Batching handler should only coalesce when params are equal.
Expand Down

0 comments on commit 2c5fa26

Please sign in to comment.