WifiP2pServiceInfopublic class WifiP2pServiceInfo extends Object implements android.os.ParcelableA class for storing service information that is advertised
over a Wi-Fi peer-to-peer setup |
Fields Summary |
---|
public static final int | SERVICE_TYPE_ALLAll service protocol types. | public static final int | SERVICE_TYPE_BONJOURDNS based service discovery protocol. | public static final int | SERVICE_TYPE_UPNPUPnP protocol. | public static final int | SERVICE_TYPE_WS_DISCOVERYWS-Discovery protocol | public static final int | SERVICE_TYPE_VENDOR_SPECIFICVendor Specific protocol | private List | mQueryListthe list of query string for wpa_supplicant
e.g)
# IP Printing over TCP (PTR) (RDATA=MyPrinter._ipp._tcp.local.)
{"bonjour", "045f697070c00c000c01", "094d795072696e746572c027"
# IP Printing over TCP (TXT) (RDATA=txtvers=1,pdl=application/postscript)
{"bonjour", "096d797072696e746572045f697070c00c001001",
"09747874766572733d311a70646c3d6170706c69636174696f6e2f706f7374736372797074"}
[UPnP]
# UPnP uuid
{"upnp", "10", "uuid:6859dede-8574-59ab-9332-123456789012"}
# UPnP rootdevice
{"upnp", "10", "uuid:6859dede-8574-59ab-9332-123456789012::upnp:rootdevice"}
# UPnP device
{"upnp", "10", "uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp
-org:device:InternetGatewayDevice:1"}
# UPnP service
{"upnp", "10", "uuid:6859dede-8574-59ab-9322-123456789012::urn:schemas-upnp
-org:service:ContentDirectory:2"} | public static final Creator | CREATORImplement the Parcelable interface {@hide} |
Constructors Summary |
---|
protected WifiP2pServiceInfo(List queryList)This is only used in subclass.
if (queryList == null) {
throw new IllegalArgumentException("query list cannot be null");
}
mQueryList = queryList;
|
Methods Summary |
---|
static java.lang.String | bin2HexStr(byte[] data)Converts byte array to hex string.
StringBuffer sb = new StringBuffer();
for (byte b: data) {
String s = null;
try {
s = Integer.toHexString(b & 0xff);
} catch (Exception e) {
e.printStackTrace();
return null;
}
//add 0 padding
if (s.length() == 1) {
sb.append('0");
}
sb.append(s);
}
return sb.toString();
| public int | describeContents()Implement the Parcelable interface {@hide}
return 0;
| public boolean | equals(java.lang.Object o)
if (o == this) {
return true;
}
if (!(o instanceof WifiP2pServiceInfo)) {
return false;
}
WifiP2pServiceInfo servInfo = (WifiP2pServiceInfo)o;
return mQueryList.equals(servInfo.mQueryList);
| public java.util.List | getSupplicantQueryList()Return the list of the query string for wpa_supplicant.
return mQueryList;
| public int | hashCode()
int result = 17;
result = 31 * result + (mQueryList == null ? 0 : mQueryList.hashCode());
return result;
| public void | writeToParcel(android.os.Parcel dest, int flags)Implement the Parcelable interface {@hide}
dest.writeStringList(mQueryList);
|
|