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, verboserepeatMax| 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, setVerbosityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTransmittersetTimeoutisValid, setDebug, setVerbositypublic 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.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic Arduino(String portName) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic Arduino(String portName, int baudRate, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic Arduino(String portName, int baudRate, int beginTimeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic Arduino(String portName, int beginTimeout, int middleTimeout, int endingTimeout, boolean verbose) throws gnu.io.NoSuchPortException, gnu.io.PortInUseException, gnu.io.UnsupportedCommOperationException, IOException
gnu.io.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic 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.NoSuchPortExceptiongnu.io.PortInUseExceptiongnu.io.UnsupportedCommOperationExceptionIOExceptionpublic 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 IRawIrSenderNoSuchTransmitterExceptionIrpMasterExceptionIOExceptionpublic void open()
throws IOException,
HarcHardwareException
IHarcHardwareopen in interface IHarcHardwareopen in class IrSerial<LocalSerialPortBuffered>IOExceptionHarcHardwareExceptionpublic String getVersion()
IHarcHardwaregetVersion in interface IHarcHardwaregetVersion in class IrSerial<LocalSerialPortBuffered>public ModulatedIrSequence capture() throws IOException, HarcHardwareException
ICapturecapture in interface ICaptureIOExceptionHarcHardwareException - if the device is not in valid/open state.public boolean stopCapture()
ICapturestopCapture in interface ICapturepublic IrSequence receive() throws HarcHardwareException, IOException, IrpMasterException
IReceivereceive in interface IReceiveHarcHardwareException - if the device is not in valid/open state.IOExceptionIrpMasterExceptionpublic boolean stopReceive()
IReceivestopReceive in interface IReceivepublic void setTimeout(int beginTimeout,
int middleTimeout,
int endingTimeout)
throws IOException
setTimeout in interface ICaptureIOExceptionpublic void reset()
public static void main(String[] args)
args - the command line argumentspublic void sendString(String cmd) throws IOException
sendString in interface IStringCommandIOExceptionpublic String readString() throws IOException
IStringCommandreadString in interface IStringCommandIOExceptionpublic String readString(boolean wait) throws IOException
IOExceptionpublic boolean ready()
throws IOException
IStringCommandready in interface IStringCommandIOException - If an I/O error occursCopyright © 2015. All rights reserved.