Skip to content

Commit 12b3cd1

Browse files
committed
Refactor Zigbee event mapping CDDL to reuse zigbee-property definition
1 parent 449a65e commit 12b3cd1

4 files changed

Lines changed: 19 additions & 44 deletions

File tree

cddl/zigbee-event-map.cddl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,15 @@ zigbee-event-map = zigbee-attribute-reporting / zigbee-write-event / zigbee-conn
66

77
zigbee-attribute-reporting = {
88
type: "attribute_reporting",
9-
endpointID: uint,
10-
clusterID: uint,
11-
attributeID: uint,
12-
attributeType: uint,
13-
? profileID: uint,
14-
? manufacturerCode: uint,
9+
~zigbee-property,
1510
? minReportingInterval: uint,
1611
? maxReportingInterval: uint,
1712
? reportableChange: number,
1813
}
1914

2015
zigbee-write-event = {
2116
type: "write_event",
22-
endpointID: uint,
23-
clusterID: uint,
24-
attributeID: uint,
25-
attributeType: uint,
26-
? profileID: uint,
27-
? manufacturerCode: uint,
17+
~zigbee-property,
2818
}
2919

3020
zigbee-connection-event = {

draft-ietf-asdf-sdf-protocol-mapping.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,9 @@ follows:
542542

543543
An `sdfEvent` is mapped to a Zigbee cluster event such as attribute reporting
544544
or a device-initiated write to an attribute on the gateway. The Zigbee event
545-
protocol mapping structure is defined as follows:
545+
protocol mapping structure is defined as follows. The `"attribute_reporting"`
546+
and `"write_event"` variants reuse the `zigbee-property` definition from
547+
{{zigmap1}} to identify the underlying Zigbee attribute:
546548

547549
~~~ cddl
548550
{::include-fold cddl/zigbee-event-map.cddl}
@@ -558,21 +560,10 @@ Where:
558560
attribute on the gateway.
559561
- `"connection_events"`: the event is triggered when a Zigbee end device
560562
joins or leaves the Zigbee network.
561-
- `endpointID` is the Zigbee endpoint ID that corresponds to the SDF event.
562-
It is required when `type` is `"attribute_reporting"` or `"write_event"`.
563-
- `clusterID` is the Zigbee cluster ID that corresponds to the SDF event.
564-
It is required when `type` is `"attribute_reporting"` or `"write_event"`.
565-
- `attributeID` is the Zigbee attribute ID that corresponds to the SDF event.
566-
It is required when `type` is `"attribute_reporting"` or `"write_event"`.
567-
- `attributeType` is the Zigbee data type of the attribute. It is required
568-
when `type` is `"attribute_reporting"` or `"write_event"`.
569-
- `profileID` is the Zigbee application profile ID (optional). It only
570-
applies when `type` is `"attribute_reporting"` or `"write_event"`. If not
571-
provided, it defaults to the Home Automation profile (0x0104), which is the
572-
default profile in Zigbee 3.0.
573-
- `manufacturerCode` is the Zigbee manufacturer code of the attribute
574-
(optional). It only applies when `type` is `"attribute_reporting"` or
575-
`"write_event"`.
563+
- `endpointID`, `clusterID`, `attributeID`, `attributeType`, `profileID`, and
564+
`manufacturerCode` have the same meaning as described for `sdfProperty` in
565+
{{zigmap1}}. These fields are present when `type` is `"attribute_reporting"`
566+
or `"write_event"`, and MUST be absent when `type` is `"connection_events"`.
576567
- `minReportingInterval` is the minimum reporting interval in seconds
577568
(optional). It is the minimum time between issued attribute reports and
578569
only applies when `type` is `"attribute_reporting"`.
@@ -581,10 +572,12 @@ Where:
581572
only applies when `type` is `"attribute_reporting"`.
582573
- `reportableChange` is the minimum change to the attribute value that triggers
583574
a report (optional). It only applies when `type` is `"attribute_reporting"`
584-
and to attributes with an 'analog' data type, and MUST have the same data type
585-
as the reported attribute.
586-
587-
When `type` is `"connection_events"`, no other attributes are required.
575+
and to attributes whose `attributeType` is one of the "analog" data types
576+
defined by the Zigbee Cluster Library, part of {{Zigbee30}} (e.g., unsigned
577+
and signed integers, floating point numbers), as opposed to "discrete" data types
578+
(e.g., booleans, enumerations, bitmaps), for which reporting a minimum
579+
change is not meaningful. The encoded value MUST use the same Zigbee data type
580+
as the reported attribute's `attributeType`.
588581

589582
For example, a Zigbee event mapping for a temperature change report:
590583

generated/combined.cddl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,15 @@ zigbee-event-map = zigbee-attribute-reporting / zigbee-write-event / zigbee-conn
6464

6565
zigbee-attribute-reporting = {
6666
type: "attribute_reporting",
67-
endpointID: uint,
68-
clusterID: uint,
69-
attributeID: uint,
70-
attributeType: uint,
71-
? profileID: uint,
72-
? manufacturerCode: uint,
67+
~zigbee-property,
7368
? minReportingInterval: uint,
7469
? maxReportingInterval: uint,
7570
? reportableChange: number,
7671
}
7772

7873
zigbee-write-event = {
7974
type: "write_event",
80-
endpointID: uint,
81-
clusterID: uint,
82-
attributeID: uint,
83-
attributeType: uint,
84-
? profileID: uint,
85-
? manufacturerCode: uint,
75+
~zigbee-property,
8676
}
8777

8878
zigbee-connection-event = {

openapi/ProtocolMap-Zigbee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ components:
5959
- endpointID
6060
- clusterID
6161
- attributeID
62+
- attributeType
6263
properties:
6364
type:
6465
type: string
@@ -105,6 +106,7 @@ components:
105106
- endpointID
106107
- clusterID
107108
- attributeID
109+
- attributeType
108110
properties:
109111
type:
110112
type: string

0 commit comments

Comments
 (0)