org.cybergarage.upnp.Device.isDeviceType()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中org.cybergarage.upnp.Device.isDeviceType()方法的一些代码示例,展示了Device.isDeviceType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.isDeviceType()方法的具体详情如下:
包路径:org.cybergarage.upnp.Device
类名称:Device
方法名:isDeviceType

Device.isDeviceType介绍

暂无

代码示例

代码示例来源:origin: cybergarage/cybergarage-upnp

  1. public Device getServerDevice(String name)
  2. {
  3. Device foundDev = getDevice(name);
  4. if (foundDev.isDeviceType(MediaServer.DEVICE_TYPE))
  5. return foundDev;
  6. return null;
  7. }

代码示例来源:origin: cybergarage/cybergarage-upnp

  1. public Device getRendererDevice(String name)
  2. {
  3. Device foundDev = getDevice(name);
  4. if (foundDev.isDeviceType(MediaRenderer.DEVICE_TYPE))
  5. return foundDev;
  6. return null;
  7. }

代码示例来源:origin: geniusgithub/MediaPlayer

  1. public Device getServerDevice(String name)
  2. {
  3. Device foundDev = getDevice(name);
  4. if (foundDev.isDeviceType(MediaServer.DEVICE_TYPE))
  5. return foundDev;
  6. return null;
  7. }

代码示例来源:origin: geniusgithub/MediaPlayer

  1. public Device getRendererDevice(String name)
  2. {
  3. Device foundDev = getDevice(name);
  4. if (foundDev.isDeviceType(MediaRenderer.DEVICE_TYPE))
  5. return foundDev;
  6. return null;
  7. }

代码示例来源:origin: cybergarage/cybergarage-upnp

  1. public synchronized void updateDeviceComboList()
  2. {
  3. DeviceList devList = ctrlPoint.getDeviceList();
  4. int devCnt = devList.size();
  5. for (int n=0; n<devCnt; n++) {
  6. Device dev = devList.getDevice(n);
  7. if (dev.isDeviceType("urn:schemas-upnp-org:device:InternetGatewayDevice:1") == false)
  8. continue;
  9. String devComboName = getDeviceComboName(dev);
  10. int itemCnt = deviceCombo.getItemCount();
  11. boolean hasSameDeviceName = false;
  12. for (int i=0; i<itemCnt; i++) {
  13. String itemName = (String)deviceCombo.getItemAt(i);
  14. if (itemName == null)
  15. continue;
  16. if (itemName.compareTo(devComboName) == 0) {
  17. hasSameDeviceName = true;
  18. break;
  19. }
  20. }
  21. if (hasSameDeviceName == false) {
  22. deviceCombo.addItem(devComboName);
  23. }
  24. }
  25. }

代码示例来源:origin: cybergarage/cybergarage-upnp

  1. public void printMediaServers()
  2. {
  3. DeviceList devList = getDeviceList();
  4. int devCnt = devList.size();
  5. int mediaServerCnt = 0;
  6. for (int n=0; n<devCnt; n++) {
  7. Device dev = devList.getDevice(n);
  8. if (dev.isDeviceType(MediaServer.DEVICE_TYPE) == false)
  9. continue;
  10. System.out.println("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());
  11. printContentDirectory(dev);
  12. mediaServerCnt++;
  13. }
  14. if (mediaServerCnt == 0) {
  15. System.out.println("MediaServer is not found");
  16. }
  17. }

代码示例来源:origin: cybergarage/cybergarage-upnp

  1. private DeviceList getDeviceList(String deviceType)
  2. {
  3. DeviceList devList = new DeviceList();
  4. DeviceList allDevList = getDeviceList();
  5. int allDevCnt = allDevList.size();
  6. for (int n=0; n<allDevCnt; n++) {
  7. Device dev = allDevList.getDevice(n);
  8. if (dev.isDeviceType(deviceType) == false)
  9. continue;
  10. devList.add(dev);
  11. }
  12. return devList;
  13. }

代码示例来源:origin: geniusgithub/MediaPlayer

  1. public void printMediaServers()
  2. {
  3. DeviceList devList = getDeviceList();
  4. int devCnt = devList.size();
  5. int mediaServerCnt = 0;
  6. for (int n=0; n<devCnt; n++) {
  7. Device dev = devList.getDevice(n);
  8. if (dev.isDeviceType(MediaServer.DEVICE_TYPE) == false)
  9. continue;
  10. System.out.println("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());
  11. printContentDirectory(dev);
  12. mediaServerCnt++;
  13. }
  14. if (mediaServerCnt == 0) {
  15. System.out.println("MediaServer is not found");
  16. }
  17. }

代码示例来源:origin: geniusgithub/MediaPlayer

  1. private DeviceList getDeviceList(String deviceType)
  2. {
  3. DeviceList devList = new DeviceList();
  4. DeviceList allDevList = getDeviceList();
  5. int allDevCnt = allDevList.size();
  6. for (int n=0; n<allDevCnt; n++) {
  7. Device dev = allDevList.getDevice(n);
  8. if (dev.isDeviceType(deviceType) == false)
  9. continue;
  10. devList.add(dev);
  11. }
  12. return devList;
  13. }

代码示例来源:origin: cybergarage/cybergarage-upnp

  1. for (int n=0; n<devCnt; n++) {
  2. Device dev = devList.getDevice(n);
  3. if (dev.isDeviceType(MediaServer.DEVICE_TYPE) == false)
  4. continue;
  5. System.out.println("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());

代码示例来源:origin: geniusgithub/MediaPlayer

  1. for (int n=0; n<devCnt; n++) {
  2. Device dev = devList.getDevice(n);
  3. if (dev.isDeviceType(MediaServer.DEVICE_TYPE) == false)
  4. continue;
  5. System.out.println("[" + n + "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());

相关文章

Device类方法