diff --git a/MatterDotNet/OperationalDiscovery/DiscoveryService.cs b/MatterDotNet/OperationalDiscovery/DiscoveryService.cs index 59667aa..8fa9373 100644 --- a/MatterDotNet/OperationalDiscovery/DiscoveryService.cs +++ b/MatterDotNet/OperationalDiscovery/DiscoveryService.cs @@ -80,7 +80,13 @@ public async Task> Find(uint discriminator, bool fullLen) else instance = "_S" + discriminator.ToString(); string domain = instance + "._sub._matterc._udp.local"; - List results = await mdns.ResolveQuery(domain, false, DNSRecordType.PTR); + List results = []; + for (int i = 0; i < 10; i++) + { + results = await mdns.ResolveQuery(domain, false, DNSRecordType.PTR); + if (results.Count > 0) + break; + } foreach (Message msg in results) { foreach (ResourceRecord record in msg.Answers) @@ -185,7 +191,8 @@ private void PopulateText(TxtRecord txt, ref ODNode node) node.Product = product; break; case "CM": - node.Commissionable = kv[1] == "1"; + if (byte.TryParse(kv[1], out byte mode)) + node.CommissioningMode = (CommissioningMode)mode; break; case "D": if (ushort.TryParse(kv[1], out ushort descriminator))