public final class WiFiDirectPeer

  1. Object
  2. WiFiDirectPeer
One peer discovered by WiFiDirect.startDiscovery(...). Immutable.

Fields

public static final int STATE_AVAILABLE = 0Discovery state: peer has not been contacted.
public static final int STATE_INVITED = 1Discovery state: pairing in progress.
public static final int STATE_CONNECTED = 2Discovery state: pairing established.
public static final int STATE_FAILED = 3Discovery state: peer transitioned out of range or refused pairing.
public static final int STATE_UNAVAILABLE = 4Discovery state: peer no longer responding to discovery probes.

Constructors

public WiFiDirectPeer(String deviceName, String deviceAddress, int state)

Methods

public String getDeviceName()User-visible device name (e.g. “Pixel 9”).
public String getDeviceAddress()Stable peer identifier (MAC address on Android).
public int getState()One of the STATE_* constants.

Inherited methods

Field details

STATE_AVAILABLE

public static final int STATE_AVAILABLE = 0
Discovery state: peer has not been contacted.

STATE_INVITED

public static final int STATE_INVITED = 1
Discovery state: pairing in progress.

STATE_CONNECTED

public static final int STATE_CONNECTED = 2
Discovery state: pairing established.

STATE_FAILED

public static final int STATE_FAILED = 3
Discovery state: peer transitioned out of range or refused pairing.

STATE_UNAVAILABLE

public static final int STATE_UNAVAILABLE = 4
Discovery state: peer no longer responding to discovery probes.

Constructor details

WiFiDirectPeer

public WiFiDirectPeer(String deviceName, String deviceAddress, int state)

Method details

getDeviceName

public String getDeviceName()
User-visible device name (e.g. “Pixel 9”).

getDeviceAddress

public String getDeviceAddress()
Stable peer identifier (MAC address on Android).

getState

public int getState()
One of the STATE_* constants.