@matter/node 0.16.0-alpha.0-20251016-b56cf5683 → 0.16.0-alpha.0-20251020-3f6e46245
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/behavior/Behavior.d.ts +1 -1
- package/dist/cjs/behavior/Behavior.d.ts.map +1 -1
- package/dist/cjs/behavior/Behavior.js +29 -3
- package/dist/cjs/behavior/Behavior.js.map +1 -1
- package/dist/cjs/behavior/cluster/ClusterBehavior.d.ts +1 -1
- package/dist/cjs/behavior/cluster/ClusterBehavior.d.ts.map +1 -1
- package/dist/cjs/behavior/cluster/ClusterBehaviorUtil.d.ts.map +1 -1
- package/dist/cjs/behavior/cluster/ClusterBehaviorUtil.js +2 -4
- package/dist/cjs/behavior/cluster/ClusterBehaviorUtil.js.map +1 -1
- package/dist/cjs/behavior/supervision/RootSupervisor.d.ts.map +1 -1
- package/dist/cjs/behavior/supervision/RootSupervisor.js +2 -1
- package/dist/cjs/behavior/supervision/RootSupervisor.js.map +1 -1
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.d.ts +35 -11
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.d.ts.map +1 -1
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.js +147 -138
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.js.map +2 -2
- package/dist/cjs/behavior/system/commissioning/CommissioningServer.d.ts +0 -7
- package/dist/cjs/behavior/system/commissioning/CommissioningServer.d.ts.map +1 -1
- package/dist/cjs/behavior/system/commissioning/CommissioningServer.js +23 -27
- package/dist/cjs/behavior/system/commissioning/CommissioningServer.js.map +1 -1
- package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.js +4 -4
- package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.js.map +1 -1
- package/dist/cjs/behavior/system/network/NetworkClient.d.ts.map +1 -1
- package/dist/cjs/behavior/system/network/NetworkClient.js +7 -2
- package/dist/cjs/behavior/system/network/NetworkClient.js.map +1 -1
- package/dist/cjs/behavior/system/network/NetworkServer.js +1 -1
- package/dist/cjs/behavior/system/network/NetworkServer.js.map +1 -1
- package/dist/cjs/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/access-control/AccessControlServer.js +2 -9
- package/dist/cjs/behaviors/access-control/AccessControlServer.js.map +1 -1
- package/dist/cjs/behaviors/general-commissioning/GeneralCommissioningServer.js +1 -1
- package/dist/cjs/behaviors/general-commissioning/GeneralCommissioningServer.js.map +1 -1
- package/dist/cjs/node/ClientGroup.d.ts +18 -0
- package/dist/cjs/node/ClientGroup.d.ts.map +1 -0
- package/dist/cjs/node/ClientGroup.js +53 -0
- package/dist/cjs/node/ClientGroup.js.map +6 -0
- package/dist/cjs/node/ClientNode.d.ts +3 -0
- package/dist/cjs/node/ClientNode.d.ts.map +1 -1
- package/dist/cjs/node/ClientNode.js +8 -2
- package/dist/cjs/node/ClientNode.js.map +1 -1
- package/dist/cjs/node/client/ClientBehavior.d.ts.map +1 -1
- package/dist/cjs/node/client/ClientBehavior.js +13 -12
- package/dist/cjs/node/client/ClientBehavior.js.map +1 -1
- package/dist/cjs/node/client/ClientGroupInteraction.d.ts +22 -0
- package/dist/cjs/node/client/ClientGroupInteraction.d.ts.map +1 -0
- package/dist/cjs/node/client/ClientGroupInteraction.js +67 -0
- package/dist/cjs/node/client/ClientGroupInteraction.js.map +6 -0
- package/dist/cjs/node/client/ClientNodeFactory.d.ts +2 -1
- package/dist/cjs/node/client/ClientNodeFactory.d.ts.map +1 -1
- package/dist/cjs/node/client/ClientNodeFactory.js.map +1 -1
- package/dist/cjs/node/client/ClientNodeInteraction.d.ts +16 -2
- package/dist/cjs/node/client/ClientNodeInteraction.d.ts.map +1 -1
- package/dist/cjs/node/client/ClientNodeInteraction.js +14 -0
- package/dist/cjs/node/client/ClientNodeInteraction.js.map +1 -1
- package/dist/cjs/node/client/Peers.d.ts.map +1 -1
- package/dist/cjs/node/client/Peers.js +21 -8
- package/dist/cjs/node/client/Peers.js.map +1 -1
- package/dist/cjs/node/integration/ProtocolService.d.ts.map +1 -1
- package/dist/cjs/node/integration/ProtocolService.js +10 -16
- package/dist/cjs/node/integration/ProtocolService.js.map +1 -1
- package/dist/cjs/node/server/InteractionServer.d.ts.map +1 -1
- package/dist/cjs/node/server/InteractionServer.js +87 -39
- package/dist/cjs/node/server/InteractionServer.js.map +1 -1
- package/dist/cjs/node/server/OnlineServerInteraction.js +1 -1
- package/dist/cjs/node/server/OnlineServerInteraction.js.map +1 -1
- package/dist/cjs/storage/client/ClientNodeStores.d.ts +2 -0
- package/dist/cjs/storage/client/ClientNodeStores.d.ts.map +1 -1
- package/dist/cjs/storage/client/ClientNodeStores.js +19 -0
- package/dist/cjs/storage/client/ClientNodeStores.js.map +1 -1
- package/dist/esm/behavior/Behavior.d.ts +1 -1
- package/dist/esm/behavior/Behavior.d.ts.map +1 -1
- package/dist/esm/behavior/Behavior.js +29 -3
- package/dist/esm/behavior/Behavior.js.map +1 -1
- package/dist/esm/behavior/cluster/ClusterBehavior.d.ts +1 -1
- package/dist/esm/behavior/cluster/ClusterBehavior.d.ts.map +1 -1
- package/dist/esm/behavior/cluster/ClusterBehaviorUtil.d.ts.map +1 -1
- package/dist/esm/behavior/cluster/ClusterBehaviorUtil.js +3 -4
- package/dist/esm/behavior/cluster/ClusterBehaviorUtil.js.map +1 -1
- package/dist/esm/behavior/supervision/RootSupervisor.d.ts.map +1 -1
- package/dist/esm/behavior/supervision/RootSupervisor.js +3 -1
- package/dist/esm/behavior/supervision/RootSupervisor.js.map +1 -1
- package/dist/esm/behavior/system/commissioning/CommissioningClient.d.ts +35 -11
- package/dist/esm/behavior/system/commissioning/CommissioningClient.d.ts.map +1 -1
- package/dist/esm/behavior/system/commissioning/CommissioningClient.js +167 -141
- package/dist/esm/behavior/system/commissioning/CommissioningClient.js.map +2 -2
- package/dist/esm/behavior/system/commissioning/CommissioningServer.d.ts +0 -7
- package/dist/esm/behavior/system/commissioning/CommissioningServer.d.ts.map +1 -1
- package/dist/esm/behavior/system/commissioning/CommissioningServer.js +23 -27
- package/dist/esm/behavior/system/commissioning/CommissioningServer.js.map +1 -1
- package/dist/esm/behavior/system/commissioning/RemoteDescriptor.js +4 -4
- package/dist/esm/behavior/system/commissioning/RemoteDescriptor.js.map +1 -1
- package/dist/esm/behavior/system/network/NetworkClient.d.ts.map +1 -1
- package/dist/esm/behavior/system/network/NetworkClient.js +7 -2
- package/dist/esm/behavior/system/network/NetworkClient.js.map +1 -1
- package/dist/esm/behavior/system/network/NetworkServer.js +1 -1
- package/dist/esm/behavior/system/network/NetworkServer.js.map +1 -1
- package/dist/esm/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
- package/dist/esm/behaviors/access-control/AccessControlServer.js +2 -9
- package/dist/esm/behaviors/access-control/AccessControlServer.js.map +1 -1
- package/dist/esm/behaviors/general-commissioning/GeneralCommissioningServer.js +1 -1
- package/dist/esm/behaviors/general-commissioning/GeneralCommissioningServer.js.map +1 -1
- package/dist/esm/node/ClientGroup.d.ts +18 -0
- package/dist/esm/node/ClientGroup.d.ts.map +1 -0
- package/dist/esm/node/ClientGroup.js +33 -0
- package/dist/esm/node/ClientGroup.js.map +6 -0
- package/dist/esm/node/ClientNode.d.ts +3 -0
- package/dist/esm/node/ClientNode.d.ts.map +1 -1
- package/dist/esm/node/ClientNode.js +8 -2
- package/dist/esm/node/ClientNode.js.map +1 -1
- package/dist/esm/node/client/ClientBehavior.d.ts.map +1 -1
- package/dist/esm/node/client/ClientBehavior.js +13 -12
- package/dist/esm/node/client/ClientBehavior.js.map +1 -1
- package/dist/esm/node/client/ClientGroupInteraction.d.ts +22 -0
- package/dist/esm/node/client/ClientGroupInteraction.d.ts.map +1 -0
- package/dist/esm/node/client/ClientGroupInteraction.js +47 -0
- package/dist/esm/node/client/ClientGroupInteraction.js.map +6 -0
- package/dist/esm/node/client/ClientNodeFactory.d.ts +2 -1
- package/dist/esm/node/client/ClientNodeFactory.d.ts.map +1 -1
- package/dist/esm/node/client/ClientNodeFactory.js.map +1 -1
- package/dist/esm/node/client/ClientNodeInteraction.d.ts +16 -2
- package/dist/esm/node/client/ClientNodeInteraction.d.ts.map +1 -1
- package/dist/esm/node/client/ClientNodeInteraction.js +17 -1
- package/dist/esm/node/client/ClientNodeInteraction.js.map +1 -1
- package/dist/esm/node/client/Peers.d.ts.map +1 -1
- package/dist/esm/node/client/Peers.js +21 -8
- package/dist/esm/node/client/Peers.js.map +1 -1
- package/dist/esm/node/integration/ProtocolService.d.ts.map +1 -1
- package/dist/esm/node/integration/ProtocolService.js +16 -17
- package/dist/esm/node/integration/ProtocolService.js.map +1 -1
- package/dist/esm/node/server/InteractionServer.d.ts.map +1 -1
- package/dist/esm/node/server/InteractionServer.js +88 -39
- package/dist/esm/node/server/InteractionServer.js.map +1 -1
- package/dist/esm/node/server/OnlineServerInteraction.js +1 -1
- package/dist/esm/node/server/OnlineServerInteraction.js.map +1 -1
- package/dist/esm/storage/client/ClientNodeStores.d.ts +2 -0
- package/dist/esm/storage/client/ClientNodeStores.d.ts.map +1 -1
- package/dist/esm/storage/client/ClientNodeStores.js +20 -1
- package/dist/esm/storage/client/ClientNodeStores.js.map +1 -1
- package/package.json +7 -7
- package/src/behavior/Behavior.ts +42 -4
- package/src/behavior/cluster/ClusterBehavior.ts +1 -1
- package/src/behavior/cluster/ClusterBehaviorUtil.ts +7 -7
- package/src/behavior/supervision/RootSupervisor.ts +4 -2
- package/src/behavior/system/commissioning/CommissioningClient.ts +113 -73
- package/src/behavior/system/commissioning/CommissioningServer.ts +25 -30
- package/src/behavior/system/commissioning/RemoteDescriptor.ts +4 -4
- package/src/behavior/system/network/NetworkClient.ts +8 -2
- package/src/behavior/system/network/NetworkServer.ts +1 -1
- package/src/behaviors/access-control/AccessControlServer.ts +1 -8
- package/src/behaviors/general-commissioning/GeneralCommissioningServer.ts +1 -1
- package/src/node/ClientGroup.ts +36 -0
- package/src/node/ClientNode.ts +10 -2
- package/src/node/client/ClientBehavior.ts +17 -17
- package/src/node/client/ClientEndpointInitializer.ts +1 -1
- package/src/node/client/ClientGroupInteraction.ts +70 -0
- package/src/node/client/ClientNodeFactory.ts +2 -1
- package/src/node/client/ClientNodeInteraction.ts +19 -5
- package/src/node/client/Peers.ts +23 -8
- package/src/node/integration/ProtocolService.ts +18 -18
- package/src/node/server/InteractionServer.ts +108 -57
- package/src/node/server/OnlineServerInteraction.ts +1 -1
- package/src/storage/client/ClientNodeStores.ts +25 -1
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
DEFAULT_MAX_PATHS_PER_INVOKE,
|
|
47
47
|
INTERACTION_PROTOCOL_ID,
|
|
48
48
|
ReceivedStatusResponseError,
|
|
49
|
+
Status,
|
|
49
50
|
StatusCode,
|
|
50
51
|
StatusResponseError,
|
|
51
52
|
TlvAny,
|
|
@@ -256,14 +257,20 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
256
257
|
eventFilters,
|
|
257
258
|
interactionModelRevision,
|
|
258
259
|
} = readRequest;
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
|
|
261
|
+
logger.debug(() => [
|
|
262
|
+
"Read «",
|
|
263
|
+
exchange.via,
|
|
264
|
+
Diagnostic.asFlags({ fabricFiltered: isFabricFiltered }),
|
|
265
|
+
Diagnostic.dict({
|
|
266
|
+
attributes: `${
|
|
262
267
|
attributeRequests?.map(path => this.#node.protocol.inspectPath(path)).join(", ") ?? "none"
|
|
263
|
-
}${dataVersionFilters?.length ? ` with ${dataVersionFilters?.length} filters` : ""}
|
|
268
|
+
}${dataVersionFilters?.length ? ` with ${dataVersionFilters?.length} filters` : ""}`,
|
|
269
|
+
events: `${
|
|
264
270
|
eventRequests?.map(path => this.#node.protocol.inspectPath(path)).join(", ") ?? "none"
|
|
265
|
-
}${eventFilters?.length ? `, ${eventFilters?.length} filters` : ""}
|
|
266
|
-
|
|
271
|
+
}${eventFilters?.length ? `, ${eventFilters?.length} filters` : ""}`,
|
|
272
|
+
}),
|
|
273
|
+
]);
|
|
267
274
|
|
|
268
275
|
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
269
276
|
logger.debug(
|
|
@@ -303,12 +310,13 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
303
310
|
const { suppressResponse, timedRequest, writeRequests, interactionModelRevision, moreChunkedMessages } =
|
|
304
311
|
writeRequest;
|
|
305
312
|
const sessionType = message.packetHeader.sessionType;
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
313
|
+
|
|
314
|
+
logger.info(() => [
|
|
315
|
+
"Write «",
|
|
316
|
+
exchange.via,
|
|
317
|
+
Diagnostic.asFlags({ suppressResponse, moreChunkedMessages }),
|
|
318
|
+
Diagnostic.weak(writeRequests.map(req => this.#node.protocol.inspectPath(req.path)).join(", ")),
|
|
319
|
+
]);
|
|
312
320
|
|
|
313
321
|
if (moreChunkedMessages && suppressResponse) {
|
|
314
322
|
throw new StatusResponseError(
|
|
@@ -345,9 +353,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
345
353
|
}
|
|
346
354
|
|
|
347
355
|
if (receivedWithinTimedInteraction) {
|
|
348
|
-
logger.debug(
|
|
349
|
-
`Write request from ${exchange.channel.name} successfully received while timed interaction is running.`,
|
|
350
|
-
);
|
|
356
|
+
logger.debug("Write request for timed interaction on", exchange.channel.name);
|
|
351
357
|
exchange.clearTimedInteraction();
|
|
352
358
|
if (sessionType !== SessionType.Unicast) {
|
|
353
359
|
throw new StatusResponseError(
|
|
@@ -402,9 +408,16 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
402
408
|
isFabricFiltered,
|
|
403
409
|
interactionModelRevision,
|
|
404
410
|
} = request;
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
411
|
+
|
|
412
|
+
logger.info(() => [
|
|
413
|
+
"Subscribe «",
|
|
414
|
+
exchange.via,
|
|
415
|
+
Diagnostic.asFlags({ fabricFiltered: isFabricFiltered, keepSubscriptions }),
|
|
416
|
+
Diagnostic.dict({
|
|
417
|
+
attributePaths: attributeRequests?.length,
|
|
418
|
+
eventPaths: eventRequests?.length,
|
|
419
|
+
}),
|
|
420
|
+
]);
|
|
408
421
|
|
|
409
422
|
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
410
423
|
logger.debug(
|
|
@@ -442,27 +455,29 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
442
455
|
throw new StatusResponseError("No attributes or events requested", StatusCode.InvalidAction);
|
|
443
456
|
}
|
|
444
457
|
|
|
445
|
-
logger.debug(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
458
|
+
logger.debug(() => [
|
|
459
|
+
"Subscribe request details «",
|
|
460
|
+
exchange.via,
|
|
461
|
+
Diagnostic.dict({
|
|
462
|
+
attributes: attributeRequests?.length
|
|
463
|
+
? attributeRequests?.map(path => this.#node.protocol.inspectPath(path)).join(", ")
|
|
464
|
+
: undefined,
|
|
465
|
+
dataVersionFilters: dataVersionFilters?.length
|
|
466
|
+
? dataVersionFilters
|
|
467
|
+
.map(
|
|
468
|
+
({ path: { nodeId, endpointId, clusterId }, dataVersion }) =>
|
|
469
|
+
`${clusterPathToId({ nodeId, endpointId, clusterId })}=${dataVersion}`,
|
|
470
|
+
)
|
|
471
|
+
.join(", ")
|
|
472
|
+
: undefined,
|
|
473
|
+
events: eventRequests?.length
|
|
474
|
+
? eventRequests.map(path => this.#node.protocol.inspectPath(path)).join(", ")
|
|
475
|
+
: undefined,
|
|
476
|
+
eventFilters: eventFilters?.length
|
|
477
|
+
? eventFilters.map(filter => `${filter.nodeId}/${filter.eventMin}`).join(", ")
|
|
478
|
+
: undefined,
|
|
479
|
+
}),
|
|
480
|
+
]);
|
|
466
481
|
|
|
467
482
|
// Validate of the paths before proceeding
|
|
468
483
|
attributeRequests?.forEach(path => validateReadAttributesPath(path));
|
|
@@ -507,7 +522,14 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
507
522
|
error instanceof MatterError ? error.message : error,
|
|
508
523
|
);
|
|
509
524
|
if (error instanceof StatusResponseError && !(error instanceof ReceivedStatusResponseError)) {
|
|
510
|
-
logger.info(
|
|
525
|
+
logger.info(
|
|
526
|
+
"Status",
|
|
527
|
+
Diagnostic.strong(`${Status[error.code]}(${error.code})`),
|
|
528
|
+
"»",
|
|
529
|
+
exchange.via,
|
|
530
|
+
"Error:",
|
|
531
|
+
Diagnostic.errorMessage(error),
|
|
532
|
+
);
|
|
511
533
|
await messenger.sendStatus(error.code, {
|
|
512
534
|
logContext: {
|
|
513
535
|
for: "I/SubscriptionSeed-Status",
|
|
@@ -588,10 +610,15 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
588
610
|
}
|
|
589
611
|
|
|
590
612
|
logger.info(
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
613
|
+
"Subscribe successful »",
|
|
614
|
+
exchange.via,
|
|
615
|
+
Diagnostic.dict({
|
|
616
|
+
subId: id,
|
|
617
|
+
timing: `${Duration.format(Seconds(minIntervalFloorSeconds))} - ${Duration.format(Seconds(maxIntervalCeilingSeconds))} => ${Duration.format(subscription.maxInterval)}`,
|
|
618
|
+
sendInterval: Duration.format(subscription.sendInterval),
|
|
619
|
+
}),
|
|
594
620
|
);
|
|
621
|
+
|
|
595
622
|
return subscription;
|
|
596
623
|
}
|
|
597
624
|
|
|
@@ -610,10 +637,18 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
610
637
|
) {
|
|
611
638
|
const exchange = this.#context.exchangeManager.initiateExchange(session.peerAddress, INTERACTION_PROTOCOL_ID);
|
|
612
639
|
const message = {} as Message;
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
640
|
+
|
|
641
|
+
logger.info(
|
|
642
|
+
`Reestablish subscription »`,
|
|
643
|
+
exchange.via,
|
|
644
|
+
Diagnostic.dict({
|
|
645
|
+
subId: subscriptionId,
|
|
646
|
+
isFabricFiltered,
|
|
647
|
+
maxInterval: Duration.format(maxInterval),
|
|
648
|
+
sendInterval: Duration.format(sendInterval),
|
|
649
|
+
}),
|
|
616
650
|
);
|
|
651
|
+
|
|
617
652
|
const context: ServerSubscriptionContext = {
|
|
618
653
|
session,
|
|
619
654
|
node: this.#node,
|
|
@@ -645,10 +680,15 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
645
680
|
true, // Do not send status responses because we simulate that the subscription is still established
|
|
646
681
|
);
|
|
647
682
|
subscription.activate();
|
|
683
|
+
|
|
648
684
|
logger.info(
|
|
649
|
-
`
|
|
650
|
-
|
|
651
|
-
|
|
685
|
+
`Subscription successfully reestablished »`,
|
|
686
|
+
exchange.via,
|
|
687
|
+
Diagnostic.dict({
|
|
688
|
+
subId: subscriptionId,
|
|
689
|
+
timing: `${Duration.format(minIntervalFloor)} - ${Duration.format(maxIntervalCeiling)} => ${Duration.format(subscription.maxInterval)}`,
|
|
690
|
+
sendInterval: Duration.format(subscription.sendInterval),
|
|
691
|
+
}),
|
|
652
692
|
);
|
|
653
693
|
} catch (error) {
|
|
654
694
|
await subscription.close(); // Cleanup
|
|
@@ -664,14 +704,18 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
664
704
|
message: Message,
|
|
665
705
|
): Promise<void> {
|
|
666
706
|
const { invokeRequests, timedRequest, suppressResponse, interactionModelRevision } = request;
|
|
667
|
-
logger.
|
|
668
|
-
|
|
669
|
-
|
|
707
|
+
logger.info(() => [
|
|
708
|
+
"Invoke «",
|
|
709
|
+
exchange.via,
|
|
710
|
+
Diagnostic.asFlags({ suppressResponse, timedRequest }),
|
|
711
|
+
Diagnostic.dict({
|
|
712
|
+
invokes: invokeRequests
|
|
670
713
|
.map(({ commandPath: { endpointId, clusterId, commandId } }) =>
|
|
671
714
|
this.#node.protocol.inspectPath({ endpointId, clusterId, commandId }),
|
|
672
715
|
)
|
|
673
|
-
.join(", ")
|
|
674
|
-
|
|
716
|
+
.join(", "),
|
|
717
|
+
}),
|
|
718
|
+
]);
|
|
675
719
|
|
|
676
720
|
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
677
721
|
logger.debug(
|
|
@@ -693,7 +737,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
693
737
|
}
|
|
694
738
|
|
|
695
739
|
if (receivedWithinTimedInteraction) {
|
|
696
|
-
logger.debug(
|
|
740
|
+
logger.debug("Invoke request for timed interaction on", exchange.channel.name);
|
|
697
741
|
exchange.clearTimedInteraction();
|
|
698
742
|
if (message.packetHeader.sessionType !== SessionType.Unicast) {
|
|
699
743
|
throw new StatusResponseError(
|
|
@@ -750,7 +794,8 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
750
794
|
if (invokeResponseMessage.invokeResponses.length > 0) {
|
|
751
795
|
if (invokeRequests.length > 1) {
|
|
752
796
|
logger.debug(
|
|
753
|
-
|
|
797
|
+
`${lastMessageProcessed ? "Final " : ""}Invoke response »`,
|
|
798
|
+
Diagnostic.dict({ commands: invokeResponseMessage.invokeResponses.length }),
|
|
754
799
|
);
|
|
755
800
|
}
|
|
756
801
|
const moreChunkedMessages = lastMessageProcessed ? undefined : true;
|
|
@@ -817,7 +862,13 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
817
862
|
handleTimedRequest(exchange: MessageExchange, { timeout, interactionModelRevision }: TimedRequest) {
|
|
818
863
|
const interval = Millis(timeout);
|
|
819
864
|
|
|
820
|
-
logger.debug(
|
|
865
|
+
logger.debug(() => [
|
|
866
|
+
"Timed request «",
|
|
867
|
+
exchange.via,
|
|
868
|
+
Diagnostic.dict({
|
|
869
|
+
interval: Duration.format(interval),
|
|
870
|
+
}),
|
|
871
|
+
]);
|
|
821
872
|
|
|
822
873
|
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
823
874
|
logger.debug(
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Construction, MatterAggregateError, StorageContext } from "#general";
|
|
7
|
+
import { Construction, MatterAggregateError, StorageBackendMemory, StorageContext, StorageManager } from "#general";
|
|
8
|
+
import type { ClientGroup } from "#node/ClientGroup.js";
|
|
8
9
|
import type { ClientNode } from "#node/ClientNode.js";
|
|
9
10
|
import type { Node } from "#node/Node.js";
|
|
10
11
|
import { ClientNodeStore } from "./ClientNodeStore.js";
|
|
@@ -86,6 +87,17 @@ export class ClientNodeStores {
|
|
|
86
87
|
return this.#createNodeStore(node.id);
|
|
87
88
|
}
|
|
88
89
|
|
|
90
|
+
storeForGroup(node: ClientGroup): ClientNodeStore {
|
|
91
|
+
this.#construction.assert();
|
|
92
|
+
|
|
93
|
+
const store = this.#stores[node.id];
|
|
94
|
+
if (store) {
|
|
95
|
+
return store;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return this.#createGroupStore(node.id);
|
|
99
|
+
}
|
|
100
|
+
|
|
89
101
|
/**
|
|
90
102
|
* List all nodes present.
|
|
91
103
|
*/
|
|
@@ -99,6 +111,18 @@ export class ClientNodeStores {
|
|
|
99
111
|
await this.construction;
|
|
100
112
|
}
|
|
101
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Group stores are always created with a memory backend as they are transient.
|
|
116
|
+
*/
|
|
117
|
+
#createGroupStore(id: string) {
|
|
118
|
+
const manager = new StorageManager(new StorageBackendMemory());
|
|
119
|
+
manager.initialize();
|
|
120
|
+
const store = new ClientNodeStore(id, manager.createContext(id));
|
|
121
|
+
store.construction.start();
|
|
122
|
+
this.#stores[id] = store;
|
|
123
|
+
return store;
|
|
124
|
+
}
|
|
125
|
+
|
|
102
126
|
#createNodeStore(id: string) {
|
|
103
127
|
const store = new ClientNodeStore(id, this.#storage.createContext(id));
|
|
104
128
|
store.construction.start();
|