Skip to content

Commit 27f4885

Browse files
authored
Align Matter/CSA encoding with events and struct fields: capture fabric sensitivity for attributes when <access fabricSensitive=true/> is present. (#1703)
Align Matter/CSA encoding with events and struct fields: capture fabric sensitivity for attributes when <access fabricSensitive=true/> is present. - Add ATTRIBUTE.IS_FABRIC_SENSITIVE in zap-schema; insert and map in query-loader / db-mapping; include column in attribute SELECTs (query-zcl, query-attribute, query-session-zcl, query-endpoint). - zcl-loader-silabs: set isFabricSensitive via isAccessFabricSensitive() on parsed attribute access children. - Extend meta fixture (test1.xml) and gen-meta tests for at2 and HelloEvent isFabricSensitive where applicable. - Updating the xsd schema - Github: ZAP #1644
1 parent bfd16fb commit 27f4885

15 files changed

Lines changed: 147 additions & 3 deletions

File tree

docs/api.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11991,6 +11991,7 @@ From `exports.map.endpointTypeAttributeExtended` in `src-electron/db/db-mapping.
1199111991
- isBound
1199211992
- isChangeOmitted
1199311993
- isClusterEnabled
11994+
- isFabricSensitive
1199411995
- isGlobalAttribute
1199511996
- isIncluded
1199611997
- isManufacturingSpecific
@@ -13128,6 +13129,7 @@ From `exports.map.attribute` in `src-electron/db/db-mapping.js`:
1312813129
- id
1312913130
- isArray
1313013131
- isChangeOmitted
13132+
- isFabricSensitive
1313113133
- isNullable
1313213134
- isOptional
1313313135
- isReadable
@@ -21878,6 +21880,7 @@ This module provides the APIs for dotdot Loading
2187821880
* [~prepareClusterGlobalAttribute(cluster)](#module_Loader API_ Loader APIs..prepareClusterGlobalAttribute) ⇒
2187921881
* [~extractAccessTag(ac)](#module_Loader API_ Loader APIs..extractAccessTag) ⇒
2188021882
* [~extractAccessIntoArray(xmlElement)](#module_Loader API_ Loader APIs..extractAccessIntoArray) ⇒
21883+
* [~isAccessFabricSensitive(xmlElement)](#module_Loader API_ Loader APIs..isAccessFabricSensitive) ⇒
2188121884
* [~prepareCluster(cluster)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
2188221885
* [~processClusters(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusters) ⇒
2188321886
* [~processClusterGlobalAttributes(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterGlobalAttributes) ⇒
@@ -22692,6 +22695,21 @@ Extract list of access information
2269222695
| --- | --- |
2269322696
| xmlElement | <code>\*</code> |
2269422697

22698+
<a name="module_Loader API_ Loader APIs..isAccessFabricSensitive"></a>
22699+
22700+
### Loader API: Loader APIs~isAccessFabricSensitive(xmlElement) ⇒
22701+
Check whether any <access fabricSensitive="true"/> child is present on the
22702+
given parsed XML element. For attributes, the CSA data model only uses this
22703+
form (not isFabricSensitive on the attribute start tag), e.g.
22704+
<access read="true" readPrivilege="manage" fabricSensitive="true"/>
22705+
22706+
**Kind**: inner method of [<code>Loader API: Loader APIs</code>](#module_Loader API_ Loader APIs)
22707+
**Returns**: Whether any access child has fabricSensitive="true"
22708+
22709+
| Param | Type | Description |
22710+
| --- | --- | --- |
22711+
| xmlElement | <code>\*</code> | xml2js-parsed element that may contain an `access` array |
22712+
2269522713
<a name="module_Loader API_ Loader APIs..prepareCluster"></a>
2269622714

2269722715
### Loader API: Loader APIs~prepareCluster(cluster) ⇒
@@ -23739,6 +23757,7 @@ This module provides the APIs for new data model loading
2373923757
* [~prepareClusterGlobalAttribute(cluster)](#module_Loader API_ Loader APIs..prepareClusterGlobalAttribute) ⇒
2374023758
* [~extractAccessTag(ac)](#module_Loader API_ Loader APIs..extractAccessTag) ⇒
2374123759
* [~extractAccessIntoArray(xmlElement)](#module_Loader API_ Loader APIs..extractAccessIntoArray) ⇒
23760+
* [~isAccessFabricSensitive(xmlElement)](#module_Loader API_ Loader APIs..isAccessFabricSensitive) ⇒
2374223761
* [~prepareCluster(cluster)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
2374323762
* [~processClusters(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusters) ⇒
2374423763
* [~processClusterGlobalAttributes(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterGlobalAttributes) ⇒
@@ -24553,6 +24572,21 @@ Extract list of access information
2455324572
| --- | --- |
2455424573
| xmlElement | <code>\*</code> |
2455524574

24575+
<a name="module_Loader API_ Loader APIs..isAccessFabricSensitive"></a>
24576+
24577+
### Loader API: Loader APIs~isAccessFabricSensitive(xmlElement) ⇒
24578+
Check whether any <access fabricSensitive="true"/> child is present on the
24579+
given parsed XML element. For attributes, the CSA data model only uses this
24580+
form (not isFabricSensitive on the attribute start tag), e.g.
24581+
<access read="true" readPrivilege="manage" fabricSensitive="true"/>
24582+
24583+
**Kind**: inner method of [<code>Loader API: Loader APIs</code>](#module_Loader API_ Loader APIs)
24584+
**Returns**: Whether any access child has fabricSensitive="true"
24585+
24586+
| Param | Type | Description |
24587+
| --- | --- | --- |
24588+
| xmlElement | <code>\*</code> | xml2js-parsed element that may contain an `access` array |
24589+
2455624590
<a name="module_Loader API_ Loader APIs..prepareCluster"></a>
2455724591

2455824592
### Loader API: Loader APIs~prepareCluster(cluster) ⇒
@@ -25600,6 +25634,7 @@ This module provides the APIs for ZCL/Data-Model loading.
2560025634
* [~prepareClusterGlobalAttribute(cluster)](#module_Loader API_ Loader APIs..prepareClusterGlobalAttribute) ⇒
2560125635
* [~extractAccessTag(ac)](#module_Loader API_ Loader APIs..extractAccessTag) ⇒
2560225636
* [~extractAccessIntoArray(xmlElement)](#module_Loader API_ Loader APIs..extractAccessIntoArray) ⇒
25637+
* [~isAccessFabricSensitive(xmlElement)](#module_Loader API_ Loader APIs..isAccessFabricSensitive) ⇒
2560325638
* [~prepareCluster(cluster)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
2560425639
* [~processClusters(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusters) ⇒
2560525640
* [~processClusterGlobalAttributes(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterGlobalAttributes) ⇒
@@ -26414,6 +26449,21 @@ Extract list of access information
2641426449
| --- | --- |
2641526450
| xmlElement | <code>\*</code> |
2641626451

26452+
<a name="module_Loader API_ Loader APIs..isAccessFabricSensitive"></a>
26453+
26454+
### Loader API: Loader APIs~isAccessFabricSensitive(xmlElement) ⇒
26455+
Check whether any <access fabricSensitive="true"/> child is present on the
26456+
given parsed XML element. For attributes, the CSA data model only uses this
26457+
form (not isFabricSensitive on the attribute start tag), e.g.
26458+
<access read="true" readPrivilege="manage" fabricSensitive="true"/>
26459+
26460+
**Kind**: inner method of [<code>Loader API: Loader APIs</code>](#module_Loader API_ Loader APIs)
26461+
**Returns**: Whether any access child has fabricSensitive="true"
26462+
26463+
| Param | Type | Description |
26464+
| --- | --- | --- |
26465+
| xmlElement | <code>\*</code> | xml2js-parsed element that may contain an `access` array |
26466+
2641726467
<a name="module_Loader API_ Loader APIs..prepareCluster"></a>
2641826468

2641926469
### Loader API: Loader APIs~prepareCluster(cluster) ⇒
@@ -27461,6 +27511,7 @@ This module provides the APIs for for common functionality related to loading.
2746127511
* [~prepareClusterGlobalAttribute(cluster)](#module_Loader API_ Loader APIs..prepareClusterGlobalAttribute) ⇒
2746227512
* [~extractAccessTag(ac)](#module_Loader API_ Loader APIs..extractAccessTag) ⇒
2746327513
* [~extractAccessIntoArray(xmlElement)](#module_Loader API_ Loader APIs..extractAccessIntoArray) ⇒
27514+
* [~isAccessFabricSensitive(xmlElement)](#module_Loader API_ Loader APIs..isAccessFabricSensitive) ⇒
2746427515
* [~prepareCluster(cluster)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
2746527516
* [~processClusters(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusters) ⇒
2746627517
* [~processClusterGlobalAttributes(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterGlobalAttributes) ⇒
@@ -28275,6 +28326,21 @@ Extract list of access information
2827528326
| --- | --- |
2827628327
| xmlElement | <code>\*</code> |
2827728328

28329+
<a name="module_Loader API_ Loader APIs..isAccessFabricSensitive"></a>
28330+
28331+
### Loader API: Loader APIs~isAccessFabricSensitive(xmlElement) ⇒
28332+
Check whether any <access fabricSensitive="true"/> child is present on the
28333+
given parsed XML element. For attributes, the CSA data model only uses this
28334+
form (not isFabricSensitive on the attribute start tag), e.g.
28335+
<access read="true" readPrivilege="manage" fabricSensitive="true"/>
28336+
28337+
**Kind**: inner method of [<code>Loader API: Loader APIs</code>](#module_Loader API_ Loader APIs)
28338+
**Returns**: Whether any access child has fabricSensitive="true"
28339+
28340+
| Param | Type | Description |
28341+
| --- | --- | --- |
28342+
| xmlElement | <code>\*</code> | xml2js-parsed element that may contain an `access` array |
28343+
2827828344
<a name="module_Loader API_ Loader APIs..prepareCluster"></a>
2827928345

2828028346
### Loader API: Loader APIs~prepareCluster(cluster) ⇒

docs/helpers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,6 +3020,7 @@ From `exports.map.endpointTypeAttributeExtended` in `src-electron/db/db-mapping.
30203020
- isBound
30213021
- isChangeOmitted
30223022
- isClusterEnabled
3023+
- isFabricSensitive
30233024
- isGlobalAttribute
30243025
- isIncluded
30253026
- isManufacturingSpecific
@@ -4157,6 +4158,7 @@ From `exports.map.attribute` in `src-electron/db/db-mapping.js`:
41574158
- id
41584159
- isArray
41594160
- isChangeOmitted
4161+
- isFabricSensitive
41604162
- isNullable
41614163
- isOptional
41624164
- isReadable

src-electron/db/db-mapping.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ exports.map = {
115115
isReadable: dbApi.fromDbBool(x.IS_READABLE),
116116
isReadableAttribute: dbApi.fromDbBool(x.IS_READABLE),
117117
isNullable: dbApi.fromDbBool(x.IS_NULLABLE),
118+
isFabricSensitive: dbApi.fromDbBool(x.IS_FABRIC_SENSITIVE),
118119
defaultValue: x.DEFAULT_VALUE,
119120
isOptional: dbApi.fromDbBool(x.IS_OPTIONAL),
120121
isReportable:
@@ -726,6 +727,7 @@ exports.map = {
726727
x.MANUFACTURER_CODE | x.CLUSTER_MANUFACTURER_CODE
727728
), // Is Attribute mfg specific or not
728729
isNullable: dbApi.fromDbBool(x.IS_NULLABLE), // Is attribute nullable
730+
isFabricSensitive: dbApi.fromDbBool(x.IS_FABRIC_SENSITIVE), // Is attribute fabric sensitive
729731
isOptionalAttribute: dbApi.fromDbBool(x.IS_OPTIONAL),
730732
isReportableAttribute: dbApi.fromDbBool(x.INCLUDED_REPORTABLE), // Is attribute reportable
731733
isSceneRequired: dbApi.fromDbBool(x.IS_SCENE_REQUIRED),

src-electron/db/query-attribute.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ async function selectAllAttributeDetailsFromEnabledClusters(
174174
ATTRIBUTE.IS_WRITABLE,
175175
ATTRIBUTE.IS_READABLE,
176176
ATTRIBUTE.IS_NULLABLE,
177+
ATTRIBUTE.IS_FABRIC_SENSITIVE,
177178
ATTRIBUTE.MAX_LENGTH,
178179
ATTRIBUTE.MIN_LENGTH,
179180
ATTRIBUTE.MIN,
@@ -882,6 +883,7 @@ SELECT
882883
A.REPORTING_POLICY,
883884
A.STORAGE_POLICY,
884885
A.IS_NULLABLE,
886+
A.IS_FABRIC_SENSITIVE,
885887
A.IS_SCENE_REQUIRED,
886888
A.ARRAY_TYPE,
887889
A.MUST_USE_TIMED_WRITE,
@@ -950,6 +952,7 @@ SELECT
950952
A.REPORTING_POLICY,
951953
A.STORAGE_POLICY,
952954
A.IS_NULLABLE,
955+
A.IS_FABRIC_SENSITIVE,
953956
A.IS_SCENE_REQUIRED,
954957
A.ARRAY_TYPE,
955958
A.MUST_USE_TIMED_WRITE,

src-electron/db/query-endpoint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ SELECT
277277
A.IS_WRITABLE,
278278
A.IS_READABLE,
279279
A.IS_NULLABLE,
280+
A.IS_FABRIC_SENSITIVE,
280281
A.MUST_USE_TIMED_WRITE,
281282
A.IS_SCENE_REQUIRED,
282283
A.IS_OPTIONAL,
@@ -331,6 +332,7 @@ ORDER BY A.MANUFACTURER_CODE, A.CODE
331332
isWritable: dbApi.fromDbBool(row.IS_WRITABLE),
332333
isReadable: dbApi.fromDbBool(row.IS_READABLE),
333334
isNullable: dbApi.fromDbBool(row.IS_NULLABLE),
335+
isFabricSensitive: dbApi.fromDbBool(row.IS_FABRIC_SENSITIVE),
334336
mustUseTimedWrite: dbApi.fromDbBool(row.MUST_USE_TIMED_WRITE),
335337
isSceneRequired: dbApi.fromDbBool(row.IS_SCENE_REQUIRED),
336338
isOptional: dbApi.fromDbBool(row.IS_OPTIONA),

src-electron/db/query-loader.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ INSERT INTO ATTRIBUTE (
173173
REPORTING_POLICY,
174174
STORAGE_POLICY,
175175
IS_NULLABLE,
176+
IS_FABRIC_SENSITIVE,
176177
IS_SCENE_REQUIRED,
177178
ARRAY_TYPE,
178179
MUST_USE_TIMED_WRITE,
@@ -183,7 +184,7 @@ INSERT INTO ATTRIBUTE (
183184
IS_CHANGE_OMITTED,
184185
PERSISTENCE
185186
) VALUES (
186-
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
187+
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
187188
(SELECT SPEC_ID FROM SPEC WHERE CODE = ? AND PACKAGE_REF = ?),
188189
(SELECT SPEC_ID FROM SPEC WHERE CODE = ? AND PACKAGE_REF = ?),
189190
?,
@@ -257,6 +258,7 @@ function attributeMap(clusterId, packageId, attributes) {
257258
attribute.reportingPolicy,
258259
attribute.storagePolicy,
259260
dbApi.toDbBool(attribute.isNullable),
261+
dbApi.toDbBool(attribute.isFabricSensitive),
260262
dbApi.toDbBool(attribute.isSceneRequired),
261263
attribute.entryType,
262264
dbApi.toDbBool(attribute.mustUseTimedWrite),

src-electron/db/query-session-zcl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ SELECT
162162
ATTRIBUTE.IS_OPTIONAL,
163163
ATTRIBUTE.REPORTING_POLICY,
164164
ATTRIBUTE.IS_NULLABLE,
165+
ATTRIBUTE.IS_FABRIC_SENSITIVE,
165166
ATTRIBUTE.IS_SCENE_REQUIRED,
166167
ATTRIBUTE.ARRAY_TYPE,
167168
ATTRIBUTE.MUST_USE_TIMED_WRITE,

src-electron/db/query-zcl.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ SELECT
709709
REPORTING_POLICY,
710710
STORAGE_POLICY,
711711
IS_NULLABLE,
712+
IS_FABRIC_SENSITIVE,
712713
IS_SCENE_REQUIRED,
713714
ARRAY_TYPE,
714715
MUST_USE_TIMED_WRITE,
@@ -768,6 +769,7 @@ SELECT
768769
REPORTING_POLICY,
769770
STORAGE_POLICY,
770771
IS_NULLABLE,
772+
IS_FABRIC_SENSITIVE,
771773
IS_SCENE_REQUIRED,
772774
ARRAY_TYPE,
773775
MUST_USE_TIMED_WRITE,
@@ -836,6 +838,7 @@ SELECT
836838
A.REPORTING_POLICY,
837839
A.STORAGE_POLICY,
838840
A.IS_NULLABLE,
841+
A.IS_FABRIC_SENSITIVE,
839842
A.IS_SCENE_REQUIRED,
840843
A.ARRAY_TYPE,
841844
A.MUST_USE_TIMED_WRITE,
@@ -891,6 +894,7 @@ SELECT
891894
REPORTING_POLICY,
892895
STORAGE_POLICY,
893896
IS_NULLABLE,
897+
IS_FABRIC_SENSITIVE,
894898
IS_SCENE_REQUIRED,
895899
ARRAY_TYPE,
896900
MUST_USE_TIMED_WRITE,
@@ -959,6 +963,7 @@ SELECT
959963
A.REPORTING_POLICY,
960964
A.STORAGE_POLICY,
961965
A.IS_NULLABLE,
966+
A.IS_FABRIC_SENSITIVE,
962967
A.IS_SCENE_REQUIRED,
963968
A.ARRAY_TYPE,
964969
A.MUST_USE_TIMED_WRITE,
@@ -1009,6 +1014,7 @@ SELECT
10091014
A.REPORTING_POLICY,
10101015
A.STORAGE_POLICY,
10111016
A.IS_NULLABLE,
1017+
A.IS_FABRIC_SENSITIVE,
10121018
A.IS_SCENE_REQUIRED,
10131019
A.ARRAY_TYPE,
10141020
A.MUST_USE_TIMED_WRITE,
@@ -1067,6 +1073,7 @@ SELECT
10671073
REPORTING_POLICY,
10681074
STORAGE_POLICY,
10691075
IS_NULLABLE,
1076+
IS_FABRIC_SENSITIVE,
10701077
IS_SCENE_REQUIRED,
10711078
ARRAY_TYPE,
10721079
MUST_USE_TIMED_WRITE,

src-electron/db/zap-schema.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ CREATE TABLE IF NOT EXISTS "ATTRIBUTE" (
300300
"REPORTING_POLICY" text,
301301
"STORAGE_POLICY" text,
302302
"IS_NULLABLE" integer,
303+
"IS_FABRIC_SENSITIVE" integer,
303304
"ARRAY_TYPE" text,
304305
"MUST_USE_TIMED_WRITE" integer,
305306
"INTRODUCED_IN_REF" integer,

src-electron/generator/helper-tokens.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ async function token_attribute_util(context, options) {
303303
* - isBound
304304
* - isChangeOmitted
305305
* - isClusterEnabled
306+
* - isFabricSensitive
306307
* - isGlobalAttribute
307308
* - isIncluded
308309
* - isManufacturingSpecific

0 commit comments

Comments
 (0)