|
24 | 24 | using namespace chip;
|
25 | 25 | using namespace chip::app;
|
26 | 26 |
|
27 |
| -namespace { |
28 |
| - |
29 |
| -void IncreaseClusterDataVersion(const ConcreteClusterPath & aConcreteClusterPath) |
30 |
| -{ |
31 |
| - DataVersion * version = emberAfDataVersionStorage(aConcreteClusterPath); |
32 |
| - if (version == nullptr) |
33 |
| - { |
34 |
| - ChipLogError(DataManagement, "Endpoint %x, Cluster " ChipLogFormatMEI " not found in IncreaseClusterDataVersion!", |
35 |
| - aConcreteClusterPath.mEndpointId, ChipLogValueMEI(aConcreteClusterPath.mClusterId)); |
36 |
| - } |
37 |
| - else |
38 |
| - { |
39 |
| - (*(version))++; |
40 |
| - ChipLogDetail(DataManagement, "Endpoint %x, Cluster " ChipLogFormatMEI " update version to %" PRIx32, |
41 |
| - aConcreteClusterPath.mEndpointId, ChipLogValueMEI(aConcreteClusterPath.mClusterId), *(version)); |
42 |
| - } |
43 |
| -} |
44 |
| - |
45 |
| -} // namespace |
46 |
| - |
47 | 27 | void MatterReportingAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId)
|
48 | 28 | {
|
49 | 29 | // Attribute writes have asserted this already, but this assert should catch
|
50 | 30 | // applications notifying about changes from their end.
|
51 | 31 | assertChipStackLockedByCurrentThread();
|
52 | 32 |
|
| 33 | + emberAfIncreaseClusterDataVersion(ConcreteClusterPath(endpoint, clusterId)); |
| 34 | + |
53 | 35 | AttributePathParams info;
|
54 | 36 | info.mClusterId = clusterId;
|
55 | 37 | info.mAttributeId = attributeId;
|
56 | 38 | info.mEndpointId = endpoint;
|
57 | 39 |
|
58 |
| - IncreaseClusterDataVersion(ConcreteClusterPath(endpoint, clusterId)); |
59 | 40 | InteractionModelEngine::GetInstance()->GetReportingEngine().SetDirty(info);
|
60 | 41 | }
|
61 | 42 |
|
|
0 commit comments