Skip to content

Commit

Permalink
Add accepted commands list and attribute list to the list of attribut…
Browse files Browse the repository at this point in the history
…es that qualify as device configuration changes
  • Loading branch information
nivi-apple committed Apr 24, 2024
1 parent 7e3320c commit 22607b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ MTR_EXTERN NSString * const MTRDataVersionKey MTR_NEWLY_AVAILABLE;

/**
* Notifies delegate when the device configuration changes. Device configuration changes include updates in parts list, device type list,
* server list, feature map or cluster revision attributes in the descriptor cluster.
* server list, accepted commands list, attribute list, feature map or cluster revision attributes in the descriptor cluster.
*
* This is called when the MTRDevice object detects a change in the device configuration and reports that to the delegate.
*
Expand Down
10 changes: 6 additions & 4 deletions src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ @implementation MTRDevice {
MTRDeviceConnectivityMonitor * _connectivityMonitor;

// This boolean keeps track of any device configuration changes received in an attribute report
// and when the report ends, we notify the delegate. Device configuration changes include parts
// list, server list, device type list, cluster revision and feature map updates.
// and when the report ends, we notify the delegate. Device configuration changes include parts list,
// server list, device type list, accepted commands list, attribute list, cluster revision and feature map updates.
BOOL _deviceConfigurationChanged;
}

Expand Down Expand Up @@ -1107,8 +1107,8 @@ - (void)_reportAttributes:(NSArray<NSDictionary<NSString *, id> *> *)attributes
}
}

// When we receive an attribute report, check if there are any changes in parts list, server list, device type list, cluster revision
// or feature map attributes of the descriptor cluster. If yes, make a note that the device configuration changed.
// When we receive an attribute report, check if there are any changes in parts list, server list, device type list, accepted commands list,
// attribute list, cluster revision or feature map attributes of the descriptor cluster. If yes, make a note that the device configuration changed.
- (void)_noteDeviceConfigurationChanged:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport
{
for (NSDictionary<NSString *, id> * attribute in attributeReport) {
Expand All @@ -1122,6 +1122,8 @@ - (void)_noteDeviceConfigurationChanged:(NSArray<NSDictionary<NSString *, id> *>
case MTRClusterDescriptorAttributePartsListID:
case MTRClusterDescriptorAttributeServerListID:
case MTRClusterDescriptorAttributeDeviceTypeListID:
case MTRClusterDescriptorAttributeAcceptedCommandListID:
case MTRClusterDescriptorAttributeAttributeListID:
case MTRClusterDescriptorAttributeClusterRevisionID:
case MTRClusterDescriptorAttributeFeatureMapID: {
// If changes are detected, note that the device configuration has changed.
Expand Down

0 comments on commit 22607b1

Please sign in to comment.