[thci] find IPv6 border agents only (#7452)

Without this fix some Border Agents will not send mDNS responses
with AAAA record for IPv6 link local address.
This commit is contained in:
Eduardo Montoya
2022-03-08 17:25:35 -08:00
committed by GitHub
parent a83d90702f
commit 465518ec64
3 changed files with 10 additions and 10 deletions
@@ -29,7 +29,7 @@
import ipaddress
import sys
import time
from zeroconf import ServiceBrowser, ServiceStateChange, Zeroconf, DNSAddress, DNSService, DNSText
from zeroconf import IPVersion, ServiceBrowser, ServiceStateChange, Zeroconf, DNSAddress, DNSService, DNSText
def on_service_state_change(zeroconf, service_type, name, state_change):
@@ -83,7 +83,7 @@ def parse_cache(cache):
def main():
# Browse border agents
zeroconf = Zeroconf()
zeroconf = Zeroconf(ip_version=IPVersion.V6Only)
ServiceBrowser(zeroconf, "_meshcop._udp.local.", handlers=[on_service_state_change])
time.sleep(2)
cache = zeroconf.cache.cache