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 StringcommandSeparationprotected Charsetencodingprotected Stringinstrumentprotected List<Interceptor>interceptorsprotected StringresponseTerminationprotected intresponseTimeout
-
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 voidconnect()abstract voiddisconnect()StringgetCommandSeparation()abstract StringgetDefaultRequestTermination()Returns the driver-specific default pattern for terminating requests.StringgetName()StringgetResponseTermination()intgetResponseTimeout()voidinit(String name, YConfiguration config)abstract voidreadAvailable(ResponseBuffer buffer, int timeout)abstract voidwrite(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:
IOExceptionTimeoutException
-
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
nullto do no request termination.
-
-