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

WifiP2pServiceInfo

public class WifiP2pServiceInfo extends Object implements android.os.Parcelable
A class for storing service information that is advertised over a Wi-Fi peer-to-peer setup
see
WifiP2pUpnpServiceInfo
see
WifiP2pDnsSdServiceInfo

Fields Summary
public static final int
SERVICE_TYPE_ALL
All service protocol types.
public static final int
SERVICE_TYPE_BONJOUR
DNS based service discovery protocol.
public static final int
SERVICE_TYPE_UPNP
UPnP protocol.
public static final int
SERVICE_TYPE_WS_DISCOVERY
WS-Discovery protocol
public static final int
SERVICE_TYPE_VENDOR_SPECIFIC
Vendor Specific protocol
private List
mQueryList
the 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
CREATOR
Implement the Parcelable interface {@hide}
Constructors Summary
protected WifiP2pServiceInfo(List queryList)
This is only used in subclass.

param
queryList query string for wpa_supplicant
hide


                      
       
        if (queryList == null) {
            throw new IllegalArgumentException("query list cannot be null");
        }
        mQueryList = queryList;
    
Methods Summary
static java.lang.Stringbin2HexStr(byte[] data)
Converts byte array to hex string.

param
data
return
hex string.
hide

       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 intdescribeContents()
Implement the Parcelable interface {@hide}

        return 0;
    
public booleanequals(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.ListgetSupplicantQueryList()
Return the list of the query string for wpa_supplicant.

return
the list of the query string for wpa_supplicant.
hide

       return mQueryList;
   
public inthashCode()

       int result = 17;
       result = 31 * result + (mQueryList == null ? 0 : mQueryList.hashCode());
       return result;
   
public voidwriteToParcel(android.os.Parcel dest, int flags)
Implement the Parcelable interface {@hide}

        dest.writeStringList(mQueryList);