public class Arduino extends IrSerial<LocalSerialPortBuffered> implements IRawIrSender, ICapture, IReceive, IStringCommand
Modifier and Type | Field and Description |
---|---|
static int |
defaultBaudRate |
static String |
defaultPortName |
static String |
okString |
debug, serialPort, verbose
repeatMax
Constructor and Description |
---|
Arduino() |
Arduino(String portName) |
Arduino(String portName,
int baudRate,
boolean verbose) |
Arduino(String portName,
int baudRate,
int beginTimeout,
boolean verbose) |
Arduino(String portName,
int beginTimeout,
int middleTimeout,
int endingTimeout,
boolean verbose) |
Arduino(String portName,
int baudRate,
int beginTimeout,
int middleTimeout,
int endingTimeout,
boolean verbose) |
Modifier and Type | Method and Description |
---|---|
ModulatedIrSequence |
capture()
Listens to the device and returns a sequence.
|
String |
getVersion()
Returns the hardware version (not the version of the driver software).
|
static void |
main(String[] args) |
void |
open()
Opens the device with previously set parameters.
|
String |
readString()
Reads a line of text.
|
String |
readString(boolean wait) |
boolean |
ready()
Tells whether this stream is ready to be read.
|
IrSequence |
receive()
Listens to the device and returns a sequence.
|
void |
reset() |
boolean |
sendIr(IrSignal irSignal,
int count,
Transmitter transmitter) |
void |
sendString(String cmd) |
void |
setFallbackFrequency(double fallbackFrequency) |
void |
setLineEnding(String lineEnding) |
void |
setTimeout(int beginTimeout,
int middleTimeout,
int endingTimeout) |
boolean |
stopCapture()
Signals the capturing device that it should stop capturing.
|
boolean |
stopReceive()
Signals the receiving device that it should stop receiving.
|
close, getTransmitter, isValid, setBaudRate, setDataSize, setDebug, setFlowControl, setParity, setPortName, setStopBits, setTimeout, setVerbosity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTransmitter
setTimeout
isValid, setDebug, setVerbosity
public static final String defaultPortName
public static final String okString
public static final int defaultBaudRate
public Arduino() throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
IOException
public Arduino(String portName) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
IOException
public Arduino(String portName, int baudRate, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
IOException
public Arduino(String portName, int baudRate, int beginTimeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
IOException
public Arduino(String portName, int beginTimeout, int middleTimeout, int endingTimeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
IOException
public Arduino(String portName, int baudRate, int beginTimeout, int middleTimeout, int endingTimeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
IOException
public void setLineEnding(String lineEnding)
lineEnding
- the lineEnding to setpublic void setFallbackFrequency(double fallbackFrequency)
fallbackFrequency
- the fallbackFrequency to setpublic boolean sendIr(IrSignal irSignal, int count, Transmitter transmitter) throws NoSuchTransmitterException, IrpMasterException, IOException
sendIr
in interface IRawIrSender
NoSuchTransmitterException
IrpMasterException
IOException
public void open() throws IOException, HarcHardwareException
IHarcHardware
open
in interface IHarcHardware
open
in class IrSerial<LocalSerialPortBuffered>
IOException
HarcHardwareException
public String getVersion()
IHarcHardware
getVersion
in interface IHarcHardware
getVersion
in class IrSerial<LocalSerialPortBuffered>
public ModulatedIrSequence capture() throws IOException, HarcHardwareException
ICapture
capture
in interface ICapture
IOException
HarcHardwareException
- if the device is not in valid/open state.public boolean stopCapture()
ICapture
stopCapture
in interface ICapture
public IrSequence receive() throws HarcHardwareException, IOException, IrpMasterException
IReceive
receive
in interface IReceive
HarcHardwareException
- if the device is not in valid/open state.IOException
IrpMasterException
public boolean stopReceive()
IReceive
stopReceive
in interface IReceive
public void setTimeout(int beginTimeout, int middleTimeout, int endingTimeout) throws IOException
setTimeout
in interface ICapture
IOException
public void reset()
public static void main(String[] args)
args
- the command line argumentspublic void sendString(String cmd) throws IOException
sendString
in interface IStringCommand
IOException
public String readString() throws IOException
IStringCommand
readString
in interface IStringCommand
IOException
public String readString(boolean wait) throws IOException
IOException
public boolean ready() throws IOException
IStringCommand
ready
in interface IStringCommand
IOException
- If an I/O error occursCopyright © 2015. All rights reserved.