onDiscovery method

void onDiscovery (
  1. Device newDevice,
  2. Iterable<Device> allDevices
)

This method is called when a new device is discovered using the internal discovery mechanism. The message sent here is a PING - PONG request reply. The latest discovered device is provided as newDevice. For convenience, all discovered devices using the internal discovery mechanism are sent to this method as allDevices. This method would not be recalled if a device disconnect and reconnects. For active connection and disconnections events, use ConnectionListener.onConnected and ConnectionListener.onDisconnected respectively.

Implementation

void onDiscovery(Device newDevice, Iterable<Device> allDevices);