@project-chip/matter.js 0.16.0-alpha.0-20251001-7eb06da95 → 0.16.0-alpha.0-20251003-dc6d5523d
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/dist/cjs/CommissioningController.d.ts +2 -2
- package/dist/cjs/CommissioningController.d.ts.map +1 -1
- package/dist/cjs/CommissioningController.js +2 -2
- package/dist/cjs/CommissioningController.js.map +1 -1
- package/dist/cjs/MatterController.d.ts +6 -6
- package/dist/cjs/MatterController.d.ts.map +1 -1
- package/dist/cjs/MatterController.js +12 -12
- package/dist/cjs/MatterController.js.map +1 -1
- package/dist/cjs/PaseCommissioner.js +1 -1
- package/dist/cjs/PaseCommissioner.js.map +1 -1
- package/dist/cjs/device/CachedClientNodeStore.d.ts +5 -4
- package/dist/cjs/device/CachedClientNodeStore.d.ts.map +1 -1
- package/dist/cjs/device/CachedClientNodeStore.js +19 -2
- package/dist/cjs/device/CachedClientNodeStore.js.map +1 -1
- package/dist/cjs/device/Endpoint.d.ts +1 -1
- package/dist/cjs/device/Endpoint.d.ts.map +1 -1
- package/dist/cjs/device/Endpoint.js.map +1 -1
- package/dist/cjs/device/PairedNode.d.ts +52 -28
- package/dist/cjs/device/PairedNode.d.ts.map +1 -1
- package/dist/cjs/device/PairedNode.js +191 -76
- package/dist/cjs/device/PairedNode.js.map +1 -1
- package/dist/esm/CommissioningController.d.ts +2 -2
- package/dist/esm/CommissioningController.d.ts.map +1 -1
- package/dist/esm/CommissioningController.js +3 -3
- package/dist/esm/CommissioningController.js.map +1 -1
- package/dist/esm/MatterController.d.ts +6 -6
- package/dist/esm/MatterController.d.ts.map +1 -1
- package/dist/esm/MatterController.js +13 -13
- package/dist/esm/MatterController.js.map +1 -1
- package/dist/esm/PaseCommissioner.js +1 -1
- package/dist/esm/PaseCommissioner.js.map +1 -1
- package/dist/esm/device/CachedClientNodeStore.d.ts +5 -4
- package/dist/esm/device/CachedClientNodeStore.d.ts.map +1 -1
- package/dist/esm/device/CachedClientNodeStore.js +19 -2
- package/dist/esm/device/CachedClientNodeStore.js.map +1 -1
- package/dist/esm/device/Endpoint.d.ts +1 -1
- package/dist/esm/device/Endpoint.d.ts.map +1 -1
- package/dist/esm/device/Endpoint.js.map +1 -1
- package/dist/esm/device/PairedNode.d.ts +52 -28
- package/dist/esm/device/PairedNode.d.ts.map +1 -1
- package/dist/esm/device/PairedNode.js +192 -77
- package/dist/esm/device/PairedNode.js.map +1 -1
- package/package.json +8 -8
- package/src/CommissioningController.ts +3 -3
- package/src/MatterController.ts +18 -18
- package/src/PaseCommissioner.ts +1 -1
- package/src/device/CachedClientNodeStore.ts +24 -4
- package/src/device/Endpoint.ts +1 -1
- package/src/device/PairedNode.ts +286 -88
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@project-chip/matter.js",
|
|
3
|
-
"version": "0.16.0-alpha.0-
|
|
3
|
+
"version": "0.16.0-alpha.0-20251003-dc6d5523d",
|
|
4
4
|
"description": "Matter protocol in pure js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iot",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"#*": "./src/*"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@matter/general": "0.16.0-alpha.0-
|
|
48
|
-
"@matter/model": "0.16.0-alpha.0-
|
|
49
|
-
"@matter/node": "0.16.0-alpha.0-
|
|
50
|
-
"@matter/protocol": "0.16.0-alpha.0-
|
|
51
|
-
"@matter/types": "0.16.0-alpha.0-
|
|
47
|
+
"@matter/general": "0.16.0-alpha.0-20251003-dc6d5523d",
|
|
48
|
+
"@matter/model": "0.16.0-alpha.0-20251003-dc6d5523d",
|
|
49
|
+
"@matter/node": "0.16.0-alpha.0-20251003-dc6d5523d",
|
|
50
|
+
"@matter/protocol": "0.16.0-alpha.0-20251003-dc6d5523d",
|
|
51
|
+
"@matter/types": "0.16.0-alpha.0-20251003-dc6d5523d"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@matter/tools": "0.16.0-alpha.0-
|
|
55
|
-
"@matter/testing": "0.16.0-alpha.0-
|
|
54
|
+
"@matter/tools": "0.16.0-alpha.0-20251003-dc6d5523d",
|
|
55
|
+
"@matter/testing": "0.16.0-alpha.0-20251003-dc6d5523d"
|
|
56
56
|
},
|
|
57
57
|
"files": [
|
|
58
58
|
"dist/**/*",
|
|
@@ -8,13 +8,13 @@ import { OperationalCredentials } from "#clusters";
|
|
|
8
8
|
import { ControllerStore } from "#ControllerStore.js";
|
|
9
9
|
import {
|
|
10
10
|
ClassExtends,
|
|
11
|
+
ConnectionlessTransportSet,
|
|
11
12
|
Crypto,
|
|
12
13
|
Environment,
|
|
13
14
|
ImplementationError,
|
|
14
15
|
InternalError,
|
|
15
16
|
Logger,
|
|
16
17
|
Minutes,
|
|
17
|
-
NetInterfaceSet,
|
|
18
18
|
Network,
|
|
19
19
|
NoAddressAvailableError,
|
|
20
20
|
StorageContext,
|
|
@@ -265,7 +265,7 @@ export class CommissioningController {
|
|
|
265
265
|
const controller = await MatterController.create({
|
|
266
266
|
controllerStore,
|
|
267
267
|
scanners,
|
|
268
|
-
netInterfaces,
|
|
268
|
+
transports: netInterfaces,
|
|
269
269
|
sessionClosedCallback: peerNodeId => {
|
|
270
270
|
logger.info(`Session for peer node ${peerNodeId} disconnected ...`);
|
|
271
271
|
const handler = this.#sessionDisconnectedHandler.get(peerNodeId);
|
|
@@ -808,7 +808,7 @@ export async function configureNetwork(options: {
|
|
|
808
808
|
}) {
|
|
809
809
|
const { network, ble, ipv4Disabled, mdnsClient, localPort, listeningAddressIpv6, listeningAddressIpv4 } = options;
|
|
810
810
|
|
|
811
|
-
const netInterfaces = new
|
|
811
|
+
const netInterfaces = new ConnectionlessTransportSet();
|
|
812
812
|
const scanners = new ScannerSet();
|
|
813
813
|
|
|
814
814
|
let udpInterface: UdpInterface;
|
package/src/MatterController.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { DeviceInformationData } from "#device/DeviceInformation.js";
|
|
|
18
18
|
import {
|
|
19
19
|
Bytes,
|
|
20
20
|
ChannelType,
|
|
21
|
+
ConnectionlessTransportSet,
|
|
21
22
|
Construction,
|
|
22
23
|
Crypto,
|
|
23
24
|
CRYPTO_SYMMETRIC_KEY_LENGTH,
|
|
@@ -26,9 +27,8 @@ import {
|
|
|
26
27
|
Logger,
|
|
27
28
|
MatterError,
|
|
28
29
|
Minutes,
|
|
29
|
-
NetInterfaceSet,
|
|
30
30
|
ServerAddress,
|
|
31
|
-
|
|
31
|
+
ServerAddressUdp,
|
|
32
32
|
StorageBackendMemory,
|
|
33
33
|
StorageManager,
|
|
34
34
|
} from "#general";
|
|
@@ -79,7 +79,7 @@ import { ClassExtends } from "@matter/general";
|
|
|
79
79
|
import { ControllerCommissioningFlow, MessageChannel } from "@matter/protocol";
|
|
80
80
|
|
|
81
81
|
export type CommissionedNodeDetails = {
|
|
82
|
-
operationalServerAddress?:
|
|
82
|
+
operationalServerAddress?: ServerAddressUdp;
|
|
83
83
|
discoveryData?: DiscoveryData;
|
|
84
84
|
deviceData?: DeviceInformationData;
|
|
85
85
|
};
|
|
@@ -101,7 +101,7 @@ export class MatterController {
|
|
|
101
101
|
public static async create(options: {
|
|
102
102
|
controllerStore: ControllerStoreInterface;
|
|
103
103
|
scanners: ScannerSet;
|
|
104
|
-
|
|
104
|
+
transports: ConnectionlessTransportSet;
|
|
105
105
|
sessionClosedCallback?: (peerNodeId: NodeId) => void;
|
|
106
106
|
adminVendorId?: VendorId;
|
|
107
107
|
adminFabricId?: FabricId;
|
|
@@ -116,7 +116,7 @@ export class MatterController {
|
|
|
116
116
|
const {
|
|
117
117
|
controllerStore,
|
|
118
118
|
scanners,
|
|
119
|
-
netInterfaces,
|
|
119
|
+
transports: netInterfaces,
|
|
120
120
|
sessionClosedCallback,
|
|
121
121
|
adminVendorId,
|
|
122
122
|
adminFabricId = FabricId(DEFAULT_FABRIC_ID),
|
|
@@ -142,7 +142,7 @@ export class MatterController {
|
|
|
142
142
|
controller = new MatterController({
|
|
143
143
|
controllerStore,
|
|
144
144
|
scanners,
|
|
145
|
-
netInterfaces,
|
|
145
|
+
transports: netInterfaces,
|
|
146
146
|
certificateManager: ca,
|
|
147
147
|
fabric,
|
|
148
148
|
adminFabricLabel,
|
|
@@ -181,7 +181,7 @@ export class MatterController {
|
|
|
181
181
|
controller = new MatterController({
|
|
182
182
|
controllerStore,
|
|
183
183
|
scanners,
|
|
184
|
-
netInterfaces,
|
|
184
|
+
transports: netInterfaces,
|
|
185
185
|
certificateManager: ca,
|
|
186
186
|
fabric,
|
|
187
187
|
adminFabricLabel,
|
|
@@ -197,7 +197,7 @@ export class MatterController {
|
|
|
197
197
|
rootCertificateAuthority?: CertificateAuthority;
|
|
198
198
|
fabricConfig: Fabric.Config;
|
|
199
199
|
scanners: ScannerSet;
|
|
200
|
-
|
|
200
|
+
transports: ConnectionlessTransportSet;
|
|
201
201
|
adminFabricLabel: string;
|
|
202
202
|
sessionClosedCallback?: (peerNodeId: NodeId) => void;
|
|
203
203
|
crypto?: Crypto;
|
|
@@ -208,7 +208,7 @@ export class MatterController {
|
|
|
208
208
|
fabricConfig,
|
|
209
209
|
adminFabricLabel,
|
|
210
210
|
scanners,
|
|
211
|
-
netInterfaces,
|
|
211
|
+
transports: netInterfaces,
|
|
212
212
|
sessionClosedCallback,
|
|
213
213
|
} = options;
|
|
214
214
|
|
|
@@ -240,7 +240,7 @@ export class MatterController {
|
|
|
240
240
|
const controller = new MatterController({
|
|
241
241
|
controllerStore: new LegacyControllerStore(storageManager.createContext("Commissioner")),
|
|
242
242
|
scanners,
|
|
243
|
-
netInterfaces,
|
|
243
|
+
transports: netInterfaces,
|
|
244
244
|
certificateManager,
|
|
245
245
|
fabric,
|
|
246
246
|
adminFabricLabel,
|
|
@@ -251,7 +251,7 @@ export class MatterController {
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
readonly sessionManager: SessionManager;
|
|
254
|
-
private readonly
|
|
254
|
+
private readonly transports = new ConnectionlessTransportSet();
|
|
255
255
|
private readonly channelManager = new ChannelManager(CONTROLLER_CONNECTIONS_PER_FABRIC_AND_NODE);
|
|
256
256
|
private readonly exchangeManager: ExchangeManager;
|
|
257
257
|
private readonly peers: PeerSet;
|
|
@@ -274,7 +274,7 @@ export class MatterController {
|
|
|
274
274
|
constructor(options: {
|
|
275
275
|
controllerStore: ControllerStoreInterface;
|
|
276
276
|
scanners: ScannerSet;
|
|
277
|
-
|
|
277
|
+
transports: ConnectionlessTransportSet;
|
|
278
278
|
certificateManager: CertificateAuthority;
|
|
279
279
|
fabric: Fabric;
|
|
280
280
|
adminFabricLabel: string;
|
|
@@ -283,7 +283,7 @@ export class MatterController {
|
|
|
283
283
|
const {
|
|
284
284
|
controllerStore,
|
|
285
285
|
scanners,
|
|
286
|
-
netInterfaces,
|
|
286
|
+
transports: netInterfaces,
|
|
287
287
|
certificateManager,
|
|
288
288
|
fabric,
|
|
289
289
|
sessionClosedCallback,
|
|
@@ -291,7 +291,7 @@ export class MatterController {
|
|
|
291
291
|
} = options;
|
|
292
292
|
this.#store = controllerStore;
|
|
293
293
|
this.scanners = scanners;
|
|
294
|
-
this.
|
|
294
|
+
this.transports = netInterfaces;
|
|
295
295
|
this.ca = certificateManager;
|
|
296
296
|
this.fabric = fabric;
|
|
297
297
|
this.sessionClosedCallback = sessionClosedCallback;
|
|
@@ -320,7 +320,7 @@ export class MatterController {
|
|
|
320
320
|
crypto: fabric.crypto,
|
|
321
321
|
sessionManager: this.sessionManager,
|
|
322
322
|
channelManager: this.channelManager,
|
|
323
|
-
|
|
323
|
+
netInterface: this.transports,
|
|
324
324
|
});
|
|
325
325
|
this.exchangeManager.addProtocolHandler(new SecureChannelProtocol(this.sessionManager, fabricManager));
|
|
326
326
|
this.exchangeManager.addProtocolHandler(subscriptionClient);
|
|
@@ -334,7 +334,7 @@ export class MatterController {
|
|
|
334
334
|
exchanges: this.exchangeManager,
|
|
335
335
|
subscriptionClient,
|
|
336
336
|
scanners: this.scanners,
|
|
337
|
-
|
|
337
|
+
transports: this.transports,
|
|
338
338
|
store: this.nodesStore,
|
|
339
339
|
});
|
|
340
340
|
|
|
@@ -344,7 +344,7 @@ export class MatterController {
|
|
|
344
344
|
peers: this.peers,
|
|
345
345
|
clients: this.clients,
|
|
346
346
|
scanners: this.scanners,
|
|
347
|
-
|
|
347
|
+
transports: this.transports,
|
|
348
348
|
exchanges: this.exchangeManager,
|
|
349
349
|
sessions: this.sessionManager,
|
|
350
350
|
ca: this.ca,
|
|
@@ -584,7 +584,7 @@ export class MatterController {
|
|
|
584
584
|
await this.exchangeManager.close();
|
|
585
585
|
await this.sessionManager.close();
|
|
586
586
|
await this.channelManager.close();
|
|
587
|
-
await this.
|
|
587
|
+
await this.transports.close();
|
|
588
588
|
await this.#advertiser.close();
|
|
589
589
|
}
|
|
590
590
|
|
package/src/PaseCommissioner.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { StorageContext } from "#general";
|
|
8
|
-
import { Construction, Logger } from "#general";
|
|
9
|
-
import { DecodedAttributeReportValue, PeerDataStore, Val } from "#protocol";
|
|
8
|
+
import { Construction, Logger, MaybePromise } from "#general";
|
|
9
|
+
import { DecodedAttributeReportValue, PeerDataStore, ReadScope, Val } from "#protocol";
|
|
10
10
|
import { AttributeId, ClusterId, EndpointNumber, EventNumber } from "#types";
|
|
11
11
|
import { ClientEndpointStore } from "./ClientEndpointStore.js";
|
|
12
12
|
|
|
@@ -141,7 +141,12 @@ export class CachedClientNodeStore extends PeerDataStore {
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
async persistAttributes(attributes: DecodedAttributeReportValue<any>[]) {
|
|
144
|
+
async persistAttributes(attributes: DecodedAttributeReportValue<any>[], scope: ReadScope) {
|
|
145
|
+
// We only store values that are filtered by out fabric, else we create a mixture of data
|
|
146
|
+
if (!scope.isFabricFiltered) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
145
150
|
const endpointDataMap = new Map<EndpointNumber, Record<ClusterId, Val.Struct>>();
|
|
146
151
|
for (const {
|
|
147
152
|
path: { endpointId, clusterId, attributeId, attributeName },
|
|
@@ -165,7 +170,9 @@ export class CachedClientNodeStore extends PeerDataStore {
|
|
|
165
170
|
}
|
|
166
171
|
|
|
167
172
|
clusterData[attributeId.toString()] = { value, attributeName };
|
|
168
|
-
|
|
173
|
+
if (scope.isWildcard(endpointId, clusterId)) {
|
|
174
|
+
clusterData[VERSION_KEY] = version;
|
|
175
|
+
}
|
|
169
176
|
}
|
|
170
177
|
for (const [endpointId, endpointData] of endpointDataMap) {
|
|
171
178
|
const store = this.#storeForEndpoint(endpointId);
|
|
@@ -202,4 +209,17 @@ export class CachedClientNodeStore extends PeerDataStore {
|
|
|
202
209
|
}
|
|
203
210
|
return versions;
|
|
204
211
|
}
|
|
212
|
+
|
|
213
|
+
cleanupAttributeData(endpointId: EndpointNumber, clusterIds?: ClusterId[]): MaybePromise<void> {
|
|
214
|
+
const store = this.#storeForEndpoint(endpointId);
|
|
215
|
+
if (clusterIds === undefined) {
|
|
216
|
+
this.#endpointStores.delete(endpointId);
|
|
217
|
+
return store.erase();
|
|
218
|
+
}
|
|
219
|
+
for (const clusterId of store.get.keys()) {
|
|
220
|
+
if (!clusterIds.includes(ClusterId(parseInt(clusterId)))) {
|
|
221
|
+
store.get.delete(clusterId);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
205
225
|
}
|
package/src/device/Endpoint.ts
CHANGED
|
@@ -305,7 +305,7 @@ export class Endpoint {
|
|
|
305
305
|
return Array.from(this.childEndpoints.values());
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
|
|
308
|
+
removeChildEndpoint(endpoint: Endpoint): void {
|
|
309
309
|
const id = endpoint.getNumber();
|
|
310
310
|
const knownEndpoint = this.childEndpoints.get(id);
|
|
311
311
|
if (knownEndpoint === undefined) {
|