UpnpDiscover(uuid=None, device_ipaddr=None, mcst_ipaddr='18.104.22.168', mcst_port=1901)¶
The uuid and device_ipaddr param can limit UpnpDiscover to find device with specified uuid or IP address. These params usually be used when you want recive specified status continuously.
- uuid (uuid.UUID) – Discover specified uuid of device only
- device_ipaddr (string) – Discover device from specified IP address only.
Sends a special message to destination IP address. And the destination device will send a unicast UDP package back.
discover(callback, lookup_callback=None, timeout=inf)¶
Executes discovering task. The callback function has a minimal definition:
def callback(upnp_discover_instance, device, **kw): pass
- upnp_discover_instance is the instance which calls this method.
- device a fluxclient.upnp.Device instance
- callback (callable) – This method will be invoked when a device has been found or the computer recived a new status from a device.
- timeout (float) – Maximum waiting time.
Invoke this function to break discover task
Discover method may still invoke a callback even if user called this method, because the data already in local socket buffer.