I'm trying to communicate with my new wemo switch over upnp. On windows this works just fine. Now I'm trying to do the same on android using the mono.upnp lib. Everything looks the same but I cant figuer out how to discover devices on mono.upnp.
Here is the code on windows:
public static List<WeMoDevice> GetDevices ()
{
UPnPDeviceFinder finder = new UPnPDeviceFinder ();
List<WeMoDevice> foundDevices = new List<WeMoDevice> ();
string deviceType = "upnp:rootdevice";
Device devices = finder.FindByType (deviceType, 1);
foreach (Device device in devices) {
if (device.Type.StartsWith ("urn:Belkin:")) {
switch (GetDeviceType (device)) {
case WeMoDeviceType.Switch:
WeMoSwitch wemoSwitch = new WeMoSwitch (device);
foundDevices.Add (wemoSwitch);
break;
case WeMoDeviceType.Sensor:
WeMoSensor wemoSensor = new WeMoSensor (device);
foundDevices.Add (wemoSensor);
break;
default:
break;
}
}
}
return foundDevices;
}
I already changed the device class to the mono.upnp one but I cant seem to find the equivalent for UPnPDeviceFinder in mono.upnp.