You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using this code to control Wemo devices, however run into an issue when calling Device.getAction(); which returns null and results in an inability to control the device.
The root of the issue appears to be in org.cybergarage.upnp.Device in the getAbsoluteURL(String, String, String) method. The method is called with:
urlString="/timesyncservice.xml"
baseURLString=""
locationURLStr="http://:49153/setup.xml"
The method returns a string: "http://:49153/setup.xml/timesyncservice.xml", which is incorrect. It should return "http://:49153/timesyncservice.xml". It appears the only validation that is being performed is to look for a MalformedURLException. My fix on the local copy of my code (attached) is to attempt to open the URL prior to returning the string to check for a response code of 200. Doing so appears to resolve my issue, though this approach breaks the test in org.cybergarage.upnp.DeviceTest as the testDeviceAbsoluteURL() method need to be able to connect to an actual device. Device.txt
The text was updated successfully, but these errors were encountered:
I have been using this code to control Wemo devices, however run into an issue when calling Device.getAction(); which returns null and results in an inability to control the device.
The root of the issue appears to be in org.cybergarage.upnp.Device in the getAbsoluteURL(String, String, String) method. The method is called with:
urlString="/timesyncservice.xml"
baseURLString=""
locationURLStr="http://:49153/setup.xml"
The method returns a string: "http://:49153/setup.xml/timesyncservice.xml", which is incorrect. It should return "http://:49153/timesyncservice.xml". It appears the only validation that is being performed is to look for a MalformedURLException. My fix on the local copy of my code (attached) is to attempt to open the URL prior to returning the string to check for a response code of 200. Doing so appears to resolve my issue, though this approach breaks the test in org.cybergarage.upnp.DeviceTest as the testDeviceAbsoluteURL() method need to be able to connect to an actual device.
Device.txt
The text was updated successfully, but these errors were encountered: