public class ConnectionBasedLink extends AbstractListenerLink
v2.1.1 Gordio - SERVICE PACK 1
project Ardulink http://www.ardulink.org/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, removeRplyListener
public 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 false
public 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 false
public long startListening(Pin pin) throws java.io.IOException
java.io.IOException
public long stopListening(Pin pin) throws java.io.IOException
java.io.IOException
public long switchAnalogPin(Pin.AnalogPin analogPin, int value) throws java.io.IOException
java.io.IOException
public long switchDigitalPin(Pin.DigitalPin digitalPin, boolean value) throws java.io.IOException
java.io.IOException
public long sendKeyPressEvent(char keychar, int keycode, int keylocation, int keymodifiers, int keymodifiersex) throws java.io.IOException
java.io.IOException
public long sendTone(Tone tone) throws java.io.IOException
java.io.IOException
public long sendNoTone(Pin.AnalogPin analogPin) throws java.io.IOException
java.io.IOException
public long sendCustomMessage(java.lang.String... messages) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class AbstractListenerLink
java.io.IOException
Copyright © 2019. All rights reserved.