@matter/protocol 0.16.0-alpha.0-20251205-dfb1e1556 → 0.16.0-alpha.0-20251209-d6072d23e
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/Val.js +1 -1
- package/dist/cjs/action/Val.js.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.js +83 -35
- 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/response/ReadResult.d.ts +1 -1
- package/dist/cjs/action/response/ReadResult.d.ts.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/Noc.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Noc.js +8 -6
- package/dist/cjs/certificate/kinds/Noc.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 +6 -3
- 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 +301 -243
- 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/Val.js +1 -1
- package/dist/esm/action/Val.js.map +1 -1
- package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.js +83 -35
- 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/response/ReadResult.d.ts +1 -1
- package/dist/esm/action/response/ReadResult.d.ts.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/Noc.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Noc.js +8 -6
- package/dist/esm/certificate/kinds/Noc.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 +6 -3
- 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 +303 -248
- 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/response/ReadResult.ts +1 -1
- 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/Noc.ts +12 -7
- 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 +149 -178
- 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
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { DecodedPacket } from "#codec/MessageCodec.js";
|
|
7
|
+
import type { DecodedPacket } from "#codec/MessageCodec.js";
|
|
8
8
|
import { SupportedTransportsSchema } from "#common/SupportedTransportsBitmap.js";
|
|
9
9
|
import { FabricManager } from "#fabric/FabricManager.js";
|
|
10
10
|
import {
|
|
11
11
|
BasicSet,
|
|
12
12
|
Bytes,
|
|
13
|
+
Channel,
|
|
14
|
+
ConnectionlessTransportSet,
|
|
13
15
|
Construction,
|
|
16
|
+
Crypto,
|
|
14
17
|
Duration,
|
|
15
18
|
Environment,
|
|
16
19
|
Environmental,
|
|
@@ -23,43 +26,25 @@ import {
|
|
|
23
26
|
ObserverGroup,
|
|
24
27
|
StorageContext,
|
|
25
28
|
StorageManager,
|
|
29
|
+
Timestamp,
|
|
26
30
|
toHex,
|
|
27
31
|
} from "#general";
|
|
28
|
-
import { Subscription } from "#interaction/Subscription.js";
|
|
29
|
-
import { Specification } from "#model";
|
|
32
|
+
import type { Subscription } from "#interaction/Subscription.js";
|
|
30
33
|
import { PeerAddress, PeerAddressMap } from "#peer/PeerAddress.js";
|
|
34
|
+
import { SessionClosedError } from "#protocol/errors.js";
|
|
31
35
|
import { GroupSession } from "#session/GroupSession.js";
|
|
32
|
-
import { CaseAuthenticatedTag,
|
|
36
|
+
import { CaseAuthenticatedTag, FabricId, FabricIndex, GroupId, NodeId } from "#types";
|
|
33
37
|
import { UnexpectedDataError } from "@matter/general";
|
|
34
|
-
import { ExposedFabricInformation, Fabric } from "../fabric/Fabric.js";
|
|
38
|
+
import type { ExposedFabricInformation, Fabric } from "../fabric/Fabric.js";
|
|
35
39
|
import { MessageCounter } from "../protocol/MessageCounter.js";
|
|
36
|
-
import { InsecureSession } from "./InsecureSession.js";
|
|
37
40
|
import { NodeSession } from "./NodeSession.js";
|
|
38
41
|
import { SecureSession } from "./SecureSession.js";
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
FALLBACK_MAX_PATHS_PER_INVOKE,
|
|
43
|
-
FALLBACK_MAX_TCP_MESSAGE_SIZE,
|
|
44
|
-
FALLBACK_SPECIFICATION_VERSION,
|
|
45
|
-
Session,
|
|
46
|
-
SessionParameterOptions,
|
|
47
|
-
SessionParameters,
|
|
48
|
-
} from "./Session.js";
|
|
49
|
-
import { SessionIntervals } from "./SessionIntervals.js";
|
|
42
|
+
import type { Session } from "./Session.js";
|
|
43
|
+
import { SessionParameters } from "./SessionParameters.js";
|
|
44
|
+
import { UnsecuredSession } from "./UnsecuredSession.js";
|
|
50
45
|
|
|
51
46
|
const logger = Logger.get("SessionManager");
|
|
52
47
|
|
|
53
|
-
const DEFAULT_SESSION_PARAMETERS = {
|
|
54
|
-
...SessionIntervals.defaults,
|
|
55
|
-
dataModelRevision: Specification.DATA_MODEL_REVISION,
|
|
56
|
-
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION,
|
|
57
|
-
specificationVersion: Specification.SPECIFICATION_VERSION,
|
|
58
|
-
maxPathsPerInvoke: DEFAULT_MAX_PATHS_PER_INVOKE,
|
|
59
|
-
supportedTransports: {},
|
|
60
|
-
maxTcpMessageSize: FALLBACK_MAX_TCP_MESSAGE_SIZE,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
48
|
export interface ResumptionRecord {
|
|
64
49
|
sharedSecret: Bytes;
|
|
65
50
|
resumptionId: Bytes;
|
|
@@ -112,7 +97,7 @@ export interface SessionManagerContext {
|
|
|
112
97
|
/**
|
|
113
98
|
* Parameter overrides.
|
|
114
99
|
*/
|
|
115
|
-
parameters?:
|
|
100
|
+
parameters?: SessionParameters.Config;
|
|
116
101
|
|
|
117
102
|
/**
|
|
118
103
|
* This is an arbitrary contextual object attached to sessions used for compatibility with legacy APIs.
|
|
@@ -129,34 +114,49 @@ const ID_SPACE_UPPER_BOUND = 0xffff;
|
|
|
129
114
|
*/
|
|
130
115
|
export class SessionManager {
|
|
131
116
|
readonly #context: SessionManagerContext;
|
|
132
|
-
readonly #
|
|
117
|
+
readonly #unsecuredSessions = new Map<NodeId, UnsecuredSession>();
|
|
133
118
|
readonly #sessions = new BasicSet<NodeSession>();
|
|
134
119
|
readonly #groupSessions = new Map<NodeId, BasicSet<GroupSession>>();
|
|
135
120
|
#nextSessionId: number;
|
|
136
121
|
#resumptionRecords = new PeerAddressMap<ResumptionRecord>();
|
|
137
122
|
readonly #globalUnencryptedMessageCounter;
|
|
138
|
-
readonly #subscriptionsChanged = Observable<[session: NodeSession, subscription: Subscription]>();
|
|
139
123
|
#sessionParameters: SessionParameters;
|
|
140
|
-
readonly #retry = Observable<[session: Session, number: number]>();
|
|
141
124
|
readonly #construction: Construction<SessionManager>;
|
|
142
125
|
readonly #observers = new ObserverGroup();
|
|
143
126
|
readonly #subscriptionUpdateMutex = new Mutex(this);
|
|
144
127
|
#idUpperBound = ID_SPACE_UPPER_BOUND;
|
|
145
128
|
|
|
129
|
+
readonly #subscriptionsChanged = Observable<[session: NodeSession, subscription: Subscription]>();
|
|
130
|
+
readonly #retry = Observable<[session: Session, number: number]>();
|
|
131
|
+
|
|
146
132
|
constructor(context: SessionManagerContext) {
|
|
147
133
|
this.#context = context;
|
|
148
134
|
const {
|
|
149
135
|
fabrics: { crypto },
|
|
150
136
|
} = context;
|
|
151
|
-
this.#sessionParameters = { ...
|
|
137
|
+
this.#sessionParameters = SessionParameters({ ...SessionParameters.defaults, ...context.parameters });
|
|
152
138
|
this.#nextSessionId = crypto.randomUint16;
|
|
153
139
|
this.#globalUnencryptedMessageCounter = new MessageCounter(crypto);
|
|
154
140
|
|
|
155
141
|
// When fabric is removed, also remove the resumption record
|
|
156
|
-
this.#observers.on(context.fabrics.events.
|
|
142
|
+
this.#observers.on(context.fabrics.events.deleting, async fabric => {
|
|
157
143
|
await this.deleteResumptionRecordsForFabric(fabric);
|
|
158
144
|
});
|
|
159
145
|
|
|
146
|
+
// Add subscription monitors to new node sessions
|
|
147
|
+
this.#sessions.added.on(session => {
|
|
148
|
+
const subscriptionsChanged = (subscription: Subscription) => {
|
|
149
|
+
if (session.isClosing) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
this.#subscriptionsChanged.emit(session, subscription);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
session.subscriptions.added.on(subscriptionsChanged);
|
|
157
|
+
session.subscriptions.deleted.on(subscriptionsChanged);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
160
|
this.#construction = Construction(this, () => this.#initialize());
|
|
161
161
|
}
|
|
162
162
|
|
|
@@ -189,10 +189,10 @@ export class SessionManager {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
|
-
* Active
|
|
192
|
+
* Active unsecured sessions.
|
|
193
193
|
*/
|
|
194
|
-
get
|
|
195
|
-
return this.#
|
|
194
|
+
get unsecuredSessions() {
|
|
195
|
+
return this.#unsecuredSessions;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
/**
|
|
@@ -251,23 +251,25 @@ export class SessionManager {
|
|
|
251
251
|
return this.#context.owner;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
createUnsecuredSession(options: {
|
|
255
|
+
channel: Channel<Bytes>;
|
|
255
256
|
initiatorNodeId?: NodeId;
|
|
256
|
-
sessionParameters?:
|
|
257
|
+
sessionParameters?: SessionParameters.Config;
|
|
257
258
|
isInitiator?: boolean;
|
|
258
259
|
}) {
|
|
259
260
|
this.#construction.assert();
|
|
260
261
|
|
|
261
|
-
const { initiatorNodeId, sessionParameters, isInitiator } = options;
|
|
262
|
+
const { channel, initiatorNodeId, sessionParameters, isInitiator } = options;
|
|
262
263
|
if (initiatorNodeId !== undefined) {
|
|
263
|
-
if (this.#
|
|
264
|
-
throw new MatterFlowError(`
|
|
264
|
+
if (this.#unsecuredSessions.has(initiatorNodeId)) {
|
|
265
|
+
throw new MatterFlowError(`UnsecuredSession with NodeId ${initiatorNodeId} already exists.`);
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
268
|
while (true) {
|
|
268
|
-
const session = new
|
|
269
|
+
const session = new UnsecuredSession({
|
|
269
270
|
crypto: this.#context.fabrics.crypto,
|
|
270
271
|
manager: this,
|
|
272
|
+
channel,
|
|
271
273
|
messageCounter: this.#globalUnencryptedMessageCounter,
|
|
272
274
|
initiatorNodeId,
|
|
273
275
|
sessionParameters,
|
|
@@ -275,68 +277,20 @@ export class SessionManager {
|
|
|
275
277
|
});
|
|
276
278
|
|
|
277
279
|
const ephemeralNodeId = session.nodeId;
|
|
278
|
-
if (this.#
|
|
280
|
+
if (this.#unsecuredSessions.has(ephemeralNodeId)) continue;
|
|
279
281
|
|
|
280
|
-
this.#
|
|
282
|
+
this.#unsecuredSessions.set(ephemeralNodeId, session);
|
|
283
|
+
session.activate();
|
|
281
284
|
return session;
|
|
282
285
|
}
|
|
283
286
|
}
|
|
284
287
|
|
|
285
|
-
async createSecureSession(
|
|
286
|
-
|
|
287
|
-
fabric: Fabric | undefined;
|
|
288
|
-
peerNodeId: NodeId;
|
|
289
|
-
peerSessionId: number;
|
|
290
|
-
sharedSecret: Bytes;
|
|
291
|
-
salt: Bytes;
|
|
292
|
-
isInitiator: boolean;
|
|
293
|
-
isResumption: boolean;
|
|
294
|
-
peerSessionParameters?: SessionParameterOptions;
|
|
295
|
-
caseAuthenticatedTags?: CaseAuthenticatedTag[];
|
|
296
|
-
}) {
|
|
297
|
-
await this.construction;
|
|
298
|
-
|
|
299
|
-
const {
|
|
300
|
-
sessionId,
|
|
301
|
-
fabric,
|
|
302
|
-
peerNodeId,
|
|
303
|
-
peerSessionId,
|
|
304
|
-
sharedSecret,
|
|
305
|
-
salt,
|
|
306
|
-
isInitiator,
|
|
307
|
-
isResumption,
|
|
308
|
-
peerSessionParameters,
|
|
309
|
-
caseAuthenticatedTags,
|
|
310
|
-
} = args;
|
|
311
|
-
const session = await NodeSession.create({
|
|
288
|
+
async createSecureSession(config: Omit<NodeSession.CreateConfig, "crypto"> & { crypto?: Crypto }) {
|
|
289
|
+
return await NodeSession.create({
|
|
312
290
|
crypto: this.crypto,
|
|
291
|
+
...config,
|
|
313
292
|
manager: this,
|
|
314
|
-
id: sessionId,
|
|
315
|
-
fabric,
|
|
316
|
-
peerNodeId,
|
|
317
|
-
peerSessionId,
|
|
318
|
-
sharedSecret,
|
|
319
|
-
salt,
|
|
320
|
-
isInitiator,
|
|
321
|
-
isResumption,
|
|
322
|
-
peerSessionParameters: peerSessionParameters,
|
|
323
|
-
caseAuthenticatedTags,
|
|
324
293
|
});
|
|
325
|
-
|
|
326
|
-
const subscriptionsChanged = (subscription: Subscription) => {
|
|
327
|
-
if (session.isClosing) {
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
this.#subscriptionsChanged.emit(session, subscription);
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
session.subscriptions.added.on(subscriptionsChanged);
|
|
335
|
-
session.subscriptions.deleted.on(subscriptionsChanged);
|
|
336
|
-
|
|
337
|
-
this.#sessions.add(session);
|
|
338
|
-
|
|
339
|
-
return session;
|
|
340
294
|
}
|
|
341
295
|
|
|
342
296
|
/**
|
|
@@ -405,7 +359,10 @@ export class SessionManager {
|
|
|
405
359
|
|
|
406
360
|
// All session ids are taken, search for the oldest unused session, and close it and re-use its ID
|
|
407
361
|
const oldestSession = this.findOldestInactiveSession();
|
|
408
|
-
|
|
362
|
+
|
|
363
|
+
await oldestSession.initiateClose(async () => {
|
|
364
|
+
await oldestSession.closeSubscriptions(true);
|
|
365
|
+
});
|
|
409
366
|
this.#nextSessionId = oldestSession.id;
|
|
410
367
|
return this.#nextSessionId++;
|
|
411
368
|
}
|
|
@@ -419,9 +376,7 @@ export class SessionManager {
|
|
|
419
376
|
getPaseSession() {
|
|
420
377
|
this.#construction.assert();
|
|
421
378
|
|
|
422
|
-
return [...this.#sessions].find(
|
|
423
|
-
session => NodeSession.is(session) && session.isPase && !session.closingAfterExchangeFinished,
|
|
424
|
-
);
|
|
379
|
+
return [...this.#sessions].find(session => NodeSession.is(session) && session.isPase && !session.isClosing);
|
|
425
380
|
}
|
|
426
381
|
|
|
427
382
|
forFabric(fabric: Fabric) {
|
|
@@ -433,45 +388,73 @@ export class SessionManager {
|
|
|
433
388
|
);
|
|
434
389
|
}
|
|
435
390
|
|
|
436
|
-
|
|
391
|
+
sessionFor(peer: PeerAddress) {
|
|
392
|
+
const session = this.maybeSessionFor(peer);
|
|
393
|
+
if (session) {
|
|
394
|
+
return session;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
throw new SessionClosedError(`Not currently connected to ${PeerAddress(peer)}`);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
maybeSessionFor(address: PeerAddress) {
|
|
437
401
|
this.#construction.assert();
|
|
438
402
|
|
|
439
|
-
//
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
403
|
+
// Prefer the most recently used session. Older ones may not work with broken peers (e.g. CHIP test harness)
|
|
404
|
+
let found: NodeSession | undefined;
|
|
405
|
+
for (const session of this.#sessions) {
|
|
406
|
+
if (!session.peerIs(address) || session.isClosing) {
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (!found || found.timestamp < session.timestamp) {
|
|
411
|
+
found = session;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return found;
|
|
444
416
|
}
|
|
445
417
|
|
|
446
|
-
|
|
418
|
+
sessionsFor(address: PeerAddress) {
|
|
419
|
+
address = PeerAddress(address);
|
|
420
|
+
return this.#sessions.filter(session => session.peerAddress === address && !session.isClosing);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
sessionsForFabricIndex(fabricIndex: FabricIndex) {
|
|
424
|
+
return this.#sessions.filter(session => session.fabric?.fabricIndex === fabricIndex);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
async handlePeerLoss(address: PeerAddress, asOf?: Timestamp) {
|
|
447
428
|
await this.#construction;
|
|
448
429
|
|
|
449
430
|
for (const session of this.#sessions) {
|
|
450
|
-
if (!session.
|
|
451
|
-
|
|
452
|
-
const secureSession = session;
|
|
453
|
-
if (secureSession.peerIs(address)) {
|
|
454
|
-
await secureSession.destroy(sendClose, false);
|
|
455
|
-
this.#sessions.delete(session);
|
|
431
|
+
if (!session.peerIs(address)) {
|
|
432
|
+
continue;
|
|
456
433
|
}
|
|
434
|
+
|
|
435
|
+
if (asOf !== undefined && session.createdAt >= asOf) {
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
await session.handlePeerLoss();
|
|
457
440
|
}
|
|
458
441
|
}
|
|
459
442
|
|
|
460
|
-
|
|
443
|
+
getUnsecuredSession(sourceNodeId?: NodeId) {
|
|
461
444
|
this.#construction.assert();
|
|
462
445
|
|
|
463
446
|
if (sourceNodeId === undefined) {
|
|
464
|
-
return this.#
|
|
447
|
+
return this.#unsecuredSessions.get(NodeId.UNSPECIFIED_NODE_ID);
|
|
465
448
|
}
|
|
466
|
-
return this.#
|
|
449
|
+
return this.#unsecuredSessions.get(sourceNodeId);
|
|
467
450
|
}
|
|
468
451
|
|
|
469
452
|
/**
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
453
|
+
* Obtain an outbound group session for a specific group.
|
|
454
|
+
*
|
|
455
|
+
* Returns the session for the current group epoch key. The source is this node and the peer is the group.
|
|
473
456
|
*/
|
|
474
|
-
groupSessionForAddress(address: PeerAddress) {
|
|
457
|
+
async groupSessionForAddress(address: PeerAddress, transports: ConnectionlessTransportSet) {
|
|
475
458
|
const groupId = GroupId.fromNodeId(address.nodeId);
|
|
476
459
|
GroupId.assertGroupId(groupId);
|
|
477
460
|
|
|
@@ -483,23 +466,29 @@ export class SessionManager {
|
|
|
483
466
|
);
|
|
484
467
|
}
|
|
485
468
|
|
|
486
|
-
|
|
487
|
-
if (session
|
|
488
|
-
session
|
|
489
|
-
manager: this,
|
|
490
|
-
id: sessionId,
|
|
491
|
-
fabric,
|
|
492
|
-
keySetId,
|
|
493
|
-
operationalGroupKey: key,
|
|
494
|
-
peerNodeId: address.nodeId, // The peer node ID is the group node ID
|
|
495
|
-
});
|
|
469
|
+
const session = this.#groupSessions.get(fabric.nodeId)?.get("id", sessionId);
|
|
470
|
+
if (session) {
|
|
471
|
+
return session;
|
|
496
472
|
}
|
|
497
|
-
|
|
473
|
+
|
|
474
|
+
return await GroupSession.create({
|
|
475
|
+
transports,
|
|
476
|
+
manager: this,
|
|
477
|
+
id: sessionId,
|
|
478
|
+
fabric,
|
|
479
|
+
keySetId,
|
|
480
|
+
operationalGroupKey: key,
|
|
481
|
+
groupNodeId: address.nodeId,
|
|
482
|
+
});
|
|
498
483
|
}
|
|
499
484
|
|
|
500
485
|
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
486
|
+
* Obtain a Group session for an incoming packet.
|
|
487
|
+
*
|
|
488
|
+
* The session ID is determined by decrypting the packet with possible keys.
|
|
489
|
+
*
|
|
490
|
+
* Note that the resulting session is non-operational in the sense that attempting outbound communication will
|
|
491
|
+
* result in an error.
|
|
503
492
|
*/
|
|
504
493
|
groupSessionFromPacket(packet: DecodedPacket, aad: Bytes) {
|
|
505
494
|
const groupId = packet.header.destGroupId;
|
|
@@ -606,17 +595,7 @@ export class SessionManager {
|
|
|
606
595
|
fabricId,
|
|
607
596
|
fabricIndex,
|
|
608
597
|
peerNodeId,
|
|
609
|
-
sessionParameters
|
|
610
|
-
idleInterval,
|
|
611
|
-
activeInterval,
|
|
612
|
-
activeThreshold,
|
|
613
|
-
dataModelRevision,
|
|
614
|
-
interactionModelRevision,
|
|
615
|
-
specificationVersion,
|
|
616
|
-
maxPathsPerInvoke,
|
|
617
|
-
supportedTransports,
|
|
618
|
-
maxTcpMessageSize,
|
|
619
|
-
} = {},
|
|
598
|
+
sessionParameters,
|
|
620
599
|
caseAuthenticatedTags,
|
|
621
600
|
}) => {
|
|
622
601
|
const fabric = this.#context.fabrics.find(
|
|
@@ -645,21 +624,8 @@ export class SessionManager {
|
|
|
645
624
|
resumptionId,
|
|
646
625
|
fabric,
|
|
647
626
|
peerNodeId,
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
idleInterval: idleInterval ?? SessionIntervals.defaults.idleInterval,
|
|
651
|
-
activeInterval: activeInterval ?? SessionIntervals.defaults.activeInterval,
|
|
652
|
-
activeThreshold: activeThreshold ?? SessionIntervals.defaults.activeThreshold,
|
|
653
|
-
dataModelRevision: dataModelRevision ?? FALLBACK_DATAMODEL_REVISION,
|
|
654
|
-
interactionModelRevision: interactionModelRevision ?? FALLBACK_INTERACTIONMODEL_REVISION,
|
|
655
|
-
specificationVersion: specificationVersion ?? FALLBACK_SPECIFICATION_VERSION,
|
|
656
|
-
maxPathsPerInvoke: maxPathsPerInvoke ?? FALLBACK_MAX_PATHS_PER_INVOKE,
|
|
657
|
-
supportedTransports:
|
|
658
|
-
supportedTransports !== undefined
|
|
659
|
-
? SupportedTransportsSchema.decode(supportedTransports)
|
|
660
|
-
: {},
|
|
661
|
-
maxTcpMessageSize: maxTcpMessageSize ?? FALLBACK_MAX_TCP_MESSAGE_SIZE,
|
|
662
|
-
},
|
|
627
|
+
// Make sure to initialize default values when restoring an older resumption record
|
|
628
|
+
sessionParameters: SessionParameters(sessionParameters),
|
|
663
629
|
caseAuthenticatedTags,
|
|
664
630
|
});
|
|
665
631
|
},
|
|
@@ -671,11 +637,11 @@ export class SessionManager {
|
|
|
671
637
|
return [...this.#sessions]
|
|
672
638
|
.filter(session => session.isSecure && !session.isPase)
|
|
673
639
|
.map(session => ({
|
|
674
|
-
name: session.
|
|
640
|
+
name: session.via,
|
|
675
641
|
nodeId: session.nodeId,
|
|
676
642
|
peerNodeId: session.peerNodeId,
|
|
677
643
|
fabric: session instanceof SecureSession ? session.fabric?.externalInformation : undefined,
|
|
678
|
-
isPeerActive: session.isPeerActive
|
|
644
|
+
isPeerActive: session.isPeerActive,
|
|
679
645
|
secure: session.isSecure,
|
|
680
646
|
lastInteractionTimestamp: session instanceof SecureSession ? session.timestamp : undefined,
|
|
681
647
|
lastActiveTimestamp: session instanceof SecureSession ? session.activeTimestamp : undefined,
|
|
@@ -689,30 +655,46 @@ export class SessionManager {
|
|
|
689
655
|
}
|
|
690
656
|
|
|
691
657
|
this.#observers.close();
|
|
658
|
+
await this.#storeResumptionRecords();
|
|
692
659
|
|
|
693
660
|
await this.closeAllSessions();
|
|
694
661
|
}
|
|
695
662
|
|
|
696
663
|
async clear() {
|
|
664
|
+
if (this.#construction.status === Lifecycle.Status.Initializing) {
|
|
665
|
+
await this.#construction;
|
|
666
|
+
}
|
|
667
|
+
|
|
697
668
|
await this.closeAllSessions();
|
|
698
669
|
await this.#context.storage.clear();
|
|
699
670
|
this.#resumptionRecords.clear();
|
|
700
671
|
}
|
|
701
672
|
|
|
702
673
|
async closeAllSessions() {
|
|
674
|
+
if (this.#construction.status === Lifecycle.Status.Initializing) {
|
|
675
|
+
await this.#construction;
|
|
676
|
+
}
|
|
677
|
+
|
|
703
678
|
await this.#subscriptionUpdateMutex;
|
|
704
679
|
|
|
705
|
-
await this.#storeResumptionRecords();
|
|
706
680
|
const closePromises = this.#sessions.map(async session => {
|
|
707
|
-
await session
|
|
681
|
+
await session.closeSubscriptions(true);
|
|
682
|
+
|
|
683
|
+
// TODO - some CHIP tests (CASERecovery for one) expect us to exit without closing the session and will fail
|
|
684
|
+
// if we end gracefully. Not clear why this behavior would be desirable as it leads to a timeout when the
|
|
685
|
+
// node attempts contact even if we've already restarted
|
|
686
|
+
await session.initiateForceClose();
|
|
687
|
+
|
|
708
688
|
this.#sessions.delete(session);
|
|
709
689
|
});
|
|
710
|
-
|
|
711
|
-
|
|
690
|
+
|
|
691
|
+
for (const session of this.#unsecuredSessions.values()) {
|
|
692
|
+
closePromises.push(session.initiateClose());
|
|
712
693
|
}
|
|
694
|
+
|
|
713
695
|
for (const sessions of this.#groupSessions.values()) {
|
|
714
696
|
for (const session of sessions) {
|
|
715
|
-
closePromises.push(session
|
|
697
|
+
closePromises.push(session.initiateClose());
|
|
716
698
|
}
|
|
717
699
|
}
|
|
718
700
|
await MatterAggregateError.allSettled(closePromises, "Error closing sessions").catch(error =>
|
|
@@ -720,27 +702,6 @@ export class SessionManager {
|
|
|
720
702
|
);
|
|
721
703
|
}
|
|
722
704
|
|
|
723
|
-
updateAllSubscriptions() {
|
|
724
|
-
this.#subscriptionUpdateMutex.run(async () => {
|
|
725
|
-
for (const session of this.#sessions) {
|
|
726
|
-
for (const subscription of session.subscriptions) {
|
|
727
|
-
await subscription.update();
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
});
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
/** Clears all subscriptions for a given node and returns how many were cleared. */
|
|
734
|
-
async clearSubscriptionsForNode(peerAddress: PeerAddress, flushSubscriptions?: boolean) {
|
|
735
|
-
let clearedCount = 0;
|
|
736
|
-
for (const session of this.#sessions) {
|
|
737
|
-
if (PeerAddress.is(session.peerAddress, peerAddress)) {
|
|
738
|
-
clearedCount += await session.clearSubscriptions(flushSubscriptions, true);
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
return clearedCount;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
705
|
/**
|
|
745
706
|
* Compress range of IDs. This is intended for testing.
|
|
746
707
|
*/
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { SupportedTransportsBitmap, SupportedTransportsSchema } from "#common/SupportedTransportsBitmap.js";
|
|
8
|
+
import { Specification } from "#model";
|
|
9
|
+
import { SessionIntervals } from "./SessionIntervals.js";
|
|
10
|
+
|
|
11
|
+
export interface SessionParameters extends SessionIntervals {
|
|
12
|
+
/** Version of Data Model for the Session parameters side where it appears. */
|
|
13
|
+
dataModelRevision: number;
|
|
14
|
+
|
|
15
|
+
/** Version of Interaction Model for the Session parameters side where it appears. */
|
|
16
|
+
interactionModelRevision: number;
|
|
17
|
+
|
|
18
|
+
/** Version of Specification for the Session parameters side where it appears. */
|
|
19
|
+
specificationVersion: number;
|
|
20
|
+
|
|
21
|
+
/** The maximum number of elements in the InvokeRequests list that the Node is able to process. */
|
|
22
|
+
maxPathsPerInvoke: number;
|
|
23
|
+
|
|
24
|
+
/** A bitmap of the supported transport protocols in addition to MRP. */
|
|
25
|
+
supportedTransports: SessionParameters.SupportedTransports;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Maximum size of the message carried over TCP, excluding the framing message length field, that the node is
|
|
29
|
+
* capable of receiving from its peer.
|
|
30
|
+
*/
|
|
31
|
+
maxTcpMessageSize?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function SessionParameters(config?: SessionParameters.Config): SessionParameters {
|
|
35
|
+
// Decode supported transports if supplied as number
|
|
36
|
+
let supportedTransports = config?.supportedTransports;
|
|
37
|
+
if (typeof supportedTransports === "number") {
|
|
38
|
+
supportedTransports = SupportedTransportsSchema.decode(supportedTransports);
|
|
39
|
+
}
|
|
40
|
+
supportedTransports ??= SessionParameters.fallbacks.supportedTransports;
|
|
41
|
+
|
|
42
|
+
// The MAX_TCP_MESSAGE_SIZE field SHALL only be present if the SUPPORTED_TRANSPORTS field indicates that TCP is
|
|
43
|
+
// supported
|
|
44
|
+
let maxTcpMessageSize: number | undefined;
|
|
45
|
+
if (supportedTransports.tcpClient || supportedTransports.tcpServer) {
|
|
46
|
+
maxTcpMessageSize = config?.maxTcpMessageSize;
|
|
47
|
+
maxTcpMessageSize ??= SessionParameters.fallbacks.maxTcpMessageSize;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return { ...SessionParameters.fallbacks, ...config, supportedTransports, maxTcpMessageSize };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export namespace SessionParameters {
|
|
54
|
+
export interface SupportedTransports extends Partial<SupportedTransportsBitmap> {}
|
|
55
|
+
|
|
56
|
+
export interface Config extends Partial<Omit<SessionParameters, "supportedTransports">> {
|
|
57
|
+
supportedTransports?: number | SupportedTransports;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Session parameters we use for peers if not supplied by the peer.
|
|
62
|
+
*/
|
|
63
|
+
export const fallbacks = {
|
|
64
|
+
...SessionIntervals.defaults,
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Fallback value for Data Model Revision when not provided in Session parameters. We use Matter 1.2 as
|
|
68
|
+
* assumption.
|
|
69
|
+
*/
|
|
70
|
+
dataModelRevision: 17,
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Fallback value for Interaction Model Revision when not provided in Session parameters. We use Matter 1.2 as
|
|
74
|
+
* assumption.
|
|
75
|
+
*/
|
|
76
|
+
interactionModelRevision: 11,
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Fallback value for Specification Version when not provided in Session parameters. We use 0 as assumption which is
|
|
80
|
+
* "before 1.3".
|
|
81
|
+
*/
|
|
82
|
+
specificationVersion: 0,
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Fallback value for the maximum number of paths that can be included in a single invoke message when not provided in
|
|
86
|
+
* Session parameters.
|
|
87
|
+
*/
|
|
88
|
+
maxPathsPerInvoke: 1,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* No TCP support by default.
|
|
92
|
+
*/
|
|
93
|
+
supportedTransports: {},
|
|
94
|
+
|
|
95
|
+
maxTcpMessageSize: 64000,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Session parameters we use for ourselves.
|
|
100
|
+
*/
|
|
101
|
+
export const defaults = {
|
|
102
|
+
...fallbacks,
|
|
103
|
+
|
|
104
|
+
dataModelRevision: Specification.DATA_MODEL_REVISION,
|
|
105
|
+
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION,
|
|
106
|
+
specificationVersion: Specification.SPECIFICATION_VERSION,
|
|
107
|
+
};
|
|
108
|
+
}
|