当前位置: 首页>>代码示例>>Java>>正文


Java ControlPoint.search方法代码示例

本文整理汇总了Java中org.cybergarage.upnp.ControlPoint.search方法的典型用法代码示例。如果您正苦于以下问题:Java ControlPoint.search方法的具体用法?Java ControlPoint.search怎么用?Java ControlPoint.search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.cybergarage.upnp.ControlPoint的用法示例。


在下文中一共展示了ControlPoint.search方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.cybergarage.upnp.ControlPoint; //导入方法依赖的package包/类
/**
 *  Dumps out device info in semi-HTML format
 */
public static void main(String[] args) throws Exception {
	Properties props = new Properties();
               props.setProperty(PROP_ADVANCED, "true");
	I2PAppContext ctx = new I2PAppContext(props);
	UPnP upnp = new UPnP(ctx);
	ControlPoint cp = new ControlPoint();
	System.out.println("Searching for UPnP devices:");
	cp.start();
	cp.search();
	Thread.sleep(10000);
	//while(true) {
		DeviceList list = cp.getDeviceList();
		System.out.println("Found " + list.size() + " devices!");
		StringBuilder sb = new StringBuilder();
		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.setLength(0);
		}
	//}
	System.exit(0);
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:29,代码来源:UPnP.java

示例2: main

import org.cybergarage.upnp.ControlPoint; //导入方法依赖的package包/类
/**
 *  Dumps out device info in semi-HTML format
 */
public static void main(String[] args) throws Exception {
	Properties props = new Properties();
               props.setProperty(PROP_ADVANCED, "true");
	I2PAppContext ctx = new I2PAppContext(props);
	UPnP upnp = new UPnP(ctx);
	ControlPoint cp = new ControlPoint();
	System.out.println("Searching for UPnP devices:");
	cp.start();
	cp.search();
	Thread.sleep(10000);
	//while(true) {
		DeviceList list = cp.getDeviceList();
		System.out.println("Found " + list.size() + " devices!");
		StringBuilder sb = new StringBuilder();
		Iterator<Device> it = list.iterator();
		int i = 0;
		while(it.hasNext()) {
			Device device = it.next();
			upnp.listSubDev(device.toString(), device, sb);
			System.out.println("Here is the listing for device " + (++i) +
			                   ' ' + device.getFriendlyName() + " :");
			System.out.println(sb.toString());
			sb.setLength(0);
		}
	//}
	System.exit(0);
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:31,代码来源:UPnP.java

示例3: run

import org.cybergarage.upnp.ControlPoint; //导入方法依赖的package包/类
@Override
public void run() {
	final ControlPoint cp = controlPointRef.get();
	if (cp == null) {
		if (LOG.isWarnEnabled()) {
			LOG.warn("Skipping search for Wemo devices because UPNP ControlPoint is unavailable.");
		}
	} else {
		if (LOG.isDebugEnabled()) {
			LOG.debug("Initiating search for Wemo devices.");
		}
		cp.search();
	}
}
 
开发者ID:kmbulebu,项目名称:NickNack,代码行数:15,代码来源:WemoProvider.java


注:本文中的org.cybergarage.upnp.ControlPoint.search方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。