Author: nextgens
Date: 2008-08-19 21:50:05 +0000 (Tue, 19 Aug 2008)
New Revision: 22044
Modified:
trunk/plugins/UPnP/UPnP.java
Log:
UPnP: Add a main method on the plugin for debugging purposes
Modified: trunk/plugins/UPnP/UPnP.java
===================================================================
--- trunk/plugins/UPnP/UPnP.java 2008-08-19 21:35:26 UTC (rev 22043)
+++ trunk/plugins/UPnP/UPnP.java 2008-08-19 21:50:05 UTC (rev 22044)
@@ -598,4 +598,27 @@
public String getVersion() {
return Version.getVersion() + " " + Version.getSvnRevision();
}
+
+ public static void main(String[] args) throws Exception {
+ UPnP upnp = new UPnP();
+ ControlPoint cp = new ControlPoint();
+ System.out.println("Searching for up&p devices:");
+ cp.start();
+ cp.search();
+ while(true) {
+ DeviceList list = cp.getDeviceList();
+ System.out.println("Found " + list.size() + "
devices!");
+ StringBuffer sb = new StringBuffer();
+ Iterator<Device> it = list.iterator();
+ while(it.hasNext()) {
+ Device device = it.next();
+ upnp.listSubDev(device.toString(), device, sb);
+ System.out.println("Here is the listing for " +
device.toString() + " :");
+ System.out.println(sb.toString());
+ sb = new StringBuffer();
+ }
+ System.out.println("End");
+ Thread.sleep(2000);
+ }
+ }
}