Package org.yamcs.tse
Class SerialPortDriver
- java.lang.Object
-
- org.yamcs.tse.InstrumentDriver
-
- org.yamcs.tse.SerialPortDriver
-
public class SerialPortDriver extends InstrumentDriver
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
Constructors Constructor Description SerialPortDriver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()voiddisconnect()intgetBaudrate()intgetDataBits()StringgetDefaultRequestTermination()Returns the driver-specific default pattern for terminating requests.StringgetParity()StringgetPath()voidinit(String name, YConfiguration config)voidreadAvailable(ResponseBuffer responseBuffer, int timeout)voidwrite(byte[] bytes)-
Methods inherited from class org.yamcs.tse.InstrumentDriver
command, getCommandSeparation, getName, getResponseTermination, getResponseTimeout
-
-
-
-
Method Detail
-
init
public void init(String name, YConfiguration config)
- Overrides:
initin classInstrumentDriver
-
getBaudrate
public int getBaudrate()
-
getDataBits
public int getDataBits()
-
getParity
public String getParity()
-
getPath
public String getPath()
-
connect
public void connect()
- Specified by:
connectin classInstrumentDriver
-
write
public void write(byte[] bytes)
- Specified by:
writein classInstrumentDriver
-
readAvailable
public void readAvailable(ResponseBuffer responseBuffer, int timeout) throws IOException
- Specified by:
readAvailablein classInstrumentDriver- Throws:
IOException
-
disconnect
public void disconnect()
- Specified by:
disconnectin classInstrumentDriver
-
getDefaultRequestTermination
public String getDefaultRequestTermination()
Description copied from class:InstrumentDriverReturns the driver-specific default pattern for terminating requests. This is the termination that gets used if the user does not explicitly configure anything.Return
nullto do no request termination.- Specified by:
getDefaultRequestTerminationin classInstrumentDriver
-
-