@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.
Files changed (136) hide show
  1. package/README.md +14 -0
  2. package/dist/cjs/cluster/AccessControlCluster.js +105 -0
  3. package/dist/cjs/cluster/BasicInformationCluster.js +92 -0
  4. package/dist/cjs/cluster/BindingCluster.js +51 -0
  5. package/dist/cjs/cluster/BridgedDeviceBasicInformationCluster.js +75 -0
  6. package/dist/cjs/cluster/Cluster.js +49 -0
  7. package/dist/cjs/cluster/DescriptorCluster.js +53 -0
  8. package/dist/cjs/cluster/GeneralCommissioningCluster.js +89 -0
  9. package/dist/cjs/cluster/GroupsCluster.js +140 -0
  10. package/dist/cjs/cluster/IdentifyCluster.js +55 -0
  11. package/dist/cjs/cluster/LabelCluster.js +55 -0
  12. package/dist/cjs/cluster/OnOffCluster.js +105 -0
  13. package/dist/cjs/cluster/OperationalCredentialsCluster.js +205 -0
  14. package/dist/cjs/cluster/ScenesCluster.js +236 -0
  15. package/dist/cjs/common/AttributeId.js +23 -0
  16. package/dist/cjs/common/ClusterId.js +24 -0
  17. package/dist/cjs/common/DeviceTypeId.js +23 -0
  18. package/dist/cjs/common/EndpointNumber.js +23 -0
  19. package/dist/cjs/common/FabricId.js +24 -0
  20. package/dist/cjs/common/FabricIndex.js +28 -0
  21. package/dist/cjs/common/GroupId.js +30 -0
  22. package/dist/cjs/common/NodeId.js +31 -0
  23. package/dist/cjs/common/SubjectId.js +11 -0
  24. package/dist/cjs/common/VendorId.js +25 -0
  25. package/{dist-cjs → dist/cjs}/matter.js +12 -0
  26. package/dist/cjs/protocol/InteractionProtocol.js +136 -0
  27. package/dist/cjs/schema/BitmapSchema.js +133 -0
  28. package/{dist-cjs → dist/cjs}/schema/Schema.js +0 -0
  29. package/{dist-cjs → dist/cjs}/spec/Specifications.js +0 -0
  30. package/{dist-cjs → dist/cjs}/tlv/TlvAny.js +0 -0
  31. package/{dist-cjs → dist/cjs}/tlv/TlvArray.js +0 -0
  32. package/{dist-cjs → dist/cjs}/tlv/TlvBoolean.js +0 -0
  33. package/{dist-cjs → dist/cjs}/tlv/TlvCodec.js +0 -0
  34. package/{dist-cjs → dist/cjs}/tlv/TlvNullable.js +0 -0
  35. package/{dist-cjs → dist/cjs}/tlv/TlvNumber.js +0 -0
  36. package/{dist-cjs → dist/cjs}/tlv/TlvObject.js +6 -2
  37. package/{dist-cjs → dist/cjs}/tlv/TlvSchema.js +0 -0
  38. package/{dist-cjs → dist/cjs}/tlv/TlvString.js +0 -0
  39. package/{dist-cjs → dist/cjs}/tlv/TlvVoid.js +0 -0
  40. package/{dist-cjs → dist/cjs}/tlv/TlvWrapper.js +0 -0
  41. package/{dist-cjs → dist/cjs}/util/ByteArray.js +2 -0
  42. package/{dist-cjs → dist/cjs}/util/DataReader.js +0 -0
  43. package/{dist-cjs → dist/cjs}/util/DataWriter.js +0 -0
  44. package/{dist-cjs → dist/cjs}/util/Number.js +0 -0
  45. package/{dist-cjs → dist/cjs}/util/Type.js +3 -0
  46. package/dist/dts/cluster/AccessControlCluster.d.ts +108 -0
  47. package/dist/dts/cluster/BasicInformationCluster.d.ts +57 -0
  48. package/dist/dts/cluster/BindingCluster.d.ts +23 -0
  49. package/dist/dts/cluster/BridgedDeviceBasicInformationCluster.d.ts +53 -0
  50. package/dist/dts/cluster/Cluster.d.ts +109 -0
  51. package/dist/dts/cluster/DescriptorCluster.d.ts +25 -0
  52. package/dist/dts/cluster/GeneralCommissioningCluster.d.ts +94 -0
  53. package/dist/dts/cluster/GroupsCluster.d.ts +92 -0
  54. package/dist/dts/cluster/IdentifyCluster.d.ts +60 -0
  55. package/dist/dts/cluster/LabelCluster.d.ts +34 -0
  56. package/dist/dts/cluster/OnOffCluster.d.ts +85 -0
  57. package/dist/dts/cluster/OperationalCredentialsCluster.d.ts +156 -0
  58. package/dist/dts/cluster/ScenesCluster.d.ts +200 -0
  59. package/dist/dts/common/AttributeId.d.ts +17 -0
  60. package/dist/dts/common/ClusterId.d.ts +18 -0
  61. package/dist/dts/common/DeviceTypeId.d.ts +17 -0
  62. package/dist/dts/common/EndpointNumber.d.ts +17 -0
  63. package/dist/dts/common/FabricId.d.ts +18 -0
  64. package/dist/dts/common/FabricIndex.d.ts +22 -0
  65. package/dist/dts/common/GroupId.d.ts +24 -0
  66. package/dist/dts/common/NodeId.d.ts +19 -0
  67. package/dist/dts/common/SubjectId.d.ts +15 -0
  68. package/dist/dts/common/VendorId.d.ts +19 -0
  69. package/dist/{matter.d.ts → dts/matter.d.ts} +12 -0
  70. package/dist/dts/protocol/InteractionProtocol.d.ts +159 -0
  71. package/dist/{schema → dts/schema}/BitmapSchema.d.ts +15 -3
  72. package/dist/{schema → dts/schema}/Schema.d.ts +0 -0
  73. package/dist/{spec → dts/spec}/Specifications.d.ts +0 -0
  74. package/dist/{tlv → dts/tlv}/TlvAny.d.ts +0 -0
  75. package/dist/{tlv → dts/tlv}/TlvArray.d.ts +0 -0
  76. package/dist/{tlv → dts/tlv}/TlvBoolean.d.ts +0 -0
  77. package/dist/{tlv → dts/tlv}/TlvCodec.d.ts +0 -0
  78. package/dist/{tlv → dts/tlv}/TlvNullable.d.ts +0 -0
  79. package/dist/{tlv → dts/tlv}/TlvNumber.d.ts +0 -0
  80. package/dist/{tlv → dts/tlv}/TlvObject.d.ts +0 -0
  81. package/dist/{tlv → dts/tlv}/TlvSchema.d.ts +0 -0
  82. package/dist/{tlv → dts/tlv}/TlvString.d.ts +0 -0
  83. package/dist/{tlv → dts/tlv}/TlvVoid.d.ts +0 -0
  84. package/dist/{tlv → dts/tlv}/TlvWrapper.d.ts +0 -0
  85. package/dist/{util → dts/util}/ByteArray.d.ts +0 -0
  86. package/dist/{util → dts/util}/DataReader.d.ts +0 -0
  87. package/dist/{util → dts/util}/DataWriter.d.ts +0 -0
  88. package/dist/{util → dts/util}/Number.d.ts +0 -0
  89. package/dist/{util → dts/util}/Type.d.ts +1 -0
  90. package/dist/es/cluster/AccessControlCluster.js +102 -0
  91. package/dist/es/cluster/BasicInformationCluster.js +89 -0
  92. package/dist/es/cluster/BindingCluster.js +48 -0
  93. package/dist/es/cluster/BridgedDeviceBasicInformationCluster.js +72 -0
  94. package/dist/es/cluster/Cluster.js +36 -0
  95. package/dist/es/cluster/DescriptorCluster.js +50 -0
  96. package/dist/es/cluster/GeneralCommissioningCluster.js +86 -0
  97. package/dist/es/cluster/GroupsCluster.js +137 -0
  98. package/dist/es/cluster/IdentifyCluster.js +52 -0
  99. package/dist/es/cluster/LabelCluster.js +52 -0
  100. package/dist/es/cluster/OnOffCluster.js +102 -0
  101. package/dist/es/cluster/OperationalCredentialsCluster.js +202 -0
  102. package/dist/es/cluster/ScenesCluster.js +233 -0
  103. package/dist/es/common/AttributeId.js +19 -0
  104. package/dist/es/common/ClusterId.js +20 -0
  105. package/dist/es/common/DeviceTypeId.js +19 -0
  106. package/dist/es/common/EndpointNumber.js +19 -0
  107. package/dist/es/common/FabricId.js +20 -0
  108. package/dist/es/common/FabricIndex.js +24 -0
  109. package/dist/es/common/GroupId.js +26 -0
  110. package/dist/es/common/NodeId.js +27 -0
  111. package/dist/es/common/SubjectId.js +8 -0
  112. package/dist/es/common/VendorId.js +21 -0
  113. package/dist/{matter.js → es/matter.js} +12 -0
  114. package/dist/es/protocol/InteractionProtocol.js +133 -0
  115. package/dist/es/schema/BitmapSchema.js +125 -0
  116. package/dist/{schema → es/schema}/Schema.js +0 -0
  117. package/dist/{spec → es/spec}/Specifications.js +0 -0
  118. package/dist/{tlv → es/tlv}/TlvAny.js +0 -0
  119. package/dist/{tlv → es/tlv}/TlvArray.js +0 -0
  120. package/dist/{tlv → es/tlv}/TlvBoolean.js +0 -0
  121. package/dist/{tlv → es/tlv}/TlvCodec.js +0 -0
  122. package/dist/{tlv → es/tlv}/TlvNullable.js +0 -0
  123. package/dist/{tlv → es/tlv}/TlvNumber.js +0 -0
  124. package/dist/{tlv → es/tlv}/TlvObject.js +6 -2
  125. package/dist/{tlv → es/tlv}/TlvSchema.js +0 -0
  126. package/dist/{tlv → es/tlv}/TlvString.js +0 -0
  127. package/dist/{tlv → es/tlv}/TlvVoid.js +0 -0
  128. package/dist/{tlv → es/tlv}/TlvWrapper.js +0 -0
  129. package/dist/{util → es/util}/ByteArray.js +2 -0
  130. package/dist/{util → es/util}/DataReader.js +0 -0
  131. package/dist/{util → es/util}/DataWriter.js +0 -0
  132. package/dist/{util → es/util}/Number.js +0 -0
  133. package/dist/{util → es/util}/Type.js +1 -1
  134. package/package.json +7 -8
  135. package/dist/schema/BitmapSchema.js +0 -48
  136. package/dist-cjs/schema/BitmapSchema.js +0 -55
