public class WifiP2pDevice extends Object implements Parcelable
WifiP2pManager
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static int |
AVAILABLE |
static int |
CONNECTED |
static Parcelable.Creator<WifiP2pDevice> |
CREATOR
Implement the Parcelable interface
|
String |
deviceAddress
The device MAC address uniquely identifies a Wi-Fi p2p device
|
int |
deviceCapability
Device capability
|
String |
deviceName
The device name is a user friendly string to identify a Wi-Fi p2p device
|
static int |
FAILED |
int |
groupCapability
Group capability
|
static int |
INVITED |
String |
primaryDeviceType
Primary device type identifies the type of device.
|
String |
secondaryDeviceType
Secondary device type is an optional attribute that can be provided by a device in
addition to the primary device type.
|
int |
status
Device connection status
|
static int |
UNAVAILABLE |
WifiP2pWfdInfo |
wfdInfo |
int |
wpsConfigMethodsSupported
WPS config methods supported
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
WifiP2pDevice() |
WifiP2pDevice(String string) |
WifiP2pDevice(WifiP2pDevice source)
copy constructor
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Implement the Parcelable interface
|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
boolean |
isDeviceLimit()
Returns true if the device reaches the limit.
|
boolean |
isGroupLimit()
Returns true if the group reaches the limit.
|
boolean |
isGroupOwner()
Returns true if the device is a group owner
|
boolean |
isInvitationCapable()
Returns true if the device is capable of invitation
|
boolean |
isServiceDiscoveryCapable()
Returns true if the device is capable of service discovery
|
String |
toString()
Returns a string representation of the object.
|
void |
update(WifiP2pDevice device)
Update device details.
|
void |
updateSupplicantDetails(WifiP2pDevice device)
Updates details obtained from supplicant @hide
|
boolean |
wpsDisplaySupported()
Returns true if WPS display configuration is supported
|
boolean |
wpsKeypadSupported()
Returns true if WPS keypad configuration is supported
|
boolean |
wpsPbcSupported()
Returns true if WPS push button configuration is supported
|
void |
writeToParcel(Parcel dest,
int flags)
Implement the Parcelable interface
|
public String deviceName
public String deviceAddress
public String primaryDeviceType
public String secondaryDeviceType
public int wpsConfigMethodsSupported
public int deviceCapability
public int groupCapability
public static final int CONNECTED
public static final int INVITED
public static final int FAILED
public static final int AVAILABLE
public static final int UNAVAILABLE
public int status
public WifiP2pWfdInfo wfdInfo
public static final Parcelable.Creator<WifiP2pDevice> CREATOR
public WifiP2pDevice()
public WifiP2pDevice(String string) throws IllegalArgumentException
string
- formats supported include
P2P-DEVICE-FOUND fa:7b:7a:42:02:13 p2p_dev_addr=fa:7b:7a:42:02:13
pri_dev_type=1-0050F204-1 name='p2p-TEST1' config_methods=0x188 dev_capab=0x27
group_capab=0x0 wfd_dev_info=000006015d022a0032
P2P-DEVICE-LOST p2p_dev_addr=fa:7b:7a:42:02:13
AP-STA-CONNECTED 42:fc:89:a8:96:09 [p2p_dev_addr=02:90:4c:a0:92:54]
AP-STA-DISCONNECTED 42:fc:89:a8:96:09 [p2p_dev_addr=02:90:4c:a0:92:54]
fa:7b:7a:42:02:13
Note: The events formats can be looked up in the wpa_supplicant codeIllegalArgumentException
public WifiP2pDevice(WifiP2pDevice source)
public boolean wpsPbcSupported()
public boolean wpsKeypadSupported()
public boolean wpsDisplaySupported()
public boolean isServiceDiscoveryCapable()
public boolean isInvitationCapable()
public boolean isDeviceLimit()
public boolean isGroupOwner()
public boolean isGroupLimit()
public void update(WifiP2pDevice device)
device
- to be updatedIllegalArgumentException
- if the device is null or device address does not matchpublic void updateSupplicantDetails(WifiP2pDevice device)
public boolean equals(Object obj)
Object
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
equals
in class Object
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap
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
.