public class WifiP2pGroup extends Object implements Parcelable
WifiP2pManager
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<WifiP2pGroup> |
CREATOR
Implement the Parcelable interface
|
static int |
PERSISTENT_NET_ID
The persistent network id.
|
static int |
TEMPORARY_NET_ID
The temporary network id.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
WifiP2pGroup() |
WifiP2pGroup(String supplicantEvent) |
WifiP2pGroup(WifiP2pGroup source)
copy constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addClient(String address) |
void |
addClient(WifiP2pDevice device) |
boolean |
contains(WifiP2pDevice device) |
int |
describeContents()
Implement the Parcelable interface
|
Collection<WifiP2pDevice> |
getClientList()
Get the list of clients currently part of the p2p group
|
String |
getInterface()
Get the interface name on which the group is created
|
int |
getNetworkId() |
String |
getNetworkName()
Get the network name (SSID) of the group.
|
WifiP2pDevice |
getOwner()
Get the details of the group owner as a
WifiP2pDevice object |
String |
getPassphrase()
Get the passphrase of the group.
|
boolean |
isClientListEmpty() |
boolean |
isGroupOwner()
Check whether this device is the group owner of the created p2p group
|
boolean |
removeClient(String address) |
boolean |
removeClient(WifiP2pDevice device) |
void |
setInterface(String intf) |
void |
setIsGroupOwner(boolean isGo) |
void |
setNetworkId(int netId) |
void |
setNetworkName(String networkName) |
void |
setOwner(WifiP2pDevice device) |
void |
setPassphrase(String passphrase) |
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int flags)
Implement the Parcelable interface
|
public static final int TEMPORARY_NET_ID
public static final int PERSISTENT_NET_ID
public static final Parcelable.Creator<WifiP2pGroup> CREATOR
public WifiP2pGroup()
public WifiP2pGroup(String supplicantEvent) throws IllegalArgumentException
supplicantEvent
- formats supported include
P2P-GROUP-STARTED p2p-wlan0-0 [client|GO] ssid="DIRECT-W8" freq=2437
[psk=2182b2e50e53f260d04f3c7b25ef33c965a3291b9b36b455a82d77fd82ca15bc|
passphrase="fKG4jMe3"] go_dev_addr=fa:7b:7a:42:02:13 [PERSISTENT]
P2P-GROUP-REMOVED p2p-wlan0-0 [client|GO] reason=REQUESTED
P2P-INVITATION-RECEIVED sa=fa:7b:7a:42:02:13 go_dev_addr=f8:7b:7a:42:02:13
bssid=fa:7b:7a:42:82:13 unknown-network
P2P-INVITATION-RECEIVED sa=b8:f9:34:2a:c7:9d persistent=0
Note: The events formats can be looked up in the wpa_supplicant codeIllegalArgumentException
public WifiP2pGroup(WifiP2pGroup source)
public void setNetworkName(String networkName)
public String getNetworkName()
public void setIsGroupOwner(boolean isGo)
public boolean isGroupOwner()
public void setOwner(WifiP2pDevice device)
public WifiP2pDevice getOwner()
WifiP2pDevice
objectpublic void addClient(String address)
public void addClient(WifiP2pDevice device)
public boolean removeClient(String address)
public boolean removeClient(WifiP2pDevice device)
public boolean isClientListEmpty()
public boolean contains(WifiP2pDevice device)
public Collection<WifiP2pDevice> getClientList()
public void setPassphrase(String passphrase)
public String getPassphrase()
getNetworkName()
to join the grouppublic void setInterface(String intf)
public String getInterface()
public int getNetworkId()
public void setNetworkId(int netId)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public int describeContents()
describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.