@@ -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 {};
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Project CHIP Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Attribute, Cluster, Command } from "./Cluster.js";
7
+ import { BitFlag } from "../schema/BitmapSchema.js";
8
+ import { StatusCode } from "../protocol/InteractionProtocol.js";
9
+ /**
10
+ * The Groups cluster manages, per endpoint, the content of the node-wide Group
11
+ * Table that is part of the underlying interaction layer.
12
+ *
13
+ * @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3
14
+ */
15
+ export declare const GroupsCluster: Cluster<{
16
+ /** The ability to store a name for a group. */
17
+ groupNames: BitFlag;
18
+ }, {
19
+ nameSupport: Attribute<import("../schema/BitmapSchema.js").TypeFromBitSchema<{
20
+ groupNames: BitFlag;
21
+ }>>;
22
+ clusterRevision: Attribute<number>;
23
+ featureMap: Attribute<import("../schema/BitmapSchema.js").TypeFromBitSchema<{
24
+ /** The ability to store a name for a group. */
25
+ groupNames: BitFlag;
26
+ }>>;
27
+ }, {
28
+ /**
29
+ * The AddGroup command allows a client to add group membership in a particular group for the server endpoint.
30
+ */
31
+ addGroup: Command<{
32
+ groupId: import("../common/GroupId.js").GroupId;
33
+ groupName: string;
34
+ }, {
35
+ status: StatusCode;
36
+ groupId: import("../common/GroupId.js").GroupId;
37
+ }>;
38
+ /**
39
+ * The ViewGroup command allows a client to request that the server responds with a ViewGroupResponse command
40
+ * containing the name string for a particular group.
41
+ *
42
+ */
43
+ viewGroup: Command<{
44
+ groupId: import("../common/GroupId.js").GroupId;
45
+ }, {
46
+ status: StatusCode;
47
+ groupId: import("../common/GroupId.js").GroupId;
48
+ groupName: string;
49
+ }>;
50
+ /**
51
+ * The GetGroupMembership command allows a client to inquire about the group membership of the server endpoint,
52
+ * in a number of ways.
53
+ */
54
+ getGroupMembership: Command<{
55
+ groupList: import("../common/GroupId.js").GroupId[];
56
+ }, {
57
+ groupList: import("../common/GroupId.js").GroupId[];
58
+ capacity: number | null;
59
+ }>;
60
+ /**
61
+ * The RemoveGroup command allows a client to request that the server removes the membership for the server
62
+ * endpoint, if any, in a particular group.
63
+ */
64
+ removeGroup: Command<{
65
+ groupId: import("../common/GroupId.js").GroupId;
66
+ }, {
67
+ status: StatusCode;
68
+ groupId: import("../common/GroupId.js").GroupId;
69
+ }>;
70
+ /**
71
+ * The RemoveAllGroups command allows a client to direct the server to remove all group associations for the
72
+ * server endpoint.
73
+ *
74
+ * TODO: According to specs the response might be suppressed:
75
+ * If the RemoveAllGroups command was received as unicast and a response is not suppressed, the server
76
+ * SHALL generate a response with the Status field set to SUCCESS.
77
+ * Else potentially no response?
78
+ *
79
+ */
80
+ removeAllGroups: Command<{}, {
81
+ status: StatusCode;
82
+ }>;
83
+ /**
84
+ * The AddGroupIfIdentifying command allows a client to add group membership in a particular group for the
85
+ * server endpoint, on condition that the endpoint is identifying itself.
86
+ *
87
+ */
88
+ addGroupIfIdentifying: Command<{
89
+ groupId: import("../common/GroupId.js").GroupId;
90
+ groupName: string;
91
+ }, void>;
92
+ }, import("./Cluster.js").Events>;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Project CHIP Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Attribute, WritableAttribute, Cluster, Command, OptionalCommand } from "./Cluster.js";
7
+ import { BitFlag } from "../schema/BitmapSchema.js";
8
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2.5.2 */
9
+ export declare const enum IdentifyType {
10
+ None = 0,
11
+ VisibleLight = 1,
12
+ VisibleLED = 2,
13
+ AudibleBeep = 3,
14
+ Display = 4,
15
+ Actuator = 5
16
+ }
17
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2.6.3.1 */
18
+ export declare const enum IdentifyEffectIdentifier {
19
+ Blink = 0,
20
+ Breathe = 1,
21
+ Okay = 2,
22
+ ChannelChange = 11,
23
+ FinishEffect = 254,
24
+ StopEffect = 255
25
+ }
26
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2.6.3.2 */
27
+ export declare const enum EffectVariant {
28
+ Default = 0
29
+ }
30
+ /**
31
+ * Attributes and commands for putting a device into Identification mode (e.g. flashing a light).
32
+ *
33
+ * @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2
34
+ */
35
+ export declare const IdentifyCluster: Cluster<{
36
+ /** Replies to multicast / groupcast queries if the identification state is active. */
37
+ query: BitFlag;
38
+ }, {
39
+ identifyTime: WritableAttribute<number>;
40
+ identifyType: Attribute<IdentifyType>;
41
+ clusterRevision: Attribute<number>;
42
+ featureMap: Attribute<import("../schema/BitmapSchema.js").TypeFromBitSchema<{
43
+ /** Replies to multicast / groupcast queries if the identification state is active. */
44
+ query: BitFlag;
45
+ }>>;
46
+ }, {
47
+ /** Starts or stops the receiving device identifying itself. */
48
+ identify: Command<{
49
+ identifyTime: number;
50
+ }, void>;
51
+ /** Request the target or targets to respond if they are currently identifying themselves. */
52
+ identifyQuery: Command<{}, {
53
+ timeout: number;
54
+ }>;
55
+ /** Allows the support of feedback to the user, such as a certain light effect when identifying. */
56
+ triggerEffect: OptionalCommand<{
57
+ effectIdentifier: IdentifyEffectIdentifier;
58
+ effectVariant: EffectVariant;
59
+ }, void>;
60
+ }, import("./Cluster.js").Events>;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Project CHIP Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Attribute, Cluster, WritableAttribute } from "./Cluster.js";
7
+ /**
8
+ * This cluster provides a feature to tag an endpoint with zero or more labels.
9
+ * Derived from LabelCluster ({@link MatterCoreSpecificationV1_0} § 9.7)
10
+ *
11
+ * @see {@link MatterCoreSpecificationV1_0} § 9.9
12
+ */
13
+ export declare const UserLabelCluster: Cluster<import("../matter.js").BitSchema, {
14
+ labelList: WritableAttribute<{
15
+ value: string;
16
+ label: string;
17
+ }[]>;
18
+ clusterRevision: Attribute<number>;
19
+ featureMap: Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
20
+ }, import("./Cluster.js").Commands, import("./Cluster.js").Events>;
21
+ /**
22
+ * This cluster provides a feature for the device to tag an endpoint with zero or more read only labels.
23
+ * Derived from LabelCluster ({@link MatterCoreSpecificationV1_0} § 9.7)
24
+ *
25
+ * @see {@link MatterCoreSpecificationV1_0} § 9.8
26
+ */
27
+ export declare const FixedLabelCluster: Cluster<import("../matter.js").BitSchema, {
28
+ labelList: Attribute<{
29
+ value: string;
30
+ label: string;
31
+ }[]>;
32
+ clusterRevision: Attribute<number>;
33
+ featureMap: Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
34
+ }, import("./Cluster.js").Commands, import("./Cluster.js").Events>;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Project CHIP Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Attribute, Cluster, Command } from "./Cluster.js";
7
+ import { BitFlag } from "../schema/BitmapSchema.js";
8
+ /**
9
+ * Defined how the devices should behave when it is powered on.
10
+ * If the value is null, the OnOff attribute is set to its previous value when the device starts up.
11
+ *
12
+ * @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.5.1
13
+ */
14
+ export declare const enum StartUpOnOff {
15
+ /** Set the OnOff attribute to FALSE when the device starts up. */
16
+ Off = 0,
17
+ /** Set the OnOff attribute to TRUE when the device starts up. */
18
+ On = 1,
19
+ /**
20
+ * If the previous value of the OnOff attribute is equal to FALSE, set the OnOff
21
+ * attribute to TRUE. If the previous value of the OnOff attribute is equal to TRUE,
22
+ * set the OnOff attribute to FALSE (toggle).
23
+ */
24
+ Toggle = 2
25
+ }
26
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4.1 */
27
+ export declare const enum OnOffEffectIdentifier {
28
+ DelayedAllOff = 0,
29
+ DyingLight = 1
30
+ }
31
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4.2 */
32
+ export declare const enum DelayedAllOffEffectVariant {
33
+ /** Fade to off in 0.8 seconds. */
34
+ Fade = 0,
35
+ /** Don't fade, turn off immediately. */
36
+ NoFade = 1,
37
+ /** 50% dim down in 0.8 seconds then fade to off in 12 seconds. */
38
+ DimDownThenFade = 2
39
+ }
40
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4.2 */
41
+ export declare const enum DyingLightEffectVariant {
42
+ /** 20% dim up in 0.5s then fade to off in 1 second. */
43
+ DimUpThenFade = 0
44
+ }
45
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4.2 */
46
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4 */
47
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4.2 */
48
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.6. */
49
+ /**
50
+ * Attributes and commands for switching devices between 'On' and 'Off' states.
51
+ *
52
+ * @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5
53
+ */
54
+ export declare const OnOffCluster: Cluster<{
55
+ /** Level Control for Lighting - Behavior that supports lighting applications */
56
+ lightingLevelControl: BitFlag;
57
+ }, {
58
+ onOff: Attribute<boolean>;
59
+ clusterRevision: Attribute<number>;
60
+ featureMap: Attribute<import("../schema/BitmapSchema.js").TypeFromBitSchema<{
61
+ /** Level Control for Lighting - Behavior that supports lighting applications */
62
+ lightingLevelControl: BitFlag;
63
+ }>>;
64
+ }, {
65
+ /**
66
+ * On receipt of this command, a device SHALL enter its ‘Off’ state. This state is device dependent, but it is
67
+ * recommended that it is used for power off or similar functions. On receipt of the Off command, the OnTime
68
+ * attribute SHALL be set to 0.
69
+ */
70
+ off: Command<{}, void>;
71
+ /**
72
+ * On receipt of this command, a device SHALL enter its ‘On’ state. This state is device dependent, but it is
73
+ * recommended that it is used for power on or similar functions. On receipt of the On command, if the value
74
+ * of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0.
75
+ */
76
+ on: Command<{}, void>;
77
+ /**
78
+ * On receipt of this command, if a device is in its ‘Off’ state it SHALL enter its ‘On’ state. Otherwise,
79
+ * if it is in its ‘On’ state it SHALL enter its ‘Off’ state. On receipt of the Toggle command, if the value
80
+ * of the OnOff attribute is equal to FALSE and if the value of the OnTime attribute is equal to 0, the device
81
+ * SHALL set the OffWaitTime attribute to 0. If the value of the OnOff attribute is equal to TRUE, the OnTime
82
+ * attribute SHALL be set to 0.
83
+ */
84
+ toggle: Command<{}, void>;
85
+ }, import("./Cluster.js").Events>;
@@ -0,0 +1,156 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Project CHIP Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Attribute, Cluster, Command } from "./Cluster.js";
7
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.5.1 */
8
+ export declare const RESP_MAX = 900;
9
+ /**
10
+ * Used by the CertificateChainRequest command to convey which certificate from the device attestation certificate
11
+ * chain to transmit back to the client.
12
+ *
13
+ * @see {@link MatterCoreSpecificationV1_0} § 11.17.5.8 */
14
+ export declare const enum CertificateChainType {
15
+ /** Request the DER- encoded DAC certificate */
16
+ DeviceAttestation = 1,
17
+ /** Request the DER- encoded PAI certificate */
18
+ ProductAttestationIntermediate = 2
19
+ }
20
+ /**
21
+ * Used by the NOCResponse common response command to convey detailed outcome of several of this cluster’s operations.
22
+ *
23
+ * @see {@link MatterCoreSpecificationV1_0} § 11.17.5.9 */
24
+ export declare const enum OperationalCertStatus {
25
+ /** OK, no error. */
26
+ Success = 0,
27
+ /** Public Key in the NOC does not match the public key in the NOCSR. */
28
+ InvalidPublicKey = 1,
29
+ /** The Node Operational ID in the NOC is not formatted correctly. */
30
+ InvalidNodeOpId = 2,
31
+ /** Any other validation error in NOC chain. */
32
+ InvalidOperationalCert = 3,
33
+ /** No record of prior CSR for which this NOC could match. */
34
+ MissingCsr = 4,
35
+ /** NOCs table full, cannot add another one. */
36
+ TableFull = 5,
37
+ /** Invalid CaseAdminSubject field for an AddNOC command. */
38
+ InvalidAdminSubject = 6,
39
+ /** Trying to AddNOC instead of UpdateNOC against an existing Fabric. */
40
+ FabricConflict = 9,
41
+ /** Label already exists on another Fabric. */
42
+ LabelConflict = 10,
43
+ /** FabricIndex argument is invalid. */
44
+ InvalidFabricIndex = 11
45
+ }
46
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.5.4 */
47
+ export declare const TlvAttestation: import("../tlv/TlvObject.js").ObjectSchema<{
48
+ declaration: import("../tlv/TlvObject.js").FieldType<Uint8Array>;
49
+ attestationNonce: import("../tlv/TlvObject.js").FieldType<Uint8Array>;
50
+ timestamp: import("../tlv/TlvObject.js").FieldType<number>;
51
+ firmwareInfo: import("../tlv/TlvObject.js").OptionalFieldType<Uint8Array>;
52
+ }>;
53
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.5.6 */
54
+ export declare const TlvCertSigningRequest: import("../tlv/TlvObject.js").ObjectSchema<{
55
+ certSigningRequest: import("../tlv/TlvObject.js").FieldType<Uint8Array>;
56
+ certSigningRequestNonce: import("../tlv/TlvObject.js").FieldType<Uint8Array>;
57
+ vendorReserved1: import("../tlv/TlvObject.js").OptionalFieldType<Uint8Array>;
58
+ vendorReserved2: import("../tlv/TlvObject.js").OptionalFieldType<Uint8Array>;
59
+ vendorReserved3: import("../tlv/TlvObject.js").OptionalFieldType<Uint8Array>;
60
+ }>;
61
+ /**
62
+ * This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the
63
+ * associated Fabrics.
64
+ *
65
+ * @see {@link MatterCoreSpecificationV1_0} § 11.17
66
+ */
67
+ export declare const OperationalCredentialsCluster: Cluster<import("../matter.js").BitSchema, {
68
+ nocs: Attribute<{
69
+ noc: Uint8Array;
70
+ icac: Uint8Array | null;
71
+ }[]>;
72
+ fabrics: Attribute<{
73
+ label: string;
74
+ vendorId: import("../common/VendorId.js").VendorId;
75
+ rootPublicKey: Uint8Array;
76
+ fabricID: import("../common/FabricId.js").FabricId;
77
+ nodeID: import("../common/NodeId.js").NodeId;
78
+ }[]>;
79
+ supportedFabrics: Attribute<number>;
80
+ commissionedFabrics: Attribute<number>;
81
+ trustedRootCertificates: Attribute<Uint8Array[]>;
82
+ currentFabricIndex: Attribute<number>;
83
+ clusterRevision: Attribute<number>;
84
+ featureMap: Attribute<import("../matter.js").TypeFromBitSchema<import("../matter.js").BitSchema>>;
85
+ }, {
86
+ /** Sender is requesting attestation information from the receiver. */
87
+ requestAttestation: Command<{
88
+ attestationNonce: Uint8Array;
89
+ }, {
90
+ elements: Uint8Array;
91
+ signature: Uint8Array;
92
+ }>;
93
+ /** Sender is requesting a device attestation certificate from the receiver. */
94
+ requestCertChain: Command<{
95
+ type: CertificateChainType;
96
+ }, {
97
+ certificate: Uint8Array;
98
+ }>;
99
+ /** Sender is requesting a certificate signing request (CSR) from the receiver. */
100
+ requestCertSigning: Command<{
101
+ certSigningRequestNonce: Uint8Array;
102
+ isForUpdateNOC?: boolean | undefined;
103
+ }, {
104
+ elements: Uint8Array;
105
+ signature: Uint8Array;
106
+ }>;
107
+ /** Sender is requesting to add the new node operational certificates. */
108
+ addOperationalCert: Command<{
109
+ operationalCert: Uint8Array;
110
+ identityProtectionKey: Uint8Array;
111
+ caseAdminNode: import("../common/NodeId.js").NodeId;
112
+ adminVendorId: import("../common/VendorId.js").VendorId;
113
+ intermediateCaCert?: Uint8Array | undefined;
114
+ }, {
115
+ status: OperationalCertStatus;
116
+ fabricIndex?: import("../common/FabricIndex.js").FabricIndex | undefined;
117
+ debugText?: string | undefined;
118
+ }>;
119
+ /** Sender is requesting to update the node operational certificates. */
120
+ updateOperationalCert: Command<{
121
+ operationalCert: Uint8Array;
122
+ intermediateCaCert?: Uint8Array | undefined;
123
+ }, {
124
+ status: OperationalCertStatus;
125
+ fabricIndex?: import("../common/FabricIndex.js").FabricIndex | undefined;
126
+ debugText?: string | undefined;
127
+ }>;
128
+ /**
129
+ * This command SHALL be used by an Administrative Node to set the user-visible Label field for a given
130
+ * Fabric, as reflected by entries in the Fabrics attribute.
131
+ */
132
+ updateFabricLabel: Command<{
133
+ label: string;
134
+ }, {
135
+ status: OperationalCertStatus;
136
+ fabricIndex?: import("../common/FabricIndex.js").FabricIndex | undefined;
137
+ debugText?: string | undefined;
138
+ }>;
139
+ /**
140
+ * This command is used by Administrative Nodes to remove a given fabric index and delete all associated
141
+ * fabric-scoped data.
142
+ */
143
+ removeFabric: Command<{
144
+ fabricIndex: import("../common/FabricIndex.js").FabricIndex;
145
+ }, {
146
+ status: OperationalCertStatus;
147
+ fabricIndex?: import("../common/FabricIndex.js").FabricIndex | undefined;
148
+ debugText?: string | undefined;
149
+ }>;
150
+ /**
151
+ * This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation.
152
+ */
153
+ addRootCert: Command<{
154
+ certificate: Uint8Array;
155
+ }, void>;
156
+ }, import("./Cluster.js").Events>;