Closed hobinjk closed 6 years ago
Yeah, we need to restart the mDNS and Eddystone searches in startPairing()
and add any devices we don't already (or no longer) know about.
Or yes, duplicate the device list and copy the deleted ones back in on startPairing()
.
Restarting the searches sounds like the better approach even if it is more work
Although it won't handle the case I ran into which is that the thing description doesn't change but the device is no longer present
(but that can be worked around too)
Unfortunately restarting the searches doesn't work (at least for dnssd). dnssd does provide a list() function that would work to regenerate the devices list. Eddystone doesn't provide a similar function but restarting the search may work for it. Given that both of these workarounds are convoluted and library-specific I'm just going to go with the duplicate devices list.
loadThing is only called on advertisement which doesn't happen that often so my first approach didn't work. This will require a bit more work than anticipated (or just duplicated devices storage come to think of it)