# Interface WiFiDirectListener

public interface WiFiDirectListener
Listener for WiFi Direct peer discovery. Methods fire on the EDT.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onDiscoveryError(Throwable error)`
  Fired when discovery itself fails (e.g. WiFi is off).
  `void`
  `onPeersAvailable(WiFiDirectPeer[] peers)`
  Fired whenever the platform reports a new snapshot of the peer list.

- ## Method Details

  - ### onPeersAvailable

    void onPeersAvailable(WiFiDirectPeer[] peers)
    Fired whenever the platform reports a new snapshot of the peer list. The array is sorted by signal strength when the platform supplies it, otherwise by discovery order.

  - ### onDiscoveryError

    void onDiscoveryError(Throwable error)
    Fired when discovery itself fails (e.g. WiFi is off).