connectedhomeip
connectedhomeip copied to clipboard
[Android] Hostname in nsdmnager is not compliant with matter
In pixel 7, we see nsdManager is advertising host name with 40bytes, in android nsdManager, there is no API to set this hostname. The below is avahi-browse -r _matter._tcp = wlan0 IPv6 B6071280809E4E17-000000000001B669 _matter._tcp local hostname = [Android_25101c8afe6a479387b1d63318378d56.local] address = [192.168.0.102] port = [58586]
During ICD check-in validation, we see the mdns advertisment from android cannot be resolved in lit icd board because of the the above length issue so that lit cannot send the check-in message, In order to resolve this issue, we expand the kHostNameMaxLength to 40 in dnssd for workaround
But it would violate the matter spec description as below
"For DNS‑SD a target host name is required, in addition to the instance name. The target host name SHALL be constructed using one of the available link-layer addresses, such as a 48-bit device MAC address (for Ethernet and Wi‑Fi) or a 64-bit MAC Extended Address (for Thread) expressed as a fixed-length twelve-character (or sixteen-character) hexadecimal string, encoded as ASCII (UTF-8) text using capital letters, e.g., B75AFB458ECD.
Potential solution:
- Modify the matter spec to adapt with android requirement.
- Extend a new API in android nsdmanager to set the hostname