forked from SiliconLabsSoftware/matter_sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rules.matterlint
179 lines (167 loc) · 11.7 KB
/
rules.matterlint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// These are global .matter idl linter rules
// First load data from XML definitions
load "../src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/access-control-definitions.xml";
load "../src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/administrator-commissioning-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml";
load "../src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/chip-ota.xml";
load "../src/app/zap-templates/zcl/data-model/chip/chip-types.xml";
load "../src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml";
load "../src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/commissioner-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/concentration-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/content-app-observer-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/content-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/measurement-and-sensing.xml";
load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/microwave-oven-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/ecosystem-information-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/general-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/global-attributes.xml";
load "../src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml";
load "../src/app/zap-templates/zcl/data-model/chip/global-enums.xml";
load "../src/app/zap-templates/zcl/data-model/chip/global-structs.xml";
load "../src/app/zap-templates/zcl/data-model/chip/groups-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/laundry-dryer-controls-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/matter-devices.xml";
load "../src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/messages-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml";
load "../src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/operational-state-oven-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/power-topology-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/proxy-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/proxy-discovery-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/service-area-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/scene.xml";
load "../src/app/zap-templates/zcl/data-model/chip/smoke-co-alarm-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/test-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thermostat-user-interface-configuration-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thread-border-router-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/thread-network-directory-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/window-covering.xml";
load "../src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml";
load "../src/app/zap-templates/zcl/data-model/chip/air-quality-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml";
load "../src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml";
all endpoints {
// These attributes follow a different code path and do not have to be
// present in the .matter file
//
// require global attribute generatedCommandList = 65528;
// require global attribute acceptedCommandList = 65529;
// require global attribute attributeList = 65531;
require global attribute featureMap = 65532;
require global attribute clusterRevision = 65533;
// Deny rules:
// deny cluster Foo; // denies entire cluster by name
// deny cluster 123; // denies entire cluster by id
// deny cluster Foo attribute bar; // denies specific attribute by name
// deny cluster Foo attribute 123; // denies specific attribute by id
// deny cluster 234 attribute 567; // Allows deny using ids only
// (previously AverageWearCount, see #30002/#29285 in GitHub)
deny cluster GeneralDiagnostics attribute 9;
}
endpoint 0 {
// Identifiers for clusters are loaded from XML files
// The required clusters are from the spec for RootNode (section 2.1.5 at the moment):
require server cluster BasicInformation;
require server cluster AccessControl;
require server cluster GroupKeyManagement;
require server cluster GeneralCommissioning;
require server cluster AdministratorCommissioning;
require server cluster OperationalCredentials;
require server cluster GeneralDiagnostics;
// It is disallowed to have Simple Device type cluster requirements on EP0.
//
// TODO: Make sure for these commented rules that nothing breaks in CI
// reject server cluster Scenes;
// reject server cluster ScenesManagement;
// reject server cluster Groups;
reject server cluster Identify;
// Required only if !CustomNetworkConfig.
// require server cluster NetworkCommissioning;
// If Ethernet
// require server cluster EthernetNetworkDiagnostics;
// If WiFi
// require server cluster WiFiNetworkDiagnostics;
// If Thread
// require server cluster ThreadNetworkDiagnostics;
}