MDNS Refactoring and Multi-Node (#209)
* Streamline DNSCodec datastructure names
* DNSCodec: Add support for Truncated Queries and Responses and more types
* DNSCodec: Fix IPv6 AAAA record decoding and decode zero sequences correctly
* DNSCodec: Fix QName encoding for empty names
we wrote one byte too much before
* DNSCodec: Allow encoding of one record as own method
Used for message segmentation when message is too big for one
* DNSCodec: Allow raw data encoding via ByteArray as already decoded
* Time: Added a promise based sleep method
* DNSCodec: Enhance tests
* Broadcaster: Rename interface and add extensible types for the commission data
InstanceBroadcaster means that this is the interface to implement to announce ONE Matter instance aka node. Detailed types allow to specify all announcement details.
* Scanner: Refactor and detail
Detail out the Scanner interface and define the data type which is returned for a discovered device/instance.
Additionally rename MatterServer as type to ServerAddress.
* MDNS: Add more naming methods because used in various places
* MDNS: Implement MdnsInstanceBroadcaster
This uses a central MdnsBroadcaster that announce instances for network ports
* MDNS: Enhance Broadcaster to handle multiple instances/ports
This uses a multi instances MdnsServer in next commit
* MDNS: Enhance MdnsServer to handle multiple instances/ports
The MdnsServer stores records not per announced network port" and announces them with the needed delays. I decided against combining the messages for now if the packet would be small enough
* MDNS: Refactor Mdns Scanner for multi Query usage
The MdnsScanner got enhanced to allow to handle multiple active queries instead of only one. It also adds known answer supression (by including them in queries) and DNS messagesize coonsideration/Splitting and also query interval backoff logic.
The details of a found device are collected from TXT record and returned as object. IPs are sorted (IPv6 ULA first, link local next, ipv6 rest afterwards, IPv4 at the end).
Discovery is possible using one identifier provided.
* MDNS: Adjust tests
* UDP: Allow local listening port for UDP channels to be optional for controller usecases
* Network: IPv6 ULA addresses will not match to any network interface but are routable locally, so consider them as ok for "default network interface"
* Network: UDP channel refactoring
Add ipv6 only flag for ipv6 UDP channels and small code refactoring
* Network: Allow UDP channels to be closed
* Controller: User ServerAddress and make IPv4 optional
Use ServerAddress on API level as ip/port replacement. Additionally make ipv4 optional (two places with error handling are in one of the next commits)
* Controller: Discover devices rather than using hard coded IP/port
* CommissioningController: Refactor to use discovery identifiers and allow to disable IPv4
* CommissioningController: Refactor to use discovery identifiers and allow to disable IPv4
* CommissioningServer/MatterDevice: Adjust to ue InstanceBroadcaster
* MatterServer: Allow multi-node operations and use MDNS classes for all nodes
* tests: Adjust tests to new logic
* Adjust ControllerNode example to new structure
* Add new example MultiDeviceNode
* update TODO and Readme
* MDNS Broadcaster: Add Data type for setFabbric too
* MDNS Broadcaster: Fix Commissioner info announcements
* MDNS: Enhance tests
* remove unneeded logging in test
* Address review feedback
* Add PairingHint typing and validation
* Code optimization
* fix tests and finalize
* disable ipv4 in this test makes logs more readable
* typo