arcam / CocoaUPnP

CocoaUPnP is a logical progression of upnpx; designed to be easy, modern and block-based.
MIT License
85 stars 40 forks source link

Once a device is detected it's not detected again #36

Closed LucasAdam closed 8 years ago

LucasAdam commented 8 years ago

Hey, I'm facing a small issue : when I start the discovery, and successfully find the device I want, if I then stop the discovery and start it again some times later (a matter of seconds/minutes), it won't find the device anymore. Is that normal ?

Thanks :)

squarefrog commented 8 years ago

Yes - as UPPDiscovery already knows about the device. The only time it'll send out another notification is if the device sends a BYEBYE message then appears again.

You can fetch all the discovered devices with:

[[UPPDiscovery sharedInstance] availableDevices];
LucasAdam commented 8 years ago

Thank you for that clarification :)

squarefrog commented 8 years ago

No problem! 👍

LucasAdam commented 8 years ago

Is there a way to reset known devices myself ? Besides killing the app ?

squarefrog commented 8 years ago

Not currently, but it wouldn't be hard to add a [discovery forgetAllDevices]; method. I'm curious though why you need it?

LucasAdam commented 8 years ago

Well I present to the user a list of detected devices he can choose as his default STB/CPE, however, 2 hours later if he's at his, let's say GF's house, I want him to only see devices availble there and not the ones he discovered earlier.

squarefrog commented 8 years ago

That makes sense. I've added a [discover forgetAllKnownDevices]; method. I'll just wait for the travis result then push out a new release.

LucasAdam commented 8 years ago

Thanks a bunch. You rock man !

squarefrog commented 8 years ago

Just pushed 1.1.0 which has the method you need 🎉 🌮

You may need to $ pod repo update to see it.