本文整理汇总了Java中org.cybergarage.upnp.ControlPoint类的典型用法代码示例。如果您正苦于以下问题:Java ControlPoint类的具体用法?Java ControlPoint怎么用?Java ControlPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ControlPoint类属于org.cybergarage.upnp包,在下文中一共展示了ControlPoint类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startThread
import org.cybergarage.upnp.ControlPoint; //导入依赖的package包/类
private void startThread() {
if (this.mSearchThread != null) {
LogInfo.log("dlna", "thread is not null");
this.mSearchThread.setSearcTimes(0);
} else {
LogInfo.log("dlna", "thread is null, create a new thread");
ControlPoint controlPoint = new ControlPoint();
this.mControlPoint = controlPoint;
this.mSearchThread = new SearchThread(controlPoint);
}
if (this.mSearchThread.isAlive()) {
LogInfo.log("dlna", "thread is alive");
this.mSearchThread.awake();
return;
}
LogInfo.log("dlna", "start the thread");
this.mSearchThread.start();
}
开发者ID:JackChan1999,项目名称:letv,代码行数:19,代码来源:DLNAService.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();
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
示例3: 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
示例4: init
import org.cybergarage.upnp.ControlPoint; //导入依赖的package包/类
@Override
public void init(ProviderConfiguration configuration, OnEventListener onEventListener) throws Exception {
controlPoint = new ControlPoint();
if (!controlPoint.start()) {
throw new IOException("Could not start UPNP ControlPoint.");
}
deviceRegistry = new WemoDeviceRegistry(controlPoint);
controlPoint.addDeviceChangeListener(deviceRegistry);
// Schedule a new UPNP search for every minute.
executorService = Executors.newSingleThreadScheduledExecutor();
executorService.scheduleAtFixedRate(new UpnpSearchRunnable(controlPoint), 0l, 1l, TimeUnit.MINUTES);
if (LOG.isInfoEnabled()) {
LOG.info("Scheduled a search for Wemo devices every minute.");
}
stateDefinitions = new ArrayList<>();
eventDefinitions = new ArrayList<>();
actionDefinitions = new HashMap<>();
stateDefinitions.add(new WemoSwitchStateDefinition());
eventDefinitions.add(new WemoSwitchOnOffEventDefinition());
actionDefinitions.put(TurnOnOffActionDefinition.DEF_UUID, new TurnOnOffActionDefinition(deviceRegistry));
this.onEventListener = onEventListener;
controlPoint.addEventListener(this);
}
开发者ID:kmbulebu,项目名称:NickNack,代码行数:29,代码来源:WemoProvider.java
示例5: 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
示例6: SearchThread
import org.cybergarage.upnp.ControlPoint; //导入依赖的package包/类
public SearchThread(ControlPoint mControlPoint) {
this.mControlPoint = mControlPoint;
this.mControlPoint.addDeviceChangeListener(this.mDeviceChangeListener);
}
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:SearchThread.java
示例7: SearchThread
import org.cybergarage.upnp.ControlPoint; //导入依赖的package包/类
public SearchThread(ControlPoint mControlPoint) {
super();
this.mControlPoint = mControlPoint;
this.mControlPoint.addDeviceChangeListener(mDeviceChangeListener);
}
开发者ID:leobert-lan,项目名称:UiLib,代码行数:6,代码来源:SearchThread.java
示例8: init
import org.cybergarage.upnp.ControlPoint; //导入依赖的package包/类
private void init() {
mControlPoint = new ControlPoint();
mSearchThread = new SearchThread(mControlPoint);
registerWifiStateReceiver();
}
开发者ID:leobert-lan,项目名称:UiLib,代码行数:6,代码来源:DLNAService.java
示例9: UpnpSearchRunnable
import org.cybergarage.upnp.ControlPoint; //导入依赖的package包/类
public UpnpSearchRunnable(ControlPoint controlPoint) {
controlPointRef = new WeakReference<ControlPoint>(controlPoint);
}
开发者ID:kmbulebu,项目名称:NickNack,代码行数:4,代码来源:WemoProvider.java
示例10: WemoDeviceRegistry
import org.cybergarage.upnp.ControlPoint; //导入依赖的package包/类
public WemoDeviceRegistry(ControlPoint controlPoint) {
this.controlPoint = controlPoint;
}
开发者ID:kmbulebu,项目名称:NickNack,代码行数:4,代码来源:WemoDeviceRegistry.java
示例11: UPnPManager
import org.cybergarage.upnp.ControlPoint; //导入依赖的package包/类
private UPnPManager() {
this.cp = new ControlPoint();
}
开发者ID:shudo,项目名称:overlayweaver,代码行数:4,代码来源:UPnPManager.java
注:本文中的org.cybergarage.upnp.ControlPoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论