WifiP2pUpnpServiceInfopublic class WifiP2pUpnpServiceInfo extends WifiP2pServiceInfo A class for storing Upnp service information that is advertised
over a Wi-Fi peer-to-peer setup.
{@see android.net.wifi.p2p.WifiP2pManager#addLocalService}
{@see android.net.wifi.p2p.WifiP2pManager#removeLocalService}
{@see WifiP2pServiceInfo}
{@see WifiP2pDnsSdServiceInfo} |
Fields Summary |
---|
public static final int | VERSION_1_0UPnP version 1.0.
Query Version should always be set to 0x10 if the query values are
compatible with UPnP Device Architecture 1.0. |
Constructors Summary |
---|
private WifiP2pUpnpServiceInfo(List queryList)This constructor is only used in newInstance().
super(queryList);
|
Methods Summary |
---|
private static java.lang.String | createSupplicantQuery(java.lang.String uuid, java.lang.String data)Create wpa_supplicant service query for upnp.
StringBuffer sb = new StringBuffer();
sb.append("upnp ");
sb.append(String.format(Locale.US, "%02x ", VERSION_1_0));
sb.append("uuid:");
sb.append(uuid);
if (data != null) {
sb.append("::");
sb.append(data);
}
return sb.toString();
| public static android.net.wifi.p2p.nsd.WifiP2pUpnpServiceInfo | newInstance(java.lang.String uuid, java.lang.String device, java.util.List services)Create UPnP service information object.
if (uuid == null || device == null) {
throw new IllegalArgumentException("uuid or device cannnot be null");
}
UUID.fromString(uuid);
ArrayList<String> info = new ArrayList<String>();
info.add(createSupplicantQuery(uuid, null));
info.add(createSupplicantQuery(uuid, "upnp:rootdevice"));
info.add(createSupplicantQuery(uuid, device));
if (services != null) {
for (String service:services) {
info.add(createSupplicantQuery(uuid, service));
}
}
return new WifiP2pUpnpServiceInfo(info);
|
|