@matter/protocol 0.16.0-alpha.0-20251203-aaf94bca8 → 0.16.0-alpha.0-20251207-37e501b18
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/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.js +82 -34
- package/dist/cjs/action/client/ClientInteraction.js.map +2 -2
- package/dist/cjs/action/client/subscription/ClientSubscription.d.ts +10 -5
- package/dist/cjs/action/client/subscription/ClientSubscription.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscription.js +21 -1
- package/dist/cjs/action/client/subscription/ClientSubscription.js.map +2 -2
- package/dist/cjs/action/client/subscription/ClientSubscriptionHandler.js +2 -3
- package/dist/cjs/action/client/subscription/ClientSubscriptionHandler.js.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscriptions.d.ts +4 -2
- package/dist/cjs/action/client/subscription/ClientSubscriptions.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscriptions.js +68 -8
- package/dist/cjs/action/client/subscription/ClientSubscriptions.js.map +1 -1
- package/dist/cjs/action/client/subscription/PeerSubscription.d.ts +0 -1
- package/dist/cjs/action/client/subscription/PeerSubscription.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/PeerSubscription.js +1 -2
- package/dist/cjs/action/client/subscription/PeerSubscription.js.map +1 -1
- package/dist/cjs/action/client/subscription/SustainedSubscription.d.ts +0 -2
- package/dist/cjs/action/client/subscription/SustainedSubscription.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/SustainedSubscription.js +2 -4
- package/dist/cjs/action/client/subscription/SustainedSubscription.js.map +1 -1
- package/dist/cjs/action/request/Invoke.js +2 -2
- package/dist/cjs/action/request/Invoke.js.map +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.js +78 -25
- package/dist/cjs/action/server/AttributeReadResponse.js.map +1 -1
- package/dist/cjs/action/server/AttributeWriteResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeWriteResponse.js +70 -17
- package/dist/cjs/action/server/AttributeWriteResponse.js.map +1 -1
- package/dist/cjs/action/server/CommandInvokeResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/CommandInvokeResponse.js +83 -30
- package/dist/cjs/action/server/CommandInvokeResponse.js.map +1 -1
- package/dist/cjs/action/server/DataResponse.d.ts +1 -0
- package/dist/cjs/action/server/DataResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/DataResponse.js +3 -0
- package/dist/cjs/action/server/DataResponse.js.map +1 -1
- package/dist/cjs/action/server/ServerInteraction.d.ts.map +1 -1
- package/dist/cjs/action/server/ServerInteraction.js +4 -4
- package/dist/cjs/action/server/ServerInteraction.js.map +1 -1
- package/dist/cjs/advertisement/Advertisement.d.ts.map +1 -1
- package/dist/cjs/advertisement/Advertisement.js +66 -14
- package/dist/cjs/advertisement/Advertisement.js.map +1 -1
- package/dist/cjs/advertisement/Advertiser.d.ts +4 -1
- package/dist/cjs/advertisement/Advertiser.d.ts.map +1 -1
- package/dist/cjs/advertisement/Advertiser.js +63 -2
- package/dist/cjs/advertisement/Advertiser.js.map +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertiser.d.ts +6 -1
- package/dist/cjs/advertisement/ble/BleAdvertiser.d.ts.map +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertiser.js +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertiser.js.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertiser.d.ts +5 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertiser.d.ts.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertiser.js +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertiser.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/asn.js +1 -1
- package/dist/cjs/certificate/kinds/definitions/asn.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/attestation.d.ts.map +1 -1
- package/dist/cjs/cluster/client/AttributeClient.d.ts.map +1 -1
- package/dist/cjs/cluster/client/AttributeClient.js +2 -2
- package/dist/cjs/cluster/client/AttributeClient.js.map +1 -1
- package/dist/cjs/codec/MessageCodec.d.ts +8 -1
- package/dist/cjs/codec/MessageCodec.d.ts.map +1 -1
- package/dist/cjs/codec/MessageCodec.js +38 -28
- package/dist/cjs/codec/MessageCodec.js.map +2 -2
- package/dist/cjs/common/FailsafeContext.d.ts +8 -9
- package/dist/cjs/common/FailsafeContext.d.ts.map +1 -1
- package/dist/cjs/common/FailsafeContext.js +27 -33
- package/dist/cjs/common/FailsafeContext.js.map +1 -1
- package/dist/cjs/common/FailsafeTimer.d.ts +4 -3
- package/dist/cjs/common/FailsafeTimer.d.ts.map +1 -1
- package/dist/cjs/common/FailsafeTimer.js +4 -4
- package/dist/cjs/common/FailsafeTimer.js.map +1 -1
- package/dist/cjs/common/Mark.d.ts +17 -0
- package/dist/cjs/common/Mark.d.ts.map +1 -0
- package/dist/cjs/{peer/OperationalPeer.js → common/Mark.js} +19 -3
- package/dist/cjs/common/Mark.js.map +6 -0
- package/dist/cjs/common/index.d.ts +1 -0
- package/dist/cjs/common/index.d.ts.map +1 -1
- package/dist/cjs/common/index.js +1 -0
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/fabric/Fabric.d.ts +16 -8
- package/dist/cjs/fabric/Fabric.d.ts.map +1 -1
- package/dist/cjs/fabric/Fabric.js +35 -18
- package/dist/cjs/fabric/Fabric.js.map +1 -1
- package/dist/cjs/fabric/FabricAuthority.d.ts +2 -2
- package/dist/cjs/fabric/FabricAuthority.d.ts.map +1 -1
- package/dist/cjs/fabric/FabricAuthority.js +3 -3
- package/dist/cjs/fabric/FabricAuthority.js.map +1 -1
- package/dist/cjs/fabric/FabricManager.d.ts +10 -14
- package/dist/cjs/fabric/FabricManager.d.ts.map +1 -1
- package/dist/cjs/fabric/FabricManager.js +44 -40
- package/dist/cjs/fabric/FabricManager.js.map +2 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interaction/AttributeDataEncoder.d.ts +1 -1
- package/dist/cjs/interaction/InteractionClient.d.ts +2 -2
- package/dist/cjs/interaction/InteractionClient.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionClient.js +39 -22
- package/dist/cjs/interaction/InteractionClient.js.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.d.ts +2 -2
- package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.js +35 -27
- package/dist/cjs/interaction/InteractionMessenger.js.map +1 -1
- package/dist/cjs/interaction/Subscription.d.ts +16 -37
- package/dist/cjs/interaction/Subscription.d.ts.map +1 -1
- package/dist/cjs/interaction/Subscription.js +15 -68
- package/dist/cjs/interaction/Subscription.js.map +2 -2
- package/dist/cjs/interaction/SubscriptionClient.d.ts +2 -2
- package/dist/cjs/interaction/SubscriptionClient.d.ts.map +1 -1
- package/dist/cjs/interaction/SubscriptionClient.js +2 -2
- package/dist/cjs/interaction/SubscriptionClient.js.map +1 -1
- package/dist/cjs/mdns/MdnsClient.d.ts +10 -10
- package/dist/cjs/mdns/MdnsClient.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsClient.js +165 -80
- package/dist/cjs/mdns/MdnsClient.js.map +1 -1
- package/dist/cjs/mdns/MdnsServer.d.ts +2 -2
- package/dist/cjs/mdns/MdnsServer.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsServer.js +173 -94
- package/dist/cjs/mdns/MdnsServer.js.map +2 -2
- package/dist/cjs/mdns/MdnsService.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsService.js +3 -2
- package/dist/cjs/mdns/MdnsService.js.map +1 -1
- package/dist/cjs/mdns/MdnsSocket.d.ts +3 -2
- package/dist/cjs/mdns/MdnsSocket.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsSocket.js +2 -1
- package/dist/cjs/mdns/MdnsSocket.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.d.ts +2 -2
- package/dist/cjs/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.js +26 -28
- package/dist/cjs/peer/ControllerCommissioner.js.map +1 -1
- package/dist/cjs/peer/ControllerDiscovery.d.ts +1 -1
- package/dist/cjs/peer/ControllerDiscovery.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerDiscovery.js +3 -3
- package/dist/cjs/peer/ControllerDiscovery.js.map +1 -1
- package/dist/cjs/peer/Peer.d.ts +57 -0
- package/dist/cjs/peer/Peer.d.ts.map +1 -0
- package/dist/cjs/peer/Peer.js +182 -0
- package/dist/cjs/peer/Peer.js.map +6 -0
- package/dist/cjs/peer/PeerAddress.d.ts.map +1 -1
- package/dist/cjs/peer/PeerAddress.js +5 -2
- package/dist/cjs/peer/PeerAddress.js.map +1 -1
- package/dist/cjs/peer/PeerAddressStore.d.ts +3 -3
- package/dist/cjs/peer/PeerAddressStore.d.ts.map +1 -1
- package/{src/peer/OperationalPeer.ts → dist/cjs/peer/PeerDescriptor.d.ts} +14 -12
- package/dist/cjs/peer/PeerDescriptor.d.ts.map +1 -0
- package/dist/cjs/peer/PeerDescriptor.js +71 -0
- package/dist/cjs/peer/PeerDescriptor.js.map +6 -0
- package/dist/cjs/peer/PeerSet.d.ts +23 -26
- package/dist/cjs/peer/PeerSet.d.ts.map +1 -1
- package/dist/cjs/peer/PeerSet.js +173 -173
- package/dist/cjs/peer/PeerSet.js.map +2 -2
- package/dist/cjs/peer/index.d.ts +1 -1
- package/dist/cjs/peer/index.d.ts.map +1 -1
- package/dist/cjs/peer/index.js +1 -1
- package/dist/cjs/peer/index.js.map +1 -1
- package/dist/cjs/protocol/DeviceAdvertiser.js +4 -4
- package/dist/cjs/protocol/DeviceAdvertiser.js.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.d.ts +6 -9
- package/dist/cjs/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.js +306 -246
- package/dist/cjs/protocol/ExchangeManager.js.map +2 -2
- package/dist/cjs/protocol/ExchangeProvider.d.ts +9 -11
- package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.js +79 -32
- package/dist/cjs/protocol/ExchangeProvider.js.map +2 -2
- package/dist/cjs/protocol/MessageChannel.d.ts +6 -7
- package/dist/cjs/protocol/MessageChannel.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageChannel.js +14 -16
- package/dist/cjs/protocol/MessageChannel.js.map +1 -1
- package/dist/cjs/protocol/MessageCounter.d.ts +4 -4
- package/dist/cjs/protocol/MessageCounter.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageCounter.js +7 -7
- package/dist/cjs/protocol/MessageCounter.js.map +1 -1
- package/dist/cjs/protocol/MessageExchange.d.ts +31 -20
- package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageExchange.js +316 -231
- package/dist/cjs/protocol/MessageExchange.js.map +2 -2
- package/dist/cjs/protocol/ProtocolMocks.d.ts +100 -0
- package/dist/cjs/protocol/ProtocolMocks.d.ts.map +1 -0
- package/dist/cjs/protocol/ProtocolMocks.js +237 -0
- package/dist/cjs/protocol/ProtocolMocks.js.map +6 -0
- package/dist/cjs/protocol/errors.d.ts +35 -0
- package/dist/cjs/protocol/errors.d.ts.map +1 -0
- package/dist/cjs/protocol/errors.js +50 -0
- package/dist/cjs/protocol/errors.js.map +6 -0
- package/dist/cjs/protocol/index.d.ts +2 -1
- package/dist/cjs/protocol/index.d.ts.map +1 -1
- package/dist/cjs/protocol/index.js +2 -1
- package/dist/cjs/protocol/index.js.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts +1 -0
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.js +3 -0
- package/dist/cjs/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/cjs/securechannel/SecureChannelProtocol.js +2 -2
- package/dist/cjs/securechannel/SecureChannelProtocol.js.map +1 -1
- package/dist/cjs/session/GroupSession.d.ts +21 -10
- package/dist/cjs/session/GroupSession.d.ts.map +1 -1
- package/dist/cjs/session/GroupSession.js +37 -12
- package/dist/cjs/session/GroupSession.js.map +1 -1
- package/dist/cjs/session/NodeSession.d.ts +56 -50
- package/dist/cjs/session/NodeSession.d.ts.map +1 -1
- package/dist/cjs/session/NodeSession.js +95 -103
- package/dist/cjs/session/NodeSession.js.map +1 -1
- package/dist/cjs/session/SecureSession.d.ts +4 -4
- package/dist/cjs/session/SecureSession.d.ts.map +1 -1
- package/dist/cjs/session/SecureSession.js +1 -1
- package/dist/cjs/session/SecureSession.js.map +1 -1
- package/dist/cjs/session/Session.d.ts +82 -66
- package/dist/cjs/session/Session.d.ts.map +1 -1
- package/dist/cjs/session/Session.js +218 -45
- package/dist/cjs/session/Session.js.map +1 -1
- package/dist/cjs/session/SessionManager.d.ts +33 -36
- package/dist/cjs/session/SessionManager.d.ts.map +1 -1
- package/dist/cjs/session/SessionManager.js +112 -150
- package/dist/cjs/session/SessionManager.js.map +1 -1
- package/dist/cjs/session/SessionParameters.d.ts +87 -0
- package/dist/cjs/session/SessionParameters.d.ts.map +1 -0
- package/dist/cjs/session/SessionParameters.js +81 -0
- package/dist/cjs/session/SessionParameters.js.map +6 -0
- package/dist/{esm/session/InsecureSession.d.ts → cjs/session/UnsecuredSession.d.ts} +18 -16
- package/dist/cjs/session/UnsecuredSession.d.ts.map +1 -0
- package/dist/cjs/session/{InsecureSession.js → UnsecuredSession.js} +21 -21
- package/dist/cjs/session/UnsecuredSession.js.map +6 -0
- package/dist/cjs/session/case/CaseClient.d.ts.map +1 -1
- package/dist/cjs/session/case/CaseClient.js +6 -4
- package/dist/cjs/session/case/CaseClient.js.map +1 -1
- package/dist/cjs/session/case/CaseServer.d.ts.map +1 -1
- package/dist/cjs/session/case/CaseServer.js +14 -10
- package/dist/cjs/session/case/CaseServer.js.map +1 -1
- package/dist/cjs/session/index.d.ts +2 -1
- package/dist/cjs/session/index.d.ts.map +1 -1
- package/dist/cjs/session/index.js +2 -1
- package/dist/cjs/session/index.js.map +1 -1
- package/dist/cjs/session/pase/PaseClient.d.ts +3 -3
- package/dist/cjs/session/pase/PaseClient.d.ts.map +1 -1
- package/dist/cjs/session/pase/PaseClient.js +5 -3
- package/dist/cjs/session/pase/PaseClient.js.map +1 -1
- package/dist/cjs/session/pase/PaseServer.d.ts.map +1 -1
- package/dist/cjs/session/pase/PaseServer.js +13 -13
- package/dist/cjs/session/pase/PaseServer.js.map +1 -1
- package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.js +82 -34
- package/dist/esm/action/client/ClientInteraction.js.map +2 -2
- package/dist/esm/action/client/subscription/ClientSubscription.d.ts +10 -5
- package/dist/esm/action/client/subscription/ClientSubscription.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscription.js +22 -2
- package/dist/esm/action/client/subscription/ClientSubscription.js.map +2 -2
- package/dist/esm/action/client/subscription/ClientSubscriptionHandler.js +2 -3
- package/dist/esm/action/client/subscription/ClientSubscriptionHandler.js.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscriptions.d.ts +4 -2
- package/dist/esm/action/client/subscription/ClientSubscriptions.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscriptions.js +68 -8
- package/dist/esm/action/client/subscription/ClientSubscriptions.js.map +1 -1
- package/dist/esm/action/client/subscription/PeerSubscription.d.ts +0 -1
- package/dist/esm/action/client/subscription/PeerSubscription.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/PeerSubscription.js +1 -2
- package/dist/esm/action/client/subscription/PeerSubscription.js.map +1 -1
- package/dist/esm/action/client/subscription/SustainedSubscription.d.ts +0 -2
- package/dist/esm/action/client/subscription/SustainedSubscription.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/SustainedSubscription.js +2 -4
- package/dist/esm/action/client/subscription/SustainedSubscription.js.map +1 -1
- package/dist/esm/action/request/Invoke.js +2 -2
- package/dist/esm/action/request/Invoke.js.map +1 -1
- package/dist/esm/action/server/AttributeReadResponse.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeReadResponse.js +78 -25
- package/dist/esm/action/server/AttributeReadResponse.js.map +1 -1
- package/dist/esm/action/server/AttributeWriteResponse.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeWriteResponse.js +70 -17
- package/dist/esm/action/server/AttributeWriteResponse.js.map +1 -1
- package/dist/esm/action/server/CommandInvokeResponse.d.ts.map +1 -1
- package/dist/esm/action/server/CommandInvokeResponse.js +83 -30
- package/dist/esm/action/server/CommandInvokeResponse.js.map +1 -1
- package/dist/esm/action/server/DataResponse.d.ts +1 -0
- package/dist/esm/action/server/DataResponse.d.ts.map +1 -1
- package/dist/esm/action/server/DataResponse.js +3 -0
- package/dist/esm/action/server/DataResponse.js.map +1 -1
- package/dist/esm/action/server/ServerInteraction.d.ts.map +1 -1
- package/dist/esm/action/server/ServerInteraction.js +4 -4
- package/dist/esm/action/server/ServerInteraction.js.map +1 -1
- package/dist/esm/advertisement/Advertisement.d.ts.map +1 -1
- package/dist/esm/advertisement/Advertisement.js +66 -14
- package/dist/esm/advertisement/Advertisement.js.map +1 -1
- package/dist/esm/advertisement/Advertiser.d.ts +4 -1
- package/dist/esm/advertisement/Advertiser.d.ts.map +1 -1
- package/dist/esm/advertisement/Advertiser.js +63 -2
- package/dist/esm/advertisement/Advertiser.js.map +1 -1
- package/dist/esm/advertisement/ble/BleAdvertiser.d.ts +6 -1
- package/dist/esm/advertisement/ble/BleAdvertiser.d.ts.map +1 -1
- package/dist/esm/advertisement/ble/BleAdvertiser.js +1 -1
- package/dist/esm/advertisement/ble/BleAdvertiser.js.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertiser.d.ts +5 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertiser.d.ts.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertiser.js +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertiser.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/asn.js +2 -2
- package/dist/esm/certificate/kinds/definitions/asn.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/attestation.d.ts.map +1 -1
- package/dist/esm/cluster/client/AttributeClient.d.ts.map +1 -1
- package/dist/esm/cluster/client/AttributeClient.js +1 -1
- package/dist/esm/cluster/client/AttributeClient.js.map +1 -1
- package/dist/esm/codec/MessageCodec.d.ts +8 -1
- package/dist/esm/codec/MessageCodec.d.ts.map +1 -1
- package/dist/esm/codec/MessageCodec.js +39 -28
- package/dist/esm/codec/MessageCodec.js.map +2 -2
- package/dist/esm/common/FailsafeContext.d.ts +8 -9
- package/dist/esm/common/FailsafeContext.d.ts.map +1 -1
- package/dist/esm/common/FailsafeContext.js +27 -33
- package/dist/esm/common/FailsafeContext.js.map +1 -1
- package/dist/esm/common/FailsafeTimer.d.ts +4 -3
- package/dist/esm/common/FailsafeTimer.d.ts.map +1 -1
- package/dist/esm/common/FailsafeTimer.js +4 -4
- package/dist/esm/common/FailsafeTimer.js.map +1 -1
- package/dist/esm/common/Mark.d.ts +17 -0
- package/dist/esm/common/Mark.d.ts.map +1 -0
- package/dist/esm/common/Mark.js +18 -0
- package/dist/esm/common/Mark.js.map +6 -0
- package/dist/esm/common/index.d.ts +1 -0
- package/dist/esm/common/index.d.ts.map +1 -1
- package/dist/esm/common/index.js +1 -0
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/fabric/Fabric.d.ts +16 -8
- package/dist/esm/fabric/Fabric.d.ts.map +1 -1
- package/dist/esm/fabric/Fabric.js +36 -18
- package/dist/esm/fabric/Fabric.js.map +1 -1
- package/dist/esm/fabric/FabricAuthority.d.ts +2 -2
- package/dist/esm/fabric/FabricAuthority.d.ts.map +1 -1
- package/dist/esm/fabric/FabricAuthority.js +5 -5
- package/dist/esm/fabric/FabricAuthority.js.map +1 -1
- package/dist/esm/fabric/FabricManager.d.ts +10 -14
- package/dist/esm/fabric/FabricManager.d.ts.map +1 -1
- package/dist/esm/fabric/FabricManager.js +45 -40
- package/dist/esm/fabric/FabricManager.js.map +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interaction/AttributeDataEncoder.d.ts +1 -1
- package/dist/esm/interaction/InteractionClient.d.ts +2 -2
- package/dist/esm/interaction/InteractionClient.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionClient.js +39 -22
- package/dist/esm/interaction/InteractionClient.js.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.d.ts +2 -2
- package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.js +33 -28
- package/dist/esm/interaction/InteractionMessenger.js.map +1 -1
- package/dist/esm/interaction/Subscription.d.ts +16 -37
- package/dist/esm/interaction/Subscription.d.ts.map +1 -1
- package/dist/esm/interaction/Subscription.js +16 -69
- package/dist/esm/interaction/Subscription.js.map +2 -2
- package/dist/esm/interaction/SubscriptionClient.d.ts +2 -2
- package/dist/esm/interaction/SubscriptionClient.d.ts.map +1 -1
- package/dist/esm/interaction/SubscriptionClient.js +2 -2
- package/dist/esm/interaction/SubscriptionClient.js.map +1 -1
- package/dist/esm/mdns/MdnsClient.d.ts +10 -10
- package/dist/esm/mdns/MdnsClient.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsClient.js +166 -80
- package/dist/esm/mdns/MdnsClient.js.map +1 -1
- package/dist/esm/mdns/MdnsServer.d.ts +2 -2
- package/dist/esm/mdns/MdnsServer.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsServer.js +176 -94
- package/dist/esm/mdns/MdnsServer.js.map +2 -2
- package/dist/esm/mdns/MdnsService.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsService.js +3 -2
- package/dist/esm/mdns/MdnsService.js.map +1 -1
- package/dist/esm/mdns/MdnsSocket.d.ts +3 -2
- package/dist/esm/mdns/MdnsSocket.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsSocket.js +2 -1
- package/dist/esm/mdns/MdnsSocket.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.d.ts +2 -2
- package/dist/esm/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.js +26 -28
- package/dist/esm/peer/ControllerCommissioner.js.map +1 -1
- package/dist/esm/peer/ControllerDiscovery.d.ts +1 -1
- package/dist/esm/peer/ControllerDiscovery.d.ts.map +1 -1
- package/dist/esm/peer/ControllerDiscovery.js +1 -1
- package/dist/esm/peer/ControllerDiscovery.js.map +1 -1
- package/dist/esm/peer/Peer.d.ts +57 -0
- package/dist/esm/peer/Peer.d.ts.map +1 -0
- package/dist/esm/peer/Peer.js +162 -0
- package/dist/esm/peer/Peer.js.map +6 -0
- package/dist/esm/peer/PeerAddress.d.ts.map +1 -1
- package/dist/esm/peer/PeerAddress.js +5 -2
- package/dist/esm/peer/PeerAddress.js.map +1 -1
- package/dist/esm/peer/PeerAddressStore.d.ts +3 -3
- package/dist/esm/peer/PeerAddressStore.d.ts.map +1 -1
- package/dist/{cjs/peer/OperationalPeer.d.ts → esm/peer/PeerDescriptor.d.ts} +14 -7
- package/dist/esm/peer/PeerDescriptor.d.ts.map +1 -0
- package/dist/esm/peer/PeerDescriptor.js +51 -0
- package/dist/esm/peer/PeerDescriptor.js.map +6 -0
- package/dist/esm/peer/PeerSet.d.ts +23 -26
- package/dist/esm/peer/PeerSet.d.ts.map +1 -1
- package/dist/esm/peer/PeerSet.js +173 -175
- package/dist/esm/peer/PeerSet.js.map +2 -2
- package/dist/esm/peer/index.d.ts +1 -1
- package/dist/esm/peer/index.d.ts.map +1 -1
- package/dist/esm/peer/index.js +1 -1
- package/dist/esm/protocol/DeviceAdvertiser.js +4 -4
- package/dist/esm/protocol/DeviceAdvertiser.js.map +1 -1
- package/dist/esm/protocol/ExchangeManager.d.ts +6 -9
- package/dist/esm/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeManager.js +308 -251
- package/dist/esm/protocol/ExchangeManager.js.map +2 -2
- package/dist/esm/protocol/ExchangeProvider.d.ts +9 -11
- package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.js +81 -37
- package/dist/esm/protocol/ExchangeProvider.js.map +2 -2
- package/dist/esm/protocol/MessageChannel.d.ts +6 -7
- package/dist/esm/protocol/MessageChannel.d.ts.map +1 -1
- package/dist/esm/protocol/MessageChannel.js +22 -18
- package/dist/esm/protocol/MessageChannel.js.map +1 -1
- package/dist/esm/protocol/MessageCounter.d.ts +4 -4
- package/dist/esm/protocol/MessageCounter.d.ts.map +1 -1
- package/dist/esm/protocol/MessageCounter.js +7 -7
- package/dist/esm/protocol/MessageCounter.js.map +1 -1
- package/dist/esm/protocol/MessageExchange.d.ts +31 -20
- package/dist/esm/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/esm/protocol/MessageExchange.js +318 -238
- package/dist/esm/protocol/MessageExchange.js.map +2 -2
- package/dist/esm/protocol/ProtocolMocks.d.ts +100 -0
- package/dist/esm/protocol/ProtocolMocks.d.ts.map +1 -0
- package/dist/esm/protocol/ProtocolMocks.js +230 -0
- package/dist/esm/protocol/ProtocolMocks.js.map +6 -0
- package/dist/esm/protocol/errors.d.ts +35 -0
- package/dist/esm/protocol/errors.d.ts.map +1 -0
- package/dist/esm/protocol/errors.js +30 -0
- package/dist/esm/protocol/errors.js.map +6 -0
- package/dist/esm/protocol/index.d.ts +2 -1
- package/dist/esm/protocol/index.d.ts.map +1 -1
- package/dist/esm/protocol/index.js +2 -1
- package/dist/esm/protocol/index.js.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts +1 -0
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.js +3 -0
- package/dist/esm/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/esm/securechannel/SecureChannelProtocol.js +2 -2
- package/dist/esm/securechannel/SecureChannelProtocol.js.map +1 -1
- package/dist/esm/session/GroupSession.d.ts +21 -10
- package/dist/esm/session/GroupSession.d.ts.map +1 -1
- package/dist/esm/session/GroupSession.js +41 -12
- package/dist/esm/session/GroupSession.js.map +1 -1
- package/dist/esm/session/NodeSession.d.ts +56 -50
- package/dist/esm/session/NodeSession.d.ts.map +1 -1
- package/dist/esm/session/NodeSession.js +99 -105
- package/dist/esm/session/NodeSession.js.map +1 -1
- package/dist/esm/session/SecureSession.d.ts +4 -4
- package/dist/esm/session/SecureSession.d.ts.map +1 -1
- package/dist/esm/session/SecureSession.js +1 -1
- package/dist/esm/session/SecureSession.js.map +1 -1
- package/dist/esm/session/Session.d.ts +82 -66
- package/dist/esm/session/Session.d.ts.map +1 -1
- package/dist/esm/session/Session.js +223 -45
- package/dist/esm/session/Session.js.map +1 -1
- package/dist/esm/session/SessionManager.d.ts +33 -36
- package/dist/esm/session/SessionManager.d.ts.map +1 -1
- package/dist/esm/session/SessionManager.js +113 -157
- package/dist/esm/session/SessionManager.js.map +1 -1
- package/dist/esm/session/SessionParameters.d.ts +87 -0
- package/dist/esm/session/SessionParameters.d.ts.map +1 -0
- package/dist/esm/session/SessionParameters.js +61 -0
- package/dist/esm/session/SessionParameters.js.map +6 -0
- package/dist/{cjs/session/InsecureSession.d.ts → esm/session/UnsecuredSession.d.ts} +18 -16
- package/dist/esm/session/UnsecuredSession.d.ts.map +1 -0
- package/dist/esm/session/{InsecureSession.js → UnsecuredSession.js} +18 -18
- package/dist/esm/session/UnsecuredSession.js.map +6 -0
- package/dist/esm/session/case/CaseClient.d.ts.map +1 -1
- package/dist/esm/session/case/CaseClient.js +5 -3
- package/dist/esm/session/case/CaseClient.js.map +1 -1
- package/dist/esm/session/case/CaseServer.d.ts.map +1 -1
- package/dist/esm/session/case/CaseServer.js +14 -10
- package/dist/esm/session/case/CaseServer.js.map +1 -1
- package/dist/esm/session/index.d.ts +2 -1
- package/dist/esm/session/index.d.ts.map +1 -1
- package/dist/esm/session/index.js +2 -1
- package/dist/esm/session/index.js.map +1 -1
- package/dist/esm/session/pase/PaseClient.d.ts +3 -3
- package/dist/esm/session/pase/PaseClient.d.ts.map +1 -1
- package/dist/esm/session/pase/PaseClient.js +5 -3
- package/dist/esm/session/pase/PaseClient.js.map +1 -1
- package/dist/esm/session/pase/PaseServer.d.ts.map +1 -1
- package/dist/esm/session/pase/PaseServer.js +13 -13
- package/dist/esm/session/pase/PaseServer.js.map +1 -1
- package/package.json +6 -6
- package/src/action/client/ClientInteraction.ts +47 -13
- package/src/action/client/subscription/ClientSubscription.ts +30 -5
- package/src/action/client/subscription/ClientSubscriptionHandler.ts +2 -4
- package/src/action/client/subscription/ClientSubscriptions.ts +14 -3
- package/src/action/client/subscription/PeerSubscription.ts +2 -2
- package/src/action/client/subscription/SustainedSubscription.ts +2 -6
- package/src/action/request/Invoke.ts +2 -2
- package/src/action/server/AttributeReadResponse.ts +2 -0
- package/src/action/server/AttributeWriteResponse.ts +2 -0
- package/src/action/server/CommandInvokeResponse.ts +1 -0
- package/src/action/server/DataResponse.ts +4 -0
- package/src/action/server/ServerInteraction.ts +4 -4
- package/src/advertisement/Advertisement.ts +6 -7
- package/src/advertisement/Advertiser.ts +12 -1
- package/src/advertisement/ble/BleAdvertiser.ts +7 -2
- package/src/advertisement/mdns/MdnsAdvertiser.ts +7 -1
- package/src/certificate/kinds/definitions/asn.ts +2 -2
- package/src/certificate/kinds/definitions/attestation.ts +1 -0
- package/src/cluster/client/AttributeClient.ts +1 -1
- package/src/codec/MessageCodec.ts +39 -32
- package/src/common/FailsafeContext.ts +36 -39
- package/src/common/FailsafeTimer.ts +7 -6
- package/src/common/Mark.ts +17 -0
- package/src/common/index.ts +1 -0
- package/src/fabric/Fabric.ts +51 -23
- package/src/fabric/FabricAuthority.ts +4 -4
- package/src/fabric/FabricManager.ts +53 -40
- package/src/index.ts +3 -1
- package/src/interaction/InteractionClient.ts +40 -23
- package/src/interaction/InteractionMessenger.ts +38 -32
- package/src/interaction/Subscription.ts +20 -92
- package/src/interaction/SubscriptionClient.ts +3 -3
- package/src/mdns/MdnsClient.ts +20 -3
- package/src/mdns/MdnsServer.ts +13 -1
- package/src/mdns/MdnsService.ts +3 -2
- package/src/mdns/MdnsSocket.ts +9 -3
- package/src/peer/ControllerCommissioner.ts +35 -37
- package/src/peer/ControllerDiscovery.ts +1 -1
- package/src/peer/Peer.ts +161 -0
- package/src/peer/PeerAddress.ts +6 -2
- package/src/peer/PeerAddressStore.ts +3 -3
- package/src/peer/PeerDescriptor.ts +89 -0
- package/src/peer/PeerSet.ts +145 -213
- package/src/peer/index.ts +1 -1
- package/src/protocol/DeviceAdvertiser.ts +4 -4
- package/src/protocol/ExchangeManager.ts +161 -181
- package/src/protocol/ExchangeProvider.ts +31 -40
- package/src/protocol/MessageChannel.ts +29 -18
- package/src/protocol/MessageCounter.ts +8 -8
- package/src/protocol/MessageExchange.ts +181 -144
- package/src/protocol/ProtocolMocks.ts +302 -0
- package/src/protocol/errors.ts +44 -0
- package/src/protocol/index.ts +2 -1
- package/src/securechannel/SecureChannelMessenger.ts +4 -0
- package/src/securechannel/SecureChannelProtocol.ts +2 -2
- package/src/session/GroupSession.ts +67 -23
- package/src/session/NodeSession.ts +140 -136
- package/src/session/SecureSession.ts +6 -5
- package/src/session/Session.ts +234 -101
- package/src/session/SessionManager.ts +148 -187
- package/src/session/SessionParameters.ts +108 -0
- package/src/session/{InsecureSession.ts → UnsecuredSession.ts} +28 -26
- package/src/session/case/CaseClient.ts +6 -3
- package/src/session/case/CaseServer.ts +15 -11
- package/src/session/index.ts +2 -1
- package/src/session/pase/PaseClient.ts +12 -5
- package/src/session/pase/PaseServer.ts +14 -13
- package/dist/cjs/peer/OperationalPeer.d.ts.map +0 -1
- package/dist/cjs/peer/OperationalPeer.js.map +0 -6
- package/dist/cjs/protocol/ChannelManager.d.ts +0 -29
- package/dist/cjs/protocol/ChannelManager.d.ts.map +0 -1
- package/dist/cjs/protocol/ChannelManager.js +0 -178
- package/dist/cjs/protocol/ChannelManager.js.map +0 -6
- package/dist/cjs/session/InsecureSession.d.ts.map +0 -1
- package/dist/cjs/session/InsecureSession.js.map +0 -6
- package/dist/esm/peer/OperationalPeer.d.ts +0 -38
- package/dist/esm/peer/OperationalPeer.d.ts.map +0 -1
- package/dist/esm/peer/OperationalPeer.js +0 -6
- package/dist/esm/peer/OperationalPeer.js.map +0 -6
- package/dist/esm/protocol/ChannelManager.d.ts +0 -29
- package/dist/esm/protocol/ChannelManager.d.ts.map +0 -1
- package/dist/esm/protocol/ChannelManager.js +0 -158
- package/dist/esm/protocol/ChannelManager.js.map +0 -6
- package/dist/esm/session/InsecureSession.d.ts.map +0 -1
- package/dist/esm/session/InsecureSession.js.map +0 -6
- package/src/protocol/ChannelManager.ts +0 -180
|
@@ -13,6 +13,7 @@ import { Write } from "#action/request/Write.js";
|
|
|
13
13
|
import { DecodedInvokeResult, InvokeResult } from "#action/response/InvokeResult.js";
|
|
14
14
|
import { ReadResult } from "#action/response/ReadResult.js";
|
|
15
15
|
import { WriteResult } from "#action/response/WriteResult.js";
|
|
16
|
+
import { Mark } from "#common/Mark.js";
|
|
16
17
|
import {
|
|
17
18
|
Abort,
|
|
18
19
|
BasicSet,
|
|
@@ -22,12 +23,14 @@ import {
|
|
|
22
23
|
Environment,
|
|
23
24
|
ImplementationError,
|
|
24
25
|
isObject,
|
|
26
|
+
Lifetime,
|
|
25
27
|
Logger,
|
|
26
28
|
Minutes,
|
|
27
29
|
RetrySchedule,
|
|
28
30
|
Seconds,
|
|
29
31
|
} from "#general";
|
|
30
32
|
import { InteractionClientMessenger, MessageType } from "#interaction/InteractionMessenger.js";
|
|
33
|
+
import { Subscription } from "#interaction/Subscription.js";
|
|
31
34
|
import { ExchangeProvider } from "#protocol/ExchangeProvider.js";
|
|
32
35
|
import { SecureSession } from "#session/SecureSession.js";
|
|
33
36
|
import { Status, TlvAttributeReport, TlvNoResponse, TlvSubscribeResponse, TypeFromSchema } from "#types";
|
|
@@ -65,6 +68,7 @@ const DEFAULT_MINIMUM_RESPONSE_TIMEOUT_WITH_FAILSAFE = Seconds(30);
|
|
|
65
68
|
export class ClientInteraction<
|
|
66
69
|
SessionT extends InteractionSession = InteractionSession,
|
|
67
70
|
> implements Interactable<SessionT> {
|
|
71
|
+
readonly #lifetime: Lifetime;
|
|
68
72
|
readonly #exchanges: ExchangeProvider;
|
|
69
73
|
readonly #subscriptions: ClientSubscriptions;
|
|
70
74
|
readonly #interactions = new BasicSet<Read | Write | Invoke | Subscribe>();
|
|
@@ -79,6 +83,17 @@ export class ClientInteraction<
|
|
|
79
83
|
environment.get(Entropy),
|
|
80
84
|
RetrySchedule.Configuration(SustainedSubscription.DefaultRetrySchedule, sustainRetries),
|
|
81
85
|
);
|
|
86
|
+
|
|
87
|
+
this.#lifetime = environment.join("interactions");
|
|
88
|
+
Object.defineProperties(this.#lifetime.details, {
|
|
89
|
+
"# active": {
|
|
90
|
+
get: () => {
|
|
91
|
+
return this.#interactions.size;
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
enumerable: true,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
82
97
|
}
|
|
83
98
|
|
|
84
99
|
get session() {
|
|
@@ -86,6 +101,8 @@ export class ClientInteraction<
|
|
|
86
101
|
}
|
|
87
102
|
|
|
88
103
|
async close() {
|
|
104
|
+
using _closing = this.#lifetime.closing();
|
|
105
|
+
|
|
89
106
|
this.#abort();
|
|
90
107
|
|
|
91
108
|
while (this.#interactions.size) {
|
|
@@ -108,10 +125,10 @@ export class ClientInteraction<
|
|
|
108
125
|
);
|
|
109
126
|
}
|
|
110
127
|
|
|
111
|
-
await using context = await this.#begin(request, session);
|
|
128
|
+
await using context = await this.#begin("reading", request, session);
|
|
112
129
|
const { checkAbort, messenger } = context;
|
|
113
130
|
|
|
114
|
-
logger.debug("Read
|
|
131
|
+
logger.debug("Read", Mark.OUTBOUND, messenger.exchange.via, request);
|
|
115
132
|
await messenger.sendReadRequest(request);
|
|
116
133
|
checkAbort();
|
|
117
134
|
|
|
@@ -128,7 +145,8 @@ export class ClientInteraction<
|
|
|
128
145
|
}
|
|
129
146
|
|
|
130
147
|
logger.debug(
|
|
131
|
-
"Read
|
|
148
|
+
"Read",
|
|
149
|
+
Mark.INBOUND,
|
|
132
150
|
messenger.exchange.via,
|
|
133
151
|
Diagnostic.weak(
|
|
134
152
|
attributeReportCount + eventReportCount === 0
|
|
@@ -145,7 +163,7 @@ export class ClientInteraction<
|
|
|
145
163
|
* You must check each {@link WriteResult.AttributeStatus} to determine whether individual updates failed.
|
|
146
164
|
*/
|
|
147
165
|
async write<T extends Write>(request: T, session?: SessionT): WriteResult<T> {
|
|
148
|
-
await using context = await this.#begin(request, session);
|
|
166
|
+
await using context = await this.#begin("writing", request, session);
|
|
149
167
|
const { checkAbort, messenger } = context;
|
|
150
168
|
|
|
151
169
|
if (request.timedRequest) {
|
|
@@ -153,7 +171,7 @@ export class ClientInteraction<
|
|
|
153
171
|
checkAbort();
|
|
154
172
|
}
|
|
155
173
|
|
|
156
|
-
logger.info("Write
|
|
174
|
+
logger.info("Write", Mark.OUTBOUND, messenger.exchange.via, request);
|
|
157
175
|
|
|
158
176
|
const response = await messenger.sendWriteCommand(request);
|
|
159
177
|
checkAbort();
|
|
@@ -192,7 +210,8 @@ export class ClientInteraction<
|
|
|
192
210
|
) as Awaited<WriteResult<T>>;
|
|
193
211
|
|
|
194
212
|
logger.info(
|
|
195
|
-
"Write
|
|
213
|
+
"Write",
|
|
214
|
+
Mark.INBOUND,
|
|
196
215
|
messenger.exchange.via,
|
|
197
216
|
Diagnostic.weak(
|
|
198
217
|
successCount + failureCount === 0
|
|
@@ -208,7 +227,7 @@ export class ClientInteraction<
|
|
|
208
227
|
* Invoke one or more commands.
|
|
209
228
|
*/
|
|
210
229
|
async *invoke(request: ClientInvoke, session?: SessionT): DecodedInvokeResult {
|
|
211
|
-
await using context = await this.#begin(request, session);
|
|
230
|
+
await using context = await this.#begin("invoking", request, session);
|
|
212
231
|
const { checkAbort, messenger } = context;
|
|
213
232
|
|
|
214
233
|
if (request.timedRequest) {
|
|
@@ -217,7 +236,8 @@ export class ClientInteraction<
|
|
|
217
236
|
}
|
|
218
237
|
|
|
219
238
|
logger.info(
|
|
220
|
-
"Invoke
|
|
239
|
+
"Invoke",
|
|
240
|
+
Mark.OUTBOUND,
|
|
221
241
|
messenger.exchange.via,
|
|
222
242
|
Diagnostic.asFlags({ suppressResponse: request.suppressResponse, timed: request.timedRequest }),
|
|
223
243
|
request,
|
|
@@ -259,7 +279,8 @@ export class ClientInteraction<
|
|
|
259
279
|
commandFields === undefined ? undefined : responseSchema.decodeTlv(commandFields);
|
|
260
280
|
|
|
261
281
|
logger.info(
|
|
262
|
-
"Invoke
|
|
282
|
+
"Invoke",
|
|
283
|
+
Mark.INBOUND,
|
|
263
284
|
messenger.exchange.via,
|
|
264
285
|
Diagnostic.strong(resolvePathForSpecifier(cmd)),
|
|
265
286
|
isObject(data) ? Diagnostic.dict(data) : Diagnostic.weak("(no payload)"),
|
|
@@ -320,7 +341,7 @@ export class ClientInteraction<
|
|
|
320
341
|
if (!request.keepSubscriptions) {
|
|
321
342
|
for (const subscription of this.#subscriptions) {
|
|
322
343
|
logger.debug(
|
|
323
|
-
`Removing subscription with ID ${subscription
|
|
344
|
+
`Removing subscription with ID ${Subscription.idStrOf(subscription)} because new subscription replaces it`,
|
|
324
345
|
);
|
|
325
346
|
subscription.close();
|
|
326
347
|
}
|
|
@@ -343,7 +364,7 @@ export class ClientInteraction<
|
|
|
343
364
|
const peer = this.#exchanges.session.peerAddress;
|
|
344
365
|
|
|
345
366
|
const subscribe = async (request: ClientSubscribe) => {
|
|
346
|
-
await using context = await this.#begin(request, session);
|
|
367
|
+
await using context = await this.#begin("subscribing", request, session);
|
|
347
368
|
const { checkAbort, messenger } = context;
|
|
348
369
|
|
|
349
370
|
logger.info(
|
|
@@ -371,7 +392,8 @@ export class ClientInteraction<
|
|
|
371
392
|
const response = TlvSubscribeResponse.decode(responseMessage.payload);
|
|
372
393
|
|
|
373
394
|
logger.info(
|
|
374
|
-
"Subscription successful
|
|
395
|
+
"Subscription successful",
|
|
396
|
+
Mark.INBOUND,
|
|
375
397
|
messenger.exchange.via,
|
|
376
398
|
Diagnostic.dict({
|
|
377
399
|
id: response.subscriptionId,
|
|
@@ -380,6 +402,7 @@ export class ClientInteraction<
|
|
|
380
402
|
);
|
|
381
403
|
|
|
382
404
|
const subscription = new PeerSubscription({
|
|
405
|
+
lifetime: this.#subscriptions,
|
|
383
406
|
request,
|
|
384
407
|
peer,
|
|
385
408
|
closed: () => this.#subscriptions.delete(subscription),
|
|
@@ -394,6 +417,7 @@ export class ClientInteraction<
|
|
|
394
417
|
let subscription: ClientSubscription;
|
|
395
418
|
if (request.sustain) {
|
|
396
419
|
subscription = new SustainedSubscription({
|
|
420
|
+
lifetime: this.#subscriptions,
|
|
397
421
|
subscribe,
|
|
398
422
|
peer,
|
|
399
423
|
closed: () => this.#subscriptions.delete(subscription),
|
|
@@ -423,7 +447,9 @@ export class ClientInteraction<
|
|
|
423
447
|
}
|
|
424
448
|
}
|
|
425
449
|
|
|
426
|
-
async #begin(request: Read | Write | Invoke | Subscribe, session: SessionT | undefined) {
|
|
450
|
+
async #begin(what: string, request: Read | Write | Invoke | Subscribe, session: SessionT | undefined) {
|
|
451
|
+
using lifetime = this.#lifetime.join(what);
|
|
452
|
+
|
|
427
453
|
if (this.#abort.aborted) {
|
|
428
454
|
throw new ImplementationError("Client interaction unavailable after close");
|
|
429
455
|
}
|
|
@@ -433,10 +459,18 @@ export class ClientInteraction<
|
|
|
433
459
|
|
|
434
460
|
const messenger = await InteractionClientMessenger.create(this.#exchanges);
|
|
435
461
|
|
|
462
|
+
// Provide via dynamically so is up-to-date if exchange changes due to retry
|
|
463
|
+
Object.defineProperty(lifetime.details, "via", {
|
|
464
|
+
get() {
|
|
465
|
+
return messenger.exchange.via;
|
|
466
|
+
},
|
|
467
|
+
});
|
|
468
|
+
|
|
436
469
|
const context: RequestContext = {
|
|
437
470
|
checkAbort,
|
|
438
471
|
messenger,
|
|
439
472
|
[Symbol.asyncDispose]: async () => {
|
|
473
|
+
using _closing = lifetime.closing();
|
|
440
474
|
await messenger.close();
|
|
441
475
|
this.#interactions.delete(request);
|
|
442
476
|
},
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
import type { Subscribe } from "#action/request/Subscribe.js";
|
|
8
8
|
import type { ActiveSubscription } from "#action/response/SubscribeResult.js";
|
|
9
|
-
import { Abort, Diagnostic, Logger } from "#general";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { Abort, decamelize, Diagnostic, Lifetime, Logger } from "#general";
|
|
10
|
+
import type { SubscriptionId } from "#interaction/Subscription.js";
|
|
11
|
+
import type { PeerAddress } from "#peer/PeerAddress.js";
|
|
12
|
+
import type { ClientSubscribe } from "./ClientSubscribe.js";
|
|
12
13
|
|
|
13
14
|
const logger = Logger.get("ClientSubscription");
|
|
14
15
|
|
|
@@ -18,7 +19,6 @@ const logger = Logger.get("ClientSubscription");
|
|
|
18
19
|
export abstract class ClientSubscription implements ActiveSubscription {
|
|
19
20
|
readonly request: Subscribe;
|
|
20
21
|
readonly peer: PeerAddress;
|
|
21
|
-
abstract subscriptionId: number;
|
|
22
22
|
abstract maxInterval: number;
|
|
23
23
|
abstract interactionModelRevision: number;
|
|
24
24
|
|
|
@@ -27,11 +27,14 @@ export abstract class ClientSubscription implements ActiveSubscription {
|
|
|
27
27
|
*/
|
|
28
28
|
done?: Promise<void>;
|
|
29
29
|
|
|
30
|
+
readonly #lifetime: Lifetime;
|
|
30
31
|
readonly #closed: () => void;
|
|
31
32
|
readonly #abort: Abort;
|
|
32
33
|
#isClosed = false;
|
|
34
|
+
#id: SubscriptionId = -1;
|
|
33
35
|
|
|
34
|
-
constructor({ request, peer, closed, abort }: ClientSubscription.Configuration) {
|
|
36
|
+
constructor({ request, peer, closed, abort, lifetime }: ClientSubscription.Configuration) {
|
|
37
|
+
this.#lifetime = lifetime.join(this.kind);
|
|
35
38
|
this.request = request;
|
|
36
39
|
this.peer = peer;
|
|
37
40
|
this.#closed = closed;
|
|
@@ -41,10 +44,26 @@ export abstract class ClientSubscription implements ActiveSubscription {
|
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
|
|
47
|
+
get kind() {
|
|
48
|
+
return decamelize(this.constructor.name.replace(/Subscription$/, ""), " ");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
get subscriptionId() {
|
|
52
|
+
return this.#id;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
set subscriptionId(id: SubscriptionId) {
|
|
56
|
+
this.#id = id;
|
|
57
|
+
this.#lifetime.name = [this.kind, Diagnostic.strong(id)];
|
|
58
|
+
}
|
|
59
|
+
|
|
44
60
|
close() {
|
|
45
61
|
if (this.#isClosed) {
|
|
46
62
|
return;
|
|
47
63
|
}
|
|
64
|
+
|
|
65
|
+
const closing = this.#lifetime.closing();
|
|
66
|
+
|
|
48
67
|
this.#isClosed = true;
|
|
49
68
|
|
|
50
69
|
this.#abort();
|
|
@@ -58,6 +77,7 @@ export abstract class ClientSubscription implements ActiveSubscription {
|
|
|
58
77
|
this.done
|
|
59
78
|
.finally(() => {
|
|
60
79
|
this.request.closed?.();
|
|
80
|
+
closing[Symbol.dispose]();
|
|
61
81
|
})
|
|
62
82
|
.catch(unhandledError);
|
|
63
83
|
} else {
|
|
@@ -65,6 +85,8 @@ export abstract class ClientSubscription implements ActiveSubscription {
|
|
|
65
85
|
this.request.closed?.();
|
|
66
86
|
} catch (e) {
|
|
67
87
|
unhandledError(e);
|
|
88
|
+
} finally {
|
|
89
|
+
closing[Symbol.dispose]();
|
|
68
90
|
}
|
|
69
91
|
}
|
|
70
92
|
}
|
|
@@ -79,10 +101,13 @@ export abstract class ClientSubscription implements ActiveSubscription {
|
|
|
79
101
|
}
|
|
80
102
|
|
|
81
103
|
export namespace ClientSubscription {
|
|
104
|
+
export const NO_SUBSCRIPTION = -1;
|
|
105
|
+
|
|
82
106
|
export interface Configuration {
|
|
83
107
|
request: ClientSubscribe;
|
|
84
108
|
peer: PeerAddress;
|
|
85
109
|
closed: () => void;
|
|
110
|
+
lifetime: Lifetime.Owner;
|
|
86
111
|
abort?: AbortSignal;
|
|
87
112
|
}
|
|
88
113
|
}
|
|
@@ -8,7 +8,7 @@ import { ReadResult } from "#action/response/ReadResult.js";
|
|
|
8
8
|
import { Diagnostic, InternalError, Logger } from "#general";
|
|
9
9
|
import { DecodedDataReport } from "#interaction/DecodedDataReport.js";
|
|
10
10
|
import { IncomingInteractionClientMessenger } from "#interaction/InteractionMessenger.js";
|
|
11
|
-
import { SubscriptionId } from "#interaction/Subscription.js";
|
|
11
|
+
import { Subscription, SubscriptionId } from "#interaction/Subscription.js";
|
|
12
12
|
import { MessageExchange } from "#protocol/MessageExchange.js";
|
|
13
13
|
import { ProtocolHandler } from "#protocol/ProtocolHandler.js";
|
|
14
14
|
import { SecureSession } from "#session/SecureSession.js";
|
|
@@ -94,9 +94,7 @@ export class ClientSubscriptionHandler implements ProtocolHandler {
|
|
|
94
94
|
async function sendInvalid(messenger: IncomingInteractionClientMessenger, subscriptionId?: SubscriptionId) {
|
|
95
95
|
await messenger.sendStatus(Status.InvalidSubscription, {
|
|
96
96
|
multipleMessageInteraction: true,
|
|
97
|
-
logContext:
|
|
98
|
-
subId: subscriptionId,
|
|
99
|
-
},
|
|
97
|
+
logContext: Subscription.diagnosticOf(subscriptionId),
|
|
100
98
|
});
|
|
101
99
|
await messenger.close();
|
|
102
100
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { ReadResult } from "#action/response/ReadResult.js";
|
|
8
8
|
import type { ActiveSubscription } from "#action/response/SubscribeResult.js";
|
|
9
|
-
import { BasicSet, Environment, Environmental, Millis, Time, Timer, Timestamp } from "#general";
|
|
9
|
+
import { BasicSet, Environment, Environmental, Lifetime, Millis, Time, Timer, Timestamp } from "#general";
|
|
10
10
|
import { SubscriptionId } from "#interaction/Subscription.js";
|
|
11
11
|
import { PeerAddress } from "#peer/PeerAddress.js";
|
|
12
12
|
import { ClientSubscription } from "./ClientSubscription.js";
|
|
@@ -15,17 +15,26 @@ import type { PeerSubscription } from "./PeerSubscription.js";
|
|
|
15
15
|
/**
|
|
16
16
|
* A managed set of {@link ActiveSubscription} instances.
|
|
17
17
|
*/
|
|
18
|
-
export class ClientSubscriptions {
|
|
18
|
+
export class ClientSubscriptions implements Lifetime.Owner {
|
|
19
|
+
#lifetime: Lifetime;
|
|
19
20
|
#active = new BasicSet<ClientSubscription>();
|
|
20
21
|
#peers = new Map<PeerAddress, Map<number, PeerSubscription>>();
|
|
21
22
|
#timeout?: Timer;
|
|
22
23
|
|
|
24
|
+
constructor(lifetime: Lifetime.Owner) {
|
|
25
|
+
this.#lifetime = lifetime.join("client subscriptions");
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
static [Environmental.create](env: Environment) {
|
|
24
|
-
const instance = new ClientSubscriptions();
|
|
29
|
+
const instance = new ClientSubscriptions(env);
|
|
25
30
|
env.set(ClientSubscriptions, instance);
|
|
26
31
|
return instance;
|
|
27
32
|
}
|
|
28
33
|
|
|
34
|
+
join(...name: unknown[]) {
|
|
35
|
+
return this.#lifetime.join(...name);
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
/**
|
|
30
39
|
* Register a user-facing {@link ClientSubscription}.
|
|
31
40
|
*/
|
|
@@ -77,6 +86,8 @@ export class ClientSubscriptions {
|
|
|
77
86
|
* Terminate all subscriptions.
|
|
78
87
|
*/
|
|
79
88
|
async close() {
|
|
89
|
+
using _closing = this.#lifetime.closing();
|
|
90
|
+
|
|
80
91
|
if (this.#timeout) {
|
|
81
92
|
this.#timeout.stop();
|
|
82
93
|
this.#timeout = undefined;
|
|
@@ -14,15 +14,15 @@ import { ClientSubscription } from "./ClientSubscription.js";
|
|
|
14
14
|
export class PeerSubscription extends ClientSubscription {
|
|
15
15
|
readonly interactionModelRevision: number;
|
|
16
16
|
readonly maxInterval: number;
|
|
17
|
-
readonly subscriptionId: number;
|
|
18
17
|
isReading = false;
|
|
19
18
|
|
|
20
19
|
timeoutAt?: Timestamp;
|
|
21
20
|
|
|
22
21
|
constructor(config: PeerSubscription.Configuration) {
|
|
22
|
+
const { subscriptionId, interactionModelRevision, maxInterval } = config.response;
|
|
23
|
+
|
|
23
24
|
super(config);
|
|
24
25
|
|
|
25
|
-
const { subscriptionId, interactionModelRevision, maxInterval } = config.response;
|
|
26
26
|
this.subscriptionId = subscriptionId;
|
|
27
27
|
this.interactionModelRevision = interactionModelRevision;
|
|
28
28
|
this.maxInterval = maxInterval;
|
|
@@ -81,6 +81,7 @@ export class SustainedSubscription extends ClientSubscription {
|
|
|
81
81
|
const closed = new Promise<void>(resolve => {
|
|
82
82
|
request.closed = () => {
|
|
83
83
|
this.#subscription = undefined;
|
|
84
|
+
this.subscriptionId = ClientSubscription.NO_SUBSCRIPTION;
|
|
84
85
|
resolve();
|
|
85
86
|
};
|
|
86
87
|
});
|
|
@@ -89,6 +90,7 @@ export class SustainedSubscription extends ClientSubscription {
|
|
|
89
90
|
for (const retry of this.#retries) {
|
|
90
91
|
try {
|
|
91
92
|
this.#subscription = await this.#subscribe(request);
|
|
93
|
+
this.subscriptionId = this.#subscription.subscriptionId;
|
|
92
94
|
break;
|
|
93
95
|
} catch (e) {
|
|
94
96
|
if (this.abort.aborted) {
|
|
@@ -146,10 +148,6 @@ export class SustainedSubscription extends ClientSubscription {
|
|
|
146
148
|
get maxInterval() {
|
|
147
149
|
return this.#subscription?.maxInterval ?? Hours.one;
|
|
148
150
|
}
|
|
149
|
-
|
|
150
|
-
get subscriptionId() {
|
|
151
|
-
return this.#subscription?.subscriptionId ?? SustainedSubscription.NO_SUBSCRIPTION;
|
|
152
|
-
}
|
|
153
151
|
}
|
|
154
152
|
|
|
155
153
|
export namespace SustainedSubscription {
|
|
@@ -177,8 +175,6 @@ export namespace SustainedSubscription {
|
|
|
177
175
|
}
|
|
178
176
|
}
|
|
179
177
|
|
|
180
|
-
export const NO_SUBSCRIPTION = -1;
|
|
181
|
-
|
|
182
178
|
export const DefaultRetrySchedule: RetrySchedule.Configuration = {
|
|
183
179
|
// Protocol-level level happens at the exchange level and is faster; this is an application-level retry. Retry
|
|
184
180
|
// more slowly so we do not hammer devices that are experiencing transient errors
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Diagnostic, Duration, isObject } from "#general";
|
|
8
|
-
import {
|
|
8
|
+
import { SessionParameters } from "#session/SessionParameters.js";
|
|
9
9
|
import { ClusterType, CommandData, FabricIndex, InvokeRequest, ObjectSchema, TlvSchema, TypeFromSchema } from "#types";
|
|
10
10
|
import { MalformedRequestError } from "./MalformedRequestError.js";
|
|
11
11
|
import { resolvePathForSpecifier, Specifier } from "./Specifier.js";
|
|
@@ -58,7 +58,7 @@ export function Invoke(
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
const {
|
|
61
|
-
interactionModelRevision =
|
|
61
|
+
interactionModelRevision = SessionParameters.fallbacks.interactionModelRevision,
|
|
62
62
|
suppressResponse = false,
|
|
63
63
|
timeout,
|
|
64
64
|
expectedProcessingTime,
|
|
@@ -64,6 +64,8 @@ export class AttributeReadResponse<
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
*process({ dataVersionFilters, attributeRequests }: Read.Attributes): Generator<ReadResult.Chunk, void, void> {
|
|
67
|
+
using _reading = this.join("reading attributes");
|
|
68
|
+
|
|
67
69
|
const nodeId = hasLocalActor(this.session) ? NodeId.UNSPECIFIED_NODE_ID : this.nodeId;
|
|
68
70
|
|
|
69
71
|
// Index versions
|
|
@@ -53,6 +53,8 @@ export class AttributeWriteResponse<
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
async process<T extends Write>({ writeRequests, suppressResponse }: T): WriteResult<T> {
|
|
56
|
+
using _writing = this.join("writing");
|
|
57
|
+
|
|
56
58
|
const writeResponses = new Array<WriteResult.AttributeStatus>();
|
|
57
59
|
for (const { path, data, dataVersion } of writeRequests) {
|
|
58
60
|
if (path.endpointId === undefined || path.clusterId === undefined || path.attributeId === undefined) {
|
|
@@ -53,6 +53,10 @@ export abstract class DataResponse<SessionT extends InteractionSession = Interac
|
|
|
53
53
|
return this.#cachedNodeId;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
protected join(...name: unknown[]) {
|
|
57
|
+
return this.#session.transaction?.join(...name);
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
abstract counts: {
|
|
57
61
|
/**
|
|
58
62
|
* Number of existent entries that were processed. Not all must have had data to send.
|
|
@@ -65,17 +65,17 @@ export class ServerInteraction<
|
|
|
65
65
|
throw new NotImplementedError();
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
write<T extends Write>(request: T, session: SessionT): WriteResult<T> {
|
|
68
|
+
async write<T extends Write>(request: T, session: SessionT): WriteResult<T> {
|
|
69
69
|
// TODO - validate request
|
|
70
70
|
|
|
71
71
|
const writer = new AttributeWriteResponse(this.#node, session);
|
|
72
|
-
return writer.process(request);
|
|
72
|
+
return await writer.process(request);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
invoke(request: Invoke, session: SessionT): InvokeResult {
|
|
75
|
+
async *invoke(request: Invoke, session: SessionT): InvokeResult {
|
|
76
76
|
// TODO - validate request
|
|
77
77
|
|
|
78
78
|
const invoker = new CommandInvokeResponse(this.#node, session);
|
|
79
|
-
|
|
79
|
+
yield* invoker.process(request);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -257,13 +257,12 @@ export abstract class Advertisement<T extends ServiceDescription = ServiceDescri
|
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
async #run(context: ActivityContext, event: Advertiser.BroadcastEvent
|
|
261
|
-
//
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
logger.debug("Begin auto broadcast", this.dict());
|
|
260
|
+
async #run(context: ActivityContext, event: Advertiser.BroadcastEvent) {
|
|
261
|
+
// Diagnostics
|
|
262
|
+
const dict = this.dict();
|
|
263
|
+
using advertising = this.advertiser.join("advertising");
|
|
264
|
+
Object.assign(advertising.details, dict);
|
|
265
|
+
logger.debug("Begin auto broadcast", dict);
|
|
267
266
|
|
|
268
267
|
// Perform advertisement
|
|
269
268
|
try {
|
|
@@ -5,16 +5,22 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { Fabric } from "#fabric/Fabric.js";
|
|
8
|
+
import { Lifetime } from "@matter/general";
|
|
8
9
|
import { Advertisement } from "./Advertisement.js";
|
|
9
10
|
import type { ServiceDescription } from "./ServiceDescription.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* A component that advertises a Matter service.
|
|
13
14
|
*/
|
|
14
|
-
export abstract class Advertiser {
|
|
15
|
+
export abstract class Advertiser implements Lifetime.Owner {
|
|
16
|
+
#lifetime: Lifetime;
|
|
15
17
|
#advertisements = new Set<Advertisement>();
|
|
16
18
|
#isClosed = false;
|
|
17
19
|
|
|
20
|
+
constructor(lifetime = Lifetime.process) {
|
|
21
|
+
this.#lifetime = lifetime.join("advertiser");
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
/**
|
|
19
25
|
* Begin advertising on configured schedule.
|
|
20
26
|
*
|
|
@@ -45,6 +51,7 @@ export abstract class Advertiser {
|
|
|
45
51
|
* Destroy the instance.
|
|
46
52
|
*/
|
|
47
53
|
async close() {
|
|
54
|
+
using _closing = this.#lifetime.closing();
|
|
48
55
|
this.#isClosed = true;
|
|
49
56
|
await Advertisement.closeAll(this.#advertisements);
|
|
50
57
|
}
|
|
@@ -73,6 +80,10 @@ export abstract class Advertiser {
|
|
|
73
80
|
filter(predicate: (ad: Advertisement) => boolean) {
|
|
74
81
|
return [...this.#advertisements].filter(predicate);
|
|
75
82
|
}
|
|
83
|
+
|
|
84
|
+
join(...name: unknown[]): Lifetime {
|
|
85
|
+
return this.#lifetime.join(...name);
|
|
86
|
+
}
|
|
76
87
|
}
|
|
77
88
|
|
|
78
89
|
export namespace Advertiser {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { BlePeripheralInterface } from "#ble/Ble.js";
|
|
8
|
-
import { Bytes, Duration, ImplementationError, Millis } from "#general";
|
|
8
|
+
import { Bytes, Duration, ImplementationError, Lifetime, Millis } from "#general";
|
|
9
9
|
import { DatatypeModel, FieldElement } from "#model";
|
|
10
10
|
import { MAXIMUM_COMMISSIONING_TIMEOUT } from "#types";
|
|
11
11
|
import { Advertisement } from "../Advertisement.js";
|
|
@@ -20,7 +20,7 @@ export class BleAdvertiser extends Advertiser {
|
|
|
20
20
|
#isClosed = false;
|
|
21
21
|
|
|
22
22
|
constructor(peripheral: BlePeripheralInterface, options?: BleAdvertiser.Options) {
|
|
23
|
-
super();
|
|
23
|
+
super(options?.lifetime);
|
|
24
24
|
|
|
25
25
|
this.#peripheral = peripheral;
|
|
26
26
|
this.#config = BleAdvertiser.Configuration(options);
|
|
@@ -58,6 +58,11 @@ export namespace BleAdvertiser {
|
|
|
58
58
|
* All intervals are in milliseconds.
|
|
59
59
|
*/
|
|
60
60
|
export interface Configuration {
|
|
61
|
+
/**
|
|
62
|
+
* Lifetime of advertiser owner.
|
|
63
|
+
*/
|
|
64
|
+
readonly lifetime?: Lifetime.Owner;
|
|
65
|
+
|
|
61
66
|
/**
|
|
62
67
|
* Additional advertisement data.
|
|
63
68
|
*/
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
ImplementationError,
|
|
14
14
|
Instant,
|
|
15
15
|
InternalError,
|
|
16
|
+
Lifetime,
|
|
16
17
|
RetrySchedule,
|
|
17
18
|
Seconds,
|
|
18
19
|
STANDARD_MATTER_PORT,
|
|
@@ -39,7 +40,7 @@ export class MdnsAdvertiser extends Advertiser {
|
|
|
39
40
|
readonly server: MdnsServer,
|
|
40
41
|
options?: MdnsAdvertiser.Options,
|
|
41
42
|
) {
|
|
42
|
-
super();
|
|
43
|
+
super(options?.lifetime);
|
|
43
44
|
|
|
44
45
|
this.port = options?.port ?? STANDARD_MATTER_PORT;
|
|
45
46
|
this.omitPrivateDetails = options?.omitPrivateDetails ?? false;
|
|
@@ -153,6 +154,11 @@ export namespace MdnsAdvertiser {
|
|
|
153
154
|
* MDNS advertisement configuration options.
|
|
154
155
|
*/
|
|
155
156
|
export interface Options {
|
|
157
|
+
/**
|
|
158
|
+
* Lifetime of advertiser owner.
|
|
159
|
+
*/
|
|
160
|
+
readonly lifetime?: Lifetime.Owner;
|
|
161
|
+
|
|
156
162
|
/**
|
|
157
163
|
* The port of the Matter service to advertise.
|
|
158
164
|
*
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Bytes, DerObject, X520 } from "#general";
|
|
7
|
+
import { Bytes, DerObject, hex, X520 } from "#general";
|
|
8
8
|
import { FabricId, MATTER_EPOCH_OFFSET_S, NodeId, VendorId } from "#types";
|
|
9
9
|
import { InternalError } from "@matter/general";
|
|
10
10
|
|
|
@@ -64,7 +64,7 @@ const GenericMatterObject = <T>(
|
|
|
64
64
|
fieldName: string,
|
|
65
65
|
valueConverter?: (value: T) => string,
|
|
66
66
|
) => {
|
|
67
|
-
const oidHex = `${oidBase}${
|
|
67
|
+
const oidHex = `${oidBase}${hex.byte(id)}`;
|
|
68
68
|
// Register in reverse lookup map immediately at function creation time
|
|
69
69
|
if (MATTER_OID_TO_FIELD_MAP[oidHex] !== undefined && MATTER_OID_TO_FIELD_MAP[oidHex] !== fieldName) {
|
|
70
70
|
throw new InternalError(
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
import { ImplementationError } from "#general";
|
|
8
8
|
import { FabricIndex as FabricIndexElement } from "#model";
|
|
9
|
+
import { NoAssociatedFabricError } from "#protocol/errors.js";
|
|
9
10
|
import { Attribute, AttributeError, AttributeId, ClusterId, EndpointNumber, FabricIndex, TlvSchema } from "#types";
|
|
10
11
|
import { InteractionClient } from "../../interaction/InteractionClient.js";
|
|
11
|
-
import { NoAssociatedFabricError } from "../../session/NodeSession.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Factory function to create an AttributeClient for a given attribute.
|