コード例 #1
0
 public void searchAll() {
   if (m_isServiceReady) {
     Log.d(TAG, "Search invoke");
     m_upnpService.getRegistry().removeAllRemoteDevices();
     m_upnpService.getControlPoint().search();
   }
 }
コード例 #2
0
  @Override
  public RemoteDevice getRemoteDevice(String UDN) {
    for (RemoteDevice device : m_upnpService.getRegistry().getRemoteDevices()) {
      if (device.getIdentity().getUdn().toString().equals(UDN)) return device;
    }

    return null;
  }
コード例 #3
0
 public void ClearAll() {
   if (m_isServiceReady) {
     Log.d(TAG, "SearchDMR invoke");
     if (m_upnpService != null) {
       m_upnpService.getRegistry().removeAllRemoteDevices();
       //				m_upnpService.getControlPoint().search(new DeviceTypeHeader(type));
     } else {
       Log.w(TAG, "UPnP Service is null");
     }
   }
 }
コード例 #4
0
  public LocalDevice getLocalDevice(String UDN) {

    for (LocalDevice device : m_upnpService.getRegistry().getLocalDevices()) {
      Log.i(
          TAG,
          "Local device:"
              + device.getDetails().getFriendlyName()
              + ","
              + device.getIdentity().getUdn().toString());
      if (device.getIdentity().getUdn().toString().compareTo(UDN) == 0) return device;
    }
    return null;
  }
コード例 #5
0
  @SuppressWarnings("rawtypes")
  public Collection<RemoteDevice> getRemoteDMR() {
    DeviceType dmrtype = new DeviceType(DMR_NAMESPACE, DMR_TYPE, 1);
    if (m_upnpService == null) return null;

    Collection<Device> devices = m_upnpService.getRegistry().getDevices(dmrtype);
    if (devices == null) return null;

    ArrayList<RemoteDevice> remoteDev = new ArrayList<RemoteDevice>();
    for (Device dev : devices) {
      if (dev instanceof RemoteDevice) remoteDev.add((RemoteDevice) dev);
    }

    return remoteDev;
  }
コード例 #6
0
 public Collection<RemoteDevice> getRemoteDevices() {
   if (m_upnpService != null) return m_upnpService.getRegistry().getRemoteDevices();
   return null;
 }