|
15 | 15 | */
|
16 | 16 | #include "MatterCallbacks.h"
|
17 | 17 |
|
18 |
| -// The defines below are using link-time callback and should be removed |
19 |
| -// |
20 |
| -// TODO: applications should be converted to use DataModelCallbacks instead |
21 |
| -// of relying on weak linkage |
22 |
| -void __attribute__((weak)) MatterPreAttributeReadCallback(const chip::app::ConcreteAttributePath & attributePath) {} |
23 |
| -void __attribute__((weak)) MatterPostAttributeReadCallback(const chip::app::ConcreteAttributePath & attributePath) {} |
24 |
| -void __attribute__((weak)) MatterPreAttributeWriteCallback(const chip::app::ConcreteAttributePath & attributePath) {} |
25 |
| -void __attribute__((weak)) MatterPostAttributeWriteCallback(const chip::app::ConcreteAttributePath & attributePath) {} |
26 |
| -CHIP_ERROR __attribute__((weak)) MatterPreCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath, |
27 |
| - const chip::Access::SubjectDescriptor & subjectDescriptor) |
28 |
| -{ |
29 |
| - return CHIP_NO_ERROR; |
30 |
| -} |
31 |
| -void __attribute__((weak)) MatterPostCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath, |
32 |
| - const chip::Access::SubjectDescriptor & subjectDescriptor) |
33 |
| -{} |
34 |
| - |
35 | 18 | namespace chip {
|
36 | 19 | namespace {
|
37 | 20 |
|
38 |
| -class WeakRedirectCallbacks : public DataModelCallbacks |
39 |
| -{ |
40 |
| -public: |
41 |
| - void AttributeOperation(OperationType operation, OperationOrder order, const chip::app::ConcreteAttributePath & path) override |
42 |
| - { |
43 |
| - switch (operation) |
44 |
| - { |
45 |
| - case OperationType::Read: |
46 |
| - switch (order) |
47 |
| - { |
48 |
| - case OperationOrder::Pre: |
49 |
| - MatterPreAttributeReadCallback(path); |
50 |
| - break; |
51 |
| - case OperationOrder::Post: |
52 |
| - MatterPostAttributeReadCallback(path); |
53 |
| - break; |
54 |
| - } |
55 |
| - break; |
56 |
| - case OperationType::Write: |
57 |
| - switch (order) |
58 |
| - { |
59 |
| - case OperationOrder::Pre: |
60 |
| - MatterPreAttributeWriteCallback(path); |
61 |
| - break; |
62 |
| - case OperationOrder::Post: |
63 |
| - MatterPostAttributeWriteCallback(path); |
64 |
| - break; |
65 |
| - } |
66 |
| - break; |
67 |
| - } |
68 |
| - } |
69 |
| - |
70 |
| - CHIP_ERROR PreCommandReceived(const chip::app::ConcreteCommandPath & commandPath, |
71 |
| - const chip::Access::SubjectDescriptor & subjectDescriptor) override |
72 |
| - { |
73 |
| - return MatterPreCommandReceivedCallback(commandPath, subjectDescriptor); |
74 |
| - } |
75 |
| - |
76 |
| - void PostCommandReceived(const chip::app::ConcreteCommandPath & commandPath, |
77 |
| - const chip::Access::SubjectDescriptor & subjectDescriptor) override |
78 |
| - { |
79 |
| - |
80 |
| - MatterPostCommandReceivedCallback(commandPath, subjectDescriptor); |
81 |
| - } |
82 |
| -}; |
83 |
| - |
84 |
| -WeakRedirectCallbacks gWeakCallbacks; |
85 |
| -DataModelCallbacks * gInstance = &gWeakCallbacks; |
| 21 | +DataModelCallbacks gNoopCallbacks; |
| 22 | +DataModelCallbacks * gInstance = &gNoopCallbacks; |
86 | 23 |
|
87 | 24 | } // namespace
|
88 | 25 |
|
|
0 commit comments