Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scanner, Discovery and Controller enhancements #473

Merged
merged 45 commits into from
Nov 6, 2023
Merged

Scanner, Discovery and Controller enhancements #473

merged 45 commits into from
Nov 6, 2023

Conversation

Apollon77
Copy link
Collaborator

@Apollon77 Apollon77 commented Nov 2, 2023

This PRS combines the following changes

Before this change the cache forgot any former cached entries on clear which do not allow to iterate over them.
Also make sure that all addresses from same matterserver over all interfaces gets combined (a respinse on anotehr netInterface was clearing out other entries evenually). ANd make sure to only request more adddresses if nothing is existing after checking ttls
This one is set differently according to the discovery methods (IP/BLE) but allows to use it as a unique field.
And allow promises and Promise generate functions as input
When the connection should be resumed we in parallel poll the device last known address evener 10mins (for devices that do not announce itself when coming back online) but also add continuous discovery run without a timeout to get notified when the device comes back online and announce itself.
This has the effect that when a command is being executed but the device is not reachable and so the InteractionClient gets resumed, we only do this for 60s. Then the command fails.
The callback is called for each discovered device and at the end the final result is returned
Make sure that defined callbacks are also used after commissioning in the created PairedNode instance and not lost
Alternatively to identifierData also an "CommissionableDevice" returned by discovery method can be used for commissioning. This first tries the addresses already discovered.
disconnect should not remove resumption records or such, removal should do that.
This commit is introducing a node state and a corresponding callback to inform the developer about state changes of the node. Additionally all callbacks are enhanced by the nodeId of the node the change happens. With this also generic callbacks can be provided when connecting to all nodes at once and the result can still be handled by node.
Node state also supports "structure changed" info when a bridge structure changed and was updated internally to reprocess the device objects if needed.
... but only update whats changed and reuse unchanged
@Apollon77 Apollon77 requested a review from lauckhart November 2, 2023 16:44
packages/matter-node-ble.js/src/ble/BleScanner.ts Outdated Show resolved Hide resolved
packages/matter-node-ble.js/src/ble/BleScanner.ts Outdated Show resolved Hide resolved
packages/matter-node-shell.js/src/shell/cmd_commission.ts Outdated Show resolved Hide resolved
packages/matter-node-shell.js/src/shell/cmd_nodes.ts Outdated Show resolved Hide resolved
packages/matter.js/src/mdns/MdnsScanner.ts Show resolved Hide resolved
packages/matter.js/src/mdns/MdnsScanner.ts Outdated Show resolved Hide resolved
packages/matter.js/src/mdns/MdnsScanner.ts Outdated Show resolved Hide resolved
packages/matter.js/src/util/Cache.ts Show resolved Hide resolved
packages/matter.js/src/util/Promises.ts Show resolved Hide resolved
@mergify mergify bot merged commit fb9719b into project-chip:main Nov 6, 2023
15 checks passed
@Apollon77 Apollon77 deleted the scanner-expiry branch November 6, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants