public class WifiNanEventListener extends Object
WifiNanSessionListener
.
During registration specify which specific events are desired using a set of
NanEventListener.LISTEN_*
flags OR'd together. Only those events will
be delivered to the registered listener. Override those callbacks
NanEventListener.on*
for the registered events.
Modifier and Type | Field and Description |
---|---|
IWifiNanEventListener |
callback |
static int |
LISTEN_CONFIG_COMPLETED
Configuration completion callback event registration flag.
|
static int |
LISTEN_CONFIG_FAILED
Configuration failed callback event registration flag.
|
static int |
LISTEN_IDENTITY_CHANGED
NAN identity has changed event registration flag.
|
static int |
LISTEN_NAN_DOWN
NAN cluster is down callback event registration flag.
|
Constructor and Description |
---|
WifiNanEventListener()
Constructs a
WifiNanEventListener using the looper of the current
thread. |
WifiNanEventListener(Looper looper)
Constructs a
WifiNanEventListener using the specified looper. |
Modifier and Type | Method and Description |
---|---|
void |
onConfigCompleted(ConfigRequest completedConfig)
Called when NAN configuration is completed.
|
void |
onConfigFailed(ConfigRequest failedConfig,
int reason)
Called when NAN configuration failed.
|
void |
onIdentityChanged()
Called when NAN identity has changed.
|
void |
onNanDown(int reason)
Called when NAN cluster is down.
|
public static final int LISTEN_CONFIG_COMPLETED
onConfigCompleted(ConfigRequest)
.public static final int LISTEN_CONFIG_FAILED
onConfigFailed(ConfigRequest, int)
.public static final int LISTEN_NAN_DOWN
onNanDown(int)
.public static final int LISTEN_IDENTITY_CHANGED
onIdentityChanged()
.public IWifiNanEventListener callback
public WifiNanEventListener()
WifiNanEventListener
using the looper of the current
thread. I.e. all callbacks will be delivered on the current thread.public WifiNanEventListener(Looper looper)
WifiNanEventListener
using the specified looper. I.e.
all callbacks will delivered on the thread of the specified looper.looper
- The looper on which to execute the callbacks.public void onConfigCompleted(ConfigRequest completedConfig)
LISTEN_CONFIG_COMPLETED
. A
dummy (empty implementation printing out a warning). Make sure to
override if registered.completedConfig
- The actual configuration request which was
completed. Note that it may be different from that requested
by the application. The service combines configuration
requests from all applications.public void onConfigFailed(ConfigRequest failedConfig, int reason)
LISTEN_CONFIG_FAILED
. A dummy
(empty implementation printing out a warning). Make sure to override if
registered.reason
- Failure reason code, see NanSessionListener.FAIL_*
.public void onNanDown(int reason)
LISTEN_NAN_DOWN
. A dummy (empty
implementation printing out a warning). Make sure to override if
registered.reason
- Reason code for event, see NanSessionListener.FAIL_*
.public void onIdentityChanged()
LISTEN_IDENTITY_CHANGED
. A dummy (empty
implementation printing out a warning). Make sure to override if
registered.