public class WifiP2pDevice
extends Object implements Parcelable
| java.lang.Object | |
| android.net.wifi.p2p.WifiP2pDevice | |
代表Wi-Fi p2p设备的类请注意,这些操作不是线程安全的
也可以看看:
常量(Constants) |
|
|---|---|
int |
AVAILABLE |
int |
CONNECTED |
int |
FAILED |
int |
INVITED |
int |
UNAVAILABLE |
Inherited constants |
|---|
android.os.Parcelable
|
Fields |
|
|---|---|
public static final Creator<WifiP2pDevice> |
CREATOR 实现Parcelable接口 |
public String |
deviceAddress 设备MAC地址唯一标识一个Wi-Fi p2p设备 |
public String |
deviceName 设备名称是用于识别Wi-Fi p2p设备的用户友好字符串 |
public String |
primaryDeviceType 主要设备类型标识设备的类型。 |
public String |
secondaryDeviceType 辅助设备类型是可选属性,除了主设备类型之外,还可以由设备提供。 |
public int |
status 设备连接状态 |
Public constructors |
|
|---|---|
WifiP2pDevice() |
|
WifiP2pDevice(WifiP2pDevice source) 复制构造函数 |
|
公共方法(Public methods) |
|
|---|---|
int |
describeContents() 实现Parcelable接口 |
boolean |
equals(Object obj) 指示其他某个对象是否“等于”这一个。 |
boolean |
isGroupOwner() 如果设备是组所有者,则返回true |
boolean |
isServiceDiscoveryCapable() 如果设备能够进行服务发现,则返回true |
String |
toString() 返回对象的字符串表示形式。 |
boolean |
wpsDisplaySupported() 如果支持WPS显示配置,则返回true |
boolean |
wpsKeypadSupported() 如果支持WPS键盘配置,则返回true |
boolean |
wpsPbcSupported() 如果支持WPS按钮配置,则返回true |
void |
writeToParcel(Parcel dest, int flags) 实现Parcelable接口 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
android.os.Parcelable
|
|
String primaryDeviceType
主要设备类型标识设备的类型。 例如,如果应用程序的目的是启用用户的打印操作,则应用程序可以将发现的设备过滤为仅显示打印机。 有关支持的标准设备类型的完整列表,请参阅Wi-Fi Direct技术规范。
String secondaryDeviceType
辅助设备类型是可选属性,除了主设备类型之外,还可以由设备提供。
WifiP2pDevice (WifiP2pDevice source)
复制构造函数
| 参数(Parameters) | |
|---|---|
source |
WifiP2pDevice
|
int describeContents ()
实现Parcelable接口
| 返回(Returns) | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
boolean equals (Object obj)
指示其他某个对象是否“等于”这一个。
equals方法在非空对象引用上实现等价关系:
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. equals类的方法Object实现了对象上最可能的等价关系; 也就是说,对于任何非空参考值x和y ,当且仅当x和y引用同一对象( x == y的值为true )时,此方法返回true 。
请注意,无论何时重写此方法,通常都必须覆盖 hashCode方法,以便维护 hashCode方法的常规协定,该方法声明相等对象必须具有相同的哈希码。
| 参数(Parameters) | |
|---|---|
obj |
Object: the reference object with which to compare. |
| 返回(Returns) | |
|---|---|
boolean |
true if this object is the same as the obj argument; false otherwise. |
boolean isServiceDiscoveryCapable ()
如果设备能够进行服务发现,则返回true
| 返回(Returns) | |
|---|---|
boolean |
|
String toString ()
返回对象的字符串表示形式。 通常, toString方法将返回一个“文本地表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。
类Object的toString方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| 返回(Returns) | |
|---|---|
String |
a string representation of the object. |
boolean wpsDisplaySupported ()
如果支持WPS显示配置,则返回true
| 返回(Returns) | |
|---|---|
boolean |
|
boolean wpsKeypadSupported ()
如果支持WPS键盘配置,则返回true
| 返回(Returns) | |
|---|---|
boolean |
|
boolean wpsPbcSupported ()
如果支持WPS按钮配置,则返回true
| 返回(Returns) | |
|---|---|
boolean |
|
void writeToParcel (Parcel dest, int flags)
实现Parcelable接口
| 参数(Parameters) | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. |
flags |
int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. |