Class AmxBeaconListener
java.lang.Object
org.harctoolbox.harchardware.beacon.AmxBeaconListener
This class listens for an AMX beacon and reports its findings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis is called when a new node appears, or a node is removed.static classThis class contains one node discovered by its AMX beacon. -
Constructor Summary
ConstructorsConstructorDescriptionAmxBeaconListener(AmxBeaconListener.Callback callback) AmxBeaconListener(AmxBeaconListener.Callback callback, String key, String value) -
Method Summary
Modifier and TypeMethodDescriptionlonggetAge()Returns the number of microseconds elapsed since the object was created.getNodes()Returns the found nodes.static Collection<AmxBeaconListener.Node>listen(int time) Listen for the amount of time given in the argument, then return then nodes found.static AmxBeaconListener.NodeSearches for a node with the prescribed value of the key.static voidmainly for testing.voidreset()Discard present nodes.voidstart()voidstop()
-
Constructor Details
-
AmxBeaconListener
-
AmxBeaconListener
public AmxBeaconListener() -
AmxBeaconListener
-
-
Method Details
-
listenFor
Searches for a node with the prescribed value of the key.- Parameters:
key- Key to search for, e.g. "-Make".value- Value of the key to search for.timeout- Timeout in microseconds.- Returns:
-
listen
Listen for the amount of time given in the argument, then return then nodes found.- Parameters:
time- Time to listen, in microseconds.- Returns:
-
main
mainly for testing.- Parameters:
args-
-
start
public void start() -
stop
public void stop() -
getNodes
Returns the found nodes.- Returns:
- Collection of nodes.
-
reset
public void reset()Discard present nodes. -
getAge
public long getAge()Returns the number of microseconds elapsed since the object was created.- Returns:
- microseconds
-