@project-chip/matter.js 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/cjs/cluster/AccessControlCluster.js +105 -0
- package/dist/cjs/cluster/BasicInformationCluster.js +92 -0
- package/dist/cjs/cluster/BindingCluster.js +51 -0
- package/dist/cjs/cluster/BridgedDeviceBasicInformationCluster.js +75 -0
- package/dist/cjs/cluster/Cluster.js +49 -0
- package/dist/cjs/cluster/DescriptorCluster.js +53 -0
- package/dist/cjs/cluster/GeneralCommissioningCluster.js +89 -0
- package/dist/cjs/cluster/GroupsCluster.js +140 -0
- package/dist/cjs/cluster/IdentifyCluster.js +55 -0
- package/dist/cjs/cluster/LabelCluster.js +55 -0
- package/dist/cjs/cluster/OnOffCluster.js +105 -0
- package/dist/cjs/cluster/OperationalCredentialsCluster.js +205 -0
- package/dist/cjs/cluster/ScenesCluster.js +236 -0
- package/dist/cjs/common/AttributeId.js +23 -0
- package/dist/cjs/common/ClusterId.js +24 -0
- package/dist/cjs/common/DeviceTypeId.js +23 -0
- package/dist/cjs/common/EndpointNumber.js +23 -0
- package/dist/cjs/common/FabricId.js +24 -0
- package/dist/cjs/common/FabricIndex.js +28 -0
- package/dist/cjs/common/GroupId.js +30 -0
- package/dist/cjs/common/NodeId.js +31 -0
- package/dist/cjs/common/SubjectId.js +11 -0
- package/dist/cjs/common/VendorId.js +25 -0
- package/{dist-cjs → dist/cjs}/matter.js +12 -0
- package/dist/cjs/protocol/InteractionProtocol.js +136 -0
- package/dist/cjs/schema/BitmapSchema.js +133 -0
- package/{dist-cjs → dist/cjs}/schema/Schema.js +0 -0
- package/{dist-cjs → dist/cjs}/spec/Specifications.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvAny.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvArray.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvBoolean.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvCodec.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvNullable.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvNumber.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvObject.js +6 -2
- package/{dist-cjs → dist/cjs}/tlv/TlvSchema.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvString.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvVoid.js +0 -0
- package/{dist-cjs → dist/cjs}/tlv/TlvWrapper.js +0 -0
- package/{dist-cjs → dist/cjs}/util/ByteArray.js +2 -0
- package/{dist-cjs → dist/cjs}/util/DataReader.js +0 -0
- package/{dist-cjs → dist/cjs}/util/DataWriter.js +0 -0
- package/{dist-cjs → dist/cjs}/util/Number.js +0 -0
- package/{dist-cjs → dist/cjs}/util/Type.js +3 -0
- package/dist/dts/cluster/AccessControlCluster.d.ts +108 -0
- package/dist/dts/cluster/BasicInformationCluster.d.ts +57 -0
- package/dist/dts/cluster/BindingCluster.d.ts +23 -0
- package/dist/dts/cluster/BridgedDeviceBasicInformationCluster.d.ts +53 -0
- package/dist/dts/cluster/Cluster.d.ts +109 -0
- package/dist/dts/cluster/DescriptorCluster.d.ts +25 -0
- package/dist/dts/cluster/GeneralCommissioningCluster.d.ts +94 -0
- package/dist/dts/cluster/GroupsCluster.d.ts +92 -0
- package/dist/dts/cluster/IdentifyCluster.d.ts +60 -0
- package/dist/dts/cluster/LabelCluster.d.ts +34 -0
- package/dist/dts/cluster/OnOffCluster.d.ts +85 -0
- package/dist/dts/cluster/OperationalCredentialsCluster.d.ts +156 -0
- package/dist/dts/cluster/ScenesCluster.d.ts +200 -0
- package/dist/dts/common/AttributeId.d.ts +17 -0
- package/dist/dts/common/ClusterId.d.ts +18 -0
- package/dist/dts/common/DeviceTypeId.d.ts +17 -0
- package/dist/dts/common/EndpointNumber.d.ts +17 -0
- package/dist/dts/common/FabricId.d.ts +18 -0
- package/dist/dts/common/FabricIndex.d.ts +22 -0
- package/dist/dts/common/GroupId.d.ts +24 -0
- package/dist/dts/common/NodeId.d.ts +19 -0
- package/dist/dts/common/SubjectId.d.ts +15 -0
- package/dist/dts/common/VendorId.d.ts +19 -0
- package/dist/{matter.d.ts → dts/matter.d.ts} +12 -0
- package/dist/dts/protocol/InteractionProtocol.d.ts +159 -0
- package/dist/{schema → dts/schema}/BitmapSchema.d.ts +15 -3
- package/dist/{schema → dts/schema}/Schema.d.ts +0 -0
- package/dist/{spec → dts/spec}/Specifications.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvAny.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvArray.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvBoolean.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvCodec.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvNullable.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvNumber.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvObject.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvSchema.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvString.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvVoid.d.ts +0 -0
- package/dist/{tlv → dts/tlv}/TlvWrapper.d.ts +0 -0
- package/dist/{util → dts/util}/ByteArray.d.ts +0 -0
- package/dist/{util → dts/util}/DataReader.d.ts +0 -0
- package/dist/{util → dts/util}/DataWriter.d.ts +0 -0
- package/dist/{util → dts/util}/Number.d.ts +0 -0
- package/dist/{util → dts/util}/Type.d.ts +1 -0
- package/dist/es/cluster/AccessControlCluster.js +102 -0
- package/dist/es/cluster/BasicInformationCluster.js +89 -0
- package/dist/es/cluster/BindingCluster.js +48 -0
- package/dist/es/cluster/BridgedDeviceBasicInformationCluster.js +72 -0
- package/dist/es/cluster/Cluster.js +36 -0
- package/dist/es/cluster/DescriptorCluster.js +50 -0
- package/dist/es/cluster/GeneralCommissioningCluster.js +86 -0
- package/dist/es/cluster/GroupsCluster.js +137 -0
- package/dist/es/cluster/IdentifyCluster.js +52 -0
- package/dist/es/cluster/LabelCluster.js +52 -0
- package/dist/es/cluster/OnOffCluster.js +102 -0
- package/dist/es/cluster/OperationalCredentialsCluster.js +202 -0
- package/dist/es/cluster/ScenesCluster.js +233 -0
- package/dist/es/common/AttributeId.js +19 -0
- package/dist/es/common/ClusterId.js +20 -0
- package/dist/es/common/DeviceTypeId.js +19 -0
- package/dist/es/common/EndpointNumber.js +19 -0
- package/dist/es/common/FabricId.js +20 -0
- package/dist/es/common/FabricIndex.js +24 -0
- package/dist/es/common/GroupId.js +26 -0
- package/dist/es/common/NodeId.js +27 -0
- package/dist/es/common/SubjectId.js +8 -0
- package/dist/es/common/VendorId.js +21 -0
- package/dist/{matter.js → es/matter.js} +12 -0
- package/dist/es/protocol/InteractionProtocol.js +133 -0
- package/dist/es/schema/BitmapSchema.js +125 -0
- package/dist/{schema → es/schema}/Schema.js +0 -0
- package/dist/{spec → es/spec}/Specifications.js +0 -0
- package/dist/{tlv → es/tlv}/TlvAny.js +0 -0
- package/dist/{tlv → es/tlv}/TlvArray.js +0 -0
- package/dist/{tlv → es/tlv}/TlvBoolean.js +0 -0
- package/dist/{tlv → es/tlv}/TlvCodec.js +0 -0
- package/dist/{tlv → es/tlv}/TlvNullable.js +0 -0
- package/dist/{tlv → es/tlv}/TlvNumber.js +0 -0
- package/dist/{tlv → es/tlv}/TlvObject.js +6 -2
- package/dist/{tlv → es/tlv}/TlvSchema.js +0 -0
- package/dist/{tlv → es/tlv}/TlvString.js +0 -0
- package/dist/{tlv → es/tlv}/TlvVoid.js +0 -0
- package/dist/{tlv → es/tlv}/TlvWrapper.js +0 -0
- package/dist/{util → es/util}/ByteArray.js +2 -0
- package/dist/{util → es/util}/DataReader.js +0 -0
- package/dist/{util → es/util}/DataWriter.js +0 -0
- package/dist/{util → es/util}/Number.js +0 -0
- package/dist/{util → es/util}/Type.js +1 -1
- package/package.json +7 -8
- package/dist/schema/BitmapSchema.js +0 -48
- package/dist-cjs/schema/BitmapSchema.js +0 -55
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Attribute, OptionalAttribute, Cluster, Command, OptionalCommand } from "./Cluster.js";
|
|
7
|
+
import { BitFlag } from "../schema/BitmapSchema.js";
|
|
8
|
+
import { StatusCode } from "../protocol/InteractionProtocol.js";
|
|
9
|
+
/**
|
|
10
|
+
* This data type indicates for a given cluster a set of attributes and their values. Only attributes which
|
|
11
|
+
* have the "S" designation in the Quality column of the cluster specification SHALL be used in the
|
|
12
|
+
* AttributeValueList field.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link MatterApplicationClusterSpecificationV1_0} § 1.4.6.2
|
|
15
|
+
*/
|
|
16
|
+
export declare const TlvExtensionFieldSet: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
17
|
+
clusterId: import("../tlv/TlvObject.js").FieldType<import("../common/ClusterId.js").ClusterId>;
|
|
18
|
+
attributeValueList: import("../tlv/TlvObject.js").FieldType<{
|
|
19
|
+
attributeId: import("../common/AttributeId.js").AttributeId;
|
|
20
|
+
attributeValue: import("../matter.js").TlvStream[];
|
|
21
|
+
}[]>;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* The Scenes cluster provides attributes and commands for setting up and recalling scenes.
|
|
25
|
+
* Each scene corresponds to a set of stored values of specified attributes for one or more
|
|
26
|
+
* clusters on the same end point as the Scenes cluster.
|
|
27
|
+
*
|
|
28
|
+
* @see {@link MatterApplicationClusterSpecificationV1_0} § 1.4
|
|
29
|
+
*/
|
|
30
|
+
export declare const ScenesCluster: Cluster<{
|
|
31
|
+
/** The ability to store a name for a scene. */
|
|
32
|
+
sceneNames: BitFlag;
|
|
33
|
+
}, {
|
|
34
|
+
sceneCount: Attribute<number>;
|
|
35
|
+
currentScene: Attribute<number>;
|
|
36
|
+
currentGroup: Attribute<number>;
|
|
37
|
+
sceneValid: Attribute<boolean>;
|
|
38
|
+
nameSupport: Attribute<import("../schema/BitmapSchema.js").TypeFromBitSchema<{
|
|
39
|
+
sceneNames: BitFlag;
|
|
40
|
+
}>>;
|
|
41
|
+
lastConfiguredBy: OptionalAttribute<import("../common/NodeId.js").NodeId | null>;
|
|
42
|
+
clusterRevision: Attribute<number>;
|
|
43
|
+
featureMap: Attribute<import("../schema/BitmapSchema.js").TypeFromBitSchema<{
|
|
44
|
+
/** The ability to store a name for a scene. */
|
|
45
|
+
sceneNames: BitFlag;
|
|
46
|
+
}>>;
|
|
47
|
+
}, {
|
|
48
|
+
/**
|
|
49
|
+
* Add a scene to the scene table.
|
|
50
|
+
* Extension field sets are supported, and are inputed as
|
|
51
|
+
* '{"ClusterID": VALUE, "AttributeValueList":[{"AttributeId": VALUE, "AttributeValue": VALUE}]}'
|
|
52
|
+
*/
|
|
53
|
+
addScene: Command<{
|
|
54
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
55
|
+
sceneId: number;
|
|
56
|
+
transitionTime: number;
|
|
57
|
+
sceneName: string;
|
|
58
|
+
extensionFieldSets: {
|
|
59
|
+
clusterId: import("../common/ClusterId.js").ClusterId;
|
|
60
|
+
attributeValueList: {
|
|
61
|
+
attributeId: import("../common/AttributeId.js").AttributeId;
|
|
62
|
+
attributeValue: import("../matter.js").TlvStream[];
|
|
63
|
+
}[];
|
|
64
|
+
}[];
|
|
65
|
+
}, {
|
|
66
|
+
status: StatusCode;
|
|
67
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
68
|
+
sceneId: number;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves the requested scene entry from its Scene table.
|
|
72
|
+
*/
|
|
73
|
+
viewScene: Command<{
|
|
74
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
75
|
+
sceneId: number;
|
|
76
|
+
}, {
|
|
77
|
+
status: StatusCode;
|
|
78
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
79
|
+
sceneId: number;
|
|
80
|
+
transitionTime?: number | undefined;
|
|
81
|
+
sceneName?: string | undefined;
|
|
82
|
+
extensionFieldSets?: {
|
|
83
|
+
clusterId: import("../common/ClusterId.js").ClusterId;
|
|
84
|
+
attributeValueList: {
|
|
85
|
+
attributeId: import("../common/AttributeId.js").AttributeId;
|
|
86
|
+
attributeValue: import("../matter.js").TlvStream[];
|
|
87
|
+
}[];
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Removes the requested scene entry, corresponding to the value of the GroupID field, from its Scene Table
|
|
92
|
+
*/
|
|
93
|
+
removeScene: Command<{
|
|
94
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
95
|
+
sceneId: number;
|
|
96
|
+
}, {
|
|
97
|
+
status: StatusCode;
|
|
98
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
99
|
+
sceneId: number;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Remove all scenes, corresponding to the value of the GroupID field, from its Scene Table
|
|
103
|
+
*/
|
|
104
|
+
removeAllScenes: Command<{
|
|
105
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
106
|
+
}, {
|
|
107
|
+
status: StatusCode;
|
|
108
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Adds the scene entry into its Scene Table along with all extension field sets corresponding to the current
|
|
112
|
+
* state of other clusters on the same endpoint
|
|
113
|
+
*/
|
|
114
|
+
storeScenes: Command<{
|
|
115
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
116
|
+
sceneId: number;
|
|
117
|
+
}, {
|
|
118
|
+
status: StatusCode;
|
|
119
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
120
|
+
sceneId: number;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Set the attributes and corresponding state for each other cluster implemented on the endpoint accordingly to
|
|
124
|
+
* the requested scene entry in the Scene Table
|
|
125
|
+
*/
|
|
126
|
+
recallScene: Command<{
|
|
127
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
128
|
+
sceneId: number;
|
|
129
|
+
transitionTime?: number | null | undefined;
|
|
130
|
+
}, void>;
|
|
131
|
+
/**
|
|
132
|
+
* Get an unused scene identifier when no commissioning tool is in the network, or for a commissioning tool to
|
|
133
|
+
* get the used scene identifiers within a certain group
|
|
134
|
+
*/
|
|
135
|
+
getSceneMembership: Command<{
|
|
136
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
137
|
+
}, {
|
|
138
|
+
status: StatusCode;
|
|
139
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
140
|
+
capacity: number | null;
|
|
141
|
+
sceneList?: number[] | undefined;
|
|
142
|
+
}>;
|
|
143
|
+
/**
|
|
144
|
+
* Allows a scene to be added using a finer scene transition time than the AddScene command.
|
|
145
|
+
*/
|
|
146
|
+
enhancedAddScene: OptionalCommand<{
|
|
147
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
148
|
+
sceneId: number;
|
|
149
|
+
transitionTime: number;
|
|
150
|
+
sceneName: string;
|
|
151
|
+
extensionFieldSets: {
|
|
152
|
+
clusterId: import("../common/ClusterId.js").ClusterId;
|
|
153
|
+
attributeValueList: {
|
|
154
|
+
attributeId: import("../common/AttributeId.js").AttributeId;
|
|
155
|
+
attributeValue: import("../matter.js").TlvStream[];
|
|
156
|
+
}[];
|
|
157
|
+
}[];
|
|
158
|
+
}, {
|
|
159
|
+
status: StatusCode;
|
|
160
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
161
|
+
sceneId: number;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* Allows a scene to be retrieved using a finer scene transition time than the ViewScene command
|
|
165
|
+
*/
|
|
166
|
+
enhancedViewScene: OptionalCommand<{
|
|
167
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
168
|
+
sceneId: number;
|
|
169
|
+
}, {
|
|
170
|
+
status: StatusCode;
|
|
171
|
+
groupId: import("../common/GroupId.js").GroupId;
|
|
172
|
+
sceneId: number;
|
|
173
|
+
transitionTime?: number | undefined;
|
|
174
|
+
sceneName?: string | undefined;
|
|
175
|
+
extensionFieldSets?: {
|
|
176
|
+
clusterId: import("../common/ClusterId.js").ClusterId;
|
|
177
|
+
attributeValueList: {
|
|
178
|
+
attributeId: import("../common/AttributeId.js").AttributeId;
|
|
179
|
+
attributeValue: import("../matter.js").TlvStream[];
|
|
180
|
+
}[];
|
|
181
|
+
}[] | undefined;
|
|
182
|
+
}>;
|
|
183
|
+
/**
|
|
184
|
+
* Allows a client to efficiently copy scenes from one group/scene identifier pair to another group/scene
|
|
185
|
+
* identifier pair.
|
|
186
|
+
*/
|
|
187
|
+
copyScene: OptionalCommand<{
|
|
188
|
+
mode: import("../schema/BitmapSchema.js").TypeFromBitSchema<{
|
|
189
|
+
copyAllScenes: BitFlag;
|
|
190
|
+
}>;
|
|
191
|
+
groupIdFrom: import("../common/GroupId.js").GroupId;
|
|
192
|
+
sceneIdFrom: number;
|
|
193
|
+
TlvGroupIdo: import("../common/GroupId.js").GroupId;
|
|
194
|
+
sceneIdTo: number;
|
|
195
|
+
}, {
|
|
196
|
+
status: StatusCode;
|
|
197
|
+
groupIdFrom: import("../common/GroupId.js").GroupId;
|
|
198
|
+
sceneIdFrom: number;
|
|
199
|
+
}>;
|
|
200
|
+
}, import("./Cluster.js").Events>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* An Attribute ID is a 32 bit number and indicates an attribute defined in a cluster specification.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link MatterCoreSpecificationV1_0} § 7.18.2.15
|
|
11
|
+
*/
|
|
12
|
+
export declare class AttributeId {
|
|
13
|
+
readonly id: number;
|
|
14
|
+
constructor(id: number);
|
|
15
|
+
}
|
|
16
|
+
/** Tlv schema for an Attribute Id. */
|
|
17
|
+
export declare const TlvAttributeId: TlvWrapper<AttributeId, number>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* A Cluster Identifier is a 32 bit number and SHALL reference a single cluster specification and
|
|
9
|
+
* SHALL define conformance to that specification.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link MatterCoreSpecificationV1_0} § 7.10
|
|
12
|
+
*/
|
|
13
|
+
export declare class ClusterId {
|
|
14
|
+
readonly id: number;
|
|
15
|
+
constructor(id: number);
|
|
16
|
+
}
|
|
17
|
+
/** Tlv schema for a cluster Id. */
|
|
18
|
+
export declare const TlvClusterId: TlvWrapper<ClusterId, number>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* A Device type ID is a 32-bit number that defines the type of the device.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link MatterCoreSpecificationV1_0} § 7.15
|
|
11
|
+
*/
|
|
12
|
+
export declare class DeviceTypeId {
|
|
13
|
+
readonly id: number;
|
|
14
|
+
constructor(id: number);
|
|
15
|
+
}
|
|
16
|
+
/** Tlv schema for a Device type ID. */
|
|
17
|
+
export declare const TlvDeviceTypeId: TlvWrapper<DeviceTypeId, number>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* A Endpoint Number is a 16-bit number that that indicates an instance of a device type.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link MatterCoreSpecificationV1_0} § 7.18.2.11
|
|
11
|
+
*/
|
|
12
|
+
export declare class EndpointNumber {
|
|
13
|
+
readonly number: number;
|
|
14
|
+
constructor(number: number);
|
|
15
|
+
}
|
|
16
|
+
/** Tlv schema for an Endpoint number. */
|
|
17
|
+
export declare const TlvEndpointNumber: TlvWrapper<EndpointNumber, number>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* A Fabric ID is a 64-bit number that uniquely identifies the Fabric within the scope of
|
|
9
|
+
* a particular root CA.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link MatterCoreSpecificationV1_0} § 2.5.1
|
|
12
|
+
*/
|
|
13
|
+
export declare class FabricId {
|
|
14
|
+
readonly id: bigint;
|
|
15
|
+
constructor(id: bigint);
|
|
16
|
+
}
|
|
17
|
+
/** Tlv schema for a Node Identifier. */
|
|
18
|
+
export declare const TlvFabricId: TlvWrapper<FabricId, number | bigint>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* Each fabric supported on a node is referenced by fabric-index that is unique on the node. This
|
|
9
|
+
* fabric-index enables the look-up of the full fabric information from the fabric-index. A fabric-index
|
|
10
|
+
* of 0 (zero) or null SHALL indicate that there is no fabric associated with the context in which the
|
|
11
|
+
* fabric-index is being used. If fabric-index is used in a context that is exclusively associated with
|
|
12
|
+
* a fabric, such as fabric-scoped data model elements, then the fabric-index values SHALL NOT include 0
|
|
13
|
+
* (zero) or null.
|
|
14
|
+
*
|
|
15
|
+
* @see {@link MatterCoreSpecificationV1_0} § 7.5.2
|
|
16
|
+
*/
|
|
17
|
+
export declare class FabricIndex {
|
|
18
|
+
readonly index: number;
|
|
19
|
+
constructor(index: number);
|
|
20
|
+
}
|
|
21
|
+
/** Tlv Schema for a Fabric Index. */
|
|
22
|
+
export declare const TlvFabricIndex: TlvWrapper<FabricIndex, number>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* A Group Identifier (Group ID or GID) is a 16-bit number that identifies a set of Nodes across a
|
|
9
|
+
* Fabric at the message layer (see Section 4.15, “Group Key Management”). A Group ID can further
|
|
10
|
+
* be bound to one or more Endpoints within each Node in the group at the interaction layer.
|
|
11
|
+
*
|
|
12
|
+
* The Group ID space is allocated as described in Table 2, “Group ID Allocations”:
|
|
13
|
+
* 0x0000 - Null or unspecified Group ID
|
|
14
|
+
* 0x0001 - 0xFEFF: Application Group ID, assigned by fabric Administrator
|
|
15
|
+
* 0xFF00 - 0xFFFF: Universal Group ID range reserved for static multicast and anycast identifiers
|
|
16
|
+
*
|
|
17
|
+
* @see {@link MatterCoreSpecificationV1_0} § 2.5.4
|
|
18
|
+
*/
|
|
19
|
+
export declare class GroupId {
|
|
20
|
+
readonly id: number;
|
|
21
|
+
constructor(id: number);
|
|
22
|
+
}
|
|
23
|
+
/** Tlv Schema for a Group Id. */
|
|
24
|
+
export declare const TlvGroupId: TlvWrapper<GroupId, number>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* A Node Identifier (Node ID) is a 64-bit number that uniquely identifies an individual Node or a
|
|
9
|
+
* group of Nodes on a Fabric.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link MatterCoreSpecificationV1_0} § 2.5.5
|
|
12
|
+
*/
|
|
13
|
+
export declare class NodeId {
|
|
14
|
+
readonly id: bigint;
|
|
15
|
+
constructor(id: bigint);
|
|
16
|
+
toString(): string;
|
|
17
|
+
}
|
|
18
|
+
/** Tlv schema for a Node Identifier. */
|
|
19
|
+
export declare const TlvNodeId: TlvWrapper<NodeId, number | bigint>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { NodeId } from "./NodeId.js";
|
|
7
|
+
/**
|
|
8
|
+
* The meaning of a "Subject" is primarily that of describing the source for an action, using a given
|
|
9
|
+
* authentication method provided by the Secure Channel architecture.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link MatterCoreSpecificationV1_0} § 6.6.2.1
|
|
12
|
+
*/
|
|
13
|
+
export type SubjectId = NodeId;
|
|
14
|
+
/** Tlv schema for a Subject Id */
|
|
15
|
+
export declare const TlvSubjectId: import("../matter.js").TlvWrapper<NodeId, number | bigint>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { TlvWrapper } from "../tlv/TlvWrapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* A Vendor Identifier (Vendor ID or VID) is a 16-bit number that uniquely identifies a particular
|
|
9
|
+
* product manufacturer, vendor, or group thereof. Each Vendor ID is statically allocated by the
|
|
10
|
+
* Connectivity Standards Alliance (see [CSA Manufacturer Code Database]).
|
|
11
|
+
*
|
|
12
|
+
* @see {@link MatterCoreSpecificationV1_0} § 2.5.2
|
|
13
|
+
*/
|
|
14
|
+
export declare class VendorId {
|
|
15
|
+
readonly id: number;
|
|
16
|
+
constructor(id: number);
|
|
17
|
+
}
|
|
18
|
+
/** Data model for a Vendor Identifier. */
|
|
19
|
+
export declare const TlvVendorId: TlvWrapper<VendorId, number>;
|
|
@@ -20,3 +20,15 @@ export * from "./tlv/TlvString.js";
|
|
|
20
20
|
export * from "./tlv/TlvNumber.js";
|
|
21
21
|
export * from "./tlv/TlvVoid.js";
|
|
22
22
|
export * from "./tlv/TlvWrapper.js";
|
|
23
|
+
export * from "./cluster/AccessControlCluster.js";
|
|
24
|
+
export * from "./cluster/BasicInformationCluster.js";
|
|
25
|
+
export * from "./cluster/BindingCluster.js";
|
|
26
|
+
export * from "./cluster/BridgedDeviceBasicInformationCluster.js";
|
|
27
|
+
export * from "./cluster/DescriptorCluster.js";
|
|
28
|
+
export * from "./cluster/GeneralCommissioningCluster.js";
|
|
29
|
+
export * from "./cluster/GroupsCluster.js";
|
|
30
|
+
export * from "./cluster/IdentifyCluster.js";
|
|
31
|
+
export * from "./cluster/LabelCluster.js";
|
|
32
|
+
export * from "./cluster/OnOffCluster.js";
|
|
33
|
+
export * from "./cluster/OperationalCredentialsCluster.js";
|
|
34
|
+
export * from "./cluster/ScenesCluster.js";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @see {@link MatterCoreSpecificationV1_0}, section 8.10
|
|
8
|
+
*/
|
|
9
|
+
export declare const enum StatusCode {
|
|
10
|
+
Success = 0,
|
|
11
|
+
Failure = 1,
|
|
12
|
+
InvalidSubscription = 125,
|
|
13
|
+
UnsupportedAccess = 126,
|
|
14
|
+
UnsupportedEndpoint = 127,
|
|
15
|
+
InvalidAction = 128,
|
|
16
|
+
UnsupportedCommand = 129,
|
|
17
|
+
InvalidCommand = 133,
|
|
18
|
+
UnsupportedAttribute = 134,
|
|
19
|
+
ConstraintError = 135,
|
|
20
|
+
UnsupportedWrite = 136,
|
|
21
|
+
ResourceExhausted = 137,
|
|
22
|
+
NotFound = 139,
|
|
23
|
+
UnreportableAttribute = 140,
|
|
24
|
+
InvalidDataType = 141,
|
|
25
|
+
UnsupportedRead = 143,
|
|
26
|
+
DataVersionMismatch = 146,
|
|
27
|
+
Timeout = 148,
|
|
28
|
+
UnsupportedMode = 155,
|
|
29
|
+
Busy = 156,
|
|
30
|
+
UnsupportedCluster = 195,
|
|
31
|
+
NoUpstreamSubscription = 197,
|
|
32
|
+
NeedsTimedInteraction = 198,
|
|
33
|
+
UnsupportedEvent = 199,
|
|
34
|
+
PathsExhausted = 200,
|
|
35
|
+
TimedRequestMismatch = 201,
|
|
36
|
+
FailsafeRequired = 202
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @see {@link MatterCoreSpecificationV1_0}, section 10.6.1. StatusResponseMessage
|
|
40
|
+
*/
|
|
41
|
+
export declare const TlvStatusResponse: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
42
|
+
status: import("../tlv/TlvObject.js").FieldType<StatusCode>;
|
|
43
|
+
interactionModelRevision: import("../tlv/TlvObject.js").FieldType<number>;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* @see {@link MatterCoreSpecificationV1_0}, section 10.6.2. ReadRequestMessage
|
|
47
|
+
*/
|
|
48
|
+
export declare const TlvReadRequest: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
49
|
+
attributes: import("../tlv/TlvObject.js").FieldType<{
|
|
50
|
+
id?: number | undefined;
|
|
51
|
+
endpointId?: number | undefined;
|
|
52
|
+
clusterId?: number | undefined;
|
|
53
|
+
}[]>;
|
|
54
|
+
isFabricFiltered: import("../tlv/TlvObject.js").FieldType<boolean>;
|
|
55
|
+
interactionModelRevision: import("../tlv/TlvObject.js").FieldType<number>;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* @see {@link MatterCoreSpecificationV1_0}, section 10.6.3. ReportDataMessage
|
|
59
|
+
*/
|
|
60
|
+
export declare const TlvReportData: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
61
|
+
subscriptionId: import("../tlv/TlvObject.js").OptionalFieldType<number>;
|
|
62
|
+
values: import("../tlv/TlvObject.js").FieldType<{
|
|
63
|
+
value: {
|
|
64
|
+
value: import("../matter.js").TlvStream;
|
|
65
|
+
path: {
|
|
66
|
+
id: number;
|
|
67
|
+
endpointId: number;
|
|
68
|
+
clusterId: number;
|
|
69
|
+
};
|
|
70
|
+
version: number;
|
|
71
|
+
};
|
|
72
|
+
}[]>;
|
|
73
|
+
isFabricFiltered: import("../tlv/TlvObject.js").OptionalFieldType<boolean>;
|
|
74
|
+
interactionModelRevision: import("../tlv/TlvObject.js").FieldType<number>;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* @see {@link MatterCoreSpecificationV1_0}, section 10.6.4. SubscribeRequestMessage
|
|
78
|
+
*/
|
|
79
|
+
export declare const TlvSubscribeRequest: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
80
|
+
keepSubscriptions: import("../tlv/TlvObject.js").FieldType<boolean>;
|
|
81
|
+
minIntervalFloorSeconds: import("../tlv/TlvObject.js").FieldType<number>;
|
|
82
|
+
maxIntervalCeilingSeconds: import("../tlv/TlvObject.js").FieldType<number>;
|
|
83
|
+
attributeRequests: import("../tlv/TlvObject.js").OptionalFieldType<{
|
|
84
|
+
id?: number | undefined;
|
|
85
|
+
endpointId?: number | undefined;
|
|
86
|
+
clusterId?: number | undefined;
|
|
87
|
+
}[]>;
|
|
88
|
+
eventRequests: import("../tlv/TlvObject.js").OptionalFieldType<{
|
|
89
|
+
event: number;
|
|
90
|
+
cluster: number;
|
|
91
|
+
endpoint: number;
|
|
92
|
+
node: import("../common/NodeId.js").NodeId;
|
|
93
|
+
isUrgent: boolean;
|
|
94
|
+
}[]>;
|
|
95
|
+
eventFilters: import("../tlv/TlvObject.js").OptionalFieldType<{
|
|
96
|
+
node: import("../common/NodeId.js").NodeId;
|
|
97
|
+
eventMin: number | bigint;
|
|
98
|
+
}[]>;
|
|
99
|
+
isFabricFiltered: import("../tlv/TlvObject.js").FieldType<boolean>;
|
|
100
|
+
dataVersionFilters: import("../tlv/TlvObject.js").OptionalFieldType<{
|
|
101
|
+
path: {
|
|
102
|
+
cluster: number;
|
|
103
|
+
endpoint: number;
|
|
104
|
+
node: import("../common/NodeId.js").NodeId;
|
|
105
|
+
};
|
|
106
|
+
dataVersion: number;
|
|
107
|
+
}[]>;
|
|
108
|
+
}>;
|
|
109
|
+
/**
|
|
110
|
+
* @see {@link MatterCoreSpecificationV1_0}, section 10.6.5. SubscribeResponseMessage
|
|
111
|
+
*/
|
|
112
|
+
export declare const TlvSubscribeResponse: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
113
|
+
subscriptionId: import("../tlv/TlvObject.js").FieldType<number>;
|
|
114
|
+
maxIntervalCeilingSeconds: import("../tlv/TlvObject.js").FieldType<number>;
|
|
115
|
+
interactionModelRevision: import("../tlv/TlvObject.js").FieldType<number>;
|
|
116
|
+
}>;
|
|
117
|
+
/**
|
|
118
|
+
* @see {@link MatterCoreSpecificationV1_0}, section 10.6.9. InvokeRequestMessage
|
|
119
|
+
*/
|
|
120
|
+
export declare const TlvInvokeRequest: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
121
|
+
suppressResponse: import("../tlv/TlvObject.js").FieldType<boolean>;
|
|
122
|
+
timedRequest: import("../tlv/TlvObject.js").FieldType<boolean>;
|
|
123
|
+
invokes: import("../tlv/TlvObject.js").FieldType<{
|
|
124
|
+
path: {
|
|
125
|
+
id: number;
|
|
126
|
+
endpointId: number;
|
|
127
|
+
clusterId: number;
|
|
128
|
+
};
|
|
129
|
+
args: import("../matter.js").TlvStream;
|
|
130
|
+
}[]>;
|
|
131
|
+
interactionModelRevision: import("../tlv/TlvObject.js").FieldType<number>;
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* @see {@link MatterCoreSpecificationV1_0}, section 10.6.10. InvokeResponseMessage
|
|
135
|
+
*/
|
|
136
|
+
export declare const TlvInvokeResponse: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
137
|
+
suppressResponse: import("../tlv/TlvObject.js").FieldType<boolean>;
|
|
138
|
+
responses: import("../tlv/TlvObject.js").FieldType<{
|
|
139
|
+
response?: {
|
|
140
|
+
path: {
|
|
141
|
+
id: number;
|
|
142
|
+
endpointId: number;
|
|
143
|
+
clusterId: number;
|
|
144
|
+
};
|
|
145
|
+
response: import("../matter.js").TlvStream;
|
|
146
|
+
} | undefined;
|
|
147
|
+
result?: {
|
|
148
|
+
path: {
|
|
149
|
+
id: number;
|
|
150
|
+
endpointId: number;
|
|
151
|
+
clusterId: number;
|
|
152
|
+
};
|
|
153
|
+
result: {
|
|
154
|
+
code: number;
|
|
155
|
+
};
|
|
156
|
+
} | undefined;
|
|
157
|
+
}[]>;
|
|
158
|
+
interactionModelRevision: import("../tlv/TlvObject.js").FieldType<number>;
|
|
159
|
+
}>;
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Copyright 2022 Project CHIP Authors
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { ByteArray } from "../util/ByteArray";
|
|
7
|
+
import { Schema } from "./Schema";
|
|
7
8
|
declare const enum BitRangeType {
|
|
8
9
|
Flag = 0,
|
|
9
10
|
Number = 1,
|
|
@@ -12,7 +13,7 @@ declare const enum BitRangeType {
|
|
|
12
13
|
type BitRange<T> = {
|
|
13
14
|
type: BitRangeType;
|
|
14
15
|
offset: number;
|
|
15
|
-
|
|
16
|
+
length: number;
|
|
16
17
|
};
|
|
17
18
|
declare const BitRange: <T>(type: BitRangeType, offset: number, length: number) => BitRange<T>;
|
|
18
19
|
/** Defines the bit position of a boolean flag. */
|
|
@@ -37,11 +38,22 @@ export type TypeFromBitSchema<T extends BitSchema> = {
|
|
|
37
38
|
[K in keyof T]: T[K] extends BitFieldEnum<infer E> ? E : (T[K] extends BitField ? number : boolean);
|
|
38
39
|
};
|
|
39
40
|
declare class BitmapSchemaInternal<T extends BitSchema> extends Schema<TypeFromBitSchema<T>, number> {
|
|
40
|
-
readonly bitSchemas
|
|
41
|
+
private readonly bitSchemas;
|
|
42
|
+
private readonly masks;
|
|
41
43
|
constructor(bitSchemas: T);
|
|
42
44
|
encodeInternal(value: TypeFromBitSchema<T>): number;
|
|
43
45
|
decodeInternal(bitmap: number): TypeFromBitSchema<T>;
|
|
44
46
|
}
|
|
47
|
+
declare class ByteArrayBitmapSchemaInternal<T extends BitSchema> extends Schema<TypeFromBitSchema<T>, ByteArray> {
|
|
48
|
+
private readonly bitSchemas;
|
|
49
|
+
private readonly byteArrayLength;
|
|
50
|
+
private readonly maskOffset;
|
|
51
|
+
constructor(bitSchemas: T);
|
|
52
|
+
encodeInternal(value: TypeFromBitSchema<T>): Uint8Array;
|
|
53
|
+
decodeInternal(bitmap: ByteArray): TypeFromBitSchema<T>;
|
|
54
|
+
}
|
|
45
55
|
/** Declares a bitmap schema by indicating the bit position and their names. */
|
|
46
56
|
export declare const BitmapSchema: <T extends BitSchema>(bitSchemas: T) => BitmapSchemaInternal<T>;
|
|
57
|
+
/** Declares a bitmap schema backed by a ByteArray by indicating the bit position and their names. */
|
|
58
|
+
export declare const ByteArrayBitmapSchema: <T extends BitSchema>(bitSchemas: T) => ByteArrayBitmapSchemaInternal<T>;
|
|
47
59
|
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|