public class BufferedExecutor extends Object implements ICommandLineDevice
| Constructor and Description |
|---|
BufferedExecutor(ICommandExecutor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flushInput() |
String |
getVersion()
Returns the hardware version (not the version of the driver software).
|
boolean |
isValid()
Tries to identify instances that are not valid.
|
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.
|
void |
sendString(String cmd)
Sends a command (a String) to the instance.
|
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setTimeout(int timeout)
Set timeout in milliseconds.
|
void |
setVerbose(boolean verbose)
Sets a verbosity flag, causing commands to be executed verbosely.
|
public BufferedExecutor(ICommandExecutor executor)
public void sendString(String cmd) throws IOException, HarcHardwareException
ICommandLineDevicesendString in interface ICommandLineDevicecmd - Command string to be sent.IOExceptionHarcHardwareExceptionpublic 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 flushInput()
throws IOException
flushInput in interface ICommandLineDeviceIOExceptionpublic String getVersion() throws IOException
IHarcHardwaregetVersion in interface IHarcHardwareIOExceptionpublic void setVerbose(boolean verbose)
IHarcHardwaresetVerbose in interface IHarcHardwareverbose - on or offpublic void setDebug(int debug)
IHarcHardwaresetDebug in interface IHarcHardwarepublic void setTimeout(int timeout)
throws IOException
IHarcHardwaresetTimeout in interface IHarcHardwaretimeout - Timeout in milliseconds.IOExceptionpublic boolean isValid()
IHarcHardwareisValid in interface IHarcHardwarepublic void open()
throws HarcHardwareException,
IOException
IHarcHardwareopen in interface IHarcHardwareHarcHardwareExceptionIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2020. All rights reserved.