public class Arduino extends IrSerial<LocalSerialPortBuffered> implements IRawIrSender, ICapture, IReceive, ICommandLineDevice
| Modifier and Type | Field and Description |
|---|---|
static int |
defaultBaudRate |
static String |
defaultPortName |
static String |
okString |
static String |
timeoutString |
serialPort, verboserepeatMaxdefaultBeginTimeout, defaultCaptureMaxSize, defaultEndTimeout| Constructor and Description |
|---|
Arduino() |
Arduino(String portName) |
Arduino(String portName,
int baudRate) |
Arduino(String portName,
int baudRate,
boolean verbose) |
Arduino(String portName,
int baudRate,
int beginTimeout,
boolean verbose) |
Arduino(String portName,
int beginTimeout,
int captureMaxSize,
int endingTimeout,
boolean verbose) |
Arduino(String portName,
int baudRate,
int beginTimeout,
int captureMaxSize,
int endingTimeout,
boolean verbose) |
| Modifier and Type | Method and Description |
|---|---|
ModulatedIrSequence |
capture()
Listens to the device and returns a sequence.
|
void |
flushInput() |
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)
Reads a line of text.
|
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)
Sends a command (a String) to the instance.
|
void |
setBeginTimeout(int beginTimeout) |
void |
setCaptureMaxSize(int captureMaxSize) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setEndTimeout(int endTimeout) |
void |
setFallbackFrequency(double fallbackFrequency) |
void |
setLineEnding(String lineEnding) |
boolean |
stopCapture()
Signals the capturing device that it should stop capturing.
|
boolean |
stopReceive()
Signals the receiving device that it should stop receiving.
|
void |
waitFor(String goal,
String areUThere,
int delay,
int tries) |
close, getTransmitter, isValid, setBaudRate, setDataSize, setFlowControl, setParity, setPortName, setStopBits, setTimeout, setVerbosityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTransmitterisValid, setTimeout, setVerbositypublic static final String defaultPortName
public static final String okString
public static final String timeoutString
public static final int defaultBaudRate
public Arduino()
throws NoSuchPortException,
PortInUseException,
UnsupportedCommOperationException,
IOException
public Arduino(String portName) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public Arduino(String portName, int baudRate) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public Arduino(String portName, int baudRate, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public Arduino(String portName, int baudRate, int beginTimeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public Arduino(String portName, int beginTimeout, int captureMaxSize, int endingTimeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public Arduino(String portName, int baudRate, int beginTimeout, int captureMaxSize, int endingTimeout, boolean verbose) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException
public static void main(String[] args)
args - the command line argumentspublic 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 void waitFor(String goal, String areUThere, int delay, int tries) throws IOException, HarcHardwareException
IOExceptionHarcHardwareExceptionpublic String getVersion()
IHarcHardwaregetVersion in interface IHarcHardwaregetVersion in class IrSerial<LocalSerialPortBuffered>public void setBeginTimeout(int beginTimeout)
throws IOException
setBeginTimeout in interface IIrReaderIOExceptionpublic void setCaptureMaxSize(int captureMaxSize)
setCaptureMaxSize in interface IIrReaderpublic void setEndTimeout(int endTimeout)
setEndTimeout in interface IIrReaderpublic 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 reset()
public void sendString(String cmd) throws IOException
ICommandLineDevicesendString in interface ICommandLineDevicecmd - Command string to be sent.IOExceptionpublic String readString() throws IOException
ICommandLineDevicereadString in interface ICommandLineDeviceIOExceptionpublic String readString(boolean wait) throws IOException
ICommandLineDevicereadString in interface ICommandLineDevicewait - if true, wait until something arrives, otherwise return null if nothing there.IOExceptionpublic boolean ready()
throws IOException
ICommandLineDeviceready in interface ICommandLineDeviceIOException - If an I/O error occurspublic void setDebug(int debug)
IHarcHardwaresetDebug in interface IHarcHardwarepublic void flushInput()
throws IOException
flushInput in interface ICommandLineDeviceIOExceptionCopyright © 2016. All rights reserved.