Package org.yamcs.tse
Class SerialPortDriver
java.lang.Object
org.yamcs.tse.InstrumentDriver
org.yamcs.tse.SerialPortDriver
Connect and command a device over a serial port.
Not thread safe.
-
Field Summary
Fields inherited from class org.yamcs.tse.InstrumentDriver
commandSeparation, encoding, instrument, interceptors, responseTermination, responseTimeout
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
connect()
void
int
int
Returns the driver-specific default pattern for terminating requests.getPath()
void
init
(String name, YConfiguration config) boolean
Returns whether this driver may require reassembly of multiple received fragments in order to obtain a full response.void
readAvailable
(ResponseBuffer responseBuffer, int timeout) void
write
(byte[] bytes) Methods inherited from class org.yamcs.tse.InstrumentDriver
command, getCommandSeparation, getName, getResponseTermination, getResponseTimeout
-
Constructor Details
-
SerialPortDriver
public SerialPortDriver()
-
-
Method Details
-
init
- Overrides:
init
in classInstrumentDriver
-
getBaudrate
public int getBaudrate() -
getDataBits
public int getDataBits() -
getParity
-
getPath
-
connect
public void connect()- Specified by:
connect
in classInstrumentDriver
-
write
public void write(byte[] bytes) - Specified by:
write
in classInstrumentDriver
-
readAvailable
- Specified by:
readAvailable
in classInstrumentDriver
- Throws:
IOException
-
disconnect
public void disconnect()- Specified by:
disconnect
in classInstrumentDriver
-
getDefaultRequestTermination
Description copied from class:InstrumentDriver
Returns the driver-specific default pattern for terminating requests. This is the termination that gets used if the user does not explicitly configure anything.Return
null
to do no request termination.- Specified by:
getDefaultRequestTermination
in classInstrumentDriver
-
isFragmented
public boolean isFragmented()Description copied from class:InstrumentDriver
Returns whether this driver may require reassembly of multiple received fragments in order to obtain a full response.Setting this to false, will allow to have a quick response, even if there is no response termination characters. That is, without needing to wait on timeouts.
- Specified by:
isFragmented
in classInstrumentDriver
-