public class AmxBeaconListener extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
AmxBeaconListener.Callback
This is called when a new node appears, or a node is removed.
|
static class |
AmxBeaconListener.Node
This class contains one node discovered by its AMX beacon.
|
Constructor and Description |
---|
AmxBeaconListener() |
AmxBeaconListener(AmxBeaconListener.Callback callback) |
AmxBeaconListener(AmxBeaconListener.Callback callback,
String key,
String value) |
AmxBeaconListener(AmxBeaconListener.Callback callback,
String key,
String value,
boolean debug) |
Modifier and Type | Method and Description |
---|---|
long |
getAge()
Returns the number of microseconds elapsed since the object was created.
|
Collection<AmxBeaconListener.Node> |
getNodes()
Returns the found nodes.
|
static Collection<AmxBeaconListener.Node> |
listen(int time,
boolean debug)
Listen for the amount of time given in the argument, then return then nodes found.
|
static AmxBeaconListener.Node |
listenFor(String key,
String value,
int timeout)
Searches for a node with the prescribed value of the key.
|
static void |
main(String[] args)
mainly for testing.
|
void |
reset()
Discard present nodes.
|
void |
setDebug(boolean dbg) |
void |
start() |
void |
stop() |
public AmxBeaconListener(AmxBeaconListener.Callback callback, String key, String value, boolean debug)
public AmxBeaconListener(AmxBeaconListener.Callback callback, String key, String value)
public AmxBeaconListener()
public AmxBeaconListener(AmxBeaconListener.Callback callback)
public static AmxBeaconListener.Node listenFor(String key, String value, int timeout)
key
- Key to search for, e.g. "-Make".value
- Value of the key to search for.timeout
- Timeout in microseconds.public static Collection<AmxBeaconListener.Node> listen(int time, boolean debug)
time
- Time to listen, in microseconds.debug
- public static void main(String[] args)
args
- public void setDebug(boolean dbg)
dbg
- the debug to setpublic void start()
public void stop()
public Collection<AmxBeaconListener.Node> getNodes()
public void reset()
public long getAge()
Copyright © 2016. All rights reserved.