FileDocCategorySizeDatePackage
WifiP2pUpnpServiceRequest.javaAPI DocAndroid 5.1 API2697Thu Mar 12 22:22:44 GMT 2015android.net.wifi.p2p.nsd

WifiP2pUpnpServiceRequest

public class WifiP2pUpnpServiceRequest extends WifiP2pServiceRequest
A class for creating a Upnp service discovery request for use with {@link WifiP2pManager#addServiceRequest} and {@link WifiP2pManager#removeServiceRequest} {@see WifiP2pManager} {@see WifiP2pServiceRequest} {@see WifiP2pDnsSdServiceRequest}

Fields Summary
Constructors Summary
protected WifiP2pUpnpServiceRequest(String query)
This constructor is only used in newInstance().

param
query The part of service specific query.
hide

        super(WifiP2pServiceInfo.SERVICE_TYPE_UPNP, query);
    
protected WifiP2pUpnpServiceRequest()
This constructor is only used in newInstance().

hide

        super(WifiP2pServiceInfo.SERVICE_TYPE_UPNP, null);
    
Methods Summary
public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequestnewInstance()
Create a service discovery request to search all UPnP services.

return
service request for UPnP.

        return new WifiP2pUpnpServiceRequest();
    
public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequestnewInstance(java.lang.String st)
Create a service discovery request to search specified UPnP services.

param
st ssdp search target. Cannot be null.
e.g )
  • "ssdp:all"
  • "upnp:rootdevice"
  • "urn:schemas-upnp-org:device:MediaServer:2"
  • "urn:schemas-upnp-org:service:ContentDirectory:2"
  • "uuid:6859dede-8574-59ab-9332-123456789012"
return
service request for UPnP.

        if (st == null) {
            throw new IllegalArgumentException("search target cannot be null");
        }
        StringBuffer sb = new StringBuffer();
        sb.append(String.format(Locale.US, "%02x", WifiP2pUpnpServiceInfo.VERSION_1_0));
        sb.append(WifiP2pServiceInfo.bin2HexStr(st.getBytes()));
        return new WifiP2pUpnpServiceRequest(sb.toString());