@project-chip/matter.js 0.0.2 → 0.2.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}/tlv/TlvObject.js +6 -2
- package/{dist-cjs → dist/cjs}/util/ByteArray.js +2 -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/{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/{tlv → es/tlv}/TlvObject.js +6 -2
- package/dist/{util → es/util}/ByteArray.js +2 -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
- /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/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/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/{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/{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}/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}/DataReader.js +0 -0
- /package/dist/{util → es/util}/DataWriter.js +0 -0
- /package/dist/{util → es/util}/Number.js +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2022 Project CHIP Authors
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ByteArrayBitmapSchema = exports.BitmapSchema = exports.BitFieldEnum = exports.BitField = exports.BitFlag = void 0;
|
|
9
|
+
const ByteArray_1 = require("../util/ByteArray");
|
|
10
|
+
const Schema_1 = require("./Schema");
|
|
11
|
+
const BitRange = (type, offset, length) => ({ type, offset, length });
|
|
12
|
+
const BitFlag = (offset) => BitRange(0 /* BitRangeType.Flag */, offset, 1);
|
|
13
|
+
exports.BitFlag = BitFlag;
|
|
14
|
+
const BitField = (offset, length) => BitRange(1 /* BitRangeType.Number */, offset, length);
|
|
15
|
+
exports.BitField = BitField;
|
|
16
|
+
const BitFieldEnum = (offset, length) => BitRange(2 /* BitRangeType.Enum */, offset, length);
|
|
17
|
+
exports.BitFieldEnum = BitFieldEnum;
|
|
18
|
+
class BitmapSchemaInternal extends Schema_1.Schema {
|
|
19
|
+
constructor(bitSchemas) {
|
|
20
|
+
super();
|
|
21
|
+
this.bitSchemas = bitSchemas;
|
|
22
|
+
const masks = {};
|
|
23
|
+
for (const name in this.bitSchemas) {
|
|
24
|
+
const { offset, length } = this.bitSchemas[name];
|
|
25
|
+
masks[name] = ((1 << length) - 1) << offset;
|
|
26
|
+
}
|
|
27
|
+
this.masks = masks;
|
|
28
|
+
// TODO: validate that bitSchemas is coherent
|
|
29
|
+
}
|
|
30
|
+
encodeInternal(value) {
|
|
31
|
+
let result = 0;
|
|
32
|
+
for (const name in this.bitSchemas) {
|
|
33
|
+
const { type, offset } = this.bitSchemas[name];
|
|
34
|
+
switch (type) {
|
|
35
|
+
case 0 /* BitRangeType.Flag */:
|
|
36
|
+
if (value[name])
|
|
37
|
+
result |= this.masks[name];
|
|
38
|
+
break;
|
|
39
|
+
case 2 /* BitRangeType.Enum */:
|
|
40
|
+
case 1 /* BitRangeType.Number */:
|
|
41
|
+
result |= value[name] << offset;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
decodeInternal(bitmap) {
|
|
47
|
+
const result = {};
|
|
48
|
+
for (const name in this.bitSchemas) {
|
|
49
|
+
const { type, offset } = this.bitSchemas[name];
|
|
50
|
+
const mask = this.masks[name];
|
|
51
|
+
if (type === 0 /* BitRangeType.Flag */) {
|
|
52
|
+
result[name] = (bitmap & mask) !== 0;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
result[name] = (bitmap & mask) >> offset;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
class ByteArrayBitmapSchemaInternal extends Schema_1.Schema {
|
|
62
|
+
constructor(bitSchemas) {
|
|
63
|
+
super();
|
|
64
|
+
this.bitSchemas = bitSchemas;
|
|
65
|
+
let maxBitLength = 0;
|
|
66
|
+
const maskOffset = {};
|
|
67
|
+
for (const name in this.bitSchemas) {
|
|
68
|
+
const { offset, length } = this.bitSchemas[name];
|
|
69
|
+
const bitOffset = offset % 8;
|
|
70
|
+
const byteOffset = (offset - bitOffset) / 8;
|
|
71
|
+
const mask = ((1 << length) - 1) << bitOffset;
|
|
72
|
+
maskOffset[name] = { bitOffset, byteOffset, mask };
|
|
73
|
+
maxBitLength = Math.max(maxBitLength, offset + length);
|
|
74
|
+
}
|
|
75
|
+
this.byteArrayLength = Math.ceil(maxBitLength / 8);
|
|
76
|
+
this.maskOffset = maskOffset;
|
|
77
|
+
}
|
|
78
|
+
encodeInternal(value) {
|
|
79
|
+
let result = new ByteArray_1.ByteArray(this.byteArrayLength);
|
|
80
|
+
for (const name in this.bitSchemas) {
|
|
81
|
+
const { type } = this.bitSchemas[name];
|
|
82
|
+
let { mask, bitOffset, byteOffset } = this.maskOffset[name];
|
|
83
|
+
switch (type) {
|
|
84
|
+
case 0 /* BitRangeType.Flag */:
|
|
85
|
+
if (value[name])
|
|
86
|
+
result[byteOffset] |= mask;
|
|
87
|
+
break;
|
|
88
|
+
case 2 /* BitRangeType.Enum */:
|
|
89
|
+
case 1 /* BitRangeType.Number */:
|
|
90
|
+
let numValue = value[name];
|
|
91
|
+
while (mask !== 0) {
|
|
92
|
+
result[byteOffset++] |= ((numValue & mask) << bitOffset) & 0xFF;
|
|
93
|
+
const bitWritten = 8 - bitOffset;
|
|
94
|
+
bitOffset = 0;
|
|
95
|
+
numValue = numValue >> bitWritten;
|
|
96
|
+
mask = mask >> 8;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
decodeInternal(bitmap) {
|
|
103
|
+
if (bitmap.length !== this.byteArrayLength)
|
|
104
|
+
throw new Error(`Unexpected length: ${bitmap.length}. Expected ${this.byteArrayLength}`);
|
|
105
|
+
const result = {};
|
|
106
|
+
for (const name in this.bitSchemas) {
|
|
107
|
+
const { type } = this.bitSchemas[name];
|
|
108
|
+
let { mask, bitOffset, byteOffset } = this.maskOffset[name];
|
|
109
|
+
if (type === 0 /* BitRangeType.Flag */) {
|
|
110
|
+
result[name] = (bitmap[byteOffset] & mask) !== 0;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
let value = 0;
|
|
114
|
+
let valueBitOffset = 0;
|
|
115
|
+
while (mask !== 0) {
|
|
116
|
+
value |= ((bitmap[byteOffset++] & mask) >> bitOffset) << valueBitOffset;
|
|
117
|
+
const bitWritten = 8 - bitOffset;
|
|
118
|
+
bitOffset = 0;
|
|
119
|
+
valueBitOffset += bitWritten;
|
|
120
|
+
mask = mask >> 8;
|
|
121
|
+
}
|
|
122
|
+
result[name] = value;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** Declares a bitmap schema by indicating the bit position and their names. */
|
|
129
|
+
const BitmapSchema = (bitSchemas) => new BitmapSchemaInternal(bitSchemas);
|
|
130
|
+
exports.BitmapSchema = BitmapSchema;
|
|
131
|
+
/** Declares a bitmap schema backed by a ByteArray by indicating the bit position and their names. */
|
|
132
|
+
const ByteArrayBitmapSchema = (bitSchemas) => new ByteArrayBitmapSchemaInternal(bitSchemas);
|
|
133
|
+
exports.ByteArrayBitmapSchema = ByteArrayBitmapSchema;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.TlvOptionalField = exports.TlvField = exports.TlvList = exports.TlvObject = exports.ObjectSchema = void 0;
|
|
9
9
|
const TlvSchema_js_1 = require("./TlvSchema.js");
|
|
10
|
+
const TlvAny_js_1 = require("./TlvAny.js");
|
|
10
11
|
;
|
|
11
12
|
/**
|
|
12
13
|
* Schema to encode an object in TLV.
|
|
@@ -51,8 +52,11 @@ class ObjectSchema extends TlvSchema_js_1.TlvSchema {
|
|
|
51
52
|
if (id === undefined)
|
|
52
53
|
throw new Error("Structure element tags should have an id.");
|
|
53
54
|
const fieldName = this.fieldById[id];
|
|
54
|
-
if (fieldName === undefined)
|
|
55
|
-
|
|
55
|
+
if (fieldName === undefined) {
|
|
56
|
+
// Ignore unknown field by decoding it as raw TLV so we skip forward the proper length.
|
|
57
|
+
TlvAny_js_1.TlvAny.decodeTlvInternalValue(reader, elementTypeLength);
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
56
60
|
const { field, name } = fieldName;
|
|
57
61
|
result[name] = field.schema.decodeTlvInternalValue(reader, elementTypeLength);
|
|
58
62
|
}
|
|
@@ -19,6 +19,8 @@ Uint8Array.prototype.equals = function (other) {
|
|
|
19
19
|
};
|
|
20
20
|
Uint8Array.fromHex = function (hexString) {
|
|
21
21
|
var _a;
|
|
22
|
+
if (hexString.length === 0)
|
|
23
|
+
return new exports.ByteArray(0);
|
|
22
24
|
if (hexString.length % 2 !== 0)
|
|
23
25
|
throw new Error("Hex string should have an even length.");
|
|
24
26
|
const bytes = (_a = hexString.match(/.{1,2}/g)) === null || _a === void 0 ? void 0 : _a.map(byteHex => parseInt(byteHex, 16));
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Cluster, WritableAttribute, Attribute, Event } from "./Cluster.js";
|
|
7
|
+
/**
|
|
8
|
+
* List of privileges that can be granted to a subject.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link MatterCoreSpecificationV1_0} § 9.10.5.3
|
|
11
|
+
*/
|
|
12
|
+
export declare const enum Privilege {
|
|
13
|
+
/** Can read and observe all (except Access Control Cluster and as seen by a non-Proxy). */
|
|
14
|
+
View = 1,
|
|
15
|
+
/** An read and observe all (as seen by a Proxy). */
|
|
16
|
+
ProxyView = 2,
|
|
17
|
+
/** View privileges, and can perform the primary function of this Node (except Access Control Cluster). */
|
|
18
|
+
Operate = 3,
|
|
19
|
+
/** Operate privileges, and can modify persistent configuration of this Node (except Access Control Cluster). */
|
|
20
|
+
Manage = 4,
|
|
21
|
+
/** Manage privileges, and can observe and modify the Access Control Cluster. */
|
|
22
|
+
Administer = 5
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List of Auth Modes that can be used to authenticate a subject.
|
|
26
|
+
*
|
|
27
|
+
* @see {@link MatterCoreSpecificationV1_0} § 9.10.5.3
|
|
28
|
+
*/
|
|
29
|
+
export declare const enum AuthMode {
|
|
30
|
+
/** Passcode authenticated session. */
|
|
31
|
+
PASE = 1,
|
|
32
|
+
/** Certificate authenticated session. */
|
|
33
|
+
CASE = 2,
|
|
34
|
+
/** Group authenticated session. */
|
|
35
|
+
Group = 3
|
|
36
|
+
}
|
|
37
|
+
/** @see {@link MatterCoreSpecificationV1_0} § 9.10.8.1 */
|
|
38
|
+
export declare const enum ChangeTypeEnum {
|
|
39
|
+
/** Entry or extension was changed. */
|
|
40
|
+
Changed = 0,
|
|
41
|
+
/** Entry or extension was added. */
|
|
42
|
+
Added = 1,
|
|
43
|
+
/** Entry or extension was removed. */
|
|
44
|
+
Removed = 2
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The Access Control Cluster exposes a data model view of a Node’s Access Control List (ACL),
|
|
48
|
+
* which codifies the rules used to manage and enforce Access Control for the Node’s endpoints
|
|
49
|
+
* and their associated cluster instances. Access to this Access Control Cluster itself requires
|
|
50
|
+
* a special Administer privilege level, such that only Nodes granted such privilege (hereafter
|
|
51
|
+
* termed "Administrators") can manage the Access Control Cluster.
|
|
52
|
+
* The Access Control Cluster SHALL be present on the root node endpoint of each Node, and SHALL
|
|
53
|
+
* NOT be present on any other Endpoint of any Node.
|
|
54
|
+
*
|
|
55
|
+
* @see {@link MatterCoreSpecificationV1_0} § 9.10
|
|
56
|
+
*/
|
|
57
|
+
export declare const AccessControlCluster: Cluster<import("../matter.js").BitSchema, {
|
|
58
|
+
acl: WritableAttribute<{
|
|
59
|
+
privilege: Privilege;
|
|
60
|
+
authMode: AuthMode;
|
|
61
|
+
subjects: import("../common/NodeId.js").NodeId[] | null;
|
|
62
|
+
targets: {
|
|
63
|
+
cluster: import("../common/ClusterId.js").ClusterId | null;
|
|
64
|
+
endpoint: import("../common/EndpointNumber.js").EndpointNumber | null;
|
|
65
|
+
deviceType: import("../common/DeviceTypeId.js").DeviceTypeId | null;
|
|
66
|
+
}[] | null;
|
|
67
|
+
}[]>;
|
|
68
|
+
extension: WritableAttribute<{
|
|
69
|
+
data: Uint8Array;
|
|
70
|
+
}[]>;
|
|
71
|
+
subjectsPerAccessControlEntry: Attribute<number>;
|
|
72
|
+
targetsPerAccessControlEntry: Attribute<number>;
|
|
73
|
+
accessControlEntriesPerFabric: Attribute<number>;
|
|
74
|
+
clusterRevision: Attribute<number>;
|
|
75
|
+
featureMap: Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
|
|
76
|
+
}, import("./Cluster.js").Commands, {
|
|
77
|
+
/**
|
|
78
|
+
* The cluster SHALL send AccessControlEntryChanged events whenever its ACL attribute data is changed by an
|
|
79
|
+
* Administrator.
|
|
80
|
+
*/
|
|
81
|
+
accessControlEntryChanged: Event<{
|
|
82
|
+
adminNodeID: import("../common/NodeId.js").NodeId | null;
|
|
83
|
+
adminPasscodeID: number | null;
|
|
84
|
+
changeType: ChangeTypeEnum;
|
|
85
|
+
latestValue: {
|
|
86
|
+
privilege: Privilege;
|
|
87
|
+
authMode: AuthMode;
|
|
88
|
+
subjects: import("../common/NodeId.js").NodeId[] | null;
|
|
89
|
+
targets: {
|
|
90
|
+
cluster: import("../common/ClusterId.js").ClusterId | null;
|
|
91
|
+
endpoint: import("../common/EndpointNumber.js").EndpointNumber | null;
|
|
92
|
+
deviceType: import("../common/DeviceTypeId.js").DeviceTypeId | null;
|
|
93
|
+
}[] | null;
|
|
94
|
+
} | null;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* The cluster SHALL send AccessControlExtensionChanged events whenever its extension attribute data is changed
|
|
98
|
+
* by an Administrator.
|
|
99
|
+
*/
|
|
100
|
+
accessControlExtensionChanged: Event<{
|
|
101
|
+
adminNodeID: import("../common/NodeId.js").NodeId | null;
|
|
102
|
+
adminPasscodeID: number | null;
|
|
103
|
+
changeType: ChangeTypeEnum;
|
|
104
|
+
latestValue: {
|
|
105
|
+
data: Uint8Array;
|
|
106
|
+
} | null;
|
|
107
|
+
}>;
|
|
108
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Attribute, Cluster, Event, OptionalAttribute, WritableAttribute } from "./Cluster.js";
|
|
7
|
+
/**
|
|
8
|
+
* This cluster provides attributes and events for determining basic information about Nodes, which supports both
|
|
9
|
+
* commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number,
|
|
10
|
+
* which apply to the whole Node. Also allows setting user device information such as location.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link MatterCoreSpecificationV1_0} § 11.1
|
|
13
|
+
*/
|
|
14
|
+
export declare const BasicInformationCluster: Cluster<import("../matter.js").BitSchema, {
|
|
15
|
+
dataModelRevision: Attribute<number>;
|
|
16
|
+
vendorName: Attribute<string>;
|
|
17
|
+
vendorId: Attribute<import("../common/VendorId.js").VendorId>;
|
|
18
|
+
productName: Attribute<string>;
|
|
19
|
+
productId: Attribute<number>;
|
|
20
|
+
nodeLabel: WritableAttribute<string>;
|
|
21
|
+
location: WritableAttribute<string>;
|
|
22
|
+
hardwareVersion: Attribute<number>;
|
|
23
|
+
hardwareVersionString: Attribute<string>;
|
|
24
|
+
softwareVersion: Attribute<number>;
|
|
25
|
+
softwareVersionString: Attribute<string>;
|
|
26
|
+
manufacturingDate: OptionalAttribute<string>;
|
|
27
|
+
partNumber: OptionalAttribute<string>;
|
|
28
|
+
productURL: OptionalAttribute<string>;
|
|
29
|
+
productLabel: OptionalAttribute<string>;
|
|
30
|
+
serialNumber: OptionalAttribute<string>;
|
|
31
|
+
localConfigDisabled: WritableAttribute<boolean>;
|
|
32
|
+
reachable: OptionalAttribute<boolean>;
|
|
33
|
+
uniqueId: OptionalAttribute<string>;
|
|
34
|
+
capabilityMinima: Attribute<{
|
|
35
|
+
caseSessionsPerFabric: number;
|
|
36
|
+
subscriptionsPerFabric: number;
|
|
37
|
+
}>;
|
|
38
|
+
clusterRevision: Attribute<number>;
|
|
39
|
+
featureMap: Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
|
|
40
|
+
}, import("./Cluster.js").Commands, {
|
|
41
|
+
/** First event fired as soon as reasonable after completing a boot or reboot process. */
|
|
42
|
+
startUp: Event<{
|
|
43
|
+
softwareVersion: number;
|
|
44
|
+
}>;
|
|
45
|
+
/** Last event fired prior to any orderly shutdown sequence on a best-effort basis. */
|
|
46
|
+
shutDown: Event<{
|
|
47
|
+
[x: string]: any;
|
|
48
|
+
}>;
|
|
49
|
+
/** Fired prior to permanently leaving a given Fabric. */
|
|
50
|
+
leave: Event<{
|
|
51
|
+
fabricIndex: import("../common/FabricIndex.js").FabricIndex;
|
|
52
|
+
}>;
|
|
53
|
+
/** Fired when there is a change in the {@link BasicInformationCluster.attributes.reachable reachable} attribute. */
|
|
54
|
+
reachableChanged: Event<{
|
|
55
|
+
reachableNewValue: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Cluster, WritableAttribute } from "./Cluster.js";
|
|
7
|
+
/**
|
|
8
|
+
* A binding represents a persistent relationship between an endpoint and one or more other local or
|
|
9
|
+
* remote endpoints. A binding does not require that the relationship exists. It is up to the node
|
|
10
|
+
* application to set up the relationship.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link MatterCoreSpecificationV1_0} § 9.6
|
|
13
|
+
*/
|
|
14
|
+
export declare const BindingCluster: Cluster<import("../matter.js").BitSchema, {
|
|
15
|
+
binding: WritableAttribute<{
|
|
16
|
+
group?: import("../common/GroupId.js").GroupId | undefined;
|
|
17
|
+
cluster?: import("../common/ClusterId.js").ClusterId | undefined;
|
|
18
|
+
endpoint?: import("../common/EndpointNumber.js").EndpointNumber | undefined;
|
|
19
|
+
node?: import("../common/NodeId.js").NodeId | undefined;
|
|
20
|
+
}[]>;
|
|
21
|
+
clusterRevision: import("./Cluster.js").Attribute<number>;
|
|
22
|
+
featureMap: import("./Cluster.js").Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
|
|
23
|
+
}, import("./Cluster.js").Commands, import("./Cluster.js").Events>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Attribute, Cluster, Event, OptionalAttribute } from "./Cluster.js";
|
|
7
|
+
/**
|
|
8
|
+
* This Cluster serves two purposes towards a Node communicating with a Bridge:
|
|
9
|
+
* * indicate that the functionality on the Endpoint where it is placed (and its Parts) is bridged from a
|
|
10
|
+
* non-Matter technology, and
|
|
11
|
+
* * provide a centralized collection of attributes that the Node MAY collect to aid in conveying information
|
|
12
|
+
* regarding the Bridged Device to a user, such as the vendor name, the model name, or user-assigned name.
|
|
13
|
+
*
|
|
14
|
+
* This cluster is Derived from Basic Information Cluster.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link MatterCoreSpecificationV1_0} § 9.13
|
|
17
|
+
*/
|
|
18
|
+
export declare const BridgedDeviceBasicInformationCluster: Cluster<import("../matter.js").BitSchema, {
|
|
19
|
+
vendorName: OptionalAttribute<string>;
|
|
20
|
+
vendorId: OptionalAttribute<import("../common/VendorId.js").VendorId>;
|
|
21
|
+
productName: OptionalAttribute<string>;
|
|
22
|
+
nodeLabel: import("./Cluster.js").WritableAttribute<string>;
|
|
23
|
+
hardwareVersion: OptionalAttribute<number>;
|
|
24
|
+
hardwareVersionString: OptionalAttribute<string>;
|
|
25
|
+
softwareVersion: OptionalAttribute<number>;
|
|
26
|
+
softwareVersionString: OptionalAttribute<string>;
|
|
27
|
+
manufacturingDate: OptionalAttribute<string>;
|
|
28
|
+
partNumber: OptionalAttribute<string>;
|
|
29
|
+
productURL: OptionalAttribute<string>;
|
|
30
|
+
productLabel: OptionalAttribute<string>;
|
|
31
|
+
serialNumber: OptionalAttribute<string>;
|
|
32
|
+
reachable: Attribute<boolean>;
|
|
33
|
+
uniqueId: OptionalAttribute<string>;
|
|
34
|
+
clusterRevision: Attribute<number>;
|
|
35
|
+
featureMap: Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
|
|
36
|
+
}, import("./Cluster.js").Commands, {
|
|
37
|
+
/** First event fired as soon as reasonable after completing a boot or reboot process. */
|
|
38
|
+
startUp: Event<{
|
|
39
|
+
softwareVersion: number;
|
|
40
|
+
}>;
|
|
41
|
+
/** Last event fired prior to any orderly shutdown sequence on a best-effort basis. */
|
|
42
|
+
shutDown: Event<{
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
}>;
|
|
45
|
+
/** Fired prior to permanently leaving a given Fabric. */
|
|
46
|
+
leave: Event<{
|
|
47
|
+
fabricIndex: import("../common/FabricIndex.js").FabricIndex;
|
|
48
|
+
}>;
|
|
49
|
+
/** Fired when there is a change in the {@link BasicInformationCluster.attributes.reachable reachable} attribute */
|
|
50
|
+
reachableChanged: Event<{
|
|
51
|
+
reachableNewValue: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { BitSchema, TypeFromBitSchema } from "../schema/BitmapSchema.js";
|
|
7
|
+
import { TlvFields, TypeFromFields } from "../tlv/TlvObject.js";
|
|
8
|
+
import { TlvSchema } from "../tlv/TlvSchema.js";
|
|
9
|
+
import { Merge } from "../util/Type.js";
|
|
10
|
+
export declare const enum AccessLevel {
|
|
11
|
+
View = 0,
|
|
12
|
+
Manage = 1,
|
|
13
|
+
Administer = 2
|
|
14
|
+
}
|
|
15
|
+
export interface Attribute<T> {
|
|
16
|
+
id: number;
|
|
17
|
+
schema: TlvSchema<T>;
|
|
18
|
+
optional: boolean;
|
|
19
|
+
readAcl: AccessLevel;
|
|
20
|
+
writable: boolean;
|
|
21
|
+
writeAcl?: AccessLevel;
|
|
22
|
+
default?: T;
|
|
23
|
+
}
|
|
24
|
+
export interface OptionalAttribute<T> extends Attribute<T> {
|
|
25
|
+
optional: true;
|
|
26
|
+
}
|
|
27
|
+
export interface WritableAttribute<T> extends Attribute<T> {
|
|
28
|
+
writable: true;
|
|
29
|
+
}
|
|
30
|
+
export interface OptionalWritableAttribute<T> extends OptionalAttribute<T> {
|
|
31
|
+
writable: true;
|
|
32
|
+
}
|
|
33
|
+
export type AttributeJsType<T extends Attribute<any>> = T extends Attribute<infer JsType> ? JsType : never;
|
|
34
|
+
interface AttributeOptions<T> {
|
|
35
|
+
default?: T;
|
|
36
|
+
readAcl?: AccessLevel;
|
|
37
|
+
writeAcl?: AccessLevel;
|
|
38
|
+
}
|
|
39
|
+
export declare const Attribute: <T, V extends T>(id: number, schema: TlvSchema<T>, { default: conformanceValue, readAcl }?: AttributeOptions<V>) => Attribute<T>;
|
|
40
|
+
export declare const OptionalAttribute: <T, V extends T>(id: number, schema: TlvSchema<T>, { default: conformanceValue, readAcl }?: AttributeOptions<V>) => OptionalAttribute<T>;
|
|
41
|
+
export declare const WritableAttribute: <T, V extends T>(id: number, schema: TlvSchema<T>, { default: conformanceValue, readAcl, writeAcl }?: AttributeOptions<V>) => WritableAttribute<T>;
|
|
42
|
+
export declare const OptionalWritableAttribute: <T, V extends T>(id: number, schema: TlvSchema<T>, { default: conformanceValue, readAcl, writeAcl }?: AttributeOptions<V>) => WritableAttribute<T>;
|
|
43
|
+
export declare const TlvNoArguments: import("../tlv/TlvObject.js").ObjectSchema<{}>;
|
|
44
|
+
export declare const TlvNoResponse: import("../tlv/TlvVoid.js").VoidSchema;
|
|
45
|
+
export interface Command<RequestT, ResponseT> {
|
|
46
|
+
optional: boolean;
|
|
47
|
+
requestId: number;
|
|
48
|
+
requestSchema: TlvSchema<RequestT>;
|
|
49
|
+
responseId: number;
|
|
50
|
+
responseSchema: TlvSchema<ResponseT>;
|
|
51
|
+
}
|
|
52
|
+
export interface OptionalCommand<RequestT, ResponseT> extends Command<RequestT, ResponseT> {
|
|
53
|
+
optional: true;
|
|
54
|
+
}
|
|
55
|
+
export type ResponseType<T extends Command<any, any>> = T extends OptionalCommand<any, infer ResponseT> ? ResponseT | undefined : (T extends Command<any, infer ResponseT> ? ResponseT : never);
|
|
56
|
+
export type RequestType<T extends Command<any, any>> = T extends Command<infer RequestT, any> ? RequestT : never;
|
|
57
|
+
export declare const Command: <RequestT, ResponseT>(requestId: number, requestSchema: TlvSchema<RequestT>, responseId: number, responseSchema: TlvSchema<ResponseT>) => Command<RequestT, ResponseT>;
|
|
58
|
+
export declare const OptionalCommand: <RequestT, ResponseT>(requestId: number, requestSchema: TlvSchema<RequestT>, responseId: number, responseSchema: TlvSchema<ResponseT>) => OptionalCommand<RequestT, ResponseT>;
|
|
59
|
+
export declare const enum EventPriority {
|
|
60
|
+
Critical = 0,
|
|
61
|
+
Info = 1
|
|
62
|
+
}
|
|
63
|
+
export interface Event<T> {
|
|
64
|
+
id: number;
|
|
65
|
+
schema: TlvSchema<T>;
|
|
66
|
+
priority: EventPriority;
|
|
67
|
+
optional: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface OptionalEvent<T> extends Event<T> {
|
|
70
|
+
optional: true;
|
|
71
|
+
}
|
|
72
|
+
export declare const Event: <FT extends TlvFields>(id: number, priority: EventPriority, data?: FT) => Event<Merge<{ [K_1 in { [K in keyof FT]: FT[K] extends import("../tlv/TlvObject.js").OptionalFieldType<any> ? never : K; }[keyof FT]]: FT[K_1] extends infer T ? T extends FT[K_1] ? T extends import("../tlv/TlvObject.js").FieldType<infer T_1> ? T_1 : never : never : never; }, { [K_3 in { [K_2 in keyof FT]: FT[K_2] extends import("../tlv/TlvObject.js").OptionalFieldType<any> ? K_2 : never; }[keyof FT]]?: (FT[K_3] extends infer T_2 ? T_2 extends FT[K_3] ? T_2 extends import("../tlv/TlvObject.js").FieldType<infer T_1> ? T_1 : never : never : never) | undefined; }>>;
|
|
73
|
+
export declare const OptionalEvent: <FT extends TlvFields>(id: number, priority: EventPriority, data?: FT) => Event<Merge<{ [K_1 in { [K in keyof FT]: FT[K] extends import("../tlv/TlvObject.js").OptionalFieldType<any> ? never : K; }[keyof FT]]: FT[K_1] extends infer T ? T extends FT[K_1] ? T extends import("../tlv/TlvObject.js").FieldType<infer T_1> ? T_1 : never : never : never; }, { [K_3 in { [K_2 in keyof FT]: FT[K_2] extends import("../tlv/TlvObject.js").OptionalFieldType<any> ? K_2 : never; }[keyof FT]]?: (FT[K_3] extends infer T_2 ? T_2 extends FT[K_3] ? T_2 extends import("../tlv/TlvObject.js").FieldType<infer T_1> ? T_1 : never : never : never) | undefined; }>>;
|
|
74
|
+
export interface Attributes {
|
|
75
|
+
[key: string]: Attribute<any>;
|
|
76
|
+
}
|
|
77
|
+
export interface Commands {
|
|
78
|
+
[key: string]: Command<any, any>;
|
|
79
|
+
}
|
|
80
|
+
export interface Events {
|
|
81
|
+
[key: string]: Event<any>;
|
|
82
|
+
}
|
|
83
|
+
/** @see {@link MatterCoreSpecificationV1_0} § 7.13 */
|
|
84
|
+
export type GlobalAttributes<F extends BitSchema> = {
|
|
85
|
+
/** Indicates the revision of the server cluster specification supported by the cluster instance. */
|
|
86
|
+
clusterRevision: Attribute<number>;
|
|
87
|
+
/** Indicates whether the server supports zero or more optional cluster features. */
|
|
88
|
+
featureMap: Attribute<TypeFromBitSchema<F>>;
|
|
89
|
+
};
|
|
90
|
+
export declare const GlobalAttributes: <F extends BitSchema>(features: F) => GlobalAttributes<F>;
|
|
91
|
+
export interface Cluster<F extends BitSchema, A extends Attributes, C extends Commands, E extends Events> {
|
|
92
|
+
id: number;
|
|
93
|
+
name: string;
|
|
94
|
+
revision: number;
|
|
95
|
+
features: BitSchema;
|
|
96
|
+
attributes: A;
|
|
97
|
+
commands: C;
|
|
98
|
+
events: E;
|
|
99
|
+
}
|
|
100
|
+
export declare const Cluster: <F extends BitSchema, A extends Attributes, C extends Commands, E extends Events>({ id, name, revision, features, attributes, commands, events, }: {
|
|
101
|
+
id: number;
|
|
102
|
+
name: string;
|
|
103
|
+
revision: number;
|
|
104
|
+
features?: F | undefined;
|
|
105
|
+
attributes?: A | undefined;
|
|
106
|
+
commands?: C | undefined;
|
|
107
|
+
events?: E | undefined;
|
|
108
|
+
}) => Cluster<F, Merge<A, GlobalAttributes<F>>, C, E>;
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Attribute, Cluster } from "./Cluster.js";
|
|
7
|
+
/**
|
|
8
|
+
* This cluster describes an endpoint instance on the node, independently of other endpoints, but also
|
|
9
|
+
* allows composition of endpoints to conform to complex device type patterns.
|
|
10
|
+
* This Cluster is also meant to replace the support from the Zigbee Device Object (ZDO) for describing a node,
|
|
11
|
+
* its endpoints and clusters.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link MatterCoreSpecificationV1_0} § 9.5
|
|
14
|
+
*/
|
|
15
|
+
export declare const DescriptorCluster: Cluster<import("../matter.js").BitSchema, {
|
|
16
|
+
deviceTypeList: Attribute<{
|
|
17
|
+
type: import("../common/DeviceTypeId.js").DeviceTypeId;
|
|
18
|
+
revision: number;
|
|
19
|
+
}[]>;
|
|
20
|
+
serverList: Attribute<import("../common/ClusterId.js").ClusterId[]>;
|
|
21
|
+
clientList: Attribute<import("../common/ClusterId.js").ClusterId[]>;
|
|
22
|
+
partsList: Attribute<import("../common/EndpointNumber.js").EndpointNumber[]>;
|
|
23
|
+
clusterRevision: Attribute<number>;
|
|
24
|
+
featureMap: Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
|
|
25
|
+
}, import("./Cluster.js").Commands, import("./Cluster.js").Events>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Project CHIP Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Attribute, Cluster, Command, WritableAttribute } from "./Cluster.js";
|
|
7
|
+
import { TypeFromSchema } from "../tlv/TlvSchema.js";
|
|
8
|
+
/**
|
|
9
|
+
* This enumeration is used by the RegulatoryConfig and LocationCapability attributes to indicate possible radio usage.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link MatterCoreSpecificationV1_0} § 11.9.5.3
|
|
12
|
+
*/
|
|
13
|
+
export declare const enum RegulatoryLocationType {
|
|
14
|
+
/** Indoor only */
|
|
15
|
+
Indoor = 0,
|
|
16
|
+
/** Outdoor only */
|
|
17
|
+
Outdoor = 1,
|
|
18
|
+
/** Indoor/Outdoor */
|
|
19
|
+
IndoorOutdoor = 2
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This enumeration is used by several response commands in this cluster to indicate particular errors.
|
|
23
|
+
*
|
|
24
|
+
* @see {@link MatterCoreSpecificationV1_0} § 11.9.5.1
|
|
25
|
+
*/
|
|
26
|
+
export declare const enum CommissioningError {
|
|
27
|
+
/** No error. */
|
|
28
|
+
Ok = 0,
|
|
29
|
+
/** Attempting to set regulatory configuration to a region or indoor/outdoor mode for which the server does not have proper configuration. */
|
|
30
|
+
ValueOutsideRange = 1,
|
|
31
|
+
/** Executed CommissioningComplete outside CASE session. */
|
|
32
|
+
InvalidAuthentication = 2,
|
|
33
|
+
/** Executed CommissioningComplete when there was no active Fail-Safe context. */
|
|
34
|
+
NoFailSafe = 3,
|
|
35
|
+
/** Attempting to arm fail-safe or execute CommissioningComplete from a fabric different than the one associated with the current fail-safe context. */
|
|
36
|
+
BusyWithOtherAdmin = 4
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Used by the following commands as response payload:
|
|
40
|
+
* ArmFailSafeResponse, @see {@link MatterCoreSpecificationV1_0} § 11.9.7.3
|
|
41
|
+
* CommissioningCompleteResponse, @see {@link MatterCoreSpecificationV1_0} § 11.9.7.7
|
|
42
|
+
* CommissioningCompleteResponse, @see {@link MatterCoreSpecificationV1_0} § 11.9.7.7
|
|
43
|
+
*/
|
|
44
|
+
declare const TlvCommissioningSuccessFailureResponse: import("../tlv/TlvObject.js").ObjectSchema<{
|
|
45
|
+
/** Contain the result of the operation. */
|
|
46
|
+
errorCode: import("../tlv/TlvObject.js").FieldType<CommissioningError>;
|
|
47
|
+
/** Should help developers in troubleshooting errors. The value MAY go into logs or crash reports, not User UIs. */
|
|
48
|
+
debugText: import("../tlv/TlvObject.js").FieldType<string>;
|
|
49
|
+
}>;
|
|
50
|
+
export type CommissioningSuccessFailureResponse = TypeFromSchema<typeof TlvCommissioningSuccessFailureResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* This cluster is used to manage global aspects of the Commissioning flow.
|
|
53
|
+
*
|
|
54
|
+
* @see {@link MatterCoreSpecificationV1_0} § 11.9
|
|
55
|
+
*/
|
|
56
|
+
export declare const GeneralCommissioningCluster: Cluster<import("../matter.js").BitSchema, {
|
|
57
|
+
breadcrumb: WritableAttribute<number | bigint>;
|
|
58
|
+
commissioningInfo: Attribute<{
|
|
59
|
+
failSafeExpiryLengthSeconds: number;
|
|
60
|
+
maxCumulativeFailsafeSeconds: number;
|
|
61
|
+
}>;
|
|
62
|
+
regulatoryConfig: Attribute<RegulatoryLocationType>;
|
|
63
|
+
locationCapability: Attribute<RegulatoryLocationType>;
|
|
64
|
+
supportsConcurrentConnections: Attribute<boolean>;
|
|
65
|
+
clusterRevision: Attribute<number>;
|
|
66
|
+
featureMap: Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
|
|
67
|
+
}, {
|
|
68
|
+
/** Arms the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock. */
|
|
69
|
+
armFailSafe: Command<{
|
|
70
|
+
expiryLengthSeconds: number;
|
|
71
|
+
breadcrumbStep: number | bigint;
|
|
72
|
+
}, {
|
|
73
|
+
errorCode: CommissioningError;
|
|
74
|
+
debugText: string;
|
|
75
|
+
}>;
|
|
76
|
+
/** Sets or Updates the regulatory configuration to be used during commissioning. */
|
|
77
|
+
setRegulatoryConfig: Command<{
|
|
78
|
+
breadcrumbStep: number | bigint;
|
|
79
|
+
newRegulatoryConfig: RegulatoryLocationType;
|
|
80
|
+
countryCode: string;
|
|
81
|
+
}, {
|
|
82
|
+
errorCode: CommissioningError;
|
|
83
|
+
debugText: string;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* Informs that all steps of Commissioning/Reconfiguration needed during the fail-safe period have been
|
|
87
|
+
* completed.
|
|
88
|
+
*/
|
|
89
|
+
commissioningComplete: Command<{}, {
|
|
90
|
+
errorCode: CommissioningError;
|
|
91
|
+
debugText: string;
|
|
92
|
+
}>;
|
|
93
|
+
}, import("./Cluster.js").Events>;
|
|
94
|
+
export {};
|