public class ConnectionBasedLink extends AbstractListenerLink
| Modifier and Type | Class and Description |
|---|---|
static class |
ConnectionBasedLink.Mode |
| Constructor and Description |
|---|
ConnectionBasedLink(Connection connection,
Protocol protocol) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Connection |
getConnection() |
Protocol |
getProtocol() |
long |
sendCustomMessage(java.lang.String... messages) |
long |
sendKeyPressEvent(char keychar,
int keycode,
int keylocation,
int keymodifiers,
int keymodifiersex) |
long |
sendNoTone(Pin.AnalogPin analogPin) |
long |
sendTone(Tone tone) |
long |
startListening(Pin pin) |
long |
stopListening(Pin pin) |
long |
switchAnalogPin(Pin.AnalogPin analogPin,
int value) |
long |
switchDigitalPin(Pin.DigitalPin digitalPin,
boolean value) |
boolean |
waitForArduinoToBoot(int wait,
java.util.concurrent.TimeUnit timeUnit)
Will wait for the arduino to received the "ready" paket or the arduino to
respond to our messages sent.
|
boolean |
waitForArduinoToBoot(int wait,
java.util.concurrent.TimeUnit timeUnit,
ConnectionBasedLink.Mode mode)
Will wait for the arduino to received the "ready" paket or the arduino to
respond to our messages sent.
|
addConnectionListener, addCustomListener, addListener, addRplyListener, deregisterAllEventListeners, fireConnectionLost, fireCustomReceived, fireReconnected, fireReplyReceived, fireStateChanged, fireStateChanged, hasRplyListeners, removeConnectionListener, removeCustomListener, removeListener, removeRplyListenerpublic ConnectionBasedLink(Connection connection, Protocol protocol)
public Connection getConnection()
public Protocol getProtocol()
public boolean waitForArduinoToBoot(int wait,
java.util.concurrent.TimeUnit timeUnit)
wait - the maximum time to waittimeUnit - the units to waittrue if the arduino did response within the given
time otherwise falsepublic boolean waitForArduinoToBoot(int wait,
java.util.concurrent.TimeUnit timeUnit,
ConnectionBasedLink.Mode mode)
wait - the maximum time to waittimeUnit - the units to waitmode - the messages to be interpreted as "ok"true if the arduino did response within the given
time otherwise falsepublic long startListening(Pin pin) throws java.io.IOException
java.io.IOExceptionpublic long stopListening(Pin pin) throws java.io.IOException
java.io.IOExceptionpublic long switchAnalogPin(Pin.AnalogPin analogPin, int value) throws java.io.IOException
java.io.IOExceptionpublic long switchDigitalPin(Pin.DigitalPin digitalPin, boolean value) throws java.io.IOException
java.io.IOExceptionpublic long sendKeyPressEvent(char keychar,
int keycode,
int keylocation,
int keymodifiers,
int keymodifiersex)
throws java.io.IOException
java.io.IOExceptionpublic long sendTone(Tone tone) throws java.io.IOException
java.io.IOExceptionpublic long sendNoTone(Pin.AnalogPin analogPin) throws java.io.IOException
java.io.IOExceptionpublic long sendCustomMessage(java.lang.String... messages)
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class AbstractListenerLinkjava.io.IOExceptionCopyright © 2018. All rights reserved.