Line data Source code
1 : /*
2 : *
3 : * Copyright (c) 2024 Project CHIP Authors
4 : *
5 : * Licensed under the Apache License, Version 2.0 (the "License");
6 : * you may not use this file except in compliance with the License.
7 : * You may obtain a copy of the License at
8 : *
9 : * http://www.apache.org/licenses/LICENSE-2.0
10 : *
11 : * Unless required by applicable law or agreed to in writing, software
12 : * distributed under the License is distributed on an "AS IS" BASIS,
13 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 : * See the License for the specific language governing permissions and
15 : * limitations under the License.
16 : */
17 : #include "reporting.h"
18 :
19 : #include <app/AttributePathParams.h>
20 : #include <app/InteractionModelEngine.h>
21 : #include <app/util/attribute-storage.h>
22 : #include <platform/LockTracker.h>
23 :
24 : using namespace chip;
25 : using namespace chip::app;
26 :
27 0 : void MatterReportingAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId)
28 : {
29 : // Attribute writes have asserted this already, but this assert should catch
30 : // applications notifying about changes from their end.
31 0 : assertChipStackLockedByCurrentThread();
32 :
33 0 : InteractionModelEngine::GetInstance()->GetDataModelProvider()->Temporary_ReportAttributeChanged(
34 0 : AttributePathParams(endpoint, clusterId, attributeId));
35 0 : }
36 :
37 0 : void MatterReportingAttributeChangeCallback(const ConcreteAttributePath & aPath)
38 : {
39 : // Attribute writes have asserted this already, but this assert should catch
40 : // applications notifying about changes from their end.
41 0 : assertChipStackLockedByCurrentThread();
42 :
43 0 : InteractionModelEngine::GetInstance()->GetDataModelProvider()->Temporary_ReportAttributeChanged(
44 0 : AttributePathParams(aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId));
45 0 : }
46 :
47 0 : void MatterReportingAttributeChangeCallback(EndpointId endpoint)
48 : {
49 : // Attribute writes have asserted this already, but this assert should catch
50 : // applications notifying about changes from their end.
51 0 : assertChipStackLockedByCurrentThread();
52 :
53 0 : InteractionModelEngine::GetInstance()->GetDataModelProvider()->Temporary_ReportAttributeChanged(AttributePathParams(endpoint));
54 0 : }
|