Fields Summary |
---|
private static final String | TAG |
public String | deviceNameThe device name is a user friendly string to identify a Wi-Fi p2p device |
public String | deviceAddressThe device MAC address uniquely identifies a Wi-Fi p2p device |
public String | primaryDeviceTypePrimary device type identifies the type of device. For example, an application
could filter the devices discovered to only display printers if the purpose is to
enable a printing action from the user. See the Wi-Fi Direct technical specification
for the full list of standard device types supported. |
public String | secondaryDeviceTypeSecondary device type is an optional attribute that can be provided by a device in
addition to the primary device type. |
private static final int | WPS_CONFIG_DISPLAY |
private static final int | WPS_CONFIG_PUSHBUTTON |
private static final int | WPS_CONFIG_KEYPAD |
private static final int | DEVICE_CAPAB_SERVICE_DISCOVERY |
private static final int | DEVICE_CAPAB_CLIENT_DISCOVERABILITY |
private static final int | DEVICE_CAPAB_CONCURRENT_OPER |
private static final int | DEVICE_CAPAB_INFRA_MANAGED |
private static final int | DEVICE_CAPAB_DEVICE_LIMIT |
private static final int | DEVICE_CAPAB_INVITATION_PROCEDURE |
private static final int | GROUP_CAPAB_GROUP_OWNER |
private static final int | GROUP_CAPAB_PERSISTENT_GROUP |
private static final int | GROUP_CAPAB_GROUP_LIMIT |
private static final int | GROUP_CAPAB_INTRA_BSS_DIST |
private static final int | GROUP_CAPAB_CROSS_CONN |
private static final int | GROUP_CAPAB_PERSISTENT_RECONN |
private static final int | GROUP_CAPAB_GROUP_FORMATION |
public int | wpsConfigMethodsSupportedWPS config methods supported |
public int | deviceCapabilityDevice capability |
public int | groupCapabilityGroup capability |
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 | statusDevice connection status |
public WifiP2pWfdInfo | wfdInfo |
private static final Pattern | detailedDevicePatternDetailed device string pattern with WFD info
Example:
P2P-DEVICE-FOUND 00:18:6b:de:a3:6e p2p_dev_addr=00:18:6b:de:a3:6e
pri_dev_type=1-0050F204-1 name='DWD-300-DEA36E' config_methods=0x188
dev_capab=0x21 group_capab=0x9 |
private static final Pattern | twoTokenPattern2 token device address pattern
Example:
P2P-DEVICE-LOST p2p_dev_addr=fa:7b:7a:42:02:13
AP-STA-DISCONNECTED 42:fc:89:a8:96:09 |
private static final Pattern | threeTokenPattern3 token device address pattern
Example:
AP-STA-CONNECTED 42:fc:89:a8:96:09 p2p_dev_addr=fa:7b:7a:42:02:13
AP-STA-DISCONNECTED 42:fc:89:a8:96:09 p2p_dev_addr=fa:7b:7a:42:02:13 |
public static final Creator | CREATORImplement the Parcelable interface |
Methods Summary |
---|
public int | describeContents()Implement the Parcelable interface
return 0;
|
public boolean | equals(java.lang.Object obj)
if (this == obj) return true;
if (!(obj instanceof WifiP2pDevice)) return false;
WifiP2pDevice other = (WifiP2pDevice) obj;
if (other == null || other.deviceAddress == null) {
return (deviceAddress == null);
}
return other.deviceAddress.equals(deviceAddress);
|
public boolean | isDeviceLimit()Returns true if the device reaches the limit. {@hide}
return (deviceCapability & DEVICE_CAPAB_DEVICE_LIMIT) != 0;
|
public boolean | isGroupLimit()Returns true if the group reaches the limit. {@hide}
return (groupCapability & GROUP_CAPAB_GROUP_LIMIT) != 0;
|
public boolean | isGroupOwner()Returns true if the device is a group owner
return (groupCapability & GROUP_CAPAB_GROUP_OWNER) != 0;
|
public boolean | isInvitationCapable()Returns true if the device is capable of invitation {@hide}
return (deviceCapability & DEVICE_CAPAB_INVITATION_PROCEDURE) != 0;
|
public boolean | isServiceDiscoveryCapable()Returns true if the device is capable of service discovery
return (deviceCapability & DEVICE_CAPAB_SERVICE_DISCOVERY) != 0;
|
private int | parseHex(java.lang.String hexString)
//supported formats: 0x1abc, 0X1abc, 1abc
int num = 0;
if (hexString.startsWith("0x") || hexString.startsWith("0X")) {
hexString = hexString.substring(2);
}
try {
num = Integer.parseInt(hexString, 16);
} catch(NumberFormatException e) {
Log.e(TAG, "Failed to parse hex string " + hexString);
}
return num;
|
public java.lang.String | toString()
StringBuffer sbuf = new StringBuffer();
sbuf.append("Device: ").append(deviceName);
sbuf.append("\n deviceAddress: ").append(deviceAddress);
sbuf.append("\n primary type: ").append(primaryDeviceType);
sbuf.append("\n secondary type: ").append(secondaryDeviceType);
sbuf.append("\n wps: ").append(wpsConfigMethodsSupported);
sbuf.append("\n grpcapab: ").append(groupCapability);
sbuf.append("\n devcapab: ").append(deviceCapability);
sbuf.append("\n status: ").append(status);
sbuf.append("\n wfdInfo: ").append(wfdInfo);
return sbuf.toString();
|
public void | update(android.net.wifi.p2p.WifiP2pDevice device)Update device details. This will be throw an exception if the device address
does not match.
updateSupplicantDetails(device);
status = device.status;
|
public void | updateSupplicantDetails(android.net.wifi.p2p.WifiP2pDevice device)Updates details obtained from supplicant @hide
if (device == null) {
throw new IllegalArgumentException("device is null");
}
if (device.deviceAddress == null) {
throw new IllegalArgumentException("deviceAddress is null");
}
if (!deviceAddress.equals(device.deviceAddress)) {
throw new IllegalArgumentException("deviceAddress does not match");
}
deviceName = device.deviceName;
primaryDeviceType = device.primaryDeviceType;
secondaryDeviceType = device.secondaryDeviceType;
wpsConfigMethodsSupported = device.wpsConfigMethodsSupported;
deviceCapability = device.deviceCapability;
groupCapability = device.groupCapability;
wfdInfo = device.wfdInfo;
|
public boolean | wpsDisplaySupported()Returns true if WPS display configuration is supported
return (wpsConfigMethodsSupported & WPS_CONFIG_DISPLAY) != 0;
|
public boolean | wpsKeypadSupported()Returns true if WPS keypad configuration is supported
return (wpsConfigMethodsSupported & WPS_CONFIG_KEYPAD) != 0;
|
public boolean | wpsPbcSupported()Returns true if WPS push button configuration is supported
return (wpsConfigMethodsSupported & WPS_CONFIG_PUSHBUTTON) != 0;
|
public void | writeToParcel(android.os.Parcel dest, int flags)Implement the Parcelable interface
dest.writeString(deviceName);
dest.writeString(deviceAddress);
dest.writeString(primaryDeviceType);
dest.writeString(secondaryDeviceType);
dest.writeInt(wpsConfigMethodsSupported);
dest.writeInt(deviceCapability);
dest.writeInt(groupCapability);
dest.writeInt(status);
if (wfdInfo != null) {
dest.writeInt(1);
wfdInfo.writeToParcel(dest, flags);
} else {
dest.writeInt(0);
}
|