@matter/protocol 0.11.0-alpha.0-20241005-e3e4e4a7a
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/LICENSE +201 -0
- package/dist/cjs/MatterDevice.d.ts +79 -0
- package/dist/cjs/MatterDevice.d.ts.map +1 -0
- package/dist/cjs/MatterDevice.js +253 -0
- package/dist/cjs/MatterDevice.js.map +6 -0
- package/dist/cjs/ble/Ble.d.ts +29 -0
- package/dist/cjs/ble/Ble.d.ts.map +1 -0
- package/dist/cjs/ble/Ble.js +50 -0
- package/dist/cjs/ble/Ble.js.map +6 -0
- package/dist/cjs/ble/BleConsts.d.ts +32 -0
- package/dist/cjs/ble/BleConsts.d.ts.map +1 -0
- package/dist/cjs/ble/BleConsts.js +53 -0
- package/dist/cjs/ble/BleConsts.js.map +6 -0
- package/dist/cjs/ble/BtpSessionHandler.d.ts +87 -0
- package/dist/cjs/ble/BtpSessionHandler.d.ts.map +1 -0
- package/dist/cjs/ble/BtpSessionHandler.js +432 -0
- package/dist/cjs/ble/BtpSessionHandler.js.map +6 -0
- package/dist/cjs/ble/index.d.ts +9 -0
- package/dist/cjs/ble/index.d.ts.map +1 -0
- package/dist/cjs/ble/index.js +26 -0
- package/dist/cjs/ble/index.js.map +6 -0
- package/dist/cjs/certificate/AttestationCertificateManager.d.ts +28 -0
- package/dist/cjs/certificate/AttestationCertificateManager.d.ts.map +1 -0
- package/dist/cjs/certificate/AttestationCertificateManager.js +171 -0
- package/dist/cjs/certificate/AttestationCertificateManager.js.map +6 -0
- package/dist/cjs/certificate/CertificateManager.d.ts +575 -0
- package/dist/cjs/certificate/CertificateManager.d.ts.map +1 -0
- package/dist/cjs/certificate/CertificateManager.js +810 -0
- package/dist/cjs/certificate/CertificateManager.js.map +6 -0
- package/dist/cjs/certificate/CertificationDeclarationManager.d.ts +5 -0
- package/dist/cjs/certificate/CertificationDeclarationManager.d.ts.map +1 -0
- package/dist/cjs/certificate/CertificationDeclarationManager.js +54 -0
- package/dist/cjs/certificate/CertificationDeclarationManager.js.map +6 -0
- package/dist/cjs/certificate/ChipPAAuthorities.d.ts +14 -0
- package/dist/cjs/certificate/ChipPAAuthorities.d.ts.map +1 -0
- package/dist/cjs/certificate/ChipPAAuthorities.js +57 -0
- package/dist/cjs/certificate/ChipPAAuthorities.js.map +6 -0
- package/dist/cjs/certificate/DeviceCertification.d.ts +30 -0
- package/dist/cjs/certificate/DeviceCertification.d.ts.map +1 -0
- package/dist/cjs/certificate/DeviceCertification.js +103 -0
- package/dist/cjs/certificate/DeviceCertification.js.map +6 -0
- package/dist/cjs/certificate/RootCertificateManager.d.ts +33 -0
- package/dist/cjs/certificate/RootCertificateManager.d.ts.map +1 -0
- package/dist/cjs/certificate/RootCertificateManager.js +142 -0
- package/dist/cjs/certificate/RootCertificateManager.js.map +6 -0
- package/dist/cjs/certificate/index.d.ts +12 -0
- package/dist/cjs/certificate/index.d.ts.map +1 -0
- package/dist/cjs/certificate/index.js +29 -0
- package/dist/cjs/certificate/index.js.map +6 -0
- package/dist/cjs/cluster/client/AttributeClient.d.ts +61 -0
- package/dist/cjs/cluster/client/AttributeClient.d.ts.map +1 -0
- package/dist/cjs/cluster/client/AttributeClient.js +177 -0
- package/dist/cjs/cluster/client/AttributeClient.js.map +6 -0
- package/dist/cjs/cluster/client/ClusterClient.d.ts +10 -0
- package/dist/cjs/cluster/client/ClusterClient.d.ts.map +1 -0
- package/dist/cjs/cluster/client/ClusterClient.js +281 -0
- package/dist/cjs/cluster/client/ClusterClient.js.map +6 -0
- package/dist/cjs/cluster/client/ClusterClientTypes.d.ts +171 -0
- package/dist/cjs/cluster/client/ClusterClientTypes.d.ts.map +1 -0
- package/dist/cjs/cluster/client/ClusterClientTypes.js +22 -0
- package/dist/cjs/cluster/client/ClusterClientTypes.js.map +6 -0
- package/dist/cjs/cluster/client/EventClient.d.ts +41 -0
- package/dist/cjs/cluster/client/EventClient.d.ts.map +1 -0
- package/dist/cjs/cluster/client/EventClient.js +94 -0
- package/dist/cjs/cluster/client/EventClient.js.map +6 -0
- package/dist/cjs/cluster/client/index.d.ts +10 -0
- package/dist/cjs/cluster/client/index.d.ts.map +1 -0
- package/dist/cjs/cluster/client/index.js +27 -0
- package/dist/cjs/cluster/client/index.js.map +6 -0
- package/dist/cjs/cluster/index.d.ts +8 -0
- package/dist/cjs/cluster/index.d.ts.map +1 -0
- package/dist/cjs/cluster/index.js +25 -0
- package/dist/cjs/cluster/index.js.map +6 -0
- package/dist/cjs/cluster/server/AttributeServer.d.ts +307 -0
- package/dist/cjs/cluster/server/AttributeServer.d.ts.map +1 -0
- package/dist/cjs/cluster/server/AttributeServer.js +734 -0
- package/dist/cjs/cluster/server/AttributeServer.js.map +6 -0
- package/dist/cjs/cluster/server/ClusterDatasource.d.ts +16 -0
- package/dist/cjs/cluster/server/ClusterDatasource.d.ts.map +1 -0
- package/dist/cjs/cluster/server/ClusterDatasource.js +22 -0
- package/dist/cjs/cluster/server/ClusterDatasource.js.map +6 -0
- package/dist/cjs/cluster/server/ClusterServer.d.ts +40 -0
- package/dist/cjs/cluster/server/ClusterServer.d.ts.map +1 -0
- package/dist/cjs/cluster/server/ClusterServer.js +22 -0
- package/dist/cjs/cluster/server/ClusterServer.js.map +6 -0
- package/dist/cjs/cluster/server/CommandServer.d.ts +34 -0
- package/dist/cjs/cluster/server/CommandServer.d.ts.map +1 -0
- package/dist/cjs/cluster/server/CommandServer.js +76 -0
- package/dist/cjs/cluster/server/CommandServer.js.map +6 -0
- package/dist/cjs/cluster/server/EventServer.d.ts +41 -0
- package/dist/cjs/cluster/server/EventServer.d.ts.map +1 -0
- package/dist/cjs/cluster/server/EventServer.js +149 -0
- package/dist/cjs/cluster/server/EventServer.js.map +6 -0
- package/dist/cjs/cluster/server/index.d.ts +11 -0
- package/dist/cjs/cluster/server/index.d.ts.map +1 -0
- package/dist/cjs/cluster/server/index.js +28 -0
- package/dist/cjs/cluster/server/index.js.map +6 -0
- package/dist/cjs/codec/BtpCodec.d.ts +78 -0
- package/dist/cjs/codec/BtpCodec.d.ts.map +1 -0
- package/dist/cjs/codec/BtpCodec.js +254 -0
- package/dist/cjs/codec/BtpCodec.js.map +6 -0
- package/dist/cjs/codec/MessageCodec.d.ts +63 -0
- package/dist/cjs/codec/MessageCodec.d.ts.map +1 -0
- package/dist/cjs/codec/MessageCodec.js +220 -0
- package/dist/cjs/codec/MessageCodec.js.map +6 -0
- package/dist/cjs/codec/index.d.ts +9 -0
- package/dist/cjs/codec/index.d.ts.map +1 -0
- package/dist/cjs/codec/index.js +36 -0
- package/dist/cjs/codec/index.js.map +6 -0
- package/dist/cjs/common/FailsafeContext.d.ts +79 -0
- package/dist/cjs/common/FailsafeContext.d.ts.map +1 -0
- package/dist/cjs/common/FailsafeContext.js +237 -0
- package/dist/cjs/common/FailsafeContext.js.map +6 -0
- package/dist/cjs/common/FailsafeTimer.d.ts +25 -0
- package/dist/cjs/common/FailsafeTimer.d.ts.map +1 -0
- package/dist/cjs/common/FailsafeTimer.js +91 -0
- package/dist/cjs/common/FailsafeTimer.js.map +6 -0
- package/dist/cjs/common/InstanceBroadcaster.d.ts +273 -0
- package/dist/cjs/common/InstanceBroadcaster.d.ts.map +1 -0
- package/dist/cjs/common/InstanceBroadcaster.js +139 -0
- package/dist/cjs/common/InstanceBroadcaster.js.map +6 -0
- package/dist/cjs/common/OperationalCredentialsTypes.d.ts +21 -0
- package/dist/cjs/common/OperationalCredentialsTypes.d.ts.map +1 -0
- package/dist/cjs/common/OperationalCredentialsTypes.js +45 -0
- package/dist/cjs/common/OperationalCredentialsTypes.js.map +6 -0
- package/dist/cjs/common/Scanner.d.ts +121 -0
- package/dist/cjs/common/Scanner.d.ts.map +1 -0
- package/dist/cjs/common/Scanner.js +51 -0
- package/dist/cjs/common/Scanner.js.map +6 -0
- package/dist/cjs/common/index.d.ts +12 -0
- package/dist/cjs/common/index.d.ts.map +1 -0
- package/dist/cjs/common/index.js +29 -0
- package/dist/cjs/common/index.js.map +6 -0
- package/dist/cjs/endpoint/EndpointInterface.d.ts +37 -0
- package/dist/cjs/endpoint/EndpointInterface.d.ts.map +1 -0
- package/dist/cjs/endpoint/EndpointInterface.js +22 -0
- package/dist/cjs/endpoint/EndpointInterface.js.map +6 -0
- package/dist/cjs/endpoint/EndpointStructureLogger.d.ts +31 -0
- package/dist/cjs/endpoint/EndpointStructureLogger.d.ts.map +1 -0
- package/dist/cjs/endpoint/EndpointStructureLogger.js +236 -0
- package/dist/cjs/endpoint/EndpointStructureLogger.js.map +6 -0
- package/dist/cjs/endpoint/index.d.ts +8 -0
- package/dist/cjs/endpoint/index.d.ts.map +1 -0
- package/dist/cjs/endpoint/index.js +25 -0
- package/dist/cjs/endpoint/index.js.map +6 -0
- package/dist/cjs/fabric/Fabric.d.ts +121 -0
- package/dist/cjs/fabric/Fabric.d.ts.map +1 -0
- package/dist/cjs/fabric/Fabric.js +427 -0
- package/dist/cjs/fabric/Fabric.js.map +6 -0
- package/dist/cjs/fabric/FabricManager.d.ts +44 -0
- package/dist/cjs/fabric/FabricManager.d.ts.map +1 -0
- package/dist/cjs/fabric/FabricManager.js +209 -0
- package/dist/cjs/fabric/FabricManager.js.map +6 -0
- package/dist/cjs/fabric/index.d.ts +8 -0
- package/dist/cjs/fabric/index.d.ts.map +1 -0
- package/dist/cjs/fabric/index.js +25 -0
- package/dist/cjs/fabric/index.js.map +6 -0
- package/dist/cjs/index.d.ts +20 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +6 -0
- package/dist/cjs/interaction/AccessControlManager.d.ts +49 -0
- package/dist/cjs/interaction/AccessControlManager.d.ts.map +1 -0
- package/dist/cjs/interaction/AccessControlManager.js +248 -0
- package/dist/cjs/interaction/AccessControlManager.js.map +6 -0
- package/dist/cjs/interaction/AttributeDataDecoder.d.ts +52 -0
- package/dist/cjs/interaction/AttributeDataDecoder.d.ts.map +1 -0
- package/dist/cjs/interaction/AttributeDataDecoder.js +185 -0
- package/dist/cjs/interaction/AttributeDataDecoder.js.map +6 -0
- package/dist/cjs/interaction/AttributeDataEncoder.d.ts +71 -0
- package/dist/cjs/interaction/AttributeDataEncoder.d.ts.map +1 -0
- package/dist/cjs/interaction/AttributeDataEncoder.js +190 -0
- package/dist/cjs/interaction/AttributeDataEncoder.js.map +6 -0
- package/dist/cjs/interaction/EventDataDecoder.d.ts +30 -0
- package/dist/cjs/interaction/EventDataDecoder.d.ts.map +1 -0
- package/dist/cjs/interaction/EventDataDecoder.js +103 -0
- package/dist/cjs/interaction/EventDataDecoder.js.map +6 -0
- package/dist/cjs/interaction/EventHandler.d.ts +42 -0
- package/dist/cjs/interaction/EventHandler.d.ts.map +1 -0
- package/dist/cjs/interaction/EventHandler.js +112 -0
- package/dist/cjs/interaction/EventHandler.js.map +6 -0
- package/dist/cjs/interaction/InteractionClient.d.ts +294 -0
- package/dist/cjs/interaction/InteractionClient.d.ts.map +1 -0
- package/dist/cjs/interaction/InteractionClient.js +829 -0
- package/dist/cjs/interaction/InteractionClient.js.map +6 -0
- package/dist/cjs/interaction/InteractionEndpointStructure.d.ts +59 -0
- package/dist/cjs/interaction/InteractionEndpointStructure.d.ts.map +1 -0
- package/dist/cjs/interaction/InteractionEndpointStructure.js +341 -0
- package/dist/cjs/interaction/InteractionEndpointStructure.js.map +6 -0
- package/dist/cjs/interaction/InteractionMessenger.d.ts +315 -0
- package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -0
- package/dist/cjs/interaction/InteractionMessenger.js +484 -0
- package/dist/cjs/interaction/InteractionMessenger.js.map +6 -0
- package/dist/cjs/interaction/InteractionServer.d.ts +97 -0
- package/dist/cjs/interaction/InteractionServer.d.ts.map +1 -0
- package/dist/cjs/interaction/InteractionServer.js +1026 -0
- package/dist/cjs/interaction/InteractionServer.js.map +6 -0
- package/dist/cjs/interaction/ServerSubscription.d.ts +121 -0
- package/dist/cjs/interaction/ServerSubscription.d.ts.map +1 -0
- package/dist/cjs/interaction/ServerSubscription.js +672 -0
- package/dist/cjs/interaction/ServerSubscription.js.map +6 -0
- package/dist/cjs/interaction/Subscription.d.ts +44 -0
- package/dist/cjs/interaction/Subscription.d.ts.map +1 -0
- package/dist/cjs/interaction/Subscription.js +85 -0
- package/dist/cjs/interaction/Subscription.js.map +6 -0
- package/dist/cjs/interaction/SubscriptionOptions.d.ts +43 -0
- package/dist/cjs/interaction/SubscriptionOptions.d.ts.map +1 -0
- package/dist/cjs/interaction/SubscriptionOptions.js +46 -0
- package/dist/cjs/interaction/SubscriptionOptions.js.map +6 -0
- package/dist/cjs/interaction/index.d.ts +17 -0
- package/dist/cjs/interaction/index.d.ts.map +1 -0
- package/dist/cjs/interaction/index.js +34 -0
- package/dist/cjs/interaction/index.js.map +6 -0
- package/dist/cjs/mdns/MdnsBroadcaster.d.ts +34 -0
- package/dist/cjs/mdns/MdnsBroadcaster.d.ts.map +1 -0
- package/dist/cjs/mdns/MdnsBroadcaster.js +338 -0
- package/dist/cjs/mdns/MdnsBroadcaster.js.map +6 -0
- package/dist/cjs/mdns/MdnsConsts.d.ts +19 -0
- package/dist/cjs/mdns/MdnsConsts.d.ts.map +1 -0
- package/dist/cjs/mdns/MdnsConsts.js +52 -0
- package/dist/cjs/mdns/MdnsConsts.js.map +6 -0
- package/dist/cjs/mdns/MdnsInstanceBroadcaster.d.ts +28 -0
- package/dist/cjs/mdns/MdnsInstanceBroadcaster.d.ts.map +1 -0
- package/dist/cjs/mdns/MdnsInstanceBroadcaster.js +87 -0
- package/dist/cjs/mdns/MdnsInstanceBroadcaster.js.map +6 -0
- package/dist/cjs/mdns/MdnsScanner.d.ts +79 -0
- package/dist/cjs/mdns/MdnsScanner.d.ts.map +1 -0
- package/dist/cjs/mdns/MdnsScanner.js +842 -0
- package/dist/cjs/mdns/MdnsScanner.js.map +6 -0
- package/dist/cjs/mdns/MdnsServer.d.ts +29 -0
- package/dist/cjs/mdns/MdnsServer.d.ts.map +1 -0
- package/dist/cjs/mdns/MdnsServer.js +275 -0
- package/dist/cjs/mdns/MdnsServer.js.map +6 -0
- package/dist/cjs/mdns/MdnsService.d.ts +28 -0
- package/dist/cjs/mdns/MdnsService.d.ts.map +1 -0
- package/dist/cjs/mdns/MdnsService.js +95 -0
- package/dist/cjs/mdns/MdnsService.js.map +6 -0
- package/dist/cjs/mdns/index.d.ts +12 -0
- package/dist/cjs/mdns/index.d.ts.map +1 -0
- package/dist/cjs/mdns/index.js +29 -0
- package/dist/cjs/mdns/index.js.map +6 -0
- package/dist/cjs/package.json +10 -0
- package/dist/cjs/peer/ControllerCommissioner.d.ts +82 -0
- package/dist/cjs/peer/ControllerCommissioner.d.ts.map +1 -0
- package/dist/cjs/peer/ControllerCommissioner.js +224 -0
- package/dist/cjs/peer/ControllerCommissioner.js.map +6 -0
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts +88 -0
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts.map +1 -0
- package/dist/cjs/peer/ControllerCommissioningFlow.js +849 -0
- package/dist/cjs/peer/ControllerCommissioningFlow.js.map +6 -0
- package/dist/cjs/peer/ControllerDiscovery.d.ts +43 -0
- package/dist/cjs/peer/ControllerDiscovery.d.ts.map +1 -0
- package/dist/cjs/peer/ControllerDiscovery.js +192 -0
- package/dist/cjs/peer/ControllerDiscovery.js.map +6 -0
- package/dist/cjs/peer/OperationalPeer.d.ts +28 -0
- package/dist/cjs/peer/OperationalPeer.d.ts.map +1 -0
- package/dist/cjs/peer/OperationalPeer.js +22 -0
- package/dist/cjs/peer/OperationalPeer.js.map +6 -0
- package/dist/cjs/peer/PeerAddress.d.ts +30 -0
- package/dist/cjs/peer/PeerAddress.d.ts.map +1 -0
- package/dist/cjs/peer/PeerAddress.js +71 -0
- package/dist/cjs/peer/PeerAddress.js.map +6 -0
- package/dist/cjs/peer/PeerSet.d.ts +98 -0
- package/dist/cjs/peer/PeerSet.d.ts.map +1 -0
- package/dist/cjs/peer/PeerSet.js +500 -0
- package/dist/cjs/peer/PeerSet.js.map +6 -0
- package/dist/cjs/peer/PeerStore.d.ts +17 -0
- package/dist/cjs/peer/PeerStore.d.ts.map +1 -0
- package/dist/cjs/peer/PeerStore.js +31 -0
- package/dist/cjs/peer/PeerStore.js.map +6 -0
- package/dist/cjs/peer/index.d.ts +13 -0
- package/dist/cjs/peer/index.d.ts.map +1 -0
- package/dist/cjs/peer/index.js +30 -0
- package/dist/cjs/peer/index.js.map +6 -0
- package/dist/cjs/protocol/ChannelManager.d.ts +30 -0
- package/dist/cjs/protocol/ChannelManager.d.ts.map +1 -0
- package/dist/cjs/protocol/ChannelManager.js +168 -0
- package/dist/cjs/protocol/ChannelManager.js.map +6 -0
- package/dist/cjs/protocol/DeviceAdvertiser.d.ts +43 -0
- package/dist/cjs/protocol/DeviceAdvertiser.d.ts.map +1 -0
- package/dist/cjs/protocol/DeviceAdvertiser.js +185 -0
- package/dist/cjs/protocol/DeviceAdvertiser.js.map +6 -0
- package/dist/cjs/protocol/DeviceCommissioner.d.ts +49 -0
- package/dist/cjs/protocol/DeviceCommissioner.d.ts.map +1 -0
- package/dist/cjs/protocol/DeviceCommissioner.js +198 -0
- package/dist/cjs/protocol/DeviceCommissioner.js.map +6 -0
- package/dist/cjs/protocol/ExchangeManager.d.ts +73 -0
- package/dist/cjs/protocol/ExchangeManager.d.ts.map +1 -0
- package/dist/cjs/protocol/ExchangeManager.js +407 -0
- package/dist/cjs/protocol/ExchangeManager.js.map +6 -0
- package/dist/cjs/protocol/MessageCounter.d.ts +57 -0
- package/dist/cjs/protocol/MessageCounter.d.ts.map +1 -0
- package/dist/cjs/protocol/MessageCounter.js +104 -0
- package/dist/cjs/protocol/MessageCounter.js.map +6 -0
- package/dist/cjs/protocol/MessageExchange.d.ts +84 -0
- package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -0
- package/dist/cjs/protocol/MessageExchange.js +508 -0
- package/dist/cjs/protocol/MessageExchange.js.map +6 -0
- package/dist/cjs/protocol/MessageReceptionState.d.ts +65 -0
- package/dist/cjs/protocol/MessageReceptionState.d.ts.map +1 -0
- package/dist/cjs/protocol/MessageReceptionState.js +173 -0
- package/dist/cjs/protocol/MessageReceptionState.js.map +6 -0
- package/dist/cjs/protocol/ProtocolHandler.d.ts +13 -0
- package/dist/cjs/protocol/ProtocolHandler.d.ts.map +1 -0
- package/dist/cjs/protocol/ProtocolHandler.js +22 -0
- package/dist/cjs/protocol/ProtocolHandler.js.map +6 -0
- package/dist/cjs/protocol/index.d.ts +14 -0
- package/dist/cjs/protocol/index.d.ts.map +1 -0
- package/dist/cjs/protocol/index.js +31 -0
- package/dist/cjs/protocol/index.js.map +6 -0
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts +53 -0
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts.map +1 -0
- package/dist/cjs/securechannel/SecureChannelMessenger.js +143 -0
- package/dist/cjs/securechannel/SecureChannelMessenger.js.map +6 -0
- package/dist/cjs/securechannel/SecureChannelProtocol.d.ts +31 -0
- package/dist/cjs/securechannel/SecureChannelProtocol.d.ts.map +1 -0
- package/dist/cjs/securechannel/SecureChannelProtocol.js +140 -0
- package/dist/cjs/securechannel/SecureChannelProtocol.js.map +6 -0
- package/dist/cjs/securechannel/SecureChannelStatusMessageSchema.d.ts +23 -0
- package/dist/cjs/securechannel/SecureChannelStatusMessageSchema.d.ts.map +1 -0
- package/dist/cjs/securechannel/SecureChannelStatusMessageSchema.js +53 -0
- package/dist/cjs/securechannel/SecureChannelStatusMessageSchema.js.map +6 -0
- package/dist/cjs/securechannel/index.d.ts +9 -0
- package/dist/cjs/securechannel/index.d.ts.map +1 -0
- package/dist/cjs/securechannel/index.js +26 -0
- package/dist/cjs/securechannel/index.js.map +6 -0
- package/dist/cjs/session/InsecureSession.d.ts +38 -0
- package/dist/cjs/session/InsecureSession.d.ts.map +1 -0
- package/dist/cjs/session/InsecureSession.js +95 -0
- package/dist/cjs/session/InsecureSession.js.map +6 -0
- package/dist/cjs/session/SecureSession.d.ts +81 -0
- package/dist/cjs/session/SecureSession.d.ts.map +1 -0
- package/dist/cjs/session/SecureSession.js +291 -0
- package/dist/cjs/session/SecureSession.js.map +6 -0
- package/dist/cjs/session/Session.d.ts +102 -0
- package/dist/cjs/session/Session.d.ts.map +1 -0
- package/dist/cjs/session/Session.js +141 -0
- package/dist/cjs/session/Session.js.map +6 -0
- package/dist/cjs/session/SessionManager.d.ts +132 -0
- package/dist/cjs/session/SessionManager.d.ts.map +1 -0
- package/dist/cjs/session/SessionManager.js +410 -0
- package/dist/cjs/session/SessionManager.js.map +6 -0
- package/dist/cjs/session/case/CaseClient.d.ts +18 -0
- package/dist/cjs/session/case/CaseClient.d.ts.map +1 -0
- package/dist/cjs/session/case/CaseClient.js +216 -0
- package/dist/cjs/session/case/CaseClient.js.map +6 -0
- package/dist/cjs/session/case/CaseMessages.d.ts +82 -0
- package/dist/cjs/session/case/CaseMessages.d.ts.map +1 -0
- package/dist/cjs/session/case/CaseMessages.js +97 -0
- package/dist/cjs/session/case/CaseMessages.js.map +6 -0
- package/dist/cjs/session/case/CaseMessenger.d.ts +79 -0
- package/dist/cjs/session/case/CaseMessenger.d.ts.map +1 -0
- package/dist/cjs/session/case/CaseMessenger.js +74 -0
- package/dist/cjs/session/case/CaseMessenger.js.map +6 -0
- package/dist/cjs/session/case/CaseServer.d.ts +18 -0
- package/dist/cjs/session/case/CaseServer.d.ts.map +1 -0
- package/dist/cjs/session/case/CaseServer.js +232 -0
- package/dist/cjs/session/case/CaseServer.js.map +6 -0
- package/dist/cjs/session/index.d.ts +18 -0
- package/dist/cjs/session/index.d.ts.map +1 -0
- package/dist/cjs/session/index.js +35 -0
- package/dist/cjs/session/index.js.map +6 -0
- package/dist/cjs/session/pase/PaseClient.d.ts +18 -0
- package/dist/cjs/session/pase/PaseClient.d.ts.map +1 -0
- package/dist/cjs/session/pase/PaseClient.js +101 -0
- package/dist/cjs/session/pase/PaseClient.js.map +6 -0
- package/dist/cjs/session/pase/PaseMessages.d.ts +85 -0
- package/dist/cjs/session/pase/PaseMessages.d.ts.map +1 -0
- package/dist/cjs/session/pase/PaseMessages.js +88 -0
- package/dist/cjs/session/pase/PaseMessages.js.map +6 -0
- package/dist/cjs/session/pase/PaseMessenger.d.ts +75 -0
- package/dist/cjs/session/pase/PaseMessenger.d.ts.map +1 -0
- package/dist/cjs/session/pase/PaseMessenger.js +86 -0
- package/dist/cjs/session/pase/PaseMessenger.js.map +6 -0
- package/dist/cjs/session/pase/PaseServer.d.ts +29 -0
- package/dist/cjs/session/pase/PaseServer.d.ts.map +1 -0
- package/dist/cjs/session/pase/PaseServer.js +159 -0
- package/dist/cjs/session/pase/PaseServer.js.map +6 -0
- package/dist/cjs/tsconfig.tsbuildinfo +1 -0
- package/dist/esm/MatterDevice.d.ts +79 -0
- package/dist/esm/MatterDevice.d.ts.map +1 -0
- package/dist/esm/MatterDevice.js +239 -0
- package/dist/esm/MatterDevice.js.map +6 -0
- package/dist/esm/ble/Ble.d.ts +29 -0
- package/dist/esm/ble/Ble.d.ts.map +1 -0
- package/dist/esm/ble/Ble.js +30 -0
- package/dist/esm/ble/Ble.js.map +6 -0
- package/dist/esm/ble/BleConsts.d.ts +32 -0
- package/dist/esm/ble/BleConsts.d.ts.map +1 -0
- package/dist/esm/ble/BleConsts.js +33 -0
- package/dist/esm/ble/BleConsts.js.map +6 -0
- package/dist/esm/ble/BtpSessionHandler.d.ts +87 -0
- package/dist/esm/ble/BtpSessionHandler.d.ts.map +1 -0
- package/dist/esm/ble/BtpSessionHandler.js +419 -0
- package/dist/esm/ble/BtpSessionHandler.js.map +6 -0
- package/dist/esm/ble/index.d.ts +9 -0
- package/dist/esm/ble/index.d.ts.map +1 -0
- package/dist/esm/ble/index.js +9 -0
- package/dist/esm/ble/index.js.map +6 -0
- package/dist/esm/certificate/AttestationCertificateManager.d.ts +28 -0
- package/dist/esm/certificate/AttestationCertificateManager.d.ts.map +1 -0
- package/dist/esm/certificate/AttestationCertificateManager.js +155 -0
- package/dist/esm/certificate/AttestationCertificateManager.js.map +6 -0
- package/dist/esm/certificate/CertificateManager.d.ts +575 -0
- package/dist/esm/certificate/CertificateManager.d.ts.map +1 -0
- package/dist/esm/certificate/CertificateManager.js +837 -0
- package/dist/esm/certificate/CertificateManager.js.map +6 -0
- package/dist/esm/certificate/CertificationDeclarationManager.d.ts +5 -0
- package/dist/esm/certificate/CertificationDeclarationManager.d.ts.map +1 -0
- package/dist/esm/certificate/CertificationDeclarationManager.js +34 -0
- package/dist/esm/certificate/CertificationDeclarationManager.js.map +6 -0
- package/dist/esm/certificate/ChipPAAuthorities.d.ts +14 -0
- package/dist/esm/certificate/ChipPAAuthorities.d.ts.map +1 -0
- package/dist/esm/certificate/ChipPAAuthorities.js +37 -0
- package/dist/esm/certificate/ChipPAAuthorities.js.map +6 -0
- package/dist/esm/certificate/DeviceCertification.d.ts +30 -0
- package/dist/esm/certificate/DeviceCertification.d.ts.map +1 -0
- package/dist/esm/certificate/DeviceCertification.js +83 -0
- package/dist/esm/certificate/DeviceCertification.js.map +6 -0
- package/dist/esm/certificate/RootCertificateManager.d.ts +33 -0
- package/dist/esm/certificate/RootCertificateManager.d.ts.map +1 -0
- package/dist/esm/certificate/RootCertificateManager.js +139 -0
- package/dist/esm/certificate/RootCertificateManager.js.map +6 -0
- package/dist/esm/certificate/index.d.ts +12 -0
- package/dist/esm/certificate/index.d.ts.map +1 -0
- package/dist/esm/certificate/index.js +12 -0
- package/dist/esm/certificate/index.js.map +6 -0
- package/dist/esm/cluster/client/AttributeClient.d.ts +61 -0
- package/dist/esm/cluster/client/AttributeClient.d.ts.map +1 -0
- package/dist/esm/cluster/client/AttributeClient.js +157 -0
- package/dist/esm/cluster/client/AttributeClient.js.map +6 -0
- package/dist/esm/cluster/client/ClusterClient.d.ts +10 -0
- package/dist/esm/cluster/client/ClusterClient.d.ts.map +1 -0
- package/dist/esm/cluster/client/ClusterClient.js +267 -0
- package/dist/esm/cluster/client/ClusterClient.js.map +6 -0
- package/dist/esm/cluster/client/ClusterClientTypes.d.ts +171 -0
- package/dist/esm/cluster/client/ClusterClientTypes.d.ts.map +1 -0
- package/dist/esm/cluster/client/ClusterClientTypes.js +6 -0
- package/dist/esm/cluster/client/ClusterClientTypes.js.map +6 -0
- package/dist/esm/cluster/client/EventClient.d.ts +41 -0
- package/dist/esm/cluster/client/EventClient.d.ts.map +1 -0
- package/dist/esm/cluster/client/EventClient.js +74 -0
- package/dist/esm/cluster/client/EventClient.js.map +6 -0
- package/dist/esm/cluster/client/index.d.ts +10 -0
- package/dist/esm/cluster/client/index.d.ts.map +1 -0
- package/dist/esm/cluster/client/index.js +10 -0
- package/dist/esm/cluster/client/index.js.map +6 -0
- package/dist/esm/cluster/index.d.ts +8 -0
- package/dist/esm/cluster/index.d.ts.map +1 -0
- package/dist/esm/cluster/index.js +8 -0
- package/dist/esm/cluster/index.js.map +6 -0
- package/dist/esm/cluster/server/AttributeServer.d.ts +307 -0
- package/dist/esm/cluster/server/AttributeServer.d.ts.map +1 -0
- package/dist/esm/cluster/server/AttributeServer.js +718 -0
- package/dist/esm/cluster/server/AttributeServer.js.map +6 -0
- package/dist/esm/cluster/server/ClusterDatasource.d.ts +16 -0
- package/dist/esm/cluster/server/ClusterDatasource.d.ts.map +1 -0
- package/dist/esm/cluster/server/ClusterDatasource.js +6 -0
- package/dist/esm/cluster/server/ClusterDatasource.js.map +6 -0
- package/dist/esm/cluster/server/ClusterServer.d.ts +40 -0
- package/dist/esm/cluster/server/ClusterServer.d.ts.map +1 -0
- package/dist/esm/cluster/server/ClusterServer.js +6 -0
- package/dist/esm/cluster/server/ClusterServer.js.map +6 -0
- package/dist/esm/cluster/server/CommandServer.d.ts +34 -0
- package/dist/esm/cluster/server/CommandServer.d.ts.map +1 -0
- package/dist/esm/cluster/server/CommandServer.js +56 -0
- package/dist/esm/cluster/server/CommandServer.js.map +6 -0
- package/dist/esm/cluster/server/EventServer.d.ts +41 -0
- package/dist/esm/cluster/server/EventServer.d.ts.map +1 -0
- package/dist/esm/cluster/server/EventServer.js +137 -0
- package/dist/esm/cluster/server/EventServer.js.map +6 -0
- package/dist/esm/cluster/server/index.d.ts +11 -0
- package/dist/esm/cluster/server/index.d.ts.map +1 -0
- package/dist/esm/cluster/server/index.js +11 -0
- package/dist/esm/cluster/server/index.js.map +6 -0
- package/dist/esm/codec/BtpCodec.d.ts +78 -0
- package/dist/esm/codec/BtpCodec.d.ts.map +1 -0
- package/dist/esm/codec/BtpCodec.js +234 -0
- package/dist/esm/codec/BtpCodec.js.map +6 -0
- package/dist/esm/codec/MessageCodec.d.ts +63 -0
- package/dist/esm/codec/MessageCodec.d.ts.map +1 -0
- package/dist/esm/codec/MessageCodec.js +200 -0
- package/dist/esm/codec/MessageCodec.js.map +6 -0
- package/dist/esm/codec/index.d.ts +9 -0
- package/dist/esm/codec/index.d.ts.map +1 -0
- package/dist/esm/codec/index.js +15 -0
- package/dist/esm/codec/index.js.map +6 -0
- package/dist/esm/common/FailsafeContext.d.ts +79 -0
- package/dist/esm/common/FailsafeContext.d.ts.map +1 -0
- package/dist/esm/common/FailsafeContext.js +217 -0
- package/dist/esm/common/FailsafeContext.js.map +6 -0
- package/dist/esm/common/FailsafeTimer.d.ts +25 -0
- package/dist/esm/common/FailsafeTimer.d.ts.map +1 -0
- package/dist/esm/common/FailsafeTimer.js +71 -0
- package/dist/esm/common/FailsafeTimer.js.map +6 -0
- package/dist/esm/common/InstanceBroadcaster.d.ts +273 -0
- package/dist/esm/common/InstanceBroadcaster.d.ts.map +1 -0
- package/dist/esm/common/InstanceBroadcaster.js +119 -0
- package/dist/esm/common/InstanceBroadcaster.js.map +6 -0
- package/dist/esm/common/OperationalCredentialsTypes.d.ts +21 -0
- package/dist/esm/common/OperationalCredentialsTypes.d.ts.map +1 -0
- package/dist/esm/common/OperationalCredentialsTypes.js +25 -0
- package/dist/esm/common/OperationalCredentialsTypes.js.map +6 -0
- package/dist/esm/common/Scanner.d.ts +121 -0
- package/dist/esm/common/Scanner.d.ts.map +1 -0
- package/dist/esm/common/Scanner.js +31 -0
- package/dist/esm/common/Scanner.js.map +6 -0
- package/dist/esm/common/index.d.ts +12 -0
- package/dist/esm/common/index.d.ts.map +1 -0
- package/dist/esm/common/index.js +12 -0
- package/dist/esm/common/index.js.map +6 -0
- package/dist/esm/endpoint/EndpointInterface.d.ts +37 -0
- package/dist/esm/endpoint/EndpointInterface.d.ts.map +1 -0
- package/dist/esm/endpoint/EndpointInterface.js +6 -0
- package/dist/esm/endpoint/EndpointInterface.js.map +6 -0
- package/dist/esm/endpoint/EndpointStructureLogger.d.ts +31 -0
- package/dist/esm/endpoint/EndpointStructureLogger.d.ts.map +1 -0
- package/dist/esm/endpoint/EndpointStructureLogger.js +216 -0
- package/dist/esm/endpoint/EndpointStructureLogger.js.map +6 -0
- package/dist/esm/endpoint/index.d.ts +8 -0
- package/dist/esm/endpoint/index.d.ts.map +1 -0
- package/dist/esm/endpoint/index.js +8 -0
- package/dist/esm/endpoint/index.js.map +6 -0
- package/dist/esm/fabric/Fabric.d.ts +121 -0
- package/dist/esm/fabric/Fabric.d.ts.map +1 -0
- package/dist/esm/fabric/Fabric.js +422 -0
- package/dist/esm/fabric/Fabric.js.map +6 -0
- package/dist/esm/fabric/FabricManager.d.ts +44 -0
- package/dist/esm/fabric/FabricManager.d.ts.map +1 -0
- package/dist/esm/fabric/FabricManager.js +200 -0
- package/dist/esm/fabric/FabricManager.js.map +6 -0
- package/dist/esm/fabric/index.d.ts +8 -0
- package/dist/esm/fabric/index.d.ts.map +1 -0
- package/dist/esm/fabric/index.js +8 -0
- package/dist/esm/fabric/index.js.map +6 -0
- package/dist/esm/index.d.ts +20 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +20 -0
- package/dist/esm/index.js.map +6 -0
- package/dist/esm/interaction/AccessControlManager.d.ts +49 -0
- package/dist/esm/interaction/AccessControlManager.d.ts.map +1 -0
- package/dist/esm/interaction/AccessControlManager.js +228 -0
- package/dist/esm/interaction/AccessControlManager.js.map +6 -0
- package/dist/esm/interaction/AttributeDataDecoder.d.ts +52 -0
- package/dist/esm/interaction/AttributeDataDecoder.d.ts.map +1 -0
- package/dist/esm/interaction/AttributeDataDecoder.js +171 -0
- package/dist/esm/interaction/AttributeDataDecoder.js.map +6 -0
- package/dist/esm/interaction/AttributeDataEncoder.d.ts +71 -0
- package/dist/esm/interaction/AttributeDataEncoder.d.ts.map +1 -0
- package/dist/esm/interaction/AttributeDataEncoder.js +174 -0
- package/dist/esm/interaction/AttributeDataEncoder.js.map +6 -0
- package/dist/esm/interaction/EventDataDecoder.d.ts +30 -0
- package/dist/esm/interaction/EventDataDecoder.d.ts.map +1 -0
- package/dist/esm/interaction/EventDataDecoder.js +87 -0
- package/dist/esm/interaction/EventDataDecoder.js.map +6 -0
- package/dist/esm/interaction/EventHandler.d.ts +42 -0
- package/dist/esm/interaction/EventHandler.d.ts.map +1 -0
- package/dist/esm/interaction/EventHandler.js +96 -0
- package/dist/esm/interaction/EventHandler.js.map +6 -0
- package/dist/esm/interaction/InteractionClient.d.ts +294 -0
- package/dist/esm/interaction/InteractionClient.d.ts.map +1 -0
- package/dist/esm/interaction/InteractionClient.js +827 -0
- package/dist/esm/interaction/InteractionClient.js.map +6 -0
- package/dist/esm/interaction/InteractionEndpointStructure.d.ts +59 -0
- package/dist/esm/interaction/InteractionEndpointStructure.d.ts.map +1 -0
- package/dist/esm/interaction/InteractionEndpointStructure.js +343 -0
- package/dist/esm/interaction/InteractionEndpointStructure.js.map +6 -0
- package/dist/esm/interaction/InteractionMessenger.d.ts +315 -0
- package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -0
- package/dist/esm/interaction/InteractionMessenger.js +489 -0
- package/dist/esm/interaction/InteractionMessenger.js.map +6 -0
- package/dist/esm/interaction/InteractionServer.d.ts +97 -0
- package/dist/esm/interaction/InteractionServer.d.ts.map +1 -0
- package/dist/esm/interaction/InteractionServer.js +1027 -0
- package/dist/esm/interaction/InteractionServer.js.map +6 -0
- package/dist/esm/interaction/ServerSubscription.d.ts +121 -0
- package/dist/esm/interaction/ServerSubscription.d.ts.map +1 -0
- package/dist/esm/interaction/ServerSubscription.js +669 -0
- package/dist/esm/interaction/ServerSubscription.js.map +6 -0
- package/dist/esm/interaction/Subscription.d.ts +44 -0
- package/dist/esm/interaction/Subscription.d.ts.map +1 -0
- package/dist/esm/interaction/Subscription.js +65 -0
- package/dist/esm/interaction/Subscription.js.map +6 -0
- package/dist/esm/interaction/SubscriptionOptions.d.ts +43 -0
- package/dist/esm/interaction/SubscriptionOptions.d.ts.map +1 -0
- package/dist/esm/interaction/SubscriptionOptions.js +26 -0
- package/dist/esm/interaction/SubscriptionOptions.js.map +6 -0
- package/dist/esm/interaction/index.d.ts +17 -0
- package/dist/esm/interaction/index.d.ts.map +1 -0
- package/dist/esm/interaction/index.js +17 -0
- package/dist/esm/interaction/index.js.map +6 -0
- package/dist/esm/mdns/MdnsBroadcaster.d.ts +34 -0
- package/dist/esm/mdns/MdnsBroadcaster.d.ts.map +1 -0
- package/dist/esm/mdns/MdnsBroadcaster.js +351 -0
- package/dist/esm/mdns/MdnsBroadcaster.js.map +6 -0
- package/dist/esm/mdns/MdnsConsts.d.ts +19 -0
- package/dist/esm/mdns/MdnsConsts.d.ts.map +1 -0
- package/dist/esm/mdns/MdnsConsts.js +32 -0
- package/dist/esm/mdns/MdnsConsts.js.map +6 -0
- package/dist/esm/mdns/MdnsInstanceBroadcaster.d.ts +28 -0
- package/dist/esm/mdns/MdnsInstanceBroadcaster.d.ts.map +1 -0
- package/dist/esm/mdns/MdnsInstanceBroadcaster.js +67 -0
- package/dist/esm/mdns/MdnsInstanceBroadcaster.js.map +6 -0
- package/dist/esm/mdns/MdnsScanner.d.ts +79 -0
- package/dist/esm/mdns/MdnsScanner.d.ts.map +1 -0
- package/dist/esm/mdns/MdnsScanner.js +847 -0
- package/dist/esm/mdns/MdnsScanner.js.map +6 -0
- package/dist/esm/mdns/MdnsServer.d.ts +29 -0
- package/dist/esm/mdns/MdnsServer.d.ts.map +1 -0
- package/dist/esm/mdns/MdnsServer.js +266 -0
- package/dist/esm/mdns/MdnsServer.js.map +6 -0
- package/dist/esm/mdns/MdnsService.d.ts +28 -0
- package/dist/esm/mdns/MdnsService.d.ts.map +1 -0
- package/dist/esm/mdns/MdnsService.js +83 -0
- package/dist/esm/mdns/MdnsService.js.map +6 -0
- package/dist/esm/mdns/index.d.ts +12 -0
- package/dist/esm/mdns/index.d.ts.map +1 -0
- package/dist/esm/mdns/index.js +12 -0
- package/dist/esm/mdns/index.js.map +6 -0
- package/dist/esm/package.json +10 -0
- package/dist/esm/peer/ControllerCommissioner.d.ts +82 -0
- package/dist/esm/peer/ControllerCommissioner.d.ts.map +1 -0
- package/dist/esm/peer/ControllerCommissioner.js +211 -0
- package/dist/esm/peer/ControllerCommissioner.js.map +6 -0
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts +88 -0
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts.map +1 -0
- package/dist/esm/peer/ControllerCommissioningFlow.js +832 -0
- package/dist/esm/peer/ControllerCommissioningFlow.js.map +6 -0
- package/dist/esm/peer/ControllerDiscovery.d.ts +43 -0
- package/dist/esm/peer/ControllerDiscovery.d.ts.map +1 -0
- package/dist/esm/peer/ControllerDiscovery.js +172 -0
- package/dist/esm/peer/ControllerDiscovery.js.map +6 -0
- package/dist/esm/peer/OperationalPeer.d.ts +28 -0
- package/dist/esm/peer/OperationalPeer.d.ts.map +1 -0
- package/dist/esm/peer/OperationalPeer.js +6 -0
- package/dist/esm/peer/OperationalPeer.js.map +6 -0
- package/dist/esm/peer/PeerAddress.d.ts +30 -0
- package/dist/esm/peer/PeerAddress.d.ts.map +1 -0
- package/dist/esm/peer/PeerAddress.js +51 -0
- package/dist/esm/peer/PeerAddress.js.map +6 -0
- package/dist/esm/peer/PeerSet.d.ts +98 -0
- package/dist/esm/peer/PeerSet.d.ts.map +1 -0
- package/dist/esm/peer/PeerSet.js +495 -0
- package/dist/esm/peer/PeerSet.js.map +6 -0
- package/dist/esm/peer/PeerStore.d.ts +17 -0
- package/dist/esm/peer/PeerStore.d.ts.map +1 -0
- package/dist/esm/peer/PeerStore.js +11 -0
- package/dist/esm/peer/PeerStore.js.map +6 -0
- package/dist/esm/peer/index.d.ts +13 -0
- package/dist/esm/peer/index.d.ts.map +1 -0
- package/dist/esm/peer/index.js +13 -0
- package/dist/esm/peer/index.js.map +6 -0
- package/dist/esm/protocol/ChannelManager.d.ts +30 -0
- package/dist/esm/protocol/ChannelManager.d.ts.map +1 -0
- package/dist/esm/protocol/ChannelManager.js +148 -0
- package/dist/esm/protocol/ChannelManager.js.map +6 -0
- package/dist/esm/protocol/DeviceAdvertiser.d.ts +43 -0
- package/dist/esm/protocol/DeviceAdvertiser.d.ts.map +1 -0
- package/dist/esm/protocol/DeviceAdvertiser.js +173 -0
- package/dist/esm/protocol/DeviceAdvertiser.js.map +6 -0
- package/dist/esm/protocol/DeviceCommissioner.d.ts +49 -0
- package/dist/esm/protocol/DeviceCommissioner.d.ts.map +1 -0
- package/dist/esm/protocol/DeviceCommissioner.js +187 -0
- package/dist/esm/protocol/DeviceCommissioner.js.map +6 -0
- package/dist/esm/protocol/ExchangeManager.d.ts +73 -0
- package/dist/esm/protocol/ExchangeManager.d.ts.map +1 -0
- package/dist/esm/protocol/ExchangeManager.js +398 -0
- package/dist/esm/protocol/ExchangeManager.js.map +6 -0
- package/dist/esm/protocol/MessageCounter.d.ts +57 -0
- package/dist/esm/protocol/MessageCounter.d.ts.map +1 -0
- package/dist/esm/protocol/MessageCounter.js +84 -0
- package/dist/esm/protocol/MessageCounter.js.map +6 -0
- package/dist/esm/protocol/MessageExchange.d.ts +84 -0
- package/dist/esm/protocol/MessageExchange.d.ts.map +1 -0
- package/dist/esm/protocol/MessageExchange.js +504 -0
- package/dist/esm/protocol/MessageExchange.js.map +6 -0
- package/dist/esm/protocol/MessageReceptionState.d.ts +65 -0
- package/dist/esm/protocol/MessageReceptionState.d.ts.map +1 -0
- package/dist/esm/protocol/MessageReceptionState.js +153 -0
- package/dist/esm/protocol/MessageReceptionState.js.map +6 -0
- package/dist/esm/protocol/ProtocolHandler.d.ts +13 -0
- package/dist/esm/protocol/ProtocolHandler.d.ts.map +1 -0
- package/dist/esm/protocol/ProtocolHandler.js +6 -0
- package/dist/esm/protocol/ProtocolHandler.js.map +6 -0
- package/dist/esm/protocol/index.d.ts +14 -0
- package/dist/esm/protocol/index.d.ts.map +1 -0
- package/dist/esm/protocol/index.js +14 -0
- package/dist/esm/protocol/index.js.map +6 -0
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts +53 -0
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts.map +1 -0
- package/dist/esm/securechannel/SecureChannelMessenger.js +128 -0
- package/dist/esm/securechannel/SecureChannelMessenger.js.map +6 -0
- package/dist/esm/securechannel/SecureChannelProtocol.d.ts +31 -0
- package/dist/esm/securechannel/SecureChannelProtocol.d.ts.map +1 -0
- package/dist/esm/securechannel/SecureChannelProtocol.js +127 -0
- package/dist/esm/securechannel/SecureChannelProtocol.js.map +6 -0
- package/dist/esm/securechannel/SecureChannelStatusMessageSchema.d.ts +23 -0
- package/dist/esm/securechannel/SecureChannelStatusMessageSchema.d.ts.map +1 -0
- package/dist/esm/securechannel/SecureChannelStatusMessageSchema.js +33 -0
- package/dist/esm/securechannel/SecureChannelStatusMessageSchema.js.map +6 -0
- package/dist/esm/securechannel/index.d.ts +9 -0
- package/dist/esm/securechannel/index.d.ts.map +1 -0
- package/dist/esm/securechannel/index.js +9 -0
- package/dist/esm/securechannel/index.js.map +6 -0
- package/dist/esm/session/InsecureSession.d.ts +38 -0
- package/dist/esm/session/InsecureSession.d.ts.map +1 -0
- package/dist/esm/session/InsecureSession.js +75 -0
- package/dist/esm/session/InsecureSession.js.map +6 -0
- package/dist/esm/session/SecureSession.d.ts +81 -0
- package/dist/esm/session/SecureSession.d.ts.map +1 -0
- package/dist/esm/session/SecureSession.js +281 -0
- package/dist/esm/session/SecureSession.js.map +6 -0
- package/dist/esm/session/Session.d.ts +102 -0
- package/dist/esm/session/Session.d.ts.map +1 -0
- package/dist/esm/session/Session.js +121 -0
- package/dist/esm/session/Session.js.map +6 -0
- package/dist/esm/session/SessionManager.d.ts +132 -0
- package/dist/esm/session/SessionManager.d.ts.map +1 -0
- package/dist/esm/session/SessionManager.js +411 -0
- package/dist/esm/session/SessionManager.js.map +6 -0
- package/dist/esm/session/case/CaseClient.d.ts +18 -0
- package/dist/esm/session/case/CaseClient.d.ts.map +1 -0
- package/dist/esm/session/case/CaseClient.js +208 -0
- package/dist/esm/session/case/CaseClient.js.map +6 -0
- package/dist/esm/session/case/CaseMessages.d.ts +82 -0
- package/dist/esm/session/case/CaseMessages.d.ts.map +1 -0
- package/dist/esm/session/case/CaseMessages.js +83 -0
- package/dist/esm/session/case/CaseMessages.js.map +6 -0
- package/dist/esm/session/case/CaseMessenger.d.ts +79 -0
- package/dist/esm/session/case/CaseMessenger.d.ts.map +1 -0
- package/dist/esm/session/case/CaseMessenger.js +54 -0
- package/dist/esm/session/case/CaseMessenger.js.map +6 -0
- package/dist/esm/session/case/CaseServer.d.ts +18 -0
- package/dist/esm/session/case/CaseServer.d.ts.map +1 -0
- package/dist/esm/session/case/CaseServer.js +224 -0
- package/dist/esm/session/case/CaseServer.js.map +6 -0
- package/dist/esm/session/index.d.ts +18 -0
- package/dist/esm/session/index.d.ts.map +1 -0
- package/dist/esm/session/index.js +18 -0
- package/dist/esm/session/index.js.map +6 -0
- package/dist/esm/session/pase/PaseClient.d.ts +18 -0
- package/dist/esm/session/pase/PaseClient.d.ts.map +1 -0
- package/dist/esm/session/pase/PaseClient.js +81 -0
- package/dist/esm/session/pase/PaseClient.js.map +6 -0
- package/dist/esm/session/pase/PaseMessages.d.ts +85 -0
- package/dist/esm/session/pase/PaseMessages.d.ts.map +1 -0
- package/dist/esm/session/pase/PaseMessages.js +68 -0
- package/dist/esm/session/pase/PaseMessages.js.map +6 -0
- package/dist/esm/session/pase/PaseMessenger.d.ts +75 -0
- package/dist/esm/session/pase/PaseMessenger.d.ts.map +1 -0
- package/dist/esm/session/pase/PaseMessenger.js +75 -0
- package/dist/esm/session/pase/PaseMessenger.js.map +6 -0
- package/dist/esm/session/pase/PaseServer.d.ts +29 -0
- package/dist/esm/session/pase/PaseServer.d.ts.map +1 -0
- package/dist/esm/session/pase/PaseServer.js +148 -0
- package/dist/esm/session/pase/PaseServer.js.map +6 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/package.json +83 -0
- package/src/MatterDevice.ts +319 -0
- package/src/ble/Ble.ts +40 -0
- package/src/ble/BleConsts.ts +41 -0
- package/src/ble/BtpSessionHandler.ts +490 -0
- package/src/ble/index.ts +9 -0
- package/src/certificate/AttestationCertificateManager.ts +166 -0
- package/src/certificate/CertificateManager.ts +1136 -0
- package/src/certificate/CertificationDeclarationManager.ts +52 -0
- package/src/certificate/ChipPAAuthorities.ts +35 -0
- package/src/certificate/DeviceCertification.ts +116 -0
- package/src/certificate/RootCertificateManager.ts +179 -0
- package/src/certificate/index.ts +12 -0
- package/src/cluster/client/AttributeClient.ts +196 -0
- package/src/cluster/client/ClusterClient.ts +354 -0
- package/src/cluster/client/ClusterClientTypes.ts +257 -0
- package/src/cluster/client/EventClient.ts +110 -0
- package/src/cluster/client/index.ts +10 -0
- package/src/cluster/index.ts +8 -0
- package/src/cluster/server/AttributeServer.ts +986 -0
- package/src/cluster/server/ClusterDatasource.ts +17 -0
- package/src/cluster/server/ClusterServer.ts +46 -0
- package/src/cluster/server/CommandServer.ts +89 -0
- package/src/cluster/server/EventServer.ts +198 -0
- package/src/cluster/server/index.ts +11 -0
- package/src/codec/BtpCodec.ts +333 -0
- package/src/codec/MessageCodec.ts +276 -0
- package/src/codec/index.ts +9 -0
- package/src/common/FailsafeContext.ts +330 -0
- package/src/common/FailsafeTimer.ts +91 -0
- package/src/common/InstanceBroadcaster.ts +220 -0
- package/src/common/OperationalCredentialsTypes.ts +24 -0
- package/src/common/Scanner.ts +188 -0
- package/src/common/index.ts +12 -0
- package/src/endpoint/EndpointInterface.ts +41 -0
- package/src/endpoint/EndpointStructureLogger.ts +277 -0
- package/src/endpoint/index.ts +8 -0
- package/src/fabric/Fabric.ts +528 -0
- package/src/fabric/FabricManager.ts +231 -0
- package/src/fabric/index.ts +8 -0
- package/src/index.ts +20 -0
- package/src/interaction/AccessControlManager.ts +343 -0
- package/src/interaction/AttributeDataDecoder.ts +266 -0
- package/src/interaction/AttributeDataEncoder.ts +268 -0
- package/src/interaction/EventDataDecoder.ts +133 -0
- package/src/interaction/EventHandler.ts +141 -0
- package/src/interaction/InteractionClient.ts +1215 -0
- package/src/interaction/InteractionEndpointStructure.ts +462 -0
- package/src/interaction/InteractionMessenger.ts +592 -0
- package/src/interaction/InteractionServer.ts +1428 -0
- package/src/interaction/ServerSubscription.ts +908 -0
- package/src/interaction/Subscription.ts +89 -0
- package/src/interaction/SubscriptionOptions.ts +49 -0
- package/src/interaction/index.ts +17 -0
- package/src/mdns/MdnsBroadcaster.ts +415 -0
- package/src/mdns/MdnsConsts.ts +24 -0
- package/src/mdns/MdnsInstanceBroadcaster.ts +88 -0
- package/src/mdns/MdnsScanner.ts +1042 -0
- package/src/mdns/MdnsServer.ts +322 -0
- package/src/mdns/MdnsService.ts +102 -0
- package/src/mdns/index.ts +12 -0
- package/src/peer/ControllerCommissioner.ts +372 -0
- package/src/peer/ControllerCommissioningFlow.ts +1127 -0
- package/src/peer/ControllerDiscovery.ts +231 -0
- package/src/peer/OperationalPeer.ts +32 -0
- package/src/peer/PeerAddress.ts +78 -0
- package/src/peer/PeerSet.ts +684 -0
- package/src/peer/PeerStore.ts +19 -0
- package/src/peer/index.ts +13 -0
- package/src/protocol/ChannelManager.ts +168 -0
- package/src/protocol/DeviceAdvertiser.ts +208 -0
- package/src/protocol/DeviceCommissioner.ts +280 -0
- package/src/protocol/ExchangeManager.ts +493 -0
- package/src/protocol/MessageCounter.ts +128 -0
- package/src/protocol/MessageExchange.ts +662 -0
- package/src/protocol/MessageReceptionState.ts +207 -0
- package/src/protocol/ProtocolHandler.ts +14 -0
- package/src/protocol/index.ts +14 -0
- package/src/securechannel/SecureChannelMessenger.ts +166 -0
- package/src/securechannel/SecureChannelProtocol.ts +150 -0
- package/src/securechannel/SecureChannelStatusMessageSchema.ts +40 -0
- package/src/securechannel/index.ts +10 -0
- package/src/session/InsecureSession.ts +96 -0
- package/src/session/SecureSession.ts +349 -0
- package/src/session/Session.ts +188 -0
- package/src/session/SessionManager.ts +559 -0
- package/src/session/case/CaseClient.ts +235 -0
- package/src/session/case/CaseMessages.ts +81 -0
- package/src/session/case/CaseMessenger.ts +57 -0
- package/src/session/case/CaseServer.ts +269 -0
- package/src/session/index.ts +21 -0
- package/src/session/pase/PaseClient.ts +100 -0
- package/src/session/pase/PaseMessages.ts +72 -0
- package/src/session/pase/PaseMessenger.ts +86 -0
- package/src/session/pase/PaseServer.ts +187 -0
- package/src/tsconfig.json +20 -0
|
@@ -0,0 +1,1027 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2024 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Crypto, Diagnostic, InternalError, Logger, MatterFlowError } from "#general";
|
|
7
|
+
import { AttributeModel, ClusterModel, CommandModel, GLOBAL_IDS, MatterModel, Specification } from "#model";
|
|
8
|
+
import {
|
|
9
|
+
ArraySchema,
|
|
10
|
+
DEFAULT_MAX_PATHS_PER_INVOKE,
|
|
11
|
+
EventNumber,
|
|
12
|
+
INTERACTION_PROTOCOL_ID,
|
|
13
|
+
StatusCode,
|
|
14
|
+
StatusResponseError,
|
|
15
|
+
TlvAny,
|
|
16
|
+
TlvInvokeResponseData,
|
|
17
|
+
TlvInvokeResponseForSend,
|
|
18
|
+
TlvNoArguments,
|
|
19
|
+
TlvNoResponse,
|
|
20
|
+
TlvSubscribeResponse,
|
|
21
|
+
ValidationError
|
|
22
|
+
} from "#types";
|
|
23
|
+
import { AttributeServer, FabricScopedAttributeServer } from "../cluster/server/AttributeServer.js";
|
|
24
|
+
import { SessionType } from "../codec/MessageCodec.js";
|
|
25
|
+
import { NoAssociatedFabricError, assertSecureSession } from "../session/SecureSession.js";
|
|
26
|
+
import {
|
|
27
|
+
decodeAttributeValueWithSchema,
|
|
28
|
+
decodeListAttributeValueWithSchema,
|
|
29
|
+
expandPathsInAttributeData
|
|
30
|
+
} from "./AttributeDataDecoder.js";
|
|
31
|
+
import {
|
|
32
|
+
InteractionServerMessenger,
|
|
33
|
+
MessageType
|
|
34
|
+
} from "./InteractionMessenger.js";
|
|
35
|
+
import { ServerSubscription } from "./ServerSubscription.js";
|
|
36
|
+
import { ServerSubscriptionConfig } from "./SubscriptionOptions.js";
|
|
37
|
+
const logger = Logger.get("InteractionServer");
|
|
38
|
+
function genericElementPathToId(endpointId, clusterId, elementId) {
|
|
39
|
+
return `${endpointId}/${clusterId}/${elementId}`;
|
|
40
|
+
}
|
|
41
|
+
function commandPathToId({ endpointId, clusterId, commandId }) {
|
|
42
|
+
return genericElementPathToId(endpointId, clusterId, commandId);
|
|
43
|
+
}
|
|
44
|
+
function attributePathToId({ endpointId, clusterId, attributeId }) {
|
|
45
|
+
return genericElementPathToId(endpointId, clusterId, attributeId);
|
|
46
|
+
}
|
|
47
|
+
function eventPathToId({ endpointId, clusterId, eventId }) {
|
|
48
|
+
return genericElementPathToId(endpointId, clusterId, eventId);
|
|
49
|
+
}
|
|
50
|
+
function clusterPathToId({ nodeId, endpointId, clusterId }) {
|
|
51
|
+
return `${nodeId}/${endpointId}/${clusterId}`;
|
|
52
|
+
}
|
|
53
|
+
function isConcreteAttributePath(path) {
|
|
54
|
+
const { endpointId, clusterId, attributeId } = path;
|
|
55
|
+
return endpointId !== void 0 && clusterId !== void 0 && attributeId !== void 0;
|
|
56
|
+
}
|
|
57
|
+
function validateReadAttributesPath(path, isGroupSession = false) {
|
|
58
|
+
if (isGroupSession) {
|
|
59
|
+
throw new StatusResponseError("Illegal read request with group session", StatusCode.InvalidAction);
|
|
60
|
+
}
|
|
61
|
+
const { clusterId, attributeId } = path;
|
|
62
|
+
if (clusterId === void 0 && attributeId !== void 0) {
|
|
63
|
+
if (!GLOBAL_IDS.has(attributeId)) {
|
|
64
|
+
throw new StatusResponseError(
|
|
65
|
+
`Illegal read request for wildcard cluster and non global attribute ${attributeId}`,
|
|
66
|
+
StatusCode.InvalidAction
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function validateWriteAttributesPath(path, isGroupSession = false) {
|
|
72
|
+
const { endpointId, clusterId, attributeId } = path;
|
|
73
|
+
if (clusterId === void 0 || attributeId === void 0) {
|
|
74
|
+
throw new StatusResponseError(
|
|
75
|
+
"Illegal write request with wildcard cluster or attribute ID",
|
|
76
|
+
StatusCode.InvalidAction
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (isGroupSession && endpointId !== void 0) {
|
|
80
|
+
throw new StatusResponseError("Illegal write request with group ID and endpoint ID", StatusCode.InvalidAction);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function isConcreteEventPath(path) {
|
|
84
|
+
const { endpointId, clusterId, eventId } = path;
|
|
85
|
+
return endpointId !== void 0 && clusterId !== void 0 && eventId !== void 0;
|
|
86
|
+
}
|
|
87
|
+
function validateReadEventPath(path, isGroupSession = false) {
|
|
88
|
+
const { clusterId, eventId } = path;
|
|
89
|
+
if (clusterId === void 0 && eventId !== void 0) {
|
|
90
|
+
throw new StatusResponseError("Illegal read request with wildcard cluster ID", StatusCode.InvalidAction);
|
|
91
|
+
}
|
|
92
|
+
if (isGroupSession) {
|
|
93
|
+
throw new StatusResponseError("Illegal read request with group session", StatusCode.InvalidAction);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function isConcreteCommandPath(path) {
|
|
97
|
+
const { endpointId, clusterId, commandId } = path;
|
|
98
|
+
return endpointId !== void 0 && clusterId !== void 0 && commandId !== void 0;
|
|
99
|
+
}
|
|
100
|
+
function validateCommandPath(path, isGroupSession = false) {
|
|
101
|
+
const { endpointId, clusterId, commandId } = path;
|
|
102
|
+
if (clusterId === void 0 || commandId === void 0) {
|
|
103
|
+
throw new StatusResponseError(
|
|
104
|
+
"Illegal write request with wildcard cluster or attribute ID",
|
|
105
|
+
StatusCode.InvalidAction
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
if (isGroupSession && endpointId !== void 0) {
|
|
109
|
+
throw new StatusResponseError("Illegal write request with group ID and endpoint ID", StatusCode.InvalidAction);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function getMatterModelCluster(clusterId) {
|
|
113
|
+
return MatterModel.standard.get(ClusterModel, clusterId);
|
|
114
|
+
}
|
|
115
|
+
function getMatterModelClusterAttribute(clusterId, attributeId) {
|
|
116
|
+
return getMatterModelCluster(clusterId)?.get(AttributeModel, attributeId);
|
|
117
|
+
}
|
|
118
|
+
function getMatterModelClusterCommand(clusterId, commandId) {
|
|
119
|
+
return getMatterModelCluster(clusterId)?.get(CommandModel, commandId);
|
|
120
|
+
}
|
|
121
|
+
class InteractionServer {
|
|
122
|
+
#context;
|
|
123
|
+
#nextSubscriptionId = Crypto.getRandomUInt32();
|
|
124
|
+
#isClosing = false;
|
|
125
|
+
#subscriptionConfig;
|
|
126
|
+
#maxPathsPerInvoke;
|
|
127
|
+
constructor(context) {
|
|
128
|
+
this.#context = context;
|
|
129
|
+
this.#subscriptionConfig = ServerSubscriptionConfig.of(context.subscriptionOptions);
|
|
130
|
+
this.#maxPathsPerInvoke = context.maxPathsPerInvoke ?? DEFAULT_MAX_PATHS_PER_INVOKE;
|
|
131
|
+
this.#context.structure.change.on(async () => {
|
|
132
|
+
this.#context.sessions.updateAllSubscriptions();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
getId() {
|
|
136
|
+
return INTERACTION_PROTOCOL_ID;
|
|
137
|
+
}
|
|
138
|
+
get isClosing() {
|
|
139
|
+
return this.#isClosing;
|
|
140
|
+
}
|
|
141
|
+
get maxPathsPerInvoke() {
|
|
142
|
+
return this.#maxPathsPerInvoke;
|
|
143
|
+
}
|
|
144
|
+
async onNewExchange(exchange) {
|
|
145
|
+
if (this.#isClosing) return;
|
|
146
|
+
await new InteractionServerMessenger(exchange).handleRequest(this);
|
|
147
|
+
}
|
|
148
|
+
async handleReadRequest(exchange, {
|
|
149
|
+
attributeRequests,
|
|
150
|
+
dataVersionFilters,
|
|
151
|
+
eventRequests,
|
|
152
|
+
eventFilters,
|
|
153
|
+
isFabricFiltered,
|
|
154
|
+
interactionModelRevision
|
|
155
|
+
}, message) {
|
|
156
|
+
logger.debug(
|
|
157
|
+
`Received read request from ${exchange.channel.name}: attributes:${attributeRequests?.map((path) => this.#endpointStructure.resolveAttributeName(path)).join(", ") ?? "none"}, events:${eventRequests?.map((path) => this.#endpointStructure.resolveEventName(path)).join(", ") ?? "none"} isFabricFiltered=${isFabricFiltered}`
|
|
158
|
+
);
|
|
159
|
+
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
160
|
+
logger.debug(
|
|
161
|
+
`Interaction model revision of sender ${interactionModelRevision} is higher than supported ${Specification.INTERACTION_MODEL_REVISION}.`
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
if (attributeRequests === void 0 && eventRequests === void 0) {
|
|
165
|
+
throw new StatusResponseError(
|
|
166
|
+
"Only Read requests with attributeRequests or eventRequests are supported right now",
|
|
167
|
+
StatusCode.UnsupportedRead
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
if (message.packetHeader.sessionType !== SessionType.Unicast) {
|
|
171
|
+
throw new StatusResponseError(
|
|
172
|
+
"Subscriptions are only allowed on unicast sessions",
|
|
173
|
+
StatusCode.InvalidAction
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
const dataVersionFilterMap = new Map(
|
|
177
|
+
dataVersionFilters?.map(({ path, dataVersion }) => [clusterPathToId(path), dataVersion]) ?? []
|
|
178
|
+
);
|
|
179
|
+
if (dataVersionFilterMap.size > 0) {
|
|
180
|
+
logger.debug(
|
|
181
|
+
`DataVersionFilters: ${Array.from(dataVersionFilterMap.entries()).map(([path, version]) => `${path}=${version}`).join(", ")}`
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
const attributeReportsPayload = new Array();
|
|
185
|
+
for (const requestPath of attributeRequests ?? []) {
|
|
186
|
+
validateReadAttributesPath(requestPath);
|
|
187
|
+
const attributes = this.#endpointStructure.getAttributes([requestPath]);
|
|
188
|
+
if (attributes.length === 0) {
|
|
189
|
+
if (isConcreteAttributePath(requestPath)) {
|
|
190
|
+
const { endpointId, clusterId, attributeId } = requestPath;
|
|
191
|
+
try {
|
|
192
|
+
this.#endpointStructure.validateConcreteAttributePath(endpointId, clusterId, attributeId);
|
|
193
|
+
throw new InternalError(
|
|
194
|
+
"validateConcreteAttributePath should throw StatusResponseError but did not."
|
|
195
|
+
);
|
|
196
|
+
} catch (e) {
|
|
197
|
+
StatusResponseError.accept(e);
|
|
198
|
+
logger.debug(
|
|
199
|
+
`Error reading attribute from ${exchange.channel.name}: ${this.#endpointStructure.resolveAttributeName(requestPath)}: unsupported path: Status=${e.code}`
|
|
200
|
+
);
|
|
201
|
+
attributeReportsPayload.push({
|
|
202
|
+
hasFabricSensitiveData: false,
|
|
203
|
+
attributeStatus: { path: requestPath, status: { status: e.code } }
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
logger.debug(
|
|
208
|
+
`Read from ${exchange.channel.name}: ${this.#endpointStructure.resolveAttributeName(
|
|
209
|
+
requestPath
|
|
210
|
+
)}: ${this.#endpointStructure.resolveAttributeName(requestPath)}: ignore non-existing attribute`
|
|
211
|
+
);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
for (const { path, attribute } of attributes) {
|
|
215
|
+
const { nodeId, endpointId, clusterId } = path;
|
|
216
|
+
try {
|
|
217
|
+
if (getMatterModelClusterAttribute(clusterId, attribute.id)?.readable === false) {
|
|
218
|
+
throw new StatusResponseError(
|
|
219
|
+
`Attribute ${attribute.id} is not readable.`,
|
|
220
|
+
StatusCode.UnsupportedRead
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
let value, version;
|
|
224
|
+
try {
|
|
225
|
+
({ value, version } = await this.readAttribute(
|
|
226
|
+
path,
|
|
227
|
+
attribute,
|
|
228
|
+
exchange,
|
|
229
|
+
isFabricFiltered,
|
|
230
|
+
message,
|
|
231
|
+
this.#endpointStructure.getEndpoint(endpointId)
|
|
232
|
+
));
|
|
233
|
+
} catch (e) {
|
|
234
|
+
NoAssociatedFabricError.accept(e);
|
|
235
|
+
if (endpointId === void 0 || clusterId === void 0) {
|
|
236
|
+
throw new MatterFlowError("Should never happen");
|
|
237
|
+
}
|
|
238
|
+
const cluster = this.#endpointStructure.getClusterServer(endpointId, clusterId);
|
|
239
|
+
if (cluster === void 0 || cluster.datasource == void 0) {
|
|
240
|
+
throw new MatterFlowError("Should never happen");
|
|
241
|
+
}
|
|
242
|
+
version = cluster.datasource.version;
|
|
243
|
+
value = [];
|
|
244
|
+
}
|
|
245
|
+
const versionFilterValue = endpointId !== void 0 && clusterId !== void 0 ? dataVersionFilterMap.get(clusterPathToId({ nodeId, endpointId, clusterId })) : void 0;
|
|
246
|
+
if (versionFilterValue !== void 0 && versionFilterValue === version) {
|
|
247
|
+
logger.debug(
|
|
248
|
+
`Read attribute from ${exchange.channel.name}: ${this.#endpointStructure.resolveAttributeName(
|
|
249
|
+
path
|
|
250
|
+
)}=${Logger.toJSON(value)} (version=${version}) ignored because of dataVersionFilter`
|
|
251
|
+
);
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
logger.debug(
|
|
255
|
+
`Read attribute from ${exchange.channel.name}: ${this.#endpointStructure.resolveAttributeName(
|
|
256
|
+
path
|
|
257
|
+
)}=${Logger.toJSON(value)} (version=${version})`
|
|
258
|
+
);
|
|
259
|
+
const { schema } = attribute;
|
|
260
|
+
attributeReportsPayload.push({
|
|
261
|
+
hasFabricSensitiveData: attribute.hasFabricSensitiveData,
|
|
262
|
+
attributeData: { path, dataVersion: version, payload: value, schema }
|
|
263
|
+
});
|
|
264
|
+
} catch (error) {
|
|
265
|
+
logger.error(
|
|
266
|
+
`Error while reading attribute from ${exchange.channel.name} to ${this.#endpointStructure.resolveAttributeName(path)}:`,
|
|
267
|
+
error
|
|
268
|
+
);
|
|
269
|
+
StatusResponseError.accept(error);
|
|
270
|
+
if (isConcreteAttributePath(requestPath)) {
|
|
271
|
+
attributeReportsPayload.push({
|
|
272
|
+
hasFabricSensitiveData: false,
|
|
273
|
+
attributeStatus: { path, status: { status: error.code } }
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
let eventReportsPayload;
|
|
280
|
+
if (eventRequests) {
|
|
281
|
+
eventReportsPayload = [];
|
|
282
|
+
for (const requestPath of eventRequests) {
|
|
283
|
+
validateReadEventPath(requestPath);
|
|
284
|
+
const events = this.#endpointStructure.getEvents([requestPath]);
|
|
285
|
+
if (events.length === 0) {
|
|
286
|
+
if (isConcreteEventPath(requestPath)) {
|
|
287
|
+
const { endpointId, clusterId, eventId } = requestPath;
|
|
288
|
+
try {
|
|
289
|
+
this.#endpointStructure.validateConcreteEventPath(endpointId, clusterId, eventId);
|
|
290
|
+
throw new InternalError(
|
|
291
|
+
"validateConcreteEventPath should throw StatusResponseError but did not."
|
|
292
|
+
);
|
|
293
|
+
} catch (e) {
|
|
294
|
+
StatusResponseError.accept(e);
|
|
295
|
+
logger.debug(
|
|
296
|
+
`Read event from ${exchange.channel.name}: ${this.#endpointStructure.resolveEventName(requestPath)}: unsupported path: Status=${e.code}`
|
|
297
|
+
);
|
|
298
|
+
eventReportsPayload?.push({
|
|
299
|
+
hasFabricSensitiveData: false,
|
|
300
|
+
eventStatus: { path: requestPath, status: { status: e.code } }
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
logger.debug(
|
|
305
|
+
`Read event from ${exchange.channel.name}: ${this.#endpointStructure.resolveEventName(
|
|
306
|
+
requestPath
|
|
307
|
+
)}: ignore non-existing event`
|
|
308
|
+
);
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
const reportsForPath = new Array();
|
|
312
|
+
for (const { path, event } of events) {
|
|
313
|
+
try {
|
|
314
|
+
const { endpointId } = path;
|
|
315
|
+
const matchingEvents = await this.readEvent(
|
|
316
|
+
path,
|
|
317
|
+
eventFilters,
|
|
318
|
+
event,
|
|
319
|
+
exchange,
|
|
320
|
+
isFabricFiltered,
|
|
321
|
+
message,
|
|
322
|
+
this.#endpointStructure.getEndpoint(endpointId)
|
|
323
|
+
);
|
|
324
|
+
logger.debug(
|
|
325
|
+
`Read event from ${exchange.channel.name}: ${this.#endpointStructure.resolveEventName(
|
|
326
|
+
path
|
|
327
|
+
)}=${Logger.toJSON(matchingEvents)}`
|
|
328
|
+
);
|
|
329
|
+
const { schema } = event;
|
|
330
|
+
reportsForPath.push(
|
|
331
|
+
...matchingEvents.map(({ eventNumber, priority, epochTimestamp, data }) => ({
|
|
332
|
+
hasFabricSensitiveData: event.hasFabricSensitiveData,
|
|
333
|
+
eventData: {
|
|
334
|
+
path,
|
|
335
|
+
eventNumber,
|
|
336
|
+
priority,
|
|
337
|
+
epochTimestamp,
|
|
338
|
+
payload: data,
|
|
339
|
+
schema
|
|
340
|
+
}
|
|
341
|
+
}))
|
|
342
|
+
);
|
|
343
|
+
} catch (error) {
|
|
344
|
+
logger.error(
|
|
345
|
+
`Error while reading event from ${exchange.channel.name} to ${this.#endpointStructure.resolveEventName(path)}:`,
|
|
346
|
+
error
|
|
347
|
+
);
|
|
348
|
+
StatusResponseError.accept(error);
|
|
349
|
+
if (isConcreteEventPath(requestPath)) {
|
|
350
|
+
eventReportsPayload?.push({
|
|
351
|
+
hasFabricSensitiveData: false,
|
|
352
|
+
eventStatus: { path, status: { status: error.code } }
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
eventReportsPayload.push(
|
|
358
|
+
...reportsForPath.sort((a, b) => {
|
|
359
|
+
const eventNumberA = a.eventData?.eventNumber ?? EventNumber(0);
|
|
360
|
+
const eventNumberB = b.eventData?.eventNumber ?? EventNumber(0);
|
|
361
|
+
if (eventNumberA > eventNumberB) {
|
|
362
|
+
return 1;
|
|
363
|
+
} else if (eventNumberA < eventNumberB) {
|
|
364
|
+
return -1;
|
|
365
|
+
} else {
|
|
366
|
+
return 0;
|
|
367
|
+
}
|
|
368
|
+
})
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return {
|
|
373
|
+
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION,
|
|
374
|
+
suppressResponse: true,
|
|
375
|
+
attributeReportsPayload,
|
|
376
|
+
eventReportsPayload
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
async readAttribute(_path, attribute, exchange, isFabricFiltered, message, _endpoint, offline = false) {
|
|
380
|
+
return attribute.getWithVersion(exchange.session, isFabricFiltered, offline ? void 0 : message);
|
|
381
|
+
}
|
|
382
|
+
async readEvent(_path, eventFilters, event, exchange, isFabricFiltered, message, _endpoint) {
|
|
383
|
+
return event.get(exchange.session, isFabricFiltered, message, eventFilters);
|
|
384
|
+
}
|
|
385
|
+
async handleWriteRequest(exchange, { suppressResponse, timedRequest, writeRequests, interactionModelRevision, moreChunkedMessages }, message) {
|
|
386
|
+
const sessionType = message.packetHeader.sessionType;
|
|
387
|
+
logger.debug(
|
|
388
|
+
`Received write request from ${exchange.channel.name}: ${writeRequests.map((req) => this.#endpointStructure.resolveAttributeName(req.path)).join(", ")}, suppressResponse=${suppressResponse}, moreChunkedMessages=${moreChunkedMessages}`
|
|
389
|
+
);
|
|
390
|
+
if (moreChunkedMessages && suppressResponse) {
|
|
391
|
+
throw new StatusResponseError(
|
|
392
|
+
"MoreChunkedMessages and SuppressResponse cannot be used together in write messages",
|
|
393
|
+
StatusCode.InvalidAction
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
397
|
+
logger.debug(
|
|
398
|
+
`Interaction model revision of sender ${interactionModelRevision} is higher than supported ${Specification.INTERACTION_MODEL_REVISION}.`
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
const receivedWithinTimedInteraction = exchange.hasActiveTimedInteraction();
|
|
402
|
+
if (receivedWithinTimedInteraction && moreChunkedMessages) {
|
|
403
|
+
throw new StatusResponseError(
|
|
404
|
+
"Write Request action that is part of a Timed Write Interaction SHALL NOT be chunked.",
|
|
405
|
+
StatusCode.InvalidAction
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
if (exchange.hasExpiredTimedInteraction()) {
|
|
409
|
+
exchange.clearTimedInteraction();
|
|
410
|
+
throw new StatusResponseError(`Timed request window expired. Decline write request.`, StatusCode.Timeout);
|
|
411
|
+
}
|
|
412
|
+
if (timedRequest !== exchange.hasTimedInteraction()) {
|
|
413
|
+
throw new StatusResponseError(
|
|
414
|
+
`timedRequest flag of write interaction (${timedRequest}) mismatch with expected timed interaction (${receivedWithinTimedInteraction}).`,
|
|
415
|
+
StatusCode.TimedRequestMismatch
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
if (receivedWithinTimedInteraction) {
|
|
419
|
+
logger.debug(
|
|
420
|
+
`Write request from ${exchange.channel.name} successfully received while timed interaction is running.`
|
|
421
|
+
);
|
|
422
|
+
exchange.clearTimedInteraction();
|
|
423
|
+
if (sessionType !== SessionType.Unicast) {
|
|
424
|
+
throw new StatusResponseError(
|
|
425
|
+
"Write requests are only allowed on unicast sessions when a timed interaction is running.",
|
|
426
|
+
StatusCode.InvalidAction
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
if (sessionType === SessionType.Group && !suppressResponse) {
|
|
431
|
+
throw new StatusResponseError(
|
|
432
|
+
"Write requests are only allowed as group casts when suppressResponse=true.",
|
|
433
|
+
StatusCode.InvalidAction
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
const writeData = expandPathsInAttributeData(writeRequests, true);
|
|
437
|
+
const writeResults = new Array();
|
|
438
|
+
const attributeListWrites = /* @__PURE__ */ new Set();
|
|
439
|
+
const clusterDataVersionInfo = /* @__PURE__ */ new Map();
|
|
440
|
+
const inaccessiblePaths = /* @__PURE__ */ new Set();
|
|
441
|
+
for (const writeRequest of writeData) {
|
|
442
|
+
const { path: writePath, dataVersion } = writeRequest;
|
|
443
|
+
validateWriteAttributesPath(writePath);
|
|
444
|
+
const attributes = this.#endpointStructure.getAttributes([writePath], true);
|
|
445
|
+
if (attributes.length === 0) {
|
|
446
|
+
if (isConcreteAttributePath(writePath)) {
|
|
447
|
+
const { endpointId, clusterId, attributeId } = writePath;
|
|
448
|
+
try {
|
|
449
|
+
this.#endpointStructure.validateConcreteAttributePath(endpointId, clusterId, attributeId);
|
|
450
|
+
throw new StatusResponseError(
|
|
451
|
+
`Attribute ${attributeId} is not writable.`,
|
|
452
|
+
StatusCode.UnsupportedWrite
|
|
453
|
+
);
|
|
454
|
+
} catch (e) {
|
|
455
|
+
StatusResponseError.accept(e);
|
|
456
|
+
logger.debug(
|
|
457
|
+
`Write from ${exchange.channel.name}: ${this.#endpointStructure.resolveAttributeName(
|
|
458
|
+
writePath
|
|
459
|
+
)} not allowed: Status=${e.code}`
|
|
460
|
+
);
|
|
461
|
+
writeResults.push({ path: writePath, statusCode: e.code });
|
|
462
|
+
}
|
|
463
|
+
} else {
|
|
464
|
+
logger.debug(
|
|
465
|
+
`Write from ${exchange.channel.name}: ${this.#endpointStructure.resolveAttributeName(
|
|
466
|
+
writePath
|
|
467
|
+
)}: ignore non-existing (wildcard) attribute`
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
if (attributes.length === 1 && isConcreteAttributePath(writePath)) {
|
|
473
|
+
const { endpointId, clusterId } = writePath;
|
|
474
|
+
const { attribute } = attributes[0];
|
|
475
|
+
if (attribute.requiresTimedInteraction && !receivedWithinTimedInteraction) {
|
|
476
|
+
logger.debug(`This write requires a timed interaction which is not initialized.`);
|
|
477
|
+
writeResults.push({ path: writePath, statusCode: StatusCode.NeedsTimedInteraction });
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
if (attribute instanceof FabricScopedAttributeServer && (!exchange.session.isSecure || !exchange.session.fabric)) {
|
|
481
|
+
logger.debug(`This write requires a secure session with a fabric assigned which is missing.`);
|
|
482
|
+
writeResults.push({ path: writePath, statusCode: StatusCode.UnsupportedAccess });
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
if (dataVersion !== void 0) {
|
|
486
|
+
const datasource = this.#endpointStructure.getClusterServer(endpointId, clusterId)?.datasource;
|
|
487
|
+
const { nodeId } = writePath;
|
|
488
|
+
const clusterKey = clusterPathToId({ nodeId, endpointId, clusterId });
|
|
489
|
+
const currentDataVersion = clusterDataVersionInfo.get(clusterKey) ?? datasource?.version;
|
|
490
|
+
if (currentDataVersion !== void 0) {
|
|
491
|
+
if (dataVersion !== currentDataVersion) {
|
|
492
|
+
logger.debug(
|
|
493
|
+
`This write requires a specific data version (${dataVersion}) which do not match the current cluster data version (${currentDataVersion}).`
|
|
494
|
+
);
|
|
495
|
+
writeResults.push({ path: writePath, statusCode: StatusCode.DataVersionMismatch });
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
clusterDataVersionInfo.set(clusterKey, currentDataVersion);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
for (const { path, attribute } of attributes) {
|
|
503
|
+
const { schema, defaultValue } = attribute;
|
|
504
|
+
const pathId = attributePathToId(path);
|
|
505
|
+
try {
|
|
506
|
+
if (!(attribute instanceof AttributeServer) && !(attribute instanceof FabricScopedAttributeServer)) {
|
|
507
|
+
throw new StatusResponseError(
|
|
508
|
+
"Fixed attributes cannot be written",
|
|
509
|
+
StatusCode.UnsupportedWrite
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
if (inaccessiblePaths.has(pathId)) {
|
|
513
|
+
logger.debug(`This write is not allowed due to previous access denied.`);
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
const { endpointId } = path;
|
|
517
|
+
const { listIndex } = writePath;
|
|
518
|
+
const value = listIndex === void 0 ? decodeAttributeValueWithSchema(schema, [writeRequest], defaultValue) : decodeListAttributeValueWithSchema(
|
|
519
|
+
schema,
|
|
520
|
+
[writeRequest],
|
|
521
|
+
(await this.readAttribute(
|
|
522
|
+
path,
|
|
523
|
+
attribute,
|
|
524
|
+
exchange,
|
|
525
|
+
true,
|
|
526
|
+
message,
|
|
527
|
+
this.#endpointStructure.getEndpoint(endpointId)
|
|
528
|
+
)).value ?? defaultValue
|
|
529
|
+
);
|
|
530
|
+
logger.debug(
|
|
531
|
+
`Handle write request from ${exchange.channel.name} resolved to: ${this.#endpointStructure.resolveAttributeName(path)}=${Logger.toJSON(
|
|
532
|
+
value
|
|
533
|
+
)} (listIndex=${listIndex}, for-version=${dataVersion})`
|
|
534
|
+
);
|
|
535
|
+
if (attribute.requiresTimedInteraction && !receivedWithinTimedInteraction) {
|
|
536
|
+
logger.debug(`This write requires a timed interaction which is not initialized.`);
|
|
537
|
+
throw new StatusResponseError(
|
|
538
|
+
"This write requires a timed interaction which is not initialized.",
|
|
539
|
+
StatusCode.NeedsTimedInteraction
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
await this.writeAttribute(
|
|
543
|
+
path,
|
|
544
|
+
attribute,
|
|
545
|
+
value,
|
|
546
|
+
exchange,
|
|
547
|
+
message,
|
|
548
|
+
this.#endpointStructure.getEndpoint(endpointId),
|
|
549
|
+
receivedWithinTimedInteraction,
|
|
550
|
+
schema instanceof ArraySchema
|
|
551
|
+
);
|
|
552
|
+
if (schema instanceof ArraySchema && !attributeListWrites.has(attribute)) {
|
|
553
|
+
attributeListWrites.add(attribute);
|
|
554
|
+
}
|
|
555
|
+
} catch (error) {
|
|
556
|
+
if (StatusResponseError.is(error, StatusCode.UnsupportedAccess)) {
|
|
557
|
+
inaccessiblePaths.add(pathId);
|
|
558
|
+
}
|
|
559
|
+
if (attributes.length === 1 && isConcreteAttributePath(writePath)) {
|
|
560
|
+
logger.error(
|
|
561
|
+
`Error while handling write request from ${exchange.channel.name} to ${this.#endpointStructure.resolveAttributeName(path)}:`,
|
|
562
|
+
error instanceof StatusResponseError ? error.message : error
|
|
563
|
+
);
|
|
564
|
+
if (error instanceof StatusResponseError) {
|
|
565
|
+
writeResults.push({ path, statusCode: error.code, clusterStatusCode: error.clusterCode });
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
writeResults.push({ path, statusCode: StatusCode.ConstraintError });
|
|
569
|
+
continue;
|
|
570
|
+
} else {
|
|
571
|
+
logger.debug(
|
|
572
|
+
`While handling write request from ${exchange.channel.name} to ${this.#endpointStructure.resolveAttributeName(path)} ignored: ${error.message}`
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
writeResults.push({ path, statusCode: StatusCode.Success });
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
const errorResults = writeResults.filter(({ statusCode }) => statusCode !== StatusCode.Success);
|
|
580
|
+
logger.debug(
|
|
581
|
+
`Write request from ${exchange.channel.name} done ${errorResults.length ? `with following errors: ${errorResults.map(
|
|
582
|
+
({ path, statusCode }) => `${this.#endpointStructure.resolveAttributeName(path)}=${Logger.toJSON(statusCode)}`
|
|
583
|
+
).join(", ")}` : "without errors"}`
|
|
584
|
+
);
|
|
585
|
+
const response = {
|
|
586
|
+
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION,
|
|
587
|
+
writeResponses: writeResults.map(({ path, statusCode, clusterStatusCode }) => ({
|
|
588
|
+
path,
|
|
589
|
+
status: { status: statusCode, clusterStatus: clusterStatusCode }
|
|
590
|
+
}))
|
|
591
|
+
};
|
|
592
|
+
for (const attribute of attributeListWrites.values()) {
|
|
593
|
+
try {
|
|
594
|
+
attribute.triggerDelayedChangeEvents();
|
|
595
|
+
} catch (error) {
|
|
596
|
+
logger.error(
|
|
597
|
+
`Ignored Error while writing attribute from ${exchange.channel.name} to ${attribute.name}:`,
|
|
598
|
+
error
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return response;
|
|
603
|
+
}
|
|
604
|
+
async writeAttribute(_path, attribute, value, exchange, message, _endpoint, _receivedWithinTimedInteraction, isListWrite = false) {
|
|
605
|
+
attribute.set(value, exchange.session, message, isListWrite);
|
|
606
|
+
}
|
|
607
|
+
async handleSubscribeRequest(exchange, {
|
|
608
|
+
minIntervalFloorSeconds,
|
|
609
|
+
maxIntervalCeilingSeconds,
|
|
610
|
+
attributeRequests,
|
|
611
|
+
dataVersionFilters,
|
|
612
|
+
eventRequests,
|
|
613
|
+
eventFilters,
|
|
614
|
+
keepSubscriptions,
|
|
615
|
+
isFabricFiltered,
|
|
616
|
+
interactionModelRevision
|
|
617
|
+
}, messenger, message) {
|
|
618
|
+
logger.debug(
|
|
619
|
+
`Received subscribe request from ${exchange.channel.name} (keepSubscriptions=${keepSubscriptions}, isFabricFiltered=${isFabricFiltered})`
|
|
620
|
+
);
|
|
621
|
+
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
622
|
+
logger.debug(
|
|
623
|
+
`Interaction model revision of sender ${interactionModelRevision} is higher than supported ${Specification.INTERACTION_MODEL_REVISION}.`
|
|
624
|
+
);
|
|
625
|
+
}
|
|
626
|
+
if (message.packetHeader.sessionType !== SessionType.Unicast) {
|
|
627
|
+
throw new StatusResponseError(
|
|
628
|
+
"Subscriptions are only allowed on unicast sessions",
|
|
629
|
+
StatusCode.InvalidAction
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
assertSecureSession(exchange.session, "Subscriptions are only implemented on secure sessions");
|
|
633
|
+
const session = exchange.session;
|
|
634
|
+
const fabric = session.fabric;
|
|
635
|
+
if (fabric === void 0)
|
|
636
|
+
throw new StatusResponseError(
|
|
637
|
+
"Subscriptions are only implemented after a fabric has been assigned",
|
|
638
|
+
StatusCode.InvalidAction
|
|
639
|
+
);
|
|
640
|
+
if (!keepSubscriptions) {
|
|
641
|
+
logger.debug(
|
|
642
|
+
`Clear subscriptions for Subscriber node ${session.peerNodeId} because keepSubscriptions=false`
|
|
643
|
+
);
|
|
644
|
+
await this.#context.sessions.clearSubscriptionsForNode(fabric.fabricIndex, session.peerNodeId, true);
|
|
645
|
+
}
|
|
646
|
+
if ((!Array.isArray(attributeRequests) || attributeRequests.length === 0) && (!Array.isArray(eventRequests) || eventRequests.length === 0)) {
|
|
647
|
+
throw new StatusResponseError("No attributes or events requested", StatusCode.InvalidAction);
|
|
648
|
+
}
|
|
649
|
+
logger.debug(
|
|
650
|
+
`Subscribe to attributes:${attributeRequests?.map((path) => this.#endpointStructure.resolveAttributeName(path)).join(", ") ?? "none"}, events:${eventRequests?.map((path) => this.#endpointStructure.resolveEventName(path)).join(", ") ?? "none"}`
|
|
651
|
+
);
|
|
652
|
+
if (dataVersionFilters !== void 0 && dataVersionFilters.length > 0) {
|
|
653
|
+
logger.debug(
|
|
654
|
+
`DataVersionFilters: ${dataVersionFilters.map(
|
|
655
|
+
({ path: { nodeId, endpointId, clusterId }, dataVersion }) => `${clusterPathToId({ nodeId, endpointId, clusterId })}=${dataVersion}`
|
|
656
|
+
).join(", ")}`
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
if (eventFilters !== void 0 && eventFilters.length > 0)
|
|
660
|
+
logger.debug(
|
|
661
|
+
`Event filters: ${eventFilters.map((filter) => `${filter.nodeId}/${filter.eventMin}`).join(", ")}`
|
|
662
|
+
);
|
|
663
|
+
attributeRequests?.forEach((path) => validateReadAttributesPath(path));
|
|
664
|
+
eventRequests?.forEach((path) => validateReadEventPath(path));
|
|
665
|
+
if (minIntervalFloorSeconds < 0) {
|
|
666
|
+
throw new StatusResponseError(
|
|
667
|
+
"minIntervalFloorSeconds should be greater or equal to 0",
|
|
668
|
+
StatusCode.InvalidAction
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
if (maxIntervalCeilingSeconds < 0) {
|
|
672
|
+
throw new StatusResponseError(
|
|
673
|
+
"maxIntervalCeilingSeconds should be greater or equal to 1",
|
|
674
|
+
StatusCode.InvalidAction
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
if (maxIntervalCeilingSeconds < minIntervalFloorSeconds) {
|
|
678
|
+
throw new StatusResponseError(
|
|
679
|
+
"maxIntervalCeilingSeconds should be greater or equal to minIntervalFloorSeconds",
|
|
680
|
+
StatusCode.InvalidAction
|
|
681
|
+
);
|
|
682
|
+
}
|
|
683
|
+
if (this.#nextSubscriptionId === 4294967295) this.#nextSubscriptionId = 0;
|
|
684
|
+
const subscriptionId = this.#nextSubscriptionId++;
|
|
685
|
+
const context = {
|
|
686
|
+
session,
|
|
687
|
+
structure: this.#endpointStructure,
|
|
688
|
+
readAttribute: (path, attribute, offline) => this.readAttribute(
|
|
689
|
+
path,
|
|
690
|
+
attribute,
|
|
691
|
+
exchange,
|
|
692
|
+
isFabricFiltered,
|
|
693
|
+
message,
|
|
694
|
+
this.#endpointStructure.getEndpoint(path.endpointId),
|
|
695
|
+
offline
|
|
696
|
+
),
|
|
697
|
+
readEvent: (path, event, eventFilters2) => this.readEvent(
|
|
698
|
+
path,
|
|
699
|
+
eventFilters2,
|
|
700
|
+
event,
|
|
701
|
+
exchange,
|
|
702
|
+
isFabricFiltered,
|
|
703
|
+
message,
|
|
704
|
+
this.#endpointStructure.getEndpoint(path.endpointId)
|
|
705
|
+
),
|
|
706
|
+
initiateExchange: (address, protocolId) => this.#context.initiateExchange(address, protocolId)
|
|
707
|
+
};
|
|
708
|
+
const subscription = new ServerSubscription({
|
|
709
|
+
id: subscriptionId,
|
|
710
|
+
context,
|
|
711
|
+
criteria: {
|
|
712
|
+
attributeRequests,
|
|
713
|
+
dataVersionFilters,
|
|
714
|
+
eventRequests,
|
|
715
|
+
eventFilters,
|
|
716
|
+
isFabricFiltered
|
|
717
|
+
},
|
|
718
|
+
minIntervalFloor: minIntervalFloorSeconds,
|
|
719
|
+
maxIntervalCeiling: maxIntervalCeilingSeconds,
|
|
720
|
+
subscriptionOptions: this.#subscriptionConfig
|
|
721
|
+
});
|
|
722
|
+
try {
|
|
723
|
+
await subscription.sendInitialReport(messenger);
|
|
724
|
+
} catch (error) {
|
|
725
|
+
logger.error(
|
|
726
|
+
`Subscription ${subscriptionId} for Session ${session.id}: Error while sending initial data reports`,
|
|
727
|
+
error
|
|
728
|
+
);
|
|
729
|
+
await subscription.close();
|
|
730
|
+
if (error instanceof StatusResponseError) {
|
|
731
|
+
logger.info(`Sending status response ${error.code} for interaction error: ${error.message}`);
|
|
732
|
+
await messenger.sendStatus(error.code);
|
|
733
|
+
}
|
|
734
|
+
await messenger.close();
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
const maxInterval = subscription.maxInterval;
|
|
738
|
+
logger.info(
|
|
739
|
+
`Successfully created subscription ${subscriptionId} for Session ${session.id}. Updates: ${minIntervalFloorSeconds} - ${maxIntervalCeilingSeconds} => ${maxInterval} seconds (sendInterval = ${subscription.sendInterval} seconds)`
|
|
740
|
+
);
|
|
741
|
+
await messenger.send(
|
|
742
|
+
MessageType.SubscribeResponse,
|
|
743
|
+
TlvSubscribeResponse.encode({
|
|
744
|
+
subscriptionId,
|
|
745
|
+
maxInterval,
|
|
746
|
+
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION
|
|
747
|
+
})
|
|
748
|
+
);
|
|
749
|
+
subscription.activateSendingUpdates();
|
|
750
|
+
}
|
|
751
|
+
async handleInvokeRequest(exchange, { invokeRequests, timedRequest, suppressResponse, interactionModelRevision }, messenger, message) {
|
|
752
|
+
logger.debug(
|
|
753
|
+
`Received invoke request from ${exchange.channel.name}${invokeRequests.length > 0 ? ` with ${invokeRequests.length} commands` : ""}: ${invokeRequests.map(
|
|
754
|
+
({ commandPath: { endpointId, clusterId, commandId } }) => this.#endpointStructure.resolveCommandName({ endpointId, clusterId, commandId })
|
|
755
|
+
).join(", ")}, suppressResponse=${suppressResponse}`
|
|
756
|
+
);
|
|
757
|
+
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
758
|
+
logger.debug(
|
|
759
|
+
`Interaction model revision of sender ${interactionModelRevision} is higher than supported ${Specification.INTERACTION_MODEL_REVISION}.`
|
|
760
|
+
);
|
|
761
|
+
}
|
|
762
|
+
const receivedWithinTimedInteraction = exchange.hasActiveTimedInteraction();
|
|
763
|
+
if (exchange.hasExpiredTimedInteraction()) {
|
|
764
|
+
exchange.clearTimedInteraction();
|
|
765
|
+
throw new StatusResponseError(`Timed request window expired. Decline invoke request.`, StatusCode.Timeout);
|
|
766
|
+
}
|
|
767
|
+
if (timedRequest !== exchange.hasTimedInteraction()) {
|
|
768
|
+
throw new StatusResponseError(
|
|
769
|
+
`timedRequest flag of invoke interaction (${timedRequest}) mismatch with expected timed interaction (${receivedWithinTimedInteraction}).`,
|
|
770
|
+
StatusCode.TimedRequestMismatch
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
if (receivedWithinTimedInteraction) {
|
|
774
|
+
logger.debug(`Invoke request from ${exchange.channel.name} received while timed interaction is running.`);
|
|
775
|
+
exchange.clearTimedInteraction();
|
|
776
|
+
if (message.packetHeader.sessionType !== SessionType.Unicast) {
|
|
777
|
+
throw new StatusResponseError(
|
|
778
|
+
"Invoke requests are only allowed on unicast sessions when a timed interaction is running.",
|
|
779
|
+
StatusCode.InvalidAction
|
|
780
|
+
);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
if (invokeRequests.length > this.#maxPathsPerInvoke) {
|
|
784
|
+
throw new StatusResponseError(
|
|
785
|
+
`Only ${this.#maxPathsPerInvoke} invoke requests are supported in one message. This message contains ${invokeRequests.length}`,
|
|
786
|
+
StatusCode.InvalidAction
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
invokeRequests.forEach(({ commandPath }) => validateCommandPath(commandPath));
|
|
790
|
+
if (invokeRequests.length > 1) {
|
|
791
|
+
const invokeUniqueSet = /* @__PURE__ */ new Set();
|
|
792
|
+
invokeRequests.forEach(({ commandPath }) => {
|
|
793
|
+
if (!isConcreteCommandPath(commandPath)) {
|
|
794
|
+
throw new StatusResponseError(
|
|
795
|
+
"Wildcard paths are not supported in multi-command invoke requests",
|
|
796
|
+
StatusCode.InvalidAction
|
|
797
|
+
);
|
|
798
|
+
}
|
|
799
|
+
const commandPathId = commandPathToId(commandPath);
|
|
800
|
+
if (invokeUniqueSet.has(commandPathId)) {
|
|
801
|
+
throw new StatusResponseError(
|
|
802
|
+
`Duplicate command paths (${commandPathId}) are not allowed in multi-command invoke requests`,
|
|
803
|
+
StatusCode.InvalidAction
|
|
804
|
+
);
|
|
805
|
+
}
|
|
806
|
+
invokeUniqueSet.add(commandPathId);
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
const isGroupSession = message.packetHeader.sessionType === SessionType.Group;
|
|
810
|
+
const invokeResponseMessage = {
|
|
811
|
+
suppressResponse: false,
|
|
812
|
+
// Deprecated but must be present
|
|
813
|
+
interactionModelRevision: Specification.INTERACTION_MODEL_REVISION,
|
|
814
|
+
invokeResponses: [],
|
|
815
|
+
moreChunkedMessages: invokeRequests.length > 1
|
|
816
|
+
// Assume for now we have multiple responses when having multiple invokes
|
|
817
|
+
};
|
|
818
|
+
const emptyInvokeResponseBytes = TlvInvokeResponseForSend.encode(invokeResponseMessage);
|
|
819
|
+
let messageSize = emptyInvokeResponseBytes.length;
|
|
820
|
+
let invokeResultsProcessed = 0;
|
|
821
|
+
const processResponseResult = async (invokeResponse) => {
|
|
822
|
+
invokeResultsProcessed++;
|
|
823
|
+
if (isGroupSession) {
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
const encodedInvokeResponse = TlvInvokeResponseData.encodeTlv(invokeResponse);
|
|
827
|
+
const invokeResponseBytes = TlvAny.getEncodedByteLength(encodedInvokeResponse);
|
|
828
|
+
if (messageSize + invokeResponseBytes > exchange.maxPayloadSize || invokeResultsProcessed === invokeRequests.length) {
|
|
829
|
+
let lastMessageProcessed = false;
|
|
830
|
+
if (messageSize + invokeResponseBytes <= exchange.maxPayloadSize) {
|
|
831
|
+
invokeResponseMessage.invokeResponses.push(encodedInvokeResponse);
|
|
832
|
+
lastMessageProcessed = true;
|
|
833
|
+
}
|
|
834
|
+
if (invokeResponseMessage.invokeResponses.length > 0) {
|
|
835
|
+
if (invokeRequests.length > 1) {
|
|
836
|
+
logger.debug(
|
|
837
|
+
`Send ${lastMessageProcessed ? "final " : ""}invoke response for ${invokeResponseMessage.invokeResponses} commands`
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
await messenger.send(
|
|
841
|
+
MessageType.InvokeResponse,
|
|
842
|
+
TlvInvokeResponseForSend.encode({
|
|
843
|
+
...invokeResponseMessage,
|
|
844
|
+
moreChunkedMessages: invokeResultsProcessed < invokeRequests.length ? true : void 0
|
|
845
|
+
})
|
|
846
|
+
);
|
|
847
|
+
invokeResponseMessage.invokeResponses = [];
|
|
848
|
+
messageSize = emptyInvokeResponseBytes.length;
|
|
849
|
+
}
|
|
850
|
+
if (!lastMessageProcessed) {
|
|
851
|
+
invokeResultsProcessed--;
|
|
852
|
+
return processResponseResult(invokeResponse);
|
|
853
|
+
}
|
|
854
|
+
} else {
|
|
855
|
+
invokeResponseMessage.invokeResponses.push(encodedInvokeResponse);
|
|
856
|
+
messageSize += invokeResponseBytes;
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
for (const { commandPath, commandFields, commandRef } of invokeRequests) {
|
|
860
|
+
const commands = this.#endpointStructure.getCommands([commandPath]);
|
|
861
|
+
if (commands.length === 0) {
|
|
862
|
+
if (isConcreteCommandPath(commandPath)) {
|
|
863
|
+
const { endpointId, clusterId, commandId } = commandPath;
|
|
864
|
+
let result;
|
|
865
|
+
try {
|
|
866
|
+
this.#endpointStructure.validateConcreteCommandPath(endpointId, clusterId, commandId);
|
|
867
|
+
throw new InternalError(
|
|
868
|
+
"validateConcreteCommandPath should throw StatusResponseError but did not."
|
|
869
|
+
);
|
|
870
|
+
} catch (e) {
|
|
871
|
+
StatusResponseError.accept(e);
|
|
872
|
+
logger.debug(
|
|
873
|
+
`Invoke from ${exchange.channel.name}: ${this.#endpointStructure.resolveCommandName(
|
|
874
|
+
commandPath
|
|
875
|
+
)} unsupported path: Status=${e.code}`
|
|
876
|
+
);
|
|
877
|
+
result = { status: { commandPath, status: { status: e.code }, commandRef } };
|
|
878
|
+
}
|
|
879
|
+
await processResponseResult(result);
|
|
880
|
+
} else {
|
|
881
|
+
logger.debug(
|
|
882
|
+
`Invoke from ${exchange.channel.name}: ${this.#endpointStructure.resolveCommandName(
|
|
883
|
+
commandPath
|
|
884
|
+
)} ignore non-existing command`
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
const isConcretePath = isConcreteCommandPath(commandPath);
|
|
890
|
+
for (const { command, path } of commands) {
|
|
891
|
+
const { endpointId, clusterId, commandId } = path;
|
|
892
|
+
if (endpointId === void 0) {
|
|
893
|
+
logger.error(
|
|
894
|
+
`Invoke from ${exchange.channel.name}: ${this.#endpointStructure.resolveCommandName(
|
|
895
|
+
path
|
|
896
|
+
)} invalid path because empty endpoint!`
|
|
897
|
+
);
|
|
898
|
+
if (isConcretePath) {
|
|
899
|
+
await processResponseResult({
|
|
900
|
+
status: {
|
|
901
|
+
commandPath: path,
|
|
902
|
+
status: { status: StatusCode.UnsupportedEndpoint },
|
|
903
|
+
commandRef
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
continue;
|
|
908
|
+
}
|
|
909
|
+
const endpoint = this.#endpointStructure.getEndpoint(endpointId);
|
|
910
|
+
if (endpoint === void 0) {
|
|
911
|
+
logger.error(
|
|
912
|
+
`Invoke from ${exchange.channel.name}: ${this.#endpointStructure.resolveCommandName(
|
|
913
|
+
path
|
|
914
|
+
)} invalid path because endpoint not found!`
|
|
915
|
+
);
|
|
916
|
+
if (isConcretePath) {
|
|
917
|
+
await processResponseResult({
|
|
918
|
+
status: {
|
|
919
|
+
commandPath: path,
|
|
920
|
+
status: { status: StatusCode.UnsupportedEndpoint },
|
|
921
|
+
commandRef
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
continue;
|
|
926
|
+
}
|
|
927
|
+
if (command.requiresTimedInteraction && !receivedWithinTimedInteraction) {
|
|
928
|
+
logger.debug(`This invoke requires a timed interaction which is not initialized.`);
|
|
929
|
+
if (isConcretePath) {
|
|
930
|
+
await processResponseResult({
|
|
931
|
+
status: {
|
|
932
|
+
commandPath: path,
|
|
933
|
+
status: { status: StatusCode.NeedsTimedInteraction },
|
|
934
|
+
commandRef
|
|
935
|
+
}
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
continue;
|
|
939
|
+
}
|
|
940
|
+
if (getMatterModelClusterCommand(clusterId, commandId)?.fabricScoped && (!exchange.session.isSecure || !exchange.session.fabric)) {
|
|
941
|
+
logger.debug(`This invoke requires a secure session with a fabric assigned which is missing.`);
|
|
942
|
+
if (isConcretePath) {
|
|
943
|
+
await processResponseResult({
|
|
944
|
+
status: { commandPath: path, status: { status: StatusCode.UnsupportedAccess }, commandRef }
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
let result;
|
|
950
|
+
try {
|
|
951
|
+
result = await this.invokeCommand(
|
|
952
|
+
path,
|
|
953
|
+
command,
|
|
954
|
+
exchange,
|
|
955
|
+
commandFields ?? TlvNoArguments.encodeTlv(commandFields),
|
|
956
|
+
message,
|
|
957
|
+
endpoint,
|
|
958
|
+
receivedWithinTimedInteraction
|
|
959
|
+
);
|
|
960
|
+
} catch (e) {
|
|
961
|
+
StatusResponseError.accept(e);
|
|
962
|
+
let errorCode = e.code;
|
|
963
|
+
const errorLogText = `Error ${Diagnostic.hex(errorCode)}${e.clusterCode !== void 0 ? `/${Diagnostic.hex(e.clusterCode)}` : ""} while invoking command: ${e.message}`;
|
|
964
|
+
if (e instanceof ValidationError) {
|
|
965
|
+
logger.info(
|
|
966
|
+
`Validation-${errorLogText}${e.fieldName !== void 0 ? ` in field ${e.fieldName}` : ""}`
|
|
967
|
+
);
|
|
968
|
+
if (errorCode === StatusCode.InvalidAction) {
|
|
969
|
+
errorCode = StatusCode.InvalidCommand;
|
|
970
|
+
}
|
|
971
|
+
} else {
|
|
972
|
+
logger.info(errorLogText);
|
|
973
|
+
}
|
|
974
|
+
result = {
|
|
975
|
+
code: errorCode,
|
|
976
|
+
clusterCode: e.clusterCode,
|
|
977
|
+
responseId: command.responseId,
|
|
978
|
+
response: TlvNoResponse.encodeTlv()
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
const { code, clusterCode, responseId, response } = result;
|
|
982
|
+
if (response.length === 0) {
|
|
983
|
+
await processResponseResult({
|
|
984
|
+
status: { commandPath: path, status: { status: code, clusterStatus: clusterCode }, commandRef }
|
|
985
|
+
});
|
|
986
|
+
} else {
|
|
987
|
+
await processResponseResult({
|
|
988
|
+
command: {
|
|
989
|
+
commandPath: { ...path, commandId: responseId },
|
|
990
|
+
commandFields: response,
|
|
991
|
+
commandRef
|
|
992
|
+
}
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
async invokeCommand(_path, command, exchange, commandFields, message, endpoint, _receivedWithinTimedInteraction = false) {
|
|
999
|
+
return command.invoke(exchange.session, commandFields, message, endpoint);
|
|
1000
|
+
}
|
|
1001
|
+
handleTimedRequest(exchange, { timeout, interactionModelRevision }) {
|
|
1002
|
+
logger.debug(`Received timed request (${timeout}ms) from ${exchange.channel.name}`);
|
|
1003
|
+
if (interactionModelRevision > Specification.INTERACTION_MODEL_REVISION) {
|
|
1004
|
+
logger.debug(
|
|
1005
|
+
`Interaction model revision of sender ${interactionModelRevision} is higher than supported ${Specification.INTERACTION_MODEL_REVISION}.`
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
1008
|
+
exchange.startTimedInteraction(timeout);
|
|
1009
|
+
}
|
|
1010
|
+
async close() {
|
|
1011
|
+
this.#isClosing = true;
|
|
1012
|
+
}
|
|
1013
|
+
get #endpointStructure() {
|
|
1014
|
+
return this.#context.structure;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
export {
|
|
1018
|
+
InteractionServer,
|
|
1019
|
+
attributePathToId,
|
|
1020
|
+
clusterPathToId,
|
|
1021
|
+
commandPathToId,
|
|
1022
|
+
eventPathToId,
|
|
1023
|
+
genericElementPathToId,
|
|
1024
|
+
validateReadAttributesPath,
|
|
1025
|
+
validateReadEventPath
|
|
1026
|
+
};
|
|
1027
|
+
//# sourceMappingURL=InteractionServer.js.map
|