WifiP2pWfdInfo

public final class WifiP2pWfdInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.net.wifi.p2p.WifiP2pWfdInfo


A class representing Wifi Display information for a device. See Wifi Display technical specification v1.0.0, section 5.1.2. See Wifi Display technical specification v2.0.0, section 5.1.12 for Wifi Display R2.

Summary

Constants

int DEVICE_INFO_AUDIO_ONLY_SUPPORT_AT_SOURCE

Bit field for getDeviceInfo(), indicate audo is only supported at source.

int DEVICE_INFO_AUDIO_UNSUPPORTED_AT_PRIMARY_SINK

Bit field for getDeviceInfo(), indicate audio is not supported at primary sink.

int DEVICE_INFO_CONTENT_PROTECTION_SUPPORT

Bit field for getDeviceInfo(), indicate the support of Content Protection using the HDCP system 2.0/2.1.

int DEVICE_INFO_COUPLED_SINK_SUPPORT_AT_SINK

Bit field for getDeviceInfo(), indicates that coupled sink is supporeted at sink.

int DEVICE_INFO_COUPLED_SINK_SUPPORT_AT_SOURCE

Bit field for getDeviceInfo(), indicates that coupled sink is supported at source.

int DEVICE_INFO_DEVICE_TYPE_MASK

getDeviceInfo() & DEVICE_INFO_DEVICE_TYPE_MASK is one of DEVICE_TYPE_WFD_SOURCE, DEVICE_TYPE_PRIMARY_SINK, DEVICE_TYPE_SECONDARY_SINK or DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK.

int DEVICE_INFO_PREFERRED_CONNECTIVITY_MASK

Bit field for getDeviceInfo(), indicate the preferred connectifity for Wifi Display.

int DEVICE_INFO_SESSION_AVAILABLE_MASK

Bit field for getDeviceInfo(), indicates that Wifi Display session is available.

int DEVICE_INFO_TDLS_PERSISTENT_GROUP

Bit field for getDeviceInfo(), indicate that TDLS persistent group is intended.

int DEVICE_INFO_TDLS_PERSISTENT_GROUP_REINVOKE

Bit field for getDeviceInfo(), indicate that the request is for re-invocation of TDLS persistent group.

int DEVICE_INFO_TIME_SYNCHRONIZATION_SUPPORT

Bit field for getDeviceInfo(), indicate time synchronization using 802.1AS is supported.

int DEVICE_INFO_WFD_SERVICE_DISCOVERY_SUPPORT

Bit field for getDeviceInfo(), indicates that Wifi Display discovery is supported.

int DEVICE_TYPE_PRIMARY_SINK

The device is a primary sink.

int DEVICE_TYPE_SECONDARY_SINK

The device is a secondary sink.

int DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK

The device is dual-role capable i.e.

int DEVICE_TYPE_WFD_SOURCE

The device is a Wifi Display Source.

int PREFERRED_CONNECTIVITY_P2P

Wifi Display (WFD) preferred connectivity is Wifi Direct (P2P).

int PREFERRED_CONNECTIVITY_TDLS

Wifi Display (WFD) preferred connectivity is TDLS.

Inherited constants

Fields

public static final Creator<WifiP2pWfdInfo> CREATOR

Implement the Parcelable interface

Public constructors

WifiP2pWfdInfo()

Default constructor.

WifiP2pWfdInfo(WifiP2pWfdInfo source)

Copy constructor.

Public methods

int describeContents()

Implement the Parcelable interface

int getControlPort()

Returns the TCP port at which the WFD Device listens for RTSP messages.

int getDeviceInfo()

Return R1 raw device info, See Wifi Display technical specification v1.0.0, section 5.1.2.

int getDeviceType()

Get the type of the device.

int getMaxThroughput()

Returns the maximum average throughput capability of the WFD Device, in megabits/second.

int getR2DeviceInfo()

Return R2 raw device info, See Wifi Display technical specification v2.0.0, section 5.1.12.

int getR2DeviceType()

Get the type of the R2 device.

boolean isContentProtectionSupported()
boolean isCoupledSinkSupportedAtSink()

Returns true if Coupled Sink is supported by WFD Sink.

boolean isCoupledSinkSupportedAtSource()

Returns true if Coupled Sink is supported by WFD Source.

