@matter/protocol 0.16.0-alpha.0-20250816-d22ad240d → 0.16.0-alpha.0-20250819-0a388db8b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/action/Val.d.ts +6 -0
- package/dist/cjs/action/Val.d.ts.map +1 -1
- package/dist/cjs/action/Val.js.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.d.ts +1 -1
- package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.js +4 -4
- package/dist/cjs/action/client/ClientInteraction.js.map +1 -1
- package/dist/cjs/action/client/ClientSubscription.d.ts +2 -1
- package/dist/cjs/action/client/ClientSubscription.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientSubscriptionHandler.js +2 -2
- package/dist/cjs/action/client/ClientSubscriptionHandler.js.map +1 -1
- package/dist/cjs/action/client/ClientSubscriptions.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientSubscriptions.js +11 -7
- package/dist/cjs/action/client/ClientSubscriptions.js.map +1 -1
- package/dist/cjs/action/request/Subscribe.d.ts +6 -6
- package/dist/cjs/action/request/Subscribe.d.ts.map +1 -1
- package/dist/cjs/action/request/Subscribe.js +11 -9
- package/dist/cjs/action/request/Subscribe.js.map +1 -1
- package/dist/cjs/advertisement/Advertisement.d.ts +3 -3
- package/dist/cjs/advertisement/Advertisement.d.ts.map +1 -1
- package/dist/cjs/advertisement/Advertisement.js +5 -5
- package/dist/cjs/advertisement/Advertisement.js.map +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertisement.d.ts.map +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertisement.js +7 -6
- package/dist/cjs/advertisement/ble/BleAdvertisement.js.map +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertiser.d.ts +11 -10
- package/dist/cjs/advertisement/ble/BleAdvertiser.d.ts.map +1 -1
- package/dist/cjs/advertisement/ble/BleAdvertiser.js +4 -4
- package/dist/cjs/advertisement/ble/BleAdvertiser.js.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js +7 -7
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertiser.d.ts +2 -2
- package/dist/cjs/advertisement/mdns/MdnsAdvertiser.d.ts.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertiser.js +4 -4
- package/dist/cjs/advertisement/mdns/MdnsAdvertiser.js.map +1 -1
- package/dist/cjs/ble/Ble.d.ts +2 -2
- package/dist/cjs/ble/Ble.d.ts.map +1 -1
- package/dist/cjs/ble/Ble.js.map +1 -1
- package/dist/cjs/ble/BleConsts.d.ts +4 -4
- package/dist/cjs/ble/BleConsts.d.ts.map +1 -1
- package/dist/cjs/ble/BleConsts.js +7 -7
- package/dist/cjs/ble/BleConsts.js.map +1 -1
- package/dist/cjs/ble/BtpSessionHandler.js +2 -2
- package/dist/cjs/ble/BtpSessionHandler.js.map +1 -1
- package/dist/cjs/certificate/AttestationCertificateManager.js +3 -3
- package/dist/cjs/certificate/AttestationCertificateManager.js.map +1 -1
- package/dist/cjs/certificate/CertificateAuthority.js +2 -2
- package/dist/cjs/certificate/CertificateAuthority.js.map +1 -1
- package/dist/cjs/certificate/kinds/OperationalBase.js +2 -2
- package/dist/cjs/certificate/kinds/OperationalBase.js.map +1 -1
- package/dist/cjs/cluster/client/ClusterClient.js +5 -5
- package/dist/cjs/cluster/client/ClusterClient.js.map +1 -1
- package/dist/cjs/cluster/client/ClusterClientTypes.d.ts +3 -3
- package/dist/cjs/cluster/client/ClusterClientTypes.d.ts.map +1 -1
- package/dist/cjs/cluster/client/EventClient.d.ts +2 -1
- package/dist/cjs/cluster/client/EventClient.d.ts.map +1 -1
- package/dist/cjs/cluster/client/EventClient.js +3 -3
- package/dist/cjs/cluster/client/EventClient.js.map +1 -1
- package/dist/cjs/common/FailsafeContext.d.ts +4 -4
- package/dist/cjs/common/FailsafeContext.d.ts.map +1 -1
- package/dist/cjs/common/FailsafeContext.js +8 -8
- package/dist/cjs/common/FailsafeContext.js.map +1 -1
- package/dist/cjs/common/FailsafeTimer.d.ts +3 -3
- package/dist/cjs/common/FailsafeTimer.d.ts.map +1 -1
- package/dist/cjs/common/FailsafeTimer.js +8 -8
- package/dist/cjs/common/FailsafeTimer.js.map +1 -1
- package/dist/cjs/common/Scanner.d.ts +7 -7
- package/dist/cjs/common/Scanner.d.ts.map +1 -1
- package/dist/cjs/common/Scanner.js.map +1 -1
- package/dist/cjs/events/OccurrenceManager.js +1 -1
- package/dist/cjs/events/OccurrenceManager.js.map +1 -1
- package/dist/cjs/groups/FabricGroups.d.ts +1 -1
- package/dist/cjs/groups/FabricGroups.js +1 -1
- package/dist/cjs/groups/Groups.d.ts +1 -1
- package/dist/cjs/groups/KeySets.d.ts +3 -3
- package/dist/cjs/groups/KeySets.d.ts.map +1 -1
- package/dist/cjs/groups/KeySets.js +12 -4
- package/dist/cjs/groups/KeySets.js.map +1 -1
- package/dist/cjs/interaction/InteractionClient.d.ts +9 -9
- package/dist/cjs/interaction/InteractionClient.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionClient.js +33 -33
- package/dist/cjs/interaction/InteractionClient.js.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.d.ts +10 -10
- package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.js +15 -15
- package/dist/cjs/interaction/InteractionMessenger.js.map +1 -1
- package/dist/cjs/interaction/Subscription.d.ts +3 -4
- package/dist/cjs/interaction/Subscription.d.ts.map +1 -1
- package/dist/cjs/interaction/Subscription.js +9 -12
- package/dist/cjs/interaction/Subscription.js.map +1 -1
- package/dist/cjs/interaction/SubscriptionClient.d.ts +3 -3
- package/dist/cjs/interaction/SubscriptionClient.d.ts.map +1 -1
- package/dist/cjs/interaction/SubscriptionClient.js +3 -3
- package/dist/cjs/interaction/SubscriptionClient.js.map +1 -1
- package/dist/cjs/mdns/MdnsClient.d.ts +9 -9
- package/dist/cjs/mdns/MdnsClient.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsClient.js +86 -82
- package/dist/cjs/mdns/MdnsClient.js.map +1 -1
- package/dist/cjs/mdns/MdnsServer.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsServer.js +11 -9
- package/dist/cjs/mdns/MdnsServer.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.d.ts +2 -2
- package/dist/cjs/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.js +7 -7
- package/dist/cjs/peer/ControllerCommissioner.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.js +37 -35
- package/dist/cjs/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/cjs/peer/ControllerDiscovery.d.ts +4 -4
- package/dist/cjs/peer/ControllerDiscovery.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerDiscovery.js +12 -17
- package/dist/cjs/peer/ControllerDiscovery.js.map +1 -1
- package/dist/cjs/peer/InteractionQueue.d.ts.map +1 -1
- package/dist/cjs/peer/InteractionQueue.js +2 -2
- package/dist/cjs/peer/InteractionQueue.js.map +1 -1
- package/dist/cjs/peer/PeerSet.d.ts +2 -2
- package/dist/cjs/peer/PeerSet.d.ts.map +1 -1
- package/dist/cjs/peer/PeerSet.js +25 -25
- package/dist/cjs/peer/PeerSet.js.map +1 -1
- package/dist/cjs/protocol/DeviceCommissioner.d.ts.map +1 -1
- package/dist/cjs/protocol/DeviceCommissioner.js +1 -1
- package/dist/cjs/protocol/DeviceCommissioner.js.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.d.ts +1 -1
- package/dist/cjs/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.js +2 -5
- package/dist/cjs/protocol/ExchangeManager.js.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.d.ts +4 -4
- package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.js +3 -3
- package/dist/cjs/protocol/ExchangeProvider.js.map +1 -1
- package/dist/cjs/protocol/MessageChannel.d.ts +5 -5
- package/dist/cjs/protocol/MessageChannel.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageChannel.js +19 -15
- package/dist/cjs/protocol/MessageChannel.js.map +1 -1
- package/dist/cjs/protocol/MessageExchange.d.ts +6 -6
- package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageExchange.js +35 -33
- package/dist/cjs/protocol/MessageExchange.js.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts +8 -8
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.js +17 -17
- package/dist/cjs/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/cjs/session/InsecureSession.d.ts +2 -2
- package/dist/cjs/session/InsecureSession.d.ts.map +1 -1
- package/dist/cjs/session/InsecureSession.js.map +1 -1
- package/dist/cjs/session/NodeSession.js +3 -3
- package/dist/cjs/session/Session.d.ts +7 -7
- package/dist/cjs/session/Session.d.ts.map +1 -1
- package/dist/cjs/session/Session.js +19 -19
- package/dist/cjs/session/Session.js.map +1 -1
- package/dist/cjs/session/SessionIntervals.d.ts +7 -6
- package/dist/cjs/session/SessionIntervals.d.ts.map +1 -1
- package/dist/cjs/session/SessionIntervals.js +8 -8
- package/dist/cjs/session/SessionIntervals.js.map +1 -1
- package/dist/cjs/session/SessionManager.d.ts +2 -2
- package/dist/cjs/session/SessionManager.d.ts.map +1 -1
- package/dist/cjs/session/SessionManager.js +6 -6
- package/dist/cjs/session/SessionManager.js.map +1 -1
- package/dist/cjs/session/case/CaseClient.d.ts +2 -1
- package/dist/cjs/session/case/CaseClient.d.ts.map +1 -1
- package/dist/cjs/session/case/CaseClient.js +2 -2
- package/dist/cjs/session/case/CaseClient.js.map +1 -1
- package/dist/cjs/session/pase/PaseMessenger.d.ts.map +1 -1
- package/dist/cjs/session/pase/PaseMessenger.js +4 -7
- package/dist/cjs/session/pase/PaseMessenger.js.map +1 -1
- package/dist/cjs/session/pase/PaseServer.d.ts.map +1 -1
- package/dist/cjs/session/pase/PaseServer.js +1 -1
- package/dist/cjs/session/pase/PaseServer.js.map +1 -1
- package/dist/esm/action/Val.d.ts +6 -0
- package/dist/esm/action/Val.d.ts.map +1 -1
- package/dist/esm/action/Val.js.map +1 -1
- package/dist/esm/action/client/ClientInteraction.d.ts +1 -1
- package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.js +5 -5
- package/dist/esm/action/client/ClientInteraction.js.map +1 -1
- package/dist/esm/action/client/ClientSubscription.d.ts +2 -1
- package/dist/esm/action/client/ClientSubscription.d.ts.map +1 -1
- package/dist/esm/action/client/ClientSubscriptionHandler.js +2 -2
- package/dist/esm/action/client/ClientSubscriptionHandler.js.map +1 -1
- package/dist/esm/action/client/ClientSubscriptions.d.ts.map +1 -1
- package/dist/esm/action/client/ClientSubscriptions.js +14 -8
- package/dist/esm/action/client/ClientSubscriptions.js.map +1 -1
- package/dist/esm/action/request/Subscribe.d.ts +6 -6
- package/dist/esm/action/request/Subscribe.d.ts.map +1 -1
- package/dist/esm/action/request/Subscribe.js +12 -10
- package/dist/esm/action/request/Subscribe.js.map +1 -1
- package/dist/esm/advertisement/Advertisement.d.ts +3 -3
- package/dist/esm/advertisement/Advertisement.d.ts.map +1 -1
- package/dist/esm/advertisement/Advertisement.js +16 -7
- package/dist/esm/advertisement/Advertisement.js.map +1 -1
- package/dist/esm/advertisement/ble/BleAdvertisement.d.ts.map +1 -1
- package/dist/esm/advertisement/ble/BleAdvertisement.js +7 -6
- package/dist/esm/advertisement/ble/BleAdvertisement.js.map +1 -1
- package/dist/esm/advertisement/ble/BleAdvertiser.d.ts +11 -10
- package/dist/esm/advertisement/ble/BleAdvertiser.d.ts.map +1 -1
- package/dist/esm/advertisement/ble/BleAdvertiser.js +6 -6
- package/dist/esm/advertisement/ble/BleAdvertiser.js.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.js +17 -8
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertiser.d.ts +2 -2
- package/dist/esm/advertisement/mdns/MdnsAdvertiser.d.ts.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertiser.js +14 -6
- package/dist/esm/advertisement/mdns/MdnsAdvertiser.js.map +1 -1
- package/dist/esm/ble/Ble.d.ts +2 -2
- package/dist/esm/ble/Ble.d.ts.map +1 -1
- package/dist/esm/ble/Ble.js +5 -1
- package/dist/esm/ble/Ble.js.map +1 -1
- package/dist/esm/ble/BleConsts.d.ts +4 -4
- package/dist/esm/ble/BleConsts.d.ts.map +1 -1
- package/dist/esm/ble/BleConsts.js +8 -8
- package/dist/esm/ble/BleConsts.js.map +1 -1
- package/dist/esm/ble/BtpSessionHandler.js +4 -4
- package/dist/esm/ble/BtpSessionHandler.js.map +1 -1
- package/dist/esm/certificate/AttestationCertificateManager.js +3 -3
- package/dist/esm/certificate/AttestationCertificateManager.js.map +1 -1
- package/dist/esm/certificate/CertificateAuthority.js +2 -2
- package/dist/esm/certificate/CertificateAuthority.js.map +1 -1
- package/dist/esm/certificate/kinds/OperationalBase.js +2 -2
- package/dist/esm/certificate/kinds/OperationalBase.js.map +1 -1
- package/dist/esm/cluster/client/ClusterClient.js +5 -5
- package/dist/esm/cluster/client/ClusterClient.js.map +1 -1
- package/dist/esm/cluster/client/ClusterClientTypes.d.ts +3 -3
- package/dist/esm/cluster/client/ClusterClientTypes.d.ts.map +1 -1
- package/dist/esm/cluster/client/EventClient.d.ts +2 -1
- package/dist/esm/cluster/client/EventClient.d.ts.map +1 -1
- package/dist/esm/cluster/client/EventClient.js +3 -3
- package/dist/esm/cluster/client/EventClient.js.map +1 -1
- package/dist/esm/common/FailsafeContext.d.ts +4 -4
- package/dist/esm/common/FailsafeContext.d.ts.map +1 -1
- package/dist/esm/common/FailsafeContext.js +9 -8
- package/dist/esm/common/FailsafeContext.js.map +1 -1
- package/dist/esm/common/FailsafeTimer.d.ts +3 -3
- package/dist/esm/common/FailsafeTimer.d.ts.map +1 -1
- package/dist/esm/common/FailsafeTimer.js +8 -8
- package/dist/esm/common/FailsafeTimer.js.map +1 -1
- package/dist/esm/common/Scanner.d.ts +7 -7
- package/dist/esm/common/Scanner.d.ts.map +1 -1
- package/dist/esm/common/Scanner.js +5 -1
- package/dist/esm/common/Scanner.js.map +1 -1
- package/dist/esm/events/OccurrenceManager.js +1 -1
- package/dist/esm/events/OccurrenceManager.js.map +1 -1
- package/dist/esm/groups/FabricGroups.d.ts +1 -1
- package/dist/esm/groups/FabricGroups.js +1 -1
- package/dist/esm/groups/Groups.d.ts +1 -1
- package/dist/esm/groups/KeySets.d.ts +3 -3
- package/dist/esm/groups/KeySets.d.ts.map +1 -1
- package/dist/esm/groups/KeySets.js +13 -5
- package/dist/esm/groups/KeySets.js.map +1 -1
- package/dist/esm/interaction/InteractionClient.d.ts +9 -9
- package/dist/esm/interaction/InteractionClient.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionClient.js +34 -33
- package/dist/esm/interaction/InteractionClient.js.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.d.ts +10 -10
- package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.js +16 -15
- package/dist/esm/interaction/InteractionMessenger.js.map +1 -1
- package/dist/esm/interaction/Subscription.d.ts +3 -4
- package/dist/esm/interaction/Subscription.d.ts.map +1 -1
- package/dist/esm/interaction/Subscription.js +9 -12
- package/dist/esm/interaction/Subscription.js.map +1 -1
- package/dist/esm/interaction/SubscriptionClient.d.ts +3 -3
- package/dist/esm/interaction/SubscriptionClient.d.ts.map +1 -1
- package/dist/esm/interaction/SubscriptionClient.js +4 -4
- package/dist/esm/interaction/SubscriptionClient.js.map +1 -1
- package/dist/esm/mdns/MdnsClient.d.ts +9 -9
- package/dist/esm/mdns/MdnsClient.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsClient.js +94 -82
- package/dist/esm/mdns/MdnsClient.js.map +1 -1
- package/dist/esm/mdns/MdnsServer.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsServer.js +14 -9
- package/dist/esm/mdns/MdnsServer.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.d.ts +2 -2
- package/dist/esm/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.js +11 -8
- package/dist/esm/peer/ControllerCommissioner.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioningFlow.js +44 -35
- package/dist/esm/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/esm/peer/ControllerDiscovery.d.ts +4 -4
- package/dist/esm/peer/ControllerDiscovery.d.ts.map +1 -1
- package/dist/esm/peer/ControllerDiscovery.js +20 -18
- package/dist/esm/peer/ControllerDiscovery.js.map +1 -1
- package/dist/esm/peer/InteractionQueue.d.ts.map +1 -1
- package/dist/esm/peer/InteractionQueue.js +3 -3
- package/dist/esm/peer/InteractionQueue.js.map +1 -1
- package/dist/esm/peer/PeerSet.d.ts +2 -2
- package/dist/esm/peer/PeerSet.d.ts.map +1 -1
- package/dist/esm/peer/PeerSet.js +29 -26
- package/dist/esm/peer/PeerSet.js.map +1 -1
- package/dist/esm/protocol/DeviceCommissioner.d.ts.map +1 -1
- package/dist/esm/protocol/DeviceCommissioner.js +2 -2
- package/dist/esm/protocol/DeviceCommissioner.js.map +1 -1
- package/dist/esm/protocol/ExchangeManager.d.ts +1 -1
- package/dist/esm/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeManager.js +3 -6
- package/dist/esm/protocol/ExchangeManager.js.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.d.ts +4 -4
- package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.js +4 -4
- package/dist/esm/protocol/ExchangeProvider.js.map +1 -1
- package/dist/esm/protocol/MessageChannel.d.ts +5 -5
- package/dist/esm/protocol/MessageChannel.d.ts.map +1 -1
- package/dist/esm/protocol/MessageChannel.js +20 -16
- package/dist/esm/protocol/MessageChannel.js.map +1 -1
- package/dist/esm/protocol/MessageExchange.d.ts +6 -6
- package/dist/esm/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/esm/protocol/MessageExchange.js +39 -34
- package/dist/esm/protocol/MessageExchange.js.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts +8 -8
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.js +18 -18
- package/dist/esm/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/esm/session/InsecureSession.d.ts +2 -2
- package/dist/esm/session/InsecureSession.d.ts.map +1 -1
- package/dist/esm/session/InsecureSession.js.map +1 -1
- package/dist/esm/session/NodeSession.js +3 -3
- package/dist/esm/session/Session.d.ts +7 -7
- package/dist/esm/session/Session.d.ts.map +1 -1
- package/dist/esm/session/Session.js +27 -20
- package/dist/esm/session/Session.js.map +1 -1
- package/dist/esm/session/SessionIntervals.d.ts +7 -6
- package/dist/esm/session/SessionIntervals.d.ts.map +1 -1
- package/dist/esm/session/SessionIntervals.js +8 -8
- package/dist/esm/session/SessionIntervals.js.map +1 -1
- package/dist/esm/session/SessionManager.d.ts +2 -2
- package/dist/esm/session/SessionManager.d.ts.map +1 -1
- package/dist/esm/session/SessionManager.js +6 -6
- package/dist/esm/session/SessionManager.js.map +1 -1
- package/dist/esm/session/case/CaseClient.d.ts +2 -1
- package/dist/esm/session/case/CaseClient.d.ts.map +1 -1
- package/dist/esm/session/case/CaseClient.js +2 -2
- package/dist/esm/session/case/CaseClient.js.map +1 -1
- package/dist/esm/session/pase/PaseMessenger.d.ts.map +1 -1
- package/dist/esm/session/pase/PaseMessenger.js +5 -11
- package/dist/esm/session/pase/PaseMessenger.js.map +1 -1
- package/dist/esm/session/pase/PaseServer.d.ts.map +1 -1
- package/dist/esm/session/pase/PaseServer.js +2 -1
- package/dist/esm/session/pase/PaseServer.js.map +1 -1
- package/package.json +6 -6
- package/src/action/Val.ts +5 -0
- package/src/action/client/ClientInteraction.ts +4 -4
- package/src/action/client/ClientSubscription.ts +2 -1
- package/src/action/client/ClientSubscriptionHandler.ts +2 -2
- package/src/action/client/ClientSubscriptions.ts +14 -8
- package/src/action/request/Subscribe.ts +17 -15
- package/src/advertisement/Advertisement.ts +18 -8
- package/src/advertisement/ble/BleAdvertisement.ts +7 -6
- package/src/advertisement/ble/BleAdvertiser.ts +11 -11
- package/src/advertisement/mdns/MdnsAdvertisement.ts +20 -9
- package/src/advertisement/mdns/MdnsAdvertiser.ts +17 -7
- package/src/ble/Ble.ts +11 -2
- package/src/ble/BleConsts.ts +5 -5
- package/src/ble/BtpSessionHandler.ts +4 -4
- package/src/certificate/AttestationCertificateManager.ts +3 -3
- package/src/certificate/CertificateAuthority.ts +2 -2
- package/src/certificate/kinds/OperationalBase.ts +3 -3
- package/src/cluster/client/ClusterClient.ts +8 -8
- package/src/cluster/client/ClusterClientTypes.ts +3 -3
- package/src/cluster/client/EventClient.ts +5 -5
- package/src/common/FailsafeContext.ts +11 -13
- package/src/common/FailsafeTimer.ts +11 -13
- package/src/common/Scanner.ts +16 -7
- package/src/events/OccurrenceManager.ts +1 -1
- package/src/groups/FabricGroups.ts +1 -1
- package/src/groups/KeySets.ts +14 -6
- package/src/interaction/InteractionClient.ts +46 -44
- package/src/interaction/InteractionMessenger.ts +24 -22
- package/src/interaction/Subscription.ts +10 -14
- package/src/interaction/SubscriptionClient.ts +6 -6
- package/src/mdns/MdnsClient.ts +105 -82
- package/src/mdns/MdnsServer.ts +14 -9
- package/src/peer/ControllerCommissioner.ts +12 -9
- package/src/peer/ControllerCommissioningFlow.ts +48 -39
- package/src/peer/ControllerDiscovery.ts +22 -18
- package/src/peer/InteractionQueue.ts +3 -3
- package/src/peer/PeerSet.ts +34 -28
- package/src/protocol/DeviceCommissioner.ts +2 -2
- package/src/protocol/ExchangeManager.ts +3 -6
- package/src/protocol/ExchangeProvider.ts +6 -6
- package/src/protocol/MessageChannel.ts +26 -21
- package/src/protocol/MessageExchange.ts +42 -38
- package/src/securechannel/SecureChannelMessenger.ts +16 -22
- package/src/session/InsecureSession.ts +2 -2
- package/src/session/NodeSession.ts +3 -3
- package/src/session/Session.ts +31 -21
- package/src/session/SessionIntervals.ts +11 -11
- package/src/session/SessionManager.ts +10 -9
- package/src/session/case/CaseClient.ts +3 -3
- package/src/session/pase/PaseMessenger.ts +5 -11
- package/src/session/pase/PaseServer.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matter/protocol",
|
|
3
|
-
"version": "0.16.0-alpha.0-
|
|
3
|
+
"version": "0.16.0-alpha.0-20250819-0a388db8b",
|
|
4
4
|
"description": "Low-level APIs for Matter interaction",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iot",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"#*": "./src/*"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@matter/general": "0.16.0-alpha.0-
|
|
44
|
-
"@matter/model": "0.16.0-alpha.0-
|
|
45
|
-
"@matter/types": "0.16.0-alpha.0-
|
|
43
|
+
"@matter/general": "0.16.0-alpha.0-20250819-0a388db8b",
|
|
44
|
+
"@matter/model": "0.16.0-alpha.0-20250819-0a388db8b",
|
|
45
|
+
"@matter/types": "0.16.0-alpha.0-20250819-0a388db8b"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@matter/tools": "0.16.0-alpha.0-
|
|
49
|
-
"@matter/testing": "0.16.0-alpha.0-
|
|
48
|
+
"@matter/tools": "0.16.0-alpha.0-20250819-0a388db8b",
|
|
49
|
+
"@matter/testing": "0.16.0-alpha.0-20250819-0a388db8b"
|
|
50
50
|
},
|
|
51
51
|
"files": [
|
|
52
52
|
"dist/**/*",
|
package/src/action/Val.ts
CHANGED
|
@@ -32,6 +32,11 @@ export namespace Val {
|
|
|
32
32
|
*/
|
|
33
33
|
export type Collection = Struct | List;
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* A readonly version of {@link Collection}.
|
|
37
|
+
*/
|
|
38
|
+
export type ReadonlyCollection = { readonly [K: string | number]: Val } | ReadonlyArray<unknown>;
|
|
39
|
+
|
|
35
40
|
/**
|
|
36
41
|
* A Reference offers a simple mechanism for referring to properties by reference.
|
|
37
42
|
*/
|
|
@@ -13,7 +13,7 @@ import { InvokeResult } from "#action/response/InvokeResult.js";
|
|
|
13
13
|
import { ReadResult } from "#action/response/ReadResult.js";
|
|
14
14
|
import { SubscribeResult } from "#action/response/SubscribeResult.js";
|
|
15
15
|
import { WriteResult } from "#action/response/WriteResult.js";
|
|
16
|
-
import { BasicSet, Environment, Environmental, ImplementationError, PromiseQueue } from "#general";
|
|
16
|
+
import { BasicSet, Environment, Environmental, ImplementationError, PromiseQueue, Seconds } from "#general";
|
|
17
17
|
import { InteractionClientMessenger, MessageType } from "#interaction/InteractionMessenger.js";
|
|
18
18
|
import { InteractionQueue } from "#peer/InteractionQueue.js";
|
|
19
19
|
import { ExchangeProvider } from "#protocol/ExchangeProvider.js";
|
|
@@ -27,7 +27,7 @@ export interface ClientInteractionContext {
|
|
|
27
27
|
queue: PromiseQueue;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export const
|
|
30
|
+
export const DEFAULT_MIN_INTERVAL_FLOOR = Seconds(1);
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Client-side implementation of the Matter protocol.
|
|
@@ -195,8 +195,8 @@ export class ClientInteraction<SessionT extends InteractionSession = Interaction
|
|
|
195
195
|
|
|
196
196
|
await messenger.sendSubscribeRequest({
|
|
197
197
|
...request,
|
|
198
|
-
minIntervalFloorSeconds:
|
|
199
|
-
maxIntervalCeilingSeconds:
|
|
198
|
+
minIntervalFloorSeconds: Seconds.of(DEFAULT_MIN_INTERVAL_FLOOR),
|
|
199
|
+
maxIntervalCeilingSeconds: Seconds.of(DEFAULT_MIN_INTERVAL_FLOOR),
|
|
200
200
|
});
|
|
201
201
|
|
|
202
202
|
await this.#handleSubscriptionResponse(request, readChunks(messenger));
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
import { Subscribe } from "#action/request/Subscribe.js";
|
|
8
8
|
import { ActiveSubscription } from "#action/response/SubscribeResult.js";
|
|
9
|
+
import { Timestamp } from "#general";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The client view of an established Matter subscription.
|
|
12
13
|
*/
|
|
13
14
|
export interface ClientSubscription extends ActiveSubscription {
|
|
14
15
|
request: Subscribe;
|
|
15
|
-
|
|
16
|
+
timeoutAt?: Timestamp;
|
|
16
17
|
isClosed: boolean;
|
|
17
18
|
isReading: boolean;
|
|
18
19
|
}
|
|
@@ -59,7 +59,7 @@ export class ClientSubscriptionHandler implements ProtocolHandler {
|
|
|
59
59
|
|
|
60
60
|
// If this is just a ping, only reset the timeout
|
|
61
61
|
if (!initialReport.attributeReports?.length && !initialReport.eventReports?.length) {
|
|
62
|
-
subscription.
|
|
62
|
+
subscription.timeoutAt = undefined;
|
|
63
63
|
this.#subscriptions.resetTimer();
|
|
64
64
|
await exchange.close();
|
|
65
65
|
return;
|
|
@@ -79,7 +79,7 @@ export class ClientSubscriptionHandler implements ProtocolHandler {
|
|
|
79
79
|
}
|
|
80
80
|
} finally {
|
|
81
81
|
subscription.isReading = false;
|
|
82
|
-
subscription.
|
|
82
|
+
subscription.timeoutAt = undefined;
|
|
83
83
|
this.#subscriptions.resetTimer();
|
|
84
84
|
await exchange.close();
|
|
85
85
|
}
|
|
@@ -14,9 +14,11 @@ import {
|
|
|
14
14
|
Environment,
|
|
15
15
|
Environmental,
|
|
16
16
|
Logger,
|
|
17
|
+
Millis,
|
|
17
18
|
Time,
|
|
18
19
|
TimeoutError,
|
|
19
20
|
Timer,
|
|
21
|
+
Timestamp,
|
|
20
22
|
} from "#general";
|
|
21
23
|
import { SubscriptionId } from "#interaction/Subscription.js";
|
|
22
24
|
import { SubscribeResponse } from "#types";
|
|
@@ -46,7 +48,7 @@ export class ClientSubscriptions {
|
|
|
46
48
|
...response,
|
|
47
49
|
request,
|
|
48
50
|
close: () => this.#closeOne(subscription, new CanceledError()),
|
|
49
|
-
|
|
51
|
+
timeoutAt: undefined,
|
|
50
52
|
isClosed: false,
|
|
51
53
|
isReading: true,
|
|
52
54
|
};
|
|
@@ -88,8 +90,8 @@ export class ClientSubscriptions {
|
|
|
88
90
|
* Restart the timeout timer for the current set of active subscriptions.
|
|
89
91
|
*/
|
|
90
92
|
resetTimer() {
|
|
91
|
-
const now = Time.nowMs
|
|
92
|
-
let nextTimeoutAt:
|
|
93
|
+
const now = Time.nowMs;
|
|
94
|
+
let nextTimeoutAt: Timestamp | undefined;
|
|
93
95
|
|
|
94
96
|
// Process each subscription
|
|
95
97
|
for (const subscription of this.#subscriptions) {
|
|
@@ -99,10 +101,10 @@ export class ClientSubscriptions {
|
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
// Update timeout or expire if timed out
|
|
102
|
-
let { timeoutAtMs } = subscription;
|
|
104
|
+
let { timeoutAt: timeoutAtMs } = subscription;
|
|
103
105
|
if (timeoutAtMs === undefined) {
|
|
104
106
|
// Set timeout time
|
|
105
|
-
timeoutAtMs = subscription.
|
|
107
|
+
timeoutAtMs = subscription.timeoutAt = timeoutFor(subscription);
|
|
106
108
|
} else if (timeoutAtMs < now) {
|
|
107
109
|
// Timeout
|
|
108
110
|
this.#timeOut(subscription);
|
|
@@ -127,9 +129,13 @@ export class ClientSubscriptions {
|
|
|
127
129
|
this.#nextTimeoutAt = nextTimeoutAt;
|
|
128
130
|
if (this.#timeout) {
|
|
129
131
|
this.#timeout?.stop();
|
|
130
|
-
this.#timeout.
|
|
132
|
+
this.#timeout.interval = Millis(nextTimeoutAt - now);
|
|
131
133
|
} else {
|
|
132
|
-
this.#timeout = Time.getTimer(
|
|
134
|
+
this.#timeout = Time.getTimer(
|
|
135
|
+
"SubscriptionTimeout",
|
|
136
|
+
Millis(nextTimeoutAt - now),
|
|
137
|
+
this.resetTimer.bind(this),
|
|
138
|
+
);
|
|
133
139
|
}
|
|
134
140
|
}
|
|
135
141
|
}
|
|
@@ -162,7 +168,7 @@ export class ClientSubscriptions {
|
|
|
162
168
|
}
|
|
163
169
|
|
|
164
170
|
function timeoutFor(subscription: ClientSubscription) {
|
|
165
|
-
return subscription.maxInterval * 1000 + (subscription.request.maxPeerResponseTime ?? 0);
|
|
171
|
+
return Timestamp(subscription.maxInterval * 1000 + (subscription.request.maxPeerResponseTime ?? 0));
|
|
166
172
|
}
|
|
167
173
|
|
|
168
174
|
export namespace ClientSubscriptions {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { ReadResult } from "#action/response/ReadResult.js";
|
|
8
|
-
import { CanceledError, TimeoutError, UINT16_MAX } from "#general";
|
|
8
|
+
import { CanceledError, Duration, Seconds, TimeoutError, UINT16_MAX } from "#general";
|
|
9
9
|
import { MalformedRequestError } from "./MalformedRequestError.js";
|
|
10
10
|
import { Read } from "./Read.js";
|
|
11
11
|
|
|
@@ -17,9 +17,9 @@ import { Read } from "./Read.js";
|
|
|
17
17
|
*/
|
|
18
18
|
export interface Subscribe extends Read {
|
|
19
19
|
keepSubscriptions: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
maxPeerResponseTime?:
|
|
20
|
+
minIntervalFloor?: Duration;
|
|
21
|
+
maxIntervalCeiling?: Duration;
|
|
22
|
+
maxPeerResponseTime?: Duration;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Invoked when subscribed data changes.
|
|
@@ -35,21 +35,23 @@ export interface Subscribe extends Read {
|
|
|
35
35
|
export function Subscribe(options: Subscribe.Options, ...selectors: Read.Selector[]): Subscribe {
|
|
36
36
|
const subscribe = Read(options, ...selectors) as unknown as Subscribe;
|
|
37
37
|
|
|
38
|
-
const { keepSubscriptions,
|
|
38
|
+
const { keepSubscriptions, minIntervalFloor, maxIntervalCeiling } = options;
|
|
39
39
|
subscribe.keepSubscriptions = keepSubscriptions ?? true;
|
|
40
40
|
|
|
41
|
-
if (
|
|
42
|
-
if (
|
|
43
|
-
throw new MalformedRequestError(`Minimum interval floor ${
|
|
41
|
+
if (minIntervalFloor !== undefined) {
|
|
42
|
+
if (minIntervalFloor < 0 || Seconds.of(minIntervalFloor) > UINT16_MAX) {
|
|
43
|
+
throw new MalformedRequestError(`Minimum interval floor ${Seconds.of(minIntervalFloor)} is out of range`);
|
|
44
44
|
}
|
|
45
|
-
subscribe.
|
|
45
|
+
subscribe.minIntervalFloor = minIntervalFloor;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
if (
|
|
49
|
-
if (
|
|
50
|
-
throw new MalformedRequestError(
|
|
48
|
+
if (maxIntervalCeiling !== undefined) {
|
|
49
|
+
if (maxIntervalCeiling < 0 || Seconds.of(maxIntervalCeiling) > UINT16_MAX) {
|
|
50
|
+
throw new MalformedRequestError(
|
|
51
|
+
`Maximum interval ceiling ${Seconds.of(maxIntervalCeiling)} is out of range`,
|
|
52
|
+
);
|
|
51
53
|
}
|
|
52
|
-
subscribe.
|
|
54
|
+
subscribe.maxIntervalCeiling = maxIntervalCeiling;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
return subscribe;
|
|
@@ -58,8 +60,8 @@ export function Subscribe(options: Subscribe.Options, ...selectors: Read.Selecto
|
|
|
58
60
|
export namespace Subscribe {
|
|
59
61
|
export interface Options extends Read.Options {
|
|
60
62
|
keepSubscriptions?: boolean;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
minIntervalFloor?: Duration;
|
|
64
|
+
maxIntervalCeiling?: Duration;
|
|
63
65
|
update?: Subscribe["updated"];
|
|
64
66
|
closed?: Subscribe["closed"];
|
|
65
67
|
}
|
|
@@ -4,8 +4,18 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
asError,
|
|
9
|
+
CancelablePromise,
|
|
10
|
+
CanceledError,
|
|
11
|
+
Diagnostic,
|
|
12
|
+
Duration,
|
|
13
|
+
Logger,
|
|
14
|
+
MatterAggregateError,
|
|
15
|
+
Time,
|
|
16
|
+
Timespan,
|
|
17
|
+
} from "#general";
|
|
18
|
+
import { STANDARD_COMMISSIONING_TIMEOUT } from "#types";
|
|
9
19
|
import type { Advertiser } from "./Advertiser.js";
|
|
10
20
|
import { ServiceDescription } from "./ServiceDescription.js";
|
|
11
21
|
|
|
@@ -39,7 +49,7 @@ export abstract class Advertisement<T extends ServiceDescription = ServiceDescri
|
|
|
39
49
|
|
|
40
50
|
#isBroadcasting = false;
|
|
41
51
|
#closed?: Promise<void>;
|
|
42
|
-
#startedAt = Time.nowMs
|
|
52
|
+
#startedAt = Time.nowMs;
|
|
43
53
|
|
|
44
54
|
/**
|
|
45
55
|
* Current activity. This is a promise with helpers for base implementations.
|
|
@@ -163,7 +173,7 @@ export abstract class Advertisement<T extends ServiceDescription = ServiceDescri
|
|
|
163
173
|
}
|
|
164
174
|
|
|
165
175
|
// Extended announcement
|
|
166
|
-
if (
|
|
176
|
+
if (this.duration >= STANDARD_COMMISSIONING_TIMEOUT) {
|
|
167
177
|
return true;
|
|
168
178
|
}
|
|
169
179
|
|
|
@@ -210,7 +220,7 @@ export abstract class Advertisement<T extends ServiceDescription = ServiceDescri
|
|
|
210
220
|
* Total duration so far.
|
|
211
221
|
*/
|
|
212
222
|
get duration() {
|
|
213
|
-
return Time.nowMs
|
|
223
|
+
return Timespan(this.#startedAt, Time.nowMs).duration;
|
|
214
224
|
}
|
|
215
225
|
|
|
216
226
|
/**
|
|
@@ -292,7 +302,7 @@ export namespace Advertisement {
|
|
|
292
302
|
* Throws {@link CanceledError} if interrupted. If thrown from {@link run} this will result in the promise
|
|
293
303
|
* resolving.
|
|
294
304
|
*/
|
|
295
|
-
sleep(name: string,
|
|
305
|
+
sleep(name: string, duration: Duration): Promise<void>;
|
|
296
306
|
}
|
|
297
307
|
}
|
|
298
308
|
|
|
@@ -316,10 +326,10 @@ class ActivityContext extends CancelablePromise implements Advertisement.Activit
|
|
|
316
326
|
});
|
|
317
327
|
}
|
|
318
328
|
|
|
319
|
-
sleep(name: string,
|
|
329
|
+
sleep(name: string, duration: Duration) {
|
|
320
330
|
this.abortIfCanceled();
|
|
321
331
|
|
|
322
|
-
const sleep = Time.sleep(name,
|
|
332
|
+
const sleep = Time.sleep(name, duration).finally(() => {
|
|
323
333
|
if (this.#sleep === sleep) {
|
|
324
334
|
this.#sleep = undefined;
|
|
325
335
|
}
|
|
@@ -5,18 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { BtpCodec } from "#codec/BtpCodec.js";
|
|
8
|
+
import { Days, Duration, Millis, Minutes, Seconds } from "#general";
|
|
8
9
|
import { Advertisement } from "../Advertisement.js";
|
|
9
10
|
import { ServiceDescription } from "../ServiceDescription.js";
|
|
10
11
|
import type { BleAdvertiser } from "./BleAdvertiser.js";
|
|
11
12
|
|
|
12
13
|
// Period for "fast" broadcast. See core spec 5.4.2.5.3
|
|
13
|
-
const EARLY_INTERVAL_SLEEP =
|
|
14
|
+
const EARLY_INTERVAL_SLEEP = Seconds(30);
|
|
14
15
|
|
|
15
16
|
// Period for "medium" broadcast. See core spec 5.4.2.5.3
|
|
16
|
-
const LATE_INTERVAL_SLEEP = 15
|
|
17
|
+
const LATE_INTERVAL_SLEEP = Millis(Minutes(15) - EARLY_INTERVAL_SLEEP);
|
|
17
18
|
|
|
18
19
|
// Period for "extended" broadcast. See core spec 5.4.2.5.3
|
|
19
|
-
const EXTENDED_INTERVAL_SLEEP =
|
|
20
|
+
const EXTENDED_INTERVAL_SLEEP = Millis(Days(2) - LATE_INTERVAL_SLEEP);
|
|
20
21
|
|
|
21
22
|
export class BleAdvertisement extends Advertisement<ServiceDescription.Commissionable> {
|
|
22
23
|
declare advertiser: BleAdvertiser;
|
|
@@ -58,10 +59,10 @@ export class BleAdvertisement extends Advertisement<ServiceDescription.Commissio
|
|
|
58
59
|
await peripheral.advertise(advertisementData, aad, broadcastInterval);
|
|
59
60
|
|
|
60
61
|
// Wait for timeout at this broadcast interval
|
|
61
|
-
await context.sleep("BLE advertisement interval",
|
|
62
|
+
await context.sleep("BLE advertisement interval", Duration.min(timeout, sleepTime));
|
|
62
63
|
|
|
63
|
-
timeout
|
|
64
|
-
if (
|
|
64
|
+
timeout = Millis(timeout - sleepTime);
|
|
65
|
+
if (timeout <= 0) {
|
|
65
66
|
break;
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { BlePeripheralInterface } from "#ble/Ble.js";
|
|
8
|
-
import { ImplementationError } from "#general";
|
|
8
|
+
import { Bytes, Duration, ImplementationError, Millis } from "#general";
|
|
9
9
|
import { DatatypeModel, FieldElement } from "#model";
|
|
10
|
-
import {
|
|
10
|
+
import { MAXIMUM_COMMISSIONING_TIMEOUT } from "#types";
|
|
11
11
|
import { Advertisement } from "../Advertisement.js";
|
|
12
12
|
import { Advertiser } from "../Advertiser.js";
|
|
13
13
|
import { CommissioningMode } from "../CommissioningMode.js";
|
|
@@ -61,43 +61,43 @@ export namespace BleAdvertiser {
|
|
|
61
61
|
/**
|
|
62
62
|
* Additional advertisement data.
|
|
63
63
|
*/
|
|
64
|
-
readonly aad?:
|
|
64
|
+
readonly aad?: Bytes;
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Advertisement timeout.
|
|
68
68
|
*/
|
|
69
|
-
readonly timeout:
|
|
69
|
+
readonly timeout: Duration;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* Transmission interval for first 30 seconds.
|
|
73
73
|
*
|
|
74
74
|
* Per core spec 5.4.2.5.3 should be 20-60ms.
|
|
75
75
|
*/
|
|
76
|
-
readonly earlyInterval:
|
|
76
|
+
readonly earlyInterval: Duration;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Transmission interval after first 30 seconds but before 15 minutes.
|
|
80
80
|
*
|
|
81
81
|
* Per core spec 5.4.2.5.3 should be 150-1285ms.
|
|
82
82
|
*/
|
|
83
|
-
readonly lateInterval:
|
|
83
|
+
readonly lateInterval: Duration;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Transmission interval after 15 minutes.
|
|
87
87
|
*
|
|
88
88
|
* Per core spec 5.4.2.5.3 should be ~1285ms.
|
|
89
89
|
*/
|
|
90
|
-
readonly extendedInterval:
|
|
90
|
+
readonly extendedInterval: Duration;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
export interface Options extends Partial<Configuration> {}
|
|
94
94
|
|
|
95
95
|
export function Configuration(options?: Options) {
|
|
96
96
|
return {
|
|
97
|
-
timeout:
|
|
98
|
-
earlyInterval: 20,
|
|
99
|
-
lateInterval: 150,
|
|
100
|
-
extendedInterval: 1285,
|
|
97
|
+
timeout: MAXIMUM_COMMISSIONING_TIMEOUT,
|
|
98
|
+
earlyInterval: Millis(20),
|
|
99
|
+
lateInterval: Millis(150),
|
|
100
|
+
extendedInterval: Millis(1285),
|
|
101
101
|
...options,
|
|
102
102
|
};
|
|
103
103
|
}
|
|
@@ -8,7 +8,18 @@ import { Advertisement } from "#advertisement/Advertisement.js";
|
|
|
8
8
|
import type { Advertiser } from "#advertisement/Advertiser.js";
|
|
9
9
|
import type { ServiceDescription } from "#advertisement/ServiceDescription.js";
|
|
10
10
|
import { SupportedTransportsSchema } from "#common/SupportedTransportsBitmap.js";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
AAAARecord,
|
|
13
|
+
ARecord,
|
|
14
|
+
DnsRecord,
|
|
15
|
+
Duration,
|
|
16
|
+
Logger,
|
|
17
|
+
NetworkInterfaceDetails,
|
|
18
|
+
SrvRecord,
|
|
19
|
+
Time,
|
|
20
|
+
Timestamp,
|
|
21
|
+
TxtRecord,
|
|
22
|
+
} from "#general";
|
|
12
23
|
import type { MdnsServer } from "#mdns/MdnsServer.js";
|
|
13
24
|
import { SessionIntervals } from "#session/SessionIntervals.js";
|
|
14
25
|
import type { MdnsAdvertiser } from "./MdnsAdvertiser.js";
|
|
@@ -29,7 +40,7 @@ export abstract class MdnsAdvertisement<T extends ServiceDescription = ServiceDe
|
|
|
29
40
|
qname: string;
|
|
30
41
|
|
|
31
42
|
#isPrivacyMasked: boolean;
|
|
32
|
-
#stopAt?:
|
|
43
|
+
#stopAt?: Timestamp;
|
|
33
44
|
|
|
34
45
|
constructor(advertiser: MdnsAdvertiser, qname: string, description: T) {
|
|
35
46
|
description = {
|
|
@@ -51,12 +62,12 @@ export abstract class MdnsAdvertisement<T extends ServiceDescription = ServiceDe
|
|
|
51
62
|
this.#stopAt = undefined;
|
|
52
63
|
let number = 0;
|
|
53
64
|
for (const retryInterval of this.advertiser.broadcastScheduleFor(this, event)) {
|
|
54
|
-
if (this.#stopAt !== undefined && this.#stopAt <= Time.nowMs
|
|
65
|
+
if (this.#stopAt !== undefined && this.#stopAt <= Time.nowMs) {
|
|
55
66
|
break;
|
|
56
67
|
}
|
|
57
68
|
|
|
58
69
|
number++;
|
|
59
|
-
logger.debug("Broadcast", this.dict({ number, next: retryInterval }));
|
|
70
|
+
logger.debug("Broadcast", this.dict({ number, next: Duration.format(retryInterval) }));
|
|
60
71
|
await this.broadcast();
|
|
61
72
|
await context.sleep("MDNS repeat", retryInterval);
|
|
62
73
|
}
|
|
@@ -78,7 +89,7 @@ export abstract class MdnsAdvertisement<T extends ServiceDescription = ServiceDe
|
|
|
78
89
|
* Broadcast expiration announcement immediately.
|
|
79
90
|
*/
|
|
80
91
|
async expire() {
|
|
81
|
-
logger.info("Unpublishing", this.dict({ time: this.duration }));
|
|
92
|
+
logger.info("Unpublishing", this.dict({ time: Duration.format(this.duration) }));
|
|
82
93
|
await this.advertiser.server.expireAnnouncements(this.service);
|
|
83
94
|
}
|
|
84
95
|
|
|
@@ -94,7 +105,7 @@ export abstract class MdnsAdvertisement<T extends ServiceDescription = ServiceDe
|
|
|
94
105
|
return;
|
|
95
106
|
}
|
|
96
107
|
|
|
97
|
-
this.#stopAt = Time.nowMs
|
|
108
|
+
this.#stopAt = Timestamp(Time.nowMs + broadcastAfterConnection);
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
override serviceDisconnected() {
|
|
@@ -148,9 +159,9 @@ export abstract class MdnsAdvertisement<T extends ServiceDescription = ServiceDe
|
|
|
148
159
|
|
|
149
160
|
get #txtValues() {
|
|
150
161
|
const values: Record<string, unknown> = {
|
|
151
|
-
SII: this.description.
|
|
152
|
-
SAI: this.description.
|
|
153
|
-
SAT: this.description.
|
|
162
|
+
SII: this.description.idleInterval /* Session Idle Interval */,
|
|
163
|
+
SAI: this.description.activeInterval /* Session Active Interval */,
|
|
164
|
+
SAT: this.description.activeThreshold /* Session Active Threshold */,
|
|
154
165
|
...this.txtValues,
|
|
155
166
|
};
|
|
156
167
|
|
|
@@ -6,10 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
import { Advertiser } from "#advertisement/Advertiser.js";
|
|
8
8
|
import { ServiceDescription } from "#advertisement/ServiceDescription.js";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
Bytes,
|
|
11
|
+
Crypto,
|
|
12
|
+
Duration,
|
|
13
|
+
ImplementationError,
|
|
14
|
+
Instant,
|
|
15
|
+
InternalError,
|
|
16
|
+
RetrySchedule,
|
|
17
|
+
Seconds,
|
|
18
|
+
STANDARD_MATTER_PORT,
|
|
19
|
+
} from "#general";
|
|
10
20
|
import type { MdnsServer } from "#mdns/MdnsServer.js";
|
|
11
21
|
import { DatatypeModel, FieldElement } from "#model";
|
|
12
|
-
import {
|
|
22
|
+
import { MAXIMUM_COMMISSIONING_TIMEOUT } from "#types";
|
|
13
23
|
import { CommissionableMdnsAdvertisement } from "./CommissionableMdnsAdvertisement.js";
|
|
14
24
|
import { CommissionerMdnsAdvertisement } from "./CommissionerMdnsAdvertisement.js";
|
|
15
25
|
import type { MdnsAdvertisement } from "./MdnsAdvertisement.js";
|
|
@@ -188,7 +198,7 @@ export namespace MdnsAdvertiser {
|
|
|
188
198
|
* Set to zero to terminate broadcast immediately after connection. If undefined broadcasts will continue until
|
|
189
199
|
* terminated by {@link timeout} or {@link maximumCount}.
|
|
190
200
|
*/
|
|
191
|
-
readonly broadcastAfterConnection?:
|
|
201
|
+
readonly broadcastAfterConnection?: Duration;
|
|
192
202
|
}
|
|
193
203
|
|
|
194
204
|
/**
|
|
@@ -196,23 +206,23 @@ export namespace MdnsAdvertiser {
|
|
|
196
206
|
*/
|
|
197
207
|
export const DefaultBroadcastSchedule: BroadcastSchedule = {
|
|
198
208
|
// Mandated by MDNS specification
|
|
199
|
-
initialInterval:
|
|
209
|
+
initialInterval: Seconds.one,
|
|
200
210
|
|
|
201
211
|
// Maximum commissioning timeout per Matter specification 5.4.2.3.1, although
|
|
202
|
-
timeout:
|
|
212
|
+
timeout: MAXIMUM_COMMISSIONING_TIMEOUT,
|
|
203
213
|
|
|
204
214
|
// Minimum per MDNS specification
|
|
205
215
|
backoffFactor: 2,
|
|
206
216
|
|
|
207
217
|
// Technically this may result in us emitting more than 8 packets which is the maximum per the MDNS
|
|
208
218
|
// specification but extra packets will only come every 90 seconds
|
|
209
|
-
maximumInterval:
|
|
219
|
+
maximumInterval: Seconds(90),
|
|
210
220
|
|
|
211
221
|
// Not in any specification AFAIK but common sense to reduce thundering herd
|
|
212
222
|
jitterFactor: 0.25,
|
|
213
223
|
|
|
214
224
|
// Generally operational broadcast is unnecessary once an operational connection is established
|
|
215
|
-
broadcastAfterConnection:
|
|
225
|
+
broadcastAfterConnection: Instant,
|
|
216
226
|
};
|
|
217
227
|
|
|
218
228
|
/**
|
package/src/ble/Ble.ts
CHANGED
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Bytes,
|
|
9
|
+
Channel,
|
|
10
|
+
ChannelType,
|
|
11
|
+
Duration,
|
|
12
|
+
MatterError,
|
|
13
|
+
NetInterface,
|
|
14
|
+
NoProviderError,
|
|
15
|
+
TransportInterface,
|
|
16
|
+
} from "#general";
|
|
8
17
|
import { Scanner } from "../common/Scanner.js";
|
|
9
18
|
import { BLE_MAX_MATTER_PAYLOAD_SIZE } from "./BleConsts.js";
|
|
10
19
|
|
|
@@ -28,7 +37,7 @@ export abstract class Ble {
|
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
export interface BlePeripheralInterface extends TransportInterface {
|
|
31
|
-
advertise(advertiseData: Bytes, additionalAdvertisementData?: Bytes,
|
|
40
|
+
advertise(advertiseData: Bytes, additionalAdvertisementData?: Bytes, interval?: Duration): Promise<void>;
|
|
32
41
|
stopAdvertising(): Promise<void>;
|
|
33
42
|
}
|
|
34
43
|
|
package/src/ble/BleConsts.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { MAX_UDP_MESSAGE_SIZE } from "#general";
|
|
7
|
+
import { MAX_UDP_MESSAGE_SIZE, Millis, Seconds } from "#general";
|
|
8
8
|
|
|
9
9
|
/** @see {@link MatterSpecification.v11.Core} § 4.17.3.2 */
|
|
10
10
|
export const BLE_MATTER_SERVICE_UUID_SHORT = "fff6";
|
|
@@ -22,18 +22,18 @@ export const BTP_MAXIMUM_WINDOW_SIZE = 255; // Server maximum window size
|
|
|
22
22
|
* The maximum amount of time after sending a BTP Session Handshake request to wait for a BTP Session Handshake response
|
|
23
23
|
* before closing the connection.
|
|
24
24
|
*/
|
|
25
|
-
export const
|
|
25
|
+
export const BTP_CONN_RSP_TIMEOUT = Seconds(5); // timer starts when receives handshake request & waits for a subscription request on c2
|
|
26
26
|
|
|
27
27
|
/** The maximum amount of time after receipt of a segment before a stand-alone ACK must be sent. */
|
|
28
|
-
export const
|
|
28
|
+
export const BTP_ACK_TIMEOUT = Seconds(15); // timer in ms before ack should be sent for a segment
|
|
29
29
|
|
|
30
|
-
export const
|
|
30
|
+
export const BTP_SEND_ACK_TIMEOUT = Millis(BTP_ACK_TIMEOUT / 3); // timer starts when we receive a packet and stops when we sends its ack
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* The maximum amount of time no unique data has been sent over a BTP session before the Central Device must close the
|
|
34
34
|
* BTP session.
|
|
35
35
|
*/
|
|
36
|
-
export const BTP_CONN_IDLE_TIMEOUT =
|
|
36
|
+
export const BTP_CONN_IDLE_TIMEOUT = Seconds(30);
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* The maximum message size that can be transported in a Matter message via BTP.
|
|
@@ -9,10 +9,10 @@ import { BtpCodec } from "../codec/BtpCodec.js";
|
|
|
9
9
|
import {
|
|
10
10
|
BLE_MAXIMUM_BTP_MTU,
|
|
11
11
|
BLE_MINIMUM_ATT_MTU,
|
|
12
|
-
|
|
12
|
+
BTP_ACK_TIMEOUT,
|
|
13
13
|
BTP_CONN_IDLE_TIMEOUT,
|
|
14
14
|
BTP_MAXIMUM_WINDOW_SIZE,
|
|
15
|
-
|
|
15
|
+
BTP_SEND_ACK_TIMEOUT,
|
|
16
16
|
} from "./BleConsts.js";
|
|
17
17
|
|
|
18
18
|
export class BtpMatterError extends MatterError {}
|
|
@@ -29,7 +29,7 @@ export class BtpSessionHandler {
|
|
|
29
29
|
private currentIncomingSegmentedPayload: Bytes | undefined;
|
|
30
30
|
private prevIncomingSequenceNumber = 255; // Incoming Sequence Number received. Set to 255 to start at 0
|
|
31
31
|
private prevIncomingAckNumber = -1; // Previous ackNumber received
|
|
32
|
-
private readonly ackReceiveTimer = Time.getTimer("BTP ack timeout",
|
|
32
|
+
private readonly ackReceiveTimer = Time.getTimer("BTP ack timeout", BTP_ACK_TIMEOUT, () =>
|
|
33
33
|
this.btpAckTimeoutTriggered(),
|
|
34
34
|
);
|
|
35
35
|
|
|
@@ -37,7 +37,7 @@ export class BtpSessionHandler {
|
|
|
37
37
|
private prevAckedSequenceNumber = -1; // Previous (outgoing) Acked Sequence Number
|
|
38
38
|
private readonly queuedOutgoingMatterMessages = new Array<DataReader<Endian.Little>>();
|
|
39
39
|
private sendInProgress = false;
|
|
40
|
-
private readonly sendAckTimer = Time.getTimer("BTP send timeout",
|
|
40
|
+
private readonly sendAckTimer = Time.getTimer("BTP send timeout", BTP_SEND_ACK_TIMEOUT, () =>
|
|
41
41
|
this.btpSendAckTimeoutTriggered(),
|
|
42
42
|
);
|
|
43
43
|
private isActive = true;
|