本文整理了Java中org.cybergarage.upnp.Device.getFriendlyName()
方法的一些代码示例,展示了Device.getFriendlyName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.getFriendlyName()
方法的具体详情如下:
包路径:org.cybergarage.upnp.Device
类名称:Device
方法名:getFriendlyName
暂无
代码示例来源:origin: i2p/i2p.i2p
public boolean isDevice(String name) {
if (name == null)
return false;
if (name.endsWith(getUDN()) == true)
return true;
if (name.equals(getFriendlyName()) == true)
return true;
if (name.endsWith(getDeviceType()) == true)
return true;
return false;
}
代码示例来源:origin: i2p/i2p.i2p
private void listSubDev(String prefix, Device dev, StringBuilder sb){
if (prefix == null)
sb.append("<p>").append(_t("Found Device")).append(": ");
else
sb.append("<li>").append(_t("Subdevice")).append(": ");
sb.append(DataHelper.escapeHTML(dev.getFriendlyName()));
if (prefix == null) {
String ip = getIP(dev);
if (ip != null)
sb.append("<br>IP: ").append(ip);
String udn = dev.getUDN();
if (udn != null)
sb.append("<br>UDN: ").append(DataHelper.escapeHTML(udn));
}
sb.append("</p>");
listSubServices(dev, sb);
DeviceList dl = dev.getDeviceList();
if (dl.isEmpty())
return;
sb.append("<ul>\n");
for(int j=0; j<dl.size(); j++) {
Device subDev = dl.getDevice(j);
if(subDev == null) continue;
listSubDev(dev.getFriendlyName(), subDev, sb);
}
sb.append("</ul>\n");
}
代码示例来源:origin: i2p/i2p.i2p
String udn = dev.getUDN();
if (_log.shouldLog(Log.WARN))
_log.warn("UP&P device removed : " + dev.getFriendlyName() + " UDN: " + udn);
ForwardPortCallback fpc = null;
Map<ForwardPort, ForwardPortStatus> removeMap = null;
if ((ROUTER_DEVICE.equals(type) || ROUTER_DEVICE_2.equals(type)) &&
dev.isRootDevice() &&
stringEquals(_router.getFriendlyName(), dev.getFriendlyName()) &&
stringEquals(_router.getUDN(), udn)) {
if (_log.shouldLog(Log.WARN))
_log.warn("UP&P IGD device removed : " + dev.getFriendlyName());
代码示例来源:origin: i2p/i2p.i2p
cp.listSubDev(device.toString(), device, sb);
System.out.println("<h3>Device " + (++i) +
": " + DataHelper.escapeHTML(device.getFriendlyName()) + "</h3>");
System.out.println("<p>UDN: " + DataHelper.escapeHTML(device.getUDN()));
System.out.println("<br>IP: " + getIP(device));
代码示例来源:origin: i2p/i2p.i2p
public void removeExpiredDevices()
{
DeviceList devList = getDeviceList();
int devCnt = devList.size();
Device dev[] = new Device[devCnt];
for (int n=0; n<devCnt; n++)
dev[n] = devList.getDevice(n);
for (int n=0; n<devCnt; n++) {
if (dev[n].isExpired() == true) {
Debug.message("Expired device = " + dev[n].getFriendlyName());
removeDevice(dev[n]);
}
}
}
代码示例来源:origin: i2p/i2p.i2p
if (_service == null) {
if (_log.shouldWarn())
_log.warn(_router.getFriendlyName() + " doesn't have any recognized connection type; we won't be able to use it!");
Service svc2 = current2.getService(WAN_IPV6_CONNECTION);
if (svc2 != null)
_log.warn(_router.getFriendlyName() + " supports WANIPv6Connection, but we don't");
代码示例来源:origin: i2p/i2p.i2p
public void print()
{
DeviceList devList = getDeviceList();
int devCnt = devList.size();
Debug.message("Device Num = " + devCnt);
for (int n=0; n<devCnt; n++) {
Device dev = devList.getDevice(n);
Debug.message("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());
}
}
}
代码示例来源:origin: com.github.kmbulebu.nicknack/wemo-provider
@Override
public String getFriendlyName() {
return device.getFriendlyName();
}
代码示例来源:origin: i2p/i2p.i2p
if (udn == null)
udn = "???";
String name = dev.getFriendlyName();
if (name == null)
name = "???";
代码示例来源:origin: geniusgithub/MediaPlayer
@Override
public void bindView(Device data, int position) {
mDevice = data;
mNameView.setText(data.getFriendlyName());
mIPView.setText(data.getHost());
}
代码示例来源:origin: geniusgithub/MediaPlayer
public boolean isDevice(String name) {
if (name == null)
return false;
if (name.endsWith(getUDN()) == true)
return true;
if (name.equals(getFriendlyName()) == true)
return true;
if (name.endsWith(getDeviceType()) == true)
return true;
return false;
}
代码示例来源:origin: cybergarage/cybergarage-upnp
public boolean isDevice(String name) {
if (name == null)
return false;
if (name.endsWith(getUDN()) == true)
return true;
if (name.equals(getFriendlyName()) == true)
return true;
if (name.endsWith(getDeviceType()) == true)
return true;
return false;
}
代码示例来源:origin: i2p/i2p.i2p
public boolean postSearchResponse(SSDPPacket ssdpPacket, String st,
String usn) {
String localAddr = ssdpPacket.getLocalAddress();
Device rootDev = getRootDevice();
String rootDevLocation = rootDev.getLocationURL(localAddr);
SSDPSearchResponse ssdpRes = new SSDPSearchResponse();
ssdpRes.setLeaseTime(getLeaseTime());
ssdpRes.setDate(cal);
ssdpRes.setST(st);
ssdpRes.setUSN(usn);
ssdpRes.setLocation(rootDevLocation);
ssdpRes.setBootId(getBootId());
// Thanks for Brent Hills (10/20/04)
ssdpRes.setMYNAME(getFriendlyName());
int mx = ssdpPacket.getMX();
TimerUtil.waitRandom(mx * 1000);
String remoteAddr = ssdpPacket.getRemoteAddress();
int remotePort = ssdpPacket.getRemotePort();
SSDPSearchResponseSocket ssdpResSock = new SSDPSearchResponseSocket();
if (Debug.isOn() == true)
ssdpRes.print();
int ssdpCount = getSSDPAnnounceCount();
for (int i = 0; i < ssdpCount; i++)
ssdpResSock.post(remoteAddr, remotePort, ssdpRes);
return true;
}
代码示例来源:origin: geniusgithub/MediaPlayer
private void updateToolTitle(int viewType){
String title = "DLNA";
if (viewType == VIEW_CONTENT){
Device device = mAllShareProxy.getmDeviceOperator().getDMSSelectedDevice();
if (device != null){
title = device.getFriendlyName();
}
}
mIBrowseView.updateToolTitle(title);
}
代码示例来源:origin: com.github.kmbulebu.nicknack/wemo-provider
@Override
public void deviceRemoved(Device dev) {
if (isWemoSwitch(dev)) {
urnToDeviceMap.remove(dev.getUDN());
final Service basicEventService = dev.getService("urn:Belkin:service:basicevent:1");
if (basicEventService != null && basicEventService.getSID() != null) {
sidToDeviceMap.remove(basicEventService.getSID());
}
if (LOG.isInfoEnabled()) {
LOG.info("Removed Wemo Device: " + dev.getFriendlyName() + " (" + dev.getUDN() + ')');
}
}
}
代码示例来源:origin: geniusgithub/MediaPlayer
public void print()
{
DeviceList devList = getDeviceList();
int devCnt = devList.size();
Debug.message("Device Num = " + devCnt);
for (int n=0; n<devCnt; n++) {
Device dev = devList.getDevice(n);
Debug.message("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());
}
}
}
代码示例来源:origin: cybergarage/cybergarage-upnp
public void print()
{
DeviceList devList = getDeviceList();
int devCnt = devList.size();
Debug.message("Device Num = " + devCnt);
for (int n=0; n<devCnt; n++) {
Device dev = devList.getDevice(n);
Debug.message("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());
}
}
}
代码示例来源:origin: apache/felix
public void removeExpiredDevices() {
DeviceList devList = getDeviceList();
int devCnt = devList.size();
for (int n = 0; n < devCnt; n++) {
Device dev = devList.getDevice(n);
if (dev.isExpired() == true) {
Activator.logger.DEBUG("[Importer] Expired device:"+ dev.getFriendlyName());
removeDevice(dev);
removeOSGiExpireDevice(dev);
}
}
}
代码示例来源:origin: org.apache.felix/org.apache.felix.upnp.basedriver
public void removeExpiredDevices() {
DeviceList devList = getDeviceList();
int devCnt = devList.size();
for (int n = 0; n < devCnt; n++) {
Device dev = devList.getDevice(n);
if (dev.isExpired() == true) {
Activator.logger.DEBUG("[Importer] Expired device:"+ dev.getFriendlyName());
removeDevice(dev);
removeOSGiExpireDevice(dev);
}
}
}
代码示例来源:origin: cybergarage/cybergarage-upnp
void updateDeviceList(TreeNode parentNode, DeviceList devList)
{
int nDevs = devList.size();
for (int n=0; n<nDevs; n++) {
Device dev = devList.getDevice(n);
String friendlyName = dev.getFriendlyName();
TreeNode devNode = new TreeNode(friendlyName);
devNode.setUserData(dev);
parentNode.add(devNode);
updateServiceList(devNode, dev);
updateIconList(devNode, dev);
updateDeviceList(devNode, dev.getDeviceList());
}
}
内容来源于网络,如有侵权,请联系作者删除!