boolean isEnabled()

Returns true is Wifi Display is enabled, false otherwise.

boolean isR2Supported()

Returns true is Wifi Display R2 is enabled, false otherwise.

boolean isSessionAvailable()

Returns true if a session is available, false otherwise.

void setContentProtectionSupported(boolean enabled)

Sets whether Content Protection using the HDCP system 2.0/2.1 is supported.

void setControlPort(int port)

Sets the TCP port at which the WFD Device listens for RTSP messages.

void setCoupledSinkSupportAtSink(boolean enabled)

Sets whether Coupled Sink feature is supported by WFD Sink.

void setCoupledSinkSupportAtSource(boolean enabled)

Sets whether Coupled Sink feature is supported by WFD Source.

boolean setDeviceType(int deviceType)

Sets the type of the device.

void setEnabled(boolean enabled)

Sets whether Wifi Display should be enabled.

void setMaxThroughput(int maxThroughput)

Sets the maximum average throughput capability of the WFD Device, in megabits/second.

boolean setR2DeviceType(int deviceType)

Sets the type of the Wifi Display R2 device.

void setSessionAvailable(boolean enabled)

Sets whether a session is available.

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int flags)

Implement the Parcelable interface

Inherited methods

Constants

DEVICE_INFO_AUDIO_ONLY_SUPPORT_AT_SOURCE

Added in API level 31
public static final int DEVICE_INFO_AUDIO_ONLY_SUPPORT_AT_SOURCE

Bit field for getDeviceInfo(), indicate audo is only supported at source. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 2048 (0x00000800)

DEVICE_INFO_AUDIO_UNSUPPORTED_AT_PRIMARY_SINK

Added in API level 31
public static final int DEVICE_INFO_AUDIO_UNSUPPORTED_AT_PRIMARY_SINK

Bit field for getDeviceInfo(), indicate audio is not supported at primary sink. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 1024 (0x00000400)

DEVICE_INFO_CONTENT_PROTECTION_SUPPORT

Added in API level 31
public static final int DEVICE_INFO_CONTENT_PROTECTION_SUPPORT

Bit field for getDeviceInfo(), indicate the support of Content Protection using the HDCP system 2.0/2.1. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 256 (0x00000100)

DEVICE_INFO_COUPLED_SINK_SUPPORT_AT_SINK

Added in API level 31
public static final int DEVICE_INFO_COUPLED_SINK_SUPPORT_AT_SINK

Bit field for getDeviceInfo(), indicates that coupled sink is supporeted at sink. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 8 (0x00000008)

DEVICE_INFO_COUPLED_SINK_SUPPORT_AT_SOURCE

Added in API level 31
public static final int DEVICE_INFO_COUPLED_SINK_SUPPORT_AT_SOURCE

Bit field for getDeviceInfo(), indicates that coupled sink is supported at source. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 4 (0x00000004)

DEVICE_INFO_DEVICE_TYPE_MASK

Added in API level 31
public static final int DEVICE_INFO_DEVICE_TYPE_MASK

getDeviceInfo() & DEVICE_INFO_DEVICE_TYPE_MASK is one of DEVICE_TYPE_WFD_SOURCE, DEVICE_TYPE_PRIMARY_SINK, DEVICE_TYPE_SECONDARY_SINK or DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK. The bit definition is listed in 5.1.2 WFD Device Information Subelement and 5.1.12 WFD R2 Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 3 (0x00000003)

DEVICE_INFO_PREFERRED_CONNECTIVITY_MASK

Added in API level 31
public static final int DEVICE_INFO_PREFERRED_CONNECTIVITY_MASK

Bit field for getDeviceInfo(), indicate the preferred connectifity for Wifi Display. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification. The value is one of PREFERRED_CONNECTIVITY_P2P or PREFERRED_CONNECTIVITY_TDLS.

Constant Value: 128 (0x00000080)

DEVICE_INFO_SESSION_AVAILABLE_MASK

Added in API level 31
public static final int DEVICE_INFO_SESSION_AVAILABLE_MASK

Bit field for getDeviceInfo(), indicates that Wifi Display session is available. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 48 (0x00000030)

DEVICE_INFO_TDLS_PERSISTENT_GROUP

Added in API level 31
public static final int DEVICE_INFO_TDLS_PERSISTENT_GROUP

Bit field for getDeviceInfo(), indicate that TDLS persistent group is intended. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 4096 (0x00001000)

DEVICE_INFO_TDLS_PERSISTENT_GROUP_REINVOKE

Added in API level 31
public static final int DEVICE_INFO_TDLS_PERSISTENT_GROUP_REINVOKE

Bit field for getDeviceInfo(), indicate that the request is for re-invocation of TDLS persistent group. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 8192 (0x00002000)

DEVICE_INFO_TIME_SYNCHRONIZATION_SUPPORT

Added in API level 31
public static final int DEVICE_INFO_TIME_SYNCHRONIZATION_SUPPORT

Bit field for getDeviceInfo(), indicate time synchronization using 802.1AS is supported. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 512 (0x00000200)

DEVICE_INFO_WFD_SERVICE_DISCOVERY_SUPPORT

Added in API level 31
public static final int DEVICE_INFO_WFD_SERVICE_DISCOVERY_SUPPORT

Bit field for getDeviceInfo(), indicates that Wifi Display discovery is supported. The bit definition is listed in 5.1.2 WFD Device Information Subelement in Wifi Display Technical Specification.

Constant Value: 64 (0x00000040)

DEVICE_TYPE_PRIMARY_SINK

Added in API level 30
public static final int DEVICE_TYPE_PRIMARY_SINK

The device is a primary sink.

Constant Value: 1 (0x00000001)

DEVICE_TYPE_SECONDARY_SINK

Added in API level 30
public static final int DEVICE_TYPE_SECONDARY_SINK

The device is a secondary sink. This type is only supported by R1.

Constant Value: 2 (0x00000002)

DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK

Added in API level 30
public static final int DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK

The device is dual-role capable i.e. either a WFD source or a primary sink.

Constant Value: 3 (0x00000003)

DEVICE_TYPE_WFD_SOURCE

Added in API level 30
public static final int DEVICE_TYPE_WFD_SOURCE

The device is a Wifi Display Source.

Constant Value: 0 (0x00000000)

PREFERRED_CONNECTIVITY_P2P

Added in API level 31
public static final int PREFERRED_CONNECTIVITY_P2P

Wifi Display (WFD) preferred connectivity is Wifi Direct (P2P).

Constant Value: 0 (0x00000000)

PREFERRED_CONNECTIVITY_TDLS

Added in API level 31
public static final int PREFERRED_CONNECTIVITY_TDLS

Wifi Display (WFD) preferred connectivity is TDLS.

Constant Value: 1 (0x00000001)

Fields

CREATOR

Added in API level 30
public static final Creator<WifiP2pWfdInfo> CREATOR

Implement the Parcelable interface

Public constructors

WifiP2pWfdInfo

Added in API level 30
public WifiP2pWfdInfo ()

Default constructor.

WifiP2pWfdInfo

Added in API level 30
public WifiP2pWfdInfo (WifiP2pWfdInfo source)

Copy constructor.

Parameters
source WifiP2pWfdInfo: This value may be null.

Public methods

describeContents

Added in API level 30
public int describeContents ()

Implement the Parcelable interface

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getControlPort

Added in API level 30
public int getControlPort ()

Returns the TCP port at which the WFD Device listens for RTSP messages.

Returns
int

getMaxThroughput

Added in API level 30
public int getMaxThroughput ()

Returns the maximum average throughput capability of the WFD Device, in megabits/second.

Returns
int

getR2DeviceInfo

Added in API level 31
public int getR2DeviceInfo ()

Return R2 raw device info, See Wifi Display technical specification v2.0.0, section 5.1.12. Access bit fields by DEVICE_INFO_DEVICE_TYPE_MASK.

Returns
int Value is either 0 or DEVICE_INFO_DEVICE_TYPE_MASK

getR2DeviceType

Added in API level 31
public int getR2DeviceType ()

Get the type of the R2 device. One of DEVICE_TYPE_WFD_SOURCE, DEVICE_TYPE_PRIMARY_SINK, or DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK

Returns
int Value is DEVICE_TYPE_WFD_SOURCE, DEVICE_TYPE_PRIMARY_SINK, DEVICE_TYPE_SECONDARY_SINK, or DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK

isContentProtectionSupported

Added in API level 30
public boolean isContentProtectionSupported ()

Returns
boolean true if Content Protection using the HDCP system 2.0/2.1 is supported.

isCoupledSinkSupportedAtSink

Added in API level 31
public boolean isCoupledSinkSupportedAtSink ()

Returns true if Coupled Sink is supported by WFD Sink. See Wifi Display technical specification v1.0.0, section 4.9.

Returns
boolean

isCoupledSinkSupportedAtSource

Added in API level 31
public boolean isCoupledSinkSupportedAtSource ()

Returns true if Coupled Sink is supported by WFD Source. See Wifi Display technical specification v1.0.0, section 4.9.

Returns
boolean

isEnabled

Added in API level 30
public boolean isEnabled ()

Returns true is Wifi Display is enabled, false otherwise.

Returns
boolean

isR2Supported

Added in API level 31
public boolean isR2Supported ()

Returns true is Wifi Display R2 is enabled, false otherwise.

Returns
boolean

isSessionAvailable

Added in API level 30
public boolean isSessionAvailable ()

Returns true if a session is available, false otherwise.

Returns
boolean

setContentProtectionSupported

Added in API level 30
public void setContentProtectionSupported (boolean enabled)

Sets whether Content Protection using the HDCP system 2.0/2.1 is supported.

Parameters
enabled boolean: true to indicate that Content Protection is supported, false otherwise.

setControlPort

Added in API level 30
public void setControlPort (int port)

Sets the TCP port at which the WFD Device listens for RTSP messages.

Parameters
port int: Value is 0 or greater

setCoupledSinkSupportAtSink

Added in API level 31
public void setCoupledSinkSupportAtSink (boolean enabled)

Sets whether Coupled Sink feature is supported by WFD Sink. See Wifi Display technical specification v1.0.0, section 4.9.

Parameters
enabled boolean: true to indicate support for coupled sink, false otherwise.

setCoupledSinkSupportAtSource

Added in API level 31
public void setCoupledSinkSupportAtSource (boolean enabled)

Sets whether Coupled Sink feature is supported by WFD Source. See Wifi Display technical specification v1.0.0, section 4.9.

Parameters
enabled boolean: true to indicate support for coupled sink, false otherwise.

setDeviceType

Added in API level 30
public boolean setDeviceType (int deviceType)

Sets the type of the device.

Parameters
deviceType int: One of DEVICE_TYPE_WFD_SOURCE, DEVICE_TYPE_PRIMARY_SINK, DEVICE_TYPE_SECONDARY_SINK, DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK Value is DEVICE_TYPE_WFD_SOURCE, DEVICE_TYPE_PRIMARY_SINK, DEVICE_TYPE_SECONDARY_SINK, or DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK

Returns
boolean true if the device type was successfully set, false otherwise

setEnabled

Added in API level 30
public void setEnabled (boolean enabled)

Sets whether Wifi Display should be enabled.

Parameters
enabled boolean: true to enable Wifi Display, false to disable

setMaxThroughput

Added in API level 30
public void setMaxThroughput (int maxThroughput)

Sets the maximum average throughput capability of the WFD Device, in megabits/second.

Parameters
maxThroughput int: Value is 0 or greater

setR2DeviceType

Added in API level 31
public boolean setR2DeviceType (int deviceType)

Sets the type of the Wifi Display R2 device. See Wifi Display technical specification v2.0.0, section 5.1.12 for Wifi Display R2. Before calling this API, call {@link WifiManager#isWifiDisplayR2Supported() to know whether Wifi Display R2 is supported or not. If R2 info was filled without Wifi Display R2 support, {@link WifiP2pManager#setWfdInfo(Channel, WifiP2pWfdInfo, ActionListener) would fail.}

Parameters
deviceType int: One of DEVICE_TYPE_WFD_SOURCE, DEVICE_TYPE_PRIMARY_SINK, DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK

Returns
boolean true if the device type was successfully set, false otherwise

setSessionAvailable

Added in API level 30
public void setSessionAvailable (boolean enabled)

Sets whether a session is available.

Parameters
enabled boolean: true to indicate that a session is available, false otherwise.

toString

Added in API level 30
public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.

writeToParcel

Added in API level 30
public void writeToParcel (Parcel dest, 
                int flags)

Implement the Parcelable interface

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES