FileDocCategorySizeDatePackage
WifiP2pInfo.javaAPI DocAndroid 5.1 API3130Thu Mar 12 22:22:44 GMT 2015android.net.wifi.p2p

WifiP2pInfo

public class WifiP2pInfo extends Object implements android.os.Parcelable
A class representing connection information about a Wi-Fi p2p group {@see WifiP2pManager}

Fields Summary
public boolean
groupFormed
Indicates if a p2p group has been successfully formed
public boolean
isGroupOwner
Indicates if the current device is the group owner
public InetAddress
groupOwnerAddress
Group owner address
public static final Creator
CREATOR
Implement the Parcelable interface
Constructors Summary
public WifiP2pInfo()

    
public WifiP2pInfo(WifiP2pInfo source)
copy constructor

        if (source != null) {
            groupFormed = source.groupFormed;
            isGroupOwner = source.isGroupOwner;
            groupOwnerAddress = source.groupOwnerAddress;
       }
    
Methods Summary
public intdescribeContents()
Implement the Parcelable interface

        return 0;
    
public java.lang.StringtoString()

        StringBuffer sbuf = new StringBuffer();
        sbuf.append("groupFormed: ").append(groupFormed)
            .append(" isGroupOwner: ").append(isGroupOwner)
            .append(" groupOwnerAddress: ").append(groupOwnerAddress);
        return sbuf.toString();
    
public voidwriteToParcel(android.os.Parcel dest, int flags)
Implement the Parcelable interface

        dest.writeByte(groupFormed ? (byte)1 : (byte)0);
        dest.writeByte(isGroupOwner ? (byte)1 : (byte)0);

        if (groupOwnerAddress != null) {
            dest.writeByte((byte)1);
            dest.writeByteArray(groupOwnerAddress.getAddress());
        } else {
            dest.writeByte((byte)0);
        }