@matter/protocol 0.15.1 → 0.15.2-alpha.0-20250704-2715344f0
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.d.ts +4 -0
- package/dist/cjs/action/Val.d.ts.map +1 -1
- package/dist/cjs/action/Val.js.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.d.ts +10 -8
- package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.js +152 -80
- package/dist/cjs/action/client/ClientInteraction.js.map +1 -1
- package/dist/cjs/action/client/ClientSubscription.d.ts +17 -0
- package/dist/cjs/action/client/ClientSubscription.d.ts.map +1 -0
- package/dist/cjs/action/client/ClientSubscription.js +22 -0
- package/dist/cjs/action/client/ClientSubscription.js.map +6 -0
- package/dist/cjs/action/client/ClientSubscriptionHandler.d.ts +20 -0
- package/dist/cjs/action/client/ClientSubscriptionHandler.d.ts.map +1 -0
- package/dist/cjs/action/client/ClientSubscriptionHandler.js +117 -0
- package/dist/cjs/action/client/ClientSubscriptionHandler.js.map +6 -0
- package/dist/cjs/action/client/ClientSubscriptions.d.ts +45 -0
- package/dist/cjs/action/client/ClientSubscriptions.d.ts.map +1 -0
- package/dist/cjs/action/client/ClientSubscriptions.js +141 -0
- package/dist/cjs/action/client/ClientSubscriptions.js.map +6 -0
- package/dist/cjs/action/client/InputChunk.d.ts +12 -0
- package/dist/cjs/action/client/InputChunk.d.ts.map +1 -0
- package/dist/cjs/action/client/InputChunk.js +89 -0
- package/dist/cjs/action/client/InputChunk.js.map +6 -0
- package/dist/cjs/action/client/ReadScope.d.ts +26 -0
- package/dist/cjs/action/client/ReadScope.d.ts.map +1 -0
- package/dist/cjs/action/client/ReadScope.js +87 -0
- package/dist/cjs/action/client/ReadScope.js.map +6 -0
- package/dist/cjs/action/client/index.d.ts +5 -0
- package/dist/cjs/action/client/index.d.ts.map +1 -1
- package/dist/cjs/action/client/index.js +5 -0
- package/dist/cjs/action/client/index.js.map +1 -1
- package/dist/cjs/action/request/Invoke.d.ts.map +1 -1
- package/dist/cjs/action/request/Invoke.js +8 -2
- package/dist/cjs/action/request/Invoke.js.map +1 -1
- package/dist/cjs/action/request/Read.d.ts +0 -4
- package/dist/cjs/action/request/Read.d.ts.map +1 -1
- package/dist/cjs/action/request/Read.js.map +1 -1
- package/dist/cjs/action/request/Subscribe.d.ts +14 -1
- package/dist/cjs/action/request/Subscribe.d.ts.map +1 -1
- package/dist/cjs/action/request/Subscribe.js +2 -2
- package/dist/cjs/action/request/Subscribe.js.map +1 -1
- package/dist/cjs/action/response/SubscribeResult.d.ts +3 -5
- package/dist/cjs/action/response/SubscribeResult.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.d.ts +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeSubscriptionResponse.d.ts +1 -1
- package/dist/cjs/action/server/AttributeSubscriptionResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeSubscriptionResponse.js.map +1 -1
- package/dist/cjs/action/server/CommandInvokeResponse.d.ts +2 -1
- package/dist/cjs/action/server/CommandInvokeResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/CommandInvokeResponse.js +3 -3
- package/dist/cjs/action/server/CommandInvokeResponse.js.map +1 -1
- package/dist/cjs/action/server/EventReadResponse.d.ts +1 -1
- package/dist/cjs/action/server/EventReadResponse.d.ts.map +1 -1
- package/dist/cjs/codec/MessageCodec.d.ts +1 -1
- package/dist/cjs/codec/MessageCodec.d.ts.map +1 -1
- package/dist/cjs/common/FailsafeContext.d.ts.map +1 -1
- package/dist/cjs/common/FailsafeContext.js +0 -1
- package/dist/cjs/common/FailsafeContext.js.map +1 -1
- package/dist/cjs/fabric/Fabric.d.ts.map +1 -1
- package/dist/cjs/fabric/Fabric.js +13 -10
- package/dist/cjs/fabric/Fabric.js.map +1 -1
- package/dist/cjs/fabric/FabricAuthority.d.ts +6 -1
- package/dist/cjs/fabric/FabricAuthority.d.ts.map +1 -1
- package/dist/cjs/fabric/FabricAuthority.js +16 -0
- package/dist/cjs/fabric/FabricAuthority.js.map +1 -1
- package/dist/cjs/groups/FabricGroups.d.ts +1 -1
- package/dist/cjs/groups/FabricGroups.d.ts.map +1 -1
- package/dist/cjs/groups/Groups.d.ts +2 -2
- package/dist/cjs/groups/Groups.d.ts.map +1 -1
- package/dist/cjs/groups/Groups.js +2 -2
- package/dist/cjs/groups/Groups.js.map +1 -1
- package/dist/cjs/interaction/AttributeDataEncoder.d.ts +1 -1
- package/dist/cjs/interaction/FabricAccessControl.d.ts +1 -1
- package/dist/cjs/interaction/FabricAccessControl.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionClient.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionClient.js +8 -4
- package/dist/cjs/interaction/InteractionClient.js.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.d.ts +21 -17
- package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.js +20 -12
- package/dist/cjs/interaction/InteractionMessenger.js.map +1 -1
- package/dist/cjs/mdns/MdnsScanner.d.ts +5 -6
- package/dist/cjs/mdns/MdnsScanner.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsScanner.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.js +4 -4
- package/dist/cjs/peer/ControllerCommissioner.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.js +2 -2
- package/dist/cjs/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/cjs/peer/OperationalPeer.d.ts +1 -1
- package/dist/cjs/peer/OperationalPeer.d.ts.map +1 -1
- package/dist/cjs/peer/PeerAddress.d.ts.map +1 -1
- package/dist/cjs/peer/PeerAddress.js +1 -1
- package/dist/cjs/peer/PeerAddress.js.map +1 -1
- package/dist/cjs/peer/PeerAddressStore.d.ts +1 -1
- package/dist/cjs/peer/PeerAddressStore.d.ts.map +1 -1
- package/dist/cjs/peer/PeerSet.d.ts.map +1 -1
- package/dist/cjs/peer/PeerSet.js +5 -5
- package/dist/cjs/peer/PeerSet.js.map +1 -1
- package/dist/cjs/protocol/ChannelManager.d.ts +1 -3
- package/dist/cjs/protocol/ChannelManager.d.ts.map +1 -1
- package/dist/cjs/protocol/ChannelManager.js +3 -6
- package/dist/cjs/protocol/ChannelManager.js.map +1 -1
- package/dist/cjs/protocol/DeviceCommissioner.d.ts +3 -2
- package/dist/cjs/protocol/DeviceCommissioner.d.ts.map +1 -1
- package/dist/cjs/protocol/DeviceCommissioner.js +6 -8
- package/dist/cjs/protocol/DeviceCommissioner.js.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.d.ts +1 -3
- package/dist/cjs/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.js +7 -9
- package/dist/cjs/protocol/ExchangeManager.js.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.js +7 -8
- package/dist/cjs/protocol/ExchangeProvider.js.map +1 -1
- package/dist/cjs/protocol/MessageChannel.d.ts +17 -4
- package/dist/cjs/protocol/MessageChannel.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageChannel.js +15 -6
- package/dist/cjs/protocol/MessageChannel.js.map +1 -1
- package/dist/cjs/protocol/MessageExchange.d.ts +0 -6
- package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageExchange.js +5 -9
- package/dist/cjs/protocol/MessageExchange.js.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts +3 -0
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.js +4 -0
- package/dist/cjs/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/cjs/securechannel/SecureChannelProtocol.d.ts +0 -1
- package/dist/cjs/securechannel/SecureChannelProtocol.d.ts.map +1 -1
- package/dist/cjs/securechannel/SecureChannelProtocol.js +0 -3
- package/dist/cjs/securechannel/SecureChannelProtocol.js.map +1 -1
- package/dist/cjs/session/GroupSession.d.ts +1 -1
- package/dist/cjs/session/GroupSession.d.ts.map +1 -1
- package/dist/cjs/session/GroupSession.js +6 -6
- package/dist/cjs/session/GroupSession.js.map +1 -1
- package/dist/cjs/session/InsecureSession.d.ts +2 -1
- package/dist/cjs/session/InsecureSession.d.ts.map +1 -1
- package/dist/cjs/session/InsecureSession.js +5 -4
- package/dist/cjs/session/InsecureSession.js.map +1 -1
- package/dist/cjs/session/NodeSession.d.ts +5 -3
- package/dist/cjs/session/NodeSession.d.ts.map +1 -1
- package/dist/cjs/session/NodeSession.js +4 -2
- package/dist/cjs/session/NodeSession.js.map +1 -1
- package/dist/cjs/session/SessionManager.d.ts +2 -3
- package/dist/cjs/session/SessionManager.d.ts.map +1 -1
- package/dist/cjs/session/SessionManager.js +1 -3
- package/dist/cjs/session/SessionManager.js.map +1 -1
- package/dist/cjs/session/case/CaseClient.d.ts.map +1 -1
- package/dist/cjs/session/case/CaseClient.js +6 -5
- package/dist/cjs/session/case/CaseClient.js.map +1 -1
- package/dist/cjs/session/case/CaseServer.js +2 -2
- package/dist/cjs/session/case/CaseServer.js.map +1 -1
- package/dist/cjs/session/pase/PaseMessages.js +2 -2
- package/dist/cjs/session/pase/PaseMessages.js.map +1 -1
- package/dist/esm/action/Val.d.ts +4 -0
- package/dist/esm/action/Val.d.ts.map +1 -1
- package/dist/esm/action/Val.js.map +1 -1
- package/dist/esm/action/client/ClientInteraction.d.ts +10 -8
- package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.js +154 -82
- package/dist/esm/action/client/ClientInteraction.js.map +1 -1
- package/dist/esm/action/client/ClientSubscription.d.ts +17 -0
- package/dist/esm/action/client/ClientSubscription.d.ts.map +1 -0
- package/dist/esm/action/client/ClientSubscription.js +6 -0
- package/dist/esm/action/client/ClientSubscription.js.map +6 -0
- package/dist/esm/action/client/ClientSubscriptionHandler.d.ts +20 -0
- package/dist/esm/action/client/ClientSubscriptionHandler.d.ts.map +1 -0
- package/dist/esm/action/client/ClientSubscriptionHandler.js +97 -0
- package/dist/esm/action/client/ClientSubscriptionHandler.js.map +6 -0
- package/dist/esm/action/client/ClientSubscriptions.d.ts +45 -0
- package/dist/esm/action/client/ClientSubscriptions.d.ts.map +1 -0
- package/dist/esm/action/client/ClientSubscriptions.js +129 -0
- package/dist/esm/action/client/ClientSubscriptions.js.map +6 -0
- package/dist/esm/action/client/InputChunk.d.ts +12 -0
- package/dist/esm/action/client/InputChunk.d.ts.map +1 -0
- package/dist/esm/action/client/InputChunk.js +69 -0
- package/dist/esm/action/client/InputChunk.js.map +6 -0
- package/dist/esm/action/client/ReadScope.d.ts +26 -0
- package/dist/esm/action/client/ReadScope.d.ts.map +1 -0
- package/dist/esm/action/client/ReadScope.js +67 -0
- package/dist/esm/action/client/ReadScope.js.map +6 -0
- package/dist/esm/action/client/index.d.ts +5 -0
- package/dist/esm/action/client/index.d.ts.map +1 -1
- package/dist/esm/action/client/index.js +5 -0
- package/dist/esm/action/client/index.js.map +1 -1
- package/dist/esm/action/request/Invoke.d.ts.map +1 -1
- package/dist/esm/action/request/Invoke.js +8 -2
- package/dist/esm/action/request/Invoke.js.map +1 -1
- package/dist/esm/action/request/Read.d.ts +0 -4
- package/dist/esm/action/request/Read.d.ts.map +1 -1
- package/dist/esm/action/request/Read.js.map +1 -1
- package/dist/esm/action/request/Subscribe.d.ts +14 -1
- package/dist/esm/action/request/Subscribe.d.ts.map +1 -1
- package/dist/esm/action/request/Subscribe.js +2 -2
- package/dist/esm/action/request/Subscribe.js.map +1 -1
- package/dist/esm/action/response/SubscribeResult.d.ts +3 -5
- package/dist/esm/action/response/SubscribeResult.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeReadResponse.d.ts +1 -1
- package/dist/esm/action/server/AttributeReadResponse.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeSubscriptionResponse.d.ts +1 -1
- package/dist/esm/action/server/AttributeSubscriptionResponse.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeSubscriptionResponse.js.map +1 -1
- package/dist/esm/action/server/CommandInvokeResponse.d.ts +2 -1
- package/dist/esm/action/server/CommandInvokeResponse.d.ts.map +1 -1
- package/dist/esm/action/server/CommandInvokeResponse.js +1 -1
- package/dist/esm/action/server/CommandInvokeResponse.js.map +1 -1
- package/dist/esm/action/server/EventReadResponse.d.ts +1 -1
- package/dist/esm/action/server/EventReadResponse.d.ts.map +1 -1
- package/dist/esm/codec/MessageCodec.d.ts +1 -1
- package/dist/esm/codec/MessageCodec.d.ts.map +1 -1
- package/dist/esm/common/FailsafeContext.d.ts.map +1 -1
- package/dist/esm/common/FailsafeContext.js +0 -1
- package/dist/esm/common/FailsafeContext.js.map +1 -1
- package/dist/esm/fabric/Fabric.d.ts.map +1 -1
- package/dist/esm/fabric/Fabric.js +4 -1
- package/dist/esm/fabric/Fabric.js.map +1 -1
- package/dist/esm/fabric/FabricAuthority.d.ts +6 -1
- package/dist/esm/fabric/FabricAuthority.d.ts.map +1 -1
- package/dist/esm/fabric/FabricAuthority.js +25 -1
- package/dist/esm/fabric/FabricAuthority.js.map +1 -1
- package/dist/esm/groups/FabricGroups.d.ts +1 -1
- package/dist/esm/groups/FabricGroups.d.ts.map +1 -1
- package/dist/esm/groups/Groups.d.ts +2 -2
- package/dist/esm/groups/Groups.d.ts.map +1 -1
- package/dist/esm/groups/Groups.js +1 -1
- package/dist/esm/groups/Groups.js.map +1 -1
- package/dist/esm/interaction/AttributeDataEncoder.d.ts +1 -1
- package/dist/esm/interaction/FabricAccessControl.d.ts +1 -1
- package/dist/esm/interaction/FabricAccessControl.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionClient.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionClient.js +8 -4
- package/dist/esm/interaction/InteractionClient.js.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.d.ts +21 -17
- package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.js +19 -11
- package/dist/esm/interaction/InteractionMessenger.js.map +1 -1
- package/dist/esm/mdns/MdnsScanner.d.ts +5 -6
- package/dist/esm/mdns/MdnsScanner.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsScanner.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.js +2 -2
- package/dist/esm/peer/ControllerCommissioningFlow.js +1 -1
- package/dist/esm/peer/OperationalPeer.d.ts +1 -1
- package/dist/esm/peer/OperationalPeer.d.ts.map +1 -1
- package/dist/esm/peer/PeerAddress.d.ts.map +1 -1
- package/dist/esm/peer/PeerAddress.js +2 -2
- package/dist/esm/peer/PeerAddress.js.map +1 -1
- package/dist/esm/peer/PeerAddressStore.d.ts +1 -1
- package/dist/esm/peer/PeerAddressStore.d.ts.map +1 -1
- package/dist/esm/peer/PeerSet.d.ts.map +1 -1
- package/dist/esm/peer/PeerSet.js +4 -4
- package/dist/esm/peer/PeerSet.js.map +1 -1
- package/dist/esm/protocol/ChannelManager.d.ts +1 -3
- package/dist/esm/protocol/ChannelManager.d.ts.map +1 -1
- package/dist/esm/protocol/ChannelManager.js +3 -6
- package/dist/esm/protocol/ChannelManager.js.map +1 -1
- package/dist/esm/protocol/DeviceCommissioner.d.ts +3 -2
- package/dist/esm/protocol/DeviceCommissioner.d.ts.map +1 -1
- package/dist/esm/protocol/DeviceCommissioner.js +4 -6
- package/dist/esm/protocol/DeviceCommissioner.js.map +1 -1
- package/dist/esm/protocol/ExchangeManager.d.ts +1 -3
- package/dist/esm/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeManager.js +8 -7
- package/dist/esm/protocol/ExchangeManager.js.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.js +4 -2
- package/dist/esm/protocol/ExchangeProvider.js.map +1 -1
- package/dist/esm/protocol/MessageChannel.d.ts +17 -4
- package/dist/esm/protocol/MessageChannel.d.ts.map +1 -1
- package/dist/esm/protocol/MessageChannel.js +12 -3
- package/dist/esm/protocol/MessageChannel.js.map +1 -1
- package/dist/esm/protocol/MessageExchange.d.ts +0 -6
- package/dist/esm/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/esm/protocol/MessageExchange.js +7 -7
- package/dist/esm/protocol/MessageExchange.js.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts +3 -0
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.js +4 -0
- package/dist/esm/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/esm/securechannel/SecureChannelProtocol.d.ts +0 -1
- package/dist/esm/securechannel/SecureChannelProtocol.d.ts.map +1 -1
- package/dist/esm/securechannel/SecureChannelProtocol.js +0 -3
- package/dist/esm/securechannel/SecureChannelProtocol.js.map +1 -1
- package/dist/esm/session/GroupSession.d.ts +1 -1
- package/dist/esm/session/GroupSession.d.ts.map +1 -1
- package/dist/esm/session/GroupSession.js +1 -1
- package/dist/esm/session/InsecureSession.d.ts +2 -1
- package/dist/esm/session/InsecureSession.d.ts.map +1 -1
- package/dist/esm/session/InsecureSession.js +3 -2
- package/dist/esm/session/InsecureSession.js.map +1 -1
- package/dist/esm/session/NodeSession.d.ts +5 -3
- package/dist/esm/session/NodeSession.d.ts.map +1 -1
- package/dist/esm/session/NodeSession.js +12 -2
- package/dist/esm/session/NodeSession.js.map +1 -1
- package/dist/esm/session/SessionManager.d.ts +2 -3
- package/dist/esm/session/SessionManager.d.ts.map +1 -1
- package/dist/esm/session/SessionManager.js +1 -3
- package/dist/esm/session/SessionManager.js.map +1 -1
- package/dist/esm/session/case/CaseClient.d.ts.map +1 -1
- package/dist/esm/session/case/CaseClient.js +3 -2
- package/dist/esm/session/case/CaseClient.js.map +1 -1
- package/dist/esm/session/case/CaseServer.js +1 -1
- package/dist/esm/session/pase/PaseMessages.js +1 -1
- package/package.json +6 -6
- package/src/action/Val.ts +5 -0
- package/src/action/client/ClientInteraction.ts +178 -90
- package/src/action/client/ClientSubscription.ts +18 -0
- package/src/action/client/ClientSubscriptionHandler.ts +137 -0
- package/src/action/client/ClientSubscriptions.ts +172 -0
- package/src/action/client/InputChunk.ts +79 -0
- package/src/action/client/ReadScope.ts +107 -0
- package/src/action/client/index.ts +5 -0
- package/src/action/request/Invoke.ts +11 -2
- package/src/action/request/Read.ts +0 -5
- package/src/action/request/Subscribe.ts +17 -3
- package/src/action/response/SubscribeResult.ts +3 -4
- package/src/action/server/AttributeReadResponse.ts +1 -1
- package/src/action/server/AttributeSubscriptionResponse.ts +2 -1
- package/src/action/server/CommandInvokeResponse.ts +4 -2
- package/src/action/server/EventReadResponse.ts +2 -2
- package/src/codec/MessageCodec.ts +1 -1
- package/src/common/FailsafeContext.ts +0 -1
- package/src/fabric/Fabric.ts +4 -1
- package/src/fabric/FabricAuthority.ts +29 -1
- package/src/groups/FabricGroups.ts +1 -1
- package/src/groups/Groups.ts +3 -2
- package/src/interaction/FabricAccessControl.ts +1 -1
- package/src/interaction/InteractionClient.ts +8 -4
- package/src/interaction/InteractionMessenger.ts +20 -13
- package/src/mdns/MdnsScanner.ts +5 -6
- package/src/peer/ControllerCommissioner.ts +2 -2
- package/src/peer/ControllerCommissioningFlow.ts +1 -1
- package/src/peer/OperationalPeer.ts +1 -1
- package/src/peer/PeerAddress.ts +2 -2
- package/src/peer/PeerAddressStore.ts +1 -1
- package/src/peer/PeerSet.ts +6 -4
- package/src/protocol/ChannelManager.ts +2 -4
- package/src/protocol/DeviceCommissioner.ts +4 -8
- package/src/protocol/ExchangeManager.ts +9 -7
- package/src/protocol/ExchangeProvider.ts +7 -3
- package/src/protocol/MessageChannel.ts +19 -4
- package/src/protocol/MessageExchange.ts +8 -12
- package/src/securechannel/SecureChannelMessenger.ts +4 -0
- package/src/securechannel/SecureChannelProtocol.ts +0 -4
- package/src/session/GroupSession.ts +1 -1
- package/src/session/InsecureSession.ts +3 -1
- package/src/session/NodeSession.ts +14 -4
- package/src/session/SessionManager.ts +1 -3
- package/src/session/case/CaseClient.ts +3 -2
- package/src/session/case/CaseServer.ts +1 -1
- package/src/session/pase/PaseMessages.ts +1 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { ReadResult } from "#action/response/ReadResult.js";
|
|
8
|
+
import { DecodedDataReport } from "#interaction/DecodedDataReport.js";
|
|
9
|
+
import { DataReport, Status, TlvAny } from "#types";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Converts a {@link DataReport} into a {@link ReadResult.Chunk}.
|
|
13
|
+
*/
|
|
14
|
+
export function* InputChunk(input: DataReport): ReadResult.Chunk {
|
|
15
|
+
const report = DecodedDataReport(input);
|
|
16
|
+
|
|
17
|
+
for (const attr of report.attributeReports) {
|
|
18
|
+
yield {
|
|
19
|
+
kind: "attr-value",
|
|
20
|
+
tlv: TlvAny,
|
|
21
|
+
...attr,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (report.attributeStatus) {
|
|
26
|
+
for (const attr of report.attributeStatus) {
|
|
27
|
+
yield {
|
|
28
|
+
kind: "attr-status",
|
|
29
|
+
path: attr.path,
|
|
30
|
+
status: attr.status ?? Status.Failure, // TODO - attr.status shouldn't be optional?
|
|
31
|
+
clusterStatus: attr.clusterStatus,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
for (const event of report.eventReports) {
|
|
37
|
+
for (const occurrence of event.events) {
|
|
38
|
+
yield {
|
|
39
|
+
kind: "event-value",
|
|
40
|
+
path: event.path,
|
|
41
|
+
value: occurrence,
|
|
42
|
+
number: occurrence.eventNumber,
|
|
43
|
+
priority: occurrence.priority,
|
|
44
|
+
timestamp: Number(
|
|
45
|
+
// TODO - this may not be useful, need to determine correct form
|
|
46
|
+
occurrence.epochTimestamp ??
|
|
47
|
+
occurrence.systemTimestamp ??
|
|
48
|
+
occurrence.deltaEpochTimestamp ??
|
|
49
|
+
occurrence.deltaSystemTimestamp ??
|
|
50
|
+
0,
|
|
51
|
+
),
|
|
52
|
+
|
|
53
|
+
// TODO - temporary, field will be removed
|
|
54
|
+
tlv: TlvAny,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (report.eventStatus) {
|
|
60
|
+
for (const event of report.eventStatus) {
|
|
61
|
+
if (event.status !== undefined) {
|
|
62
|
+
yield {
|
|
63
|
+
kind: "event-status",
|
|
64
|
+
path: event.path,
|
|
65
|
+
status: event.status,
|
|
66
|
+
clusterStatus: event.clusterStatus,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (event.clusterStatus !== undefined) {
|
|
70
|
+
yield {
|
|
71
|
+
kind: "event-status",
|
|
72
|
+
path: event.path,
|
|
73
|
+
status: event.status ?? Status.Failure,
|
|
74
|
+
clusterStatus: event.clusterStatus,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Read } from "#action/request/Read.js";
|
|
8
|
+
import { ClusterId, EndpointNumber } from "#types";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This utility tells you whether a given endpoint/cluster is in scope for a read.
|
|
12
|
+
*/
|
|
13
|
+
export interface ReadScope {
|
|
14
|
+
/**
|
|
15
|
+
* Is a cluster included in the read?
|
|
16
|
+
*
|
|
17
|
+
* This is useful to determine if the read should include a version filter.
|
|
18
|
+
*/
|
|
19
|
+
isRelevant(endpoint: EndpointNumber, cluster: ClusterId): boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Are all attributes in a cluster included in a read?
|
|
23
|
+
*
|
|
24
|
+
* This is useful to determine if the cluster's version should be updated in response to a read.
|
|
25
|
+
*/
|
|
26
|
+
isWildcard(endpoint: EndpointNumber, cluster: ClusterId): boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface Check {
|
|
30
|
+
(endpoint: EndpointNumber, cluster: ClusterId): boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function ReadScope(read: Read): ReadScope {
|
|
34
|
+
return {
|
|
35
|
+
isRelevant(endpoint, cluster) {
|
|
36
|
+
this.isRelevant = generateScopeTester(read, "any");
|
|
37
|
+
return this.isRelevant(endpoint, cluster);
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
isWildcard(endpoint, cluster) {
|
|
41
|
+
this.isWildcard = generateScopeTester(read, "all");
|
|
42
|
+
return this.isWildcard(endpoint, cluster);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function generateScopeTester(read: Read, attrRequirement: "any" | "all"): Check {
|
|
48
|
+
if (!read.attributeRequests?.length) {
|
|
49
|
+
return isNever;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let wildcardEndpointClusters: undefined | Set<ClusterId>;
|
|
53
|
+
let specificEndpointClusters: undefined | Record<EndpointNumber, true | Set<ClusterId>>;
|
|
54
|
+
|
|
55
|
+
for (const { endpointId, clusterId, attributeId } of read.attributeRequests) {
|
|
56
|
+
// Ignore path if it addresses a specific attribute and we are only interested in wildcard attributes
|
|
57
|
+
if (attributeId !== undefined && attrRequirement === "all") {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Wildcard endpoint
|
|
62
|
+
if (endpointId === undefined) {
|
|
63
|
+
// Full wildcard read; short-circuit all subsequent logic
|
|
64
|
+
if (clusterId === undefined) {
|
|
65
|
+
return isAlways;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Wildcard cluster across all endpoints
|
|
69
|
+
(wildcardEndpointClusters ??= new Set()).add(clusterId);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Specific endpoint with wildcard cluster cases
|
|
74
|
+
if (clusterId === undefined) {
|
|
75
|
+
(specificEndpointClusters ??= {})[endpointId] = true;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Specific endpoint and cluster
|
|
80
|
+
if (attributeId === undefined) {
|
|
81
|
+
let ep = specificEndpointClusters?.[endpointId];
|
|
82
|
+
if (ep === true) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (ep === undefined) {
|
|
86
|
+
ep = (specificEndpointClusters ??= {})[endpointId] = new Set();
|
|
87
|
+
}
|
|
88
|
+
ep.add(clusterId);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return (endpoint, cluster) => {
|
|
93
|
+
if (wildcardEndpointClusters?.has(cluster)) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
const ep = specificEndpointClusters?.[endpoint];
|
|
97
|
+
return ep === true || !!ep?.has(cluster);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function isNever() {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function isAlways() {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { FALLBACK_INTERACTIONMODEL_REVISION } from "#session/Session.js";
|
|
8
|
-
import { ClusterType, CommandData, InvokeRequest, TlvSchema, TypeFromSchema } from "#types";
|
|
8
|
+
import { ClusterType, CommandData, InvokeRequest, TlvSchema, TlvStream, TypeFromSchema } from "#types";
|
|
9
9
|
import { MalformedRequestError } from "./MalformedRequestError.js";
|
|
10
10
|
import { Specifier } from "./Specifier.js";
|
|
11
11
|
|
|
@@ -72,11 +72,20 @@ export namespace Invoke {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export function Command<const C extends ClusterType>(request: Invoke.CommandRequest<C>): CommandData {
|
|
75
|
+
const command = Invoke.commandOf(request);
|
|
76
|
+
|
|
77
|
+
let commandFields: TlvStream | undefined;
|
|
78
|
+
|
|
79
|
+
if ("fields" in request) {
|
|
80
|
+
commandFields = command.requestSchema.encodeTlv(request.fields, { forWriteInteraction: true });
|
|
81
|
+
}
|
|
82
|
+
|
|
75
83
|
const result: CommandData = {
|
|
76
84
|
commandPath: {
|
|
77
85
|
clusterId: Specifier.clusterFor(request.cluster).id,
|
|
78
|
-
commandId:
|
|
86
|
+
commandId: command.requestId,
|
|
79
87
|
},
|
|
88
|
+
commandFields,
|
|
80
89
|
};
|
|
81
90
|
|
|
82
91
|
const endpointId = Specifier.endpointIdOf(request);
|
|
@@ -23,11 +23,6 @@ import { Specifier } from "./Specifier.js";
|
|
|
23
23
|
*/
|
|
24
24
|
export interface Read extends ReadRequest {}
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Formulate a read request using Matter numeric IDs.
|
|
28
|
-
*/
|
|
29
|
-
export function Read(options: Read.Options): Read;
|
|
30
|
-
|
|
31
26
|
/**
|
|
32
27
|
* Formulate a read request with extended options and name-based IDs.
|
|
33
28
|
*/
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import type { ReadResult } from "#action/response/ReadResult.js";
|
|
8
|
+
import { CanceledError, TimeoutError, UINT16_MAX } from "#general";
|
|
8
9
|
import { MalformedRequestError } from "./MalformedRequestError.js";
|
|
9
10
|
import { Read } from "./Read.js";
|
|
10
11
|
|
|
@@ -18,10 +19,21 @@ export interface Subscribe extends Read {
|
|
|
18
19
|
keepSubscriptions: boolean;
|
|
19
20
|
minIntervalFloorSeconds?: number;
|
|
20
21
|
maxIntervalCeilingSeconds?: number;
|
|
22
|
+
maxPeerResponseTime?: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Invoked when subscribed data changes.
|
|
26
|
+
*/
|
|
27
|
+
updated?: (data: ReadResult) => Promise<void>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Invoked when the subscription is no longer active.
|
|
31
|
+
*/
|
|
32
|
+
closed?: (cause: CanceledError | TimeoutError) => void;
|
|
21
33
|
}
|
|
22
34
|
|
|
23
|
-
export function Subscribe(options: Subscribe.Options): Subscribe {
|
|
24
|
-
const subscribe = Read(options) as unknown as Subscribe;
|
|
35
|
+
export function Subscribe(options: Subscribe.Options, ...selectors: Read.Selector[]): Subscribe {
|
|
36
|
+
const subscribe = Read(options, ...selectors) as unknown as Subscribe;
|
|
25
37
|
|
|
26
38
|
const { keepSubscriptions, minIntervalFloorSeconds, maxIntervalCeilingSeconds } = options;
|
|
27
39
|
subscribe.keepSubscriptions = keepSubscriptions ?? true;
|
|
@@ -48,6 +60,8 @@ export namespace Subscribe {
|
|
|
48
60
|
keepSubscriptions?: boolean;
|
|
49
61
|
minIntervalFloorSeconds?: number;
|
|
50
62
|
maxIntervalCeilingSeconds?: number;
|
|
63
|
+
update?: Subscribe["updated"];
|
|
64
|
+
closed?: Subscribe["closed"];
|
|
51
65
|
}
|
|
52
66
|
}
|
|
53
67
|
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { SubscribeResponse } from "#types";
|
|
8
|
-
import { ReadResult } from "./ReadResult.js";
|
|
9
8
|
|
|
10
|
-
export
|
|
9
|
+
export type SubscribeResult = Promise<ActiveSubscription>;
|
|
11
10
|
|
|
12
|
-
export
|
|
13
|
-
|
|
11
|
+
export interface ActiveSubscription extends SubscribeResponse {
|
|
12
|
+
close(): void;
|
|
14
13
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { InteractionSession } from "#action/
|
|
7
|
+
import { InteractionSession } from "#action/Interactable.js";
|
|
8
8
|
import { AttributeTypeProtocol, ClusterProtocol, EndpointProtocol, NodeProtocol } from "#action/protocols.js";
|
|
9
9
|
import { Read } from "#action/request/Read.js";
|
|
10
10
|
import { ReadResult } from "#action/response/ReadResult.js";
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Copyright 2022-2025 Matter.js Authors
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
import { InteractionSession } from "#action/Interactable.js";
|
|
7
8
|
import { AttributeTypeProtocol, ClusterProtocol, EndpointProtocol, NodeProtocol } from "#action/protocols.js";
|
|
8
9
|
import { ReadResult } from "#action/response/ReadResult.js";
|
|
9
10
|
import { InternalError } from "#general";
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { CommandInvokeHandler, Invoke, InvokeResult, Subject } from "#action/index.js";
|
|
8
7
|
import { InteractionSession } from "#action/Interactable.js";
|
|
9
|
-
import { CommandTypeProtocol, EndpointProtocol, NodeProtocol } from "#action/protocols.js";
|
|
8
|
+
import { CommandInvokeHandler, CommandTypeProtocol, EndpointProtocol, NodeProtocol } from "#action/protocols.js";
|
|
9
|
+
import { Invoke } from "#action/request/Invoke.js";
|
|
10
|
+
import { InvokeResult } from "#action/response/InvokeResult.js";
|
|
10
11
|
import { AccessControl } from "#action/server/AccessControl.js";
|
|
11
12
|
import { DataResponse, FallbackLimits } from "#action/server/DataResponse.js";
|
|
12
13
|
import { Diagnostic, InternalError, Logger } from "#general";
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
TlvStream,
|
|
23
24
|
ValidationError,
|
|
24
25
|
} from "#types";
|
|
26
|
+
import { Subject } from "./Subject.js";
|
|
25
27
|
|
|
26
28
|
const logger = Logger.get("CommandInvokeResponse");
|
|
27
29
|
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { InteractionSession } from "#action/
|
|
7
|
+
import { InteractionSession } from "#action/Interactable.js";
|
|
8
8
|
import { ClusterProtocol, EndpointProtocol, EventTypeProtocol, NodeProtocol } from "#action/protocols.js";
|
|
9
9
|
import { Read } from "#action/request/Read.js";
|
|
10
10
|
import { ReadResult } from "#action/response/ReadResult.js";
|
|
11
11
|
import { AccessControl } from "#action/server/AccessControl.js";
|
|
12
12
|
import { DataResponse, FallbackLimits } from "#action/server/DataResponse.js";
|
|
13
|
-
import { NumberedOccurrence } from "#events/
|
|
13
|
+
import { NumberedOccurrence } from "#events/Occurrence.js";
|
|
14
14
|
import { InternalError, isObject, Logger } from "#general";
|
|
15
15
|
import { DataModelPath, ElementTag, EventModel } from "#model";
|
|
16
16
|
import {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
NotImplementedError,
|
|
15
15
|
UnexpectedDataError,
|
|
16
16
|
} from "#general";
|
|
17
|
-
import { ExchangeLogContext } from "#protocol/
|
|
17
|
+
import type { ExchangeLogContext } from "#protocol/MessageExchange.js";
|
|
18
18
|
import { GroupId, INTERACTION_PROTOCOL_ID, NodeId, SECURE_CHANNEL_PROTOCOL_ID, SecureMessageType } from "#types";
|
|
19
19
|
import { MessageType } from "../interaction/InteractionMessenger.js";
|
|
20
20
|
|
package/src/fabric/Fabric.ts
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Icac
|
|
7
|
+
import { Icac } from "#certificate/kinds/Icac.js";
|
|
8
|
+
import { Noc } from "#certificate/kinds/Noc.js";
|
|
9
|
+
import { Rcac } from "#certificate/kinds/Rcac.js";
|
|
10
|
+
import { X509Base } from "#certificate/kinds/X509Base.js";
|
|
8
11
|
import {
|
|
9
12
|
BinaryKeyPair,
|
|
10
13
|
Bytes,
|
|
@@ -5,7 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { CertificateAuthority } from "#certificate/CertificateAuthority.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
Bytes,
|
|
10
|
+
Construction,
|
|
11
|
+
CRYPTO_SYMMETRIC_KEY_LENGTH,
|
|
12
|
+
Environment,
|
|
13
|
+
Environmental,
|
|
14
|
+
ImplementationError,
|
|
15
|
+
Logger,
|
|
16
|
+
Observable,
|
|
17
|
+
} from "#general";
|
|
9
18
|
import { CaseAuthenticatedTag, FabricId, FabricIndex, NodeId, VendorId } from "#types";
|
|
10
19
|
import { Fabric, FabricBuilder } from "./Fabric.js";
|
|
11
20
|
import { FabricManager } from "./FabricManager.js";
|
|
@@ -48,14 +57,25 @@ export const DEFAULT_FABRIC_ID = FabricId(1);
|
|
|
48
57
|
* Manages fabrics controlled locally associated with a specific CA.
|
|
49
58
|
*/
|
|
50
59
|
export class FabricAuthority {
|
|
60
|
+
#construction: Construction<FabricAuthority>;
|
|
51
61
|
#ca: CertificateAuthority;
|
|
52
62
|
#fabrics: FabricManager;
|
|
53
63
|
#config: FabricAuthorityConfiguration;
|
|
64
|
+
#fabricAdded = new Observable<[Fabric]>();
|
|
54
65
|
|
|
55
66
|
constructor({ ca, fabrics, config }: FabricAuthorityContext) {
|
|
56
67
|
this.#ca = ca;
|
|
57
68
|
this.#fabrics = fabrics;
|
|
58
69
|
this.#config = config;
|
|
70
|
+
|
|
71
|
+
this.#construction = Construction(this, async () => {
|
|
72
|
+
await this.#ca.construction;
|
|
73
|
+
await this.#fabrics.construction;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get construction() {
|
|
78
|
+
return this.#construction;
|
|
59
79
|
}
|
|
60
80
|
|
|
61
81
|
/**
|
|
@@ -89,6 +109,13 @@ export class FabricAuthority {
|
|
|
89
109
|
return Array.from(this.#fabrics).filter(this.hasControlOf.bind(this));
|
|
90
110
|
}
|
|
91
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Emits after creating a new fabric.
|
|
114
|
+
*/
|
|
115
|
+
get fabricAdded() {
|
|
116
|
+
return this.#fabricAdded;
|
|
117
|
+
}
|
|
118
|
+
|
|
92
119
|
/**
|
|
93
120
|
* Determine whether a fabric belongs to this authority.
|
|
94
121
|
*/
|
|
@@ -137,6 +164,7 @@ export class FabricAuthority {
|
|
|
137
164
|
this.#fabrics.addFabric(fabric);
|
|
138
165
|
|
|
139
166
|
logger.debug(`Created new controller fabric ${index}`);
|
|
167
|
+
this.#fabricAdded.emit(fabric);
|
|
140
168
|
|
|
141
169
|
return fabric;
|
|
142
170
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2022-2025 Matter.js Authors
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { Fabric } from "#fabric/Fabric.js";
|
|
6
|
+
import type { Fabric } from "#fabric/Fabric.js";
|
|
7
7
|
import { BasicMap, Bytes, InternalError, MatterFlowError, StorageContext } from "#general";
|
|
8
8
|
import { GroupKeySet, KeySets, OperationalKeySet } from "#groups/KeySets.js";
|
|
9
9
|
import { MessagingState } from "#groups/MessagingState.js";
|
package/src/groups/Groups.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Copyright 2022-2025 Matter.js Authors
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
6
|
+
|
|
7
|
+
import { Subject } from "#action/server/Subject.js";
|
|
8
|
+
import type { Fabric } from "#fabric/Fabric.js";
|
|
8
9
|
import { BasicMap, DataWriter, ImplementationError, ipv6BytesToString } from "#general";
|
|
9
10
|
import { EndpointNumber, GroupId } from "#types";
|
|
10
11
|
import { KeySets, OperationalKeySet } from "./KeySets.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Subject } from "#action/server/Subject.js";
|
|
7
7
|
import { AccessControl } from "#clusters/access-control";
|
|
8
|
-
import { Fabric } from "#fabric/Fabric.js";
|
|
8
|
+
import type { Fabric } from "#fabric/Fabric.js";
|
|
9
9
|
import { InternalError, Logger, MatterFlowError } from "#general";
|
|
10
10
|
import { AccessLevel } from "#model";
|
|
11
11
|
import {
|
|
@@ -509,7 +509,8 @@ export class InteractionClient {
|
|
|
509
509
|
.join(", ")} and events ${eventRequests?.map(path => resolveEventName(path)).join(", ")}`,
|
|
510
510
|
);
|
|
511
511
|
// Send read request and combine all (potentially chunked) responses
|
|
512
|
-
|
|
512
|
+
await messenger.sendReadRequest(request);
|
|
513
|
+
const response = await messenger.readAggregateDataReport();
|
|
513
514
|
|
|
514
515
|
// Normalize and decode the response
|
|
515
516
|
const normalizedResult = DecodedDataReport(response);
|
|
@@ -752,7 +753,7 @@ export class InteractionClient {
|
|
|
752
753
|
report: DataReport;
|
|
753
754
|
maximumPeerResponseTimeMs: number;
|
|
754
755
|
}>(async messenger => {
|
|
755
|
-
|
|
756
|
+
await messenger.sendSubscribeRequest({
|
|
756
757
|
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION,
|
|
757
758
|
attributeRequests: [{ endpointId, clusterId, attributeId }],
|
|
758
759
|
dataVersionFilters:
|
|
@@ -764,6 +765,7 @@ export class InteractionClient {
|
|
|
764
765
|
maxIntervalCeilingSeconds,
|
|
765
766
|
isFabricFiltered,
|
|
766
767
|
});
|
|
768
|
+
const { subscribeResponse, report } = await messenger.readAggregateSubscribeResponse();
|
|
767
769
|
return {
|
|
768
770
|
subscribeResponse,
|
|
769
771
|
report,
|
|
@@ -863,7 +865,7 @@ export class InteractionClient {
|
|
|
863
865
|
report: DataReport;
|
|
864
866
|
maximumPeerResponseTimeMs: number;
|
|
865
867
|
}>(async messenger => {
|
|
866
|
-
|
|
868
|
+
await messenger.sendSubscribeRequest({
|
|
867
869
|
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION,
|
|
868
870
|
eventRequests: [{ endpointId, clusterId, eventId, isUrgent }],
|
|
869
871
|
eventFilters: minimumEventNumber !== undefined ? [{ eventMin: minimumEventNumber }] : undefined,
|
|
@@ -872,6 +874,7 @@ export class InteractionClient {
|
|
|
872
874
|
maxIntervalCeilingSeconds,
|
|
873
875
|
isFabricFiltered,
|
|
874
876
|
});
|
|
877
|
+
const { subscribeResponse, report } = await messenger.readAggregateSubscribeResponse();
|
|
875
878
|
return {
|
|
876
879
|
subscribeResponse,
|
|
877
880
|
report,
|
|
@@ -1030,7 +1033,7 @@ export class InteractionClient {
|
|
|
1030
1033
|
report: DataReport;
|
|
1031
1034
|
maximumPeerResponseTimeMs: number;
|
|
1032
1035
|
}>(async messenger => {
|
|
1033
|
-
|
|
1036
|
+
await messenger.sendSubscribeRequest({
|
|
1034
1037
|
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION,
|
|
1035
1038
|
attributeRequests,
|
|
1036
1039
|
eventRequests,
|
|
@@ -1044,6 +1047,7 @@ export class InteractionClient {
|
|
|
1044
1047
|
dataVersion,
|
|
1045
1048
|
})),
|
|
1046
1049
|
});
|
|
1050
|
+
const { subscribeResponse, report } = await messenger.readAggregateSubscribeResponse();
|
|
1047
1051
|
return {
|
|
1048
1052
|
subscribeResponse,
|
|
1049
1053
|
report,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ReadResult } from "#action/
|
|
7
|
+
import { ReadResult } from "#action/response/ReadResult.js";
|
|
8
8
|
import {
|
|
9
9
|
Diagnostic,
|
|
10
10
|
InternalError,
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
UnexpectedDataError,
|
|
15
15
|
} from "#general";
|
|
16
16
|
import { Specification } from "#model";
|
|
17
|
+
import { ChannelNotConnectedError } from "#protocol/MessageChannel.js";
|
|
17
18
|
import {
|
|
18
19
|
ReceivedStatusResponseError,
|
|
19
20
|
Status,
|
|
@@ -37,7 +38,6 @@ import {
|
|
|
37
38
|
TypeFromSchema,
|
|
38
39
|
} from "#types";
|
|
39
40
|
import { Message, SessionType } from "../codec/MessageCodec.js";
|
|
40
|
-
import { ChannelNotConnectedError } from "../protocol/ExchangeManager.js";
|
|
41
41
|
import { ExchangeProvider } from "../protocol/ExchangeProvider.js";
|
|
42
42
|
import {
|
|
43
43
|
ExchangeSendOptions,
|
|
@@ -848,6 +848,14 @@ export class IncomingInteractionClientMessenger extends InteractionMessenger {
|
|
|
848
848
|
return result;
|
|
849
849
|
}
|
|
850
850
|
|
|
851
|
+
/**
|
|
852
|
+
* Read a single data report.
|
|
853
|
+
*/
|
|
854
|
+
async readDataReport() {
|
|
855
|
+
const dataReportMessage = await this.waitFor("DataReport", MessageType.ReportData);
|
|
856
|
+
return TlvDataReport.decode(dataReportMessage.payload);
|
|
857
|
+
}
|
|
858
|
+
|
|
851
859
|
/**
|
|
852
860
|
* Read data reports as they come in on the wire.
|
|
853
861
|
*
|
|
@@ -855,8 +863,7 @@ export class IncomingInteractionClientMessenger extends InteractionMessenger {
|
|
|
855
863
|
*/
|
|
856
864
|
async *readDataReports() {
|
|
857
865
|
while (true) {
|
|
858
|
-
const
|
|
859
|
-
const report = TlvDataReport.decode(dataReportMessage.payload);
|
|
866
|
+
const report = await this.readDataReport();
|
|
860
867
|
|
|
861
868
|
yield report;
|
|
862
869
|
|
|
@@ -895,16 +902,16 @@ export class IncomingInteractionClientMessenger extends InteractionMessenger {
|
|
|
895
902
|
}
|
|
896
903
|
|
|
897
904
|
export class InteractionClientMessenger extends IncomingInteractionClientMessenger {
|
|
905
|
+
#exchangeProvider: ExchangeProvider;
|
|
906
|
+
|
|
898
907
|
static async create(exchangeProvider: ExchangeProvider) {
|
|
899
908
|
const exchange = await exchangeProvider.initiateExchange();
|
|
900
909
|
return new this(exchange, exchangeProvider);
|
|
901
910
|
}
|
|
902
911
|
|
|
903
|
-
constructor(
|
|
904
|
-
exchange: MessageExchange,
|
|
905
|
-
private readonly exchangeProvider: ExchangeProvider,
|
|
906
|
-
) {
|
|
912
|
+
constructor(exchange: MessageExchange, exchangeProvider: ExchangeProvider) {
|
|
907
913
|
super(exchange);
|
|
914
|
+
this.#exchangeProvider = exchangeProvider;
|
|
908
915
|
}
|
|
909
916
|
|
|
910
917
|
/** Implements a send method with an automatic reconnection mechanism */
|
|
@@ -917,7 +924,7 @@ export class InteractionClientMessenger extends IncomingInteractionClientMesseng
|
|
|
917
924
|
return await this.exchange.send(messageType, payload, options);
|
|
918
925
|
} catch (error) {
|
|
919
926
|
if (
|
|
920
|
-
this
|
|
927
|
+
this.#exchangeProvider.supportsReconnect &&
|
|
921
928
|
(error instanceof RetransmissionLimitReachedError || error instanceof ChannelNotConnectedError) &&
|
|
922
929
|
!options?.multipleMessageInteraction
|
|
923
930
|
) {
|
|
@@ -927,8 +934,8 @@ export class InteractionClientMessenger extends IncomingInteractionClientMesseng
|
|
|
927
934
|
`${error instanceof RetransmissionLimitReachedError ? "Retransmission limit reached" : "Channel not connected"}, trying to reconnect and resend the message.`,
|
|
928
935
|
);
|
|
929
936
|
await this.exchange.close();
|
|
930
|
-
if (await this
|
|
931
|
-
this.exchange = await this
|
|
937
|
+
if (await this.#exchangeProvider.reconnectChannel()) {
|
|
938
|
+
this.exchange = await this.#exchangeProvider.initiateExchange();
|
|
932
939
|
return await this.exchange.send(messageType, payload, options);
|
|
933
940
|
}
|
|
934
941
|
} else {
|
|
@@ -939,8 +946,6 @@ export class InteractionClientMessenger extends IncomingInteractionClientMesseng
|
|
|
939
946
|
|
|
940
947
|
async sendReadRequest(readRequest: ReadRequest) {
|
|
941
948
|
await this.send(MessageType.ReadRequest, this.#encodeReadingRequest(TlvReadRequest, readRequest));
|
|
942
|
-
|
|
943
|
-
return this.readAggregateDataReport();
|
|
944
949
|
}
|
|
945
950
|
|
|
946
951
|
#encodeReadingRequest<T extends TlvSchema<any>>(schema: T, request: TypeFromSchema<T>) {
|
|
@@ -1000,7 +1005,9 @@ export class InteractionClientMessenger extends IncomingInteractionClientMesseng
|
|
|
1000
1005
|
async sendSubscribeRequest(subscribeRequest: SubscribeRequest) {
|
|
1001
1006
|
const request = this.#encodeReadingRequest(TlvSubscribeRequest, subscribeRequest);
|
|
1002
1007
|
await this.send(MessageType.SubscribeRequest, request);
|
|
1008
|
+
}
|
|
1003
1009
|
|
|
1010
|
+
async readAggregateSubscribeResponse() {
|
|
1004
1011
|
const report = await this.readAggregateDataReport();
|
|
1005
1012
|
const { subscriptionId } = report;
|
|
1006
1013
|
|