Package org.yamcs.tse
Class InstrumentDriver
- java.lang.Object
-
- org.yamcs.tse.InstrumentDriver
-
- Direct Known Subclasses:
SerialPortDriver
,TcpIpDriver
public abstract class InstrumentDriver extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected String
commandSeparation
protected Charset
encoding
protected String
instrument
protected List<Interceptor>
interceptors
protected String
responseTermination
protected int
responseTimeout
-
Constructor Summary
Constructors Constructor Description InstrumentDriver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<String>
command(String command, TseCommand metadata, boolean expectResponse)
abstract void
connect()
abstract void
disconnect()
String
getCommandSeparation()
abstract String
getDefaultRequestTermination()
Returns the driver-specific default pattern for terminating requests.String
getName()
String
getResponseTermination()
int
getResponseTimeout()
void
init(String name, YConfiguration config)
abstract void
readAvailable(ResponseBuffer buffer, int timeout)
abstract void
write(byte[] cmd)
-
-
-
Method Detail
-
init
public void init(String name, YConfiguration config)
-
getName
public String getName()
-
getCommandSeparation
public String getCommandSeparation()
-
getResponseTermination
public String getResponseTermination()
-
getResponseTimeout
public int getResponseTimeout()
-
command
public List<String> command(String command, TseCommand metadata, boolean expectResponse) throws IOException, TimeoutException
- Throws:
IOException
TimeoutException
-
connect
public abstract void connect() throws IOException
- Throws:
IOException
-
disconnect
public abstract void disconnect() throws IOException
- Throws:
IOException
-
write
public abstract void write(byte[] cmd) throws IOException
- Throws:
IOException
-
readAvailable
public abstract void readAvailable(ResponseBuffer buffer, int timeout) throws IOException
- Throws:
IOException
-
getDefaultRequestTermination
public abstract String getDefaultRequestTermination()
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.
-
-