Package gda.device.temperature
Class AsynchronousReaderWriter
java.lang.Object
gda.device.temperature.AsynchronousReaderWriter
Class to communicate asynchronously with a Serial device FIXME is this temperature device specific or should there be
a general class shared by all serial devices ?
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleCommand(String command) Handles commands which do not need a reply.voidlock()Locks use of this for current threadsendCommandAndGetReply(String command) Sends a command to the hardware and reads back a data reply.voidsetCommandEndString(String commandEndString) Set the string termination for a commandvoidsetReplyChecker(ReplyChecker replyChecker) Set the reply checkervoidsetReplyEndString(String replyEndString) Set the reply string terminationvoidunLock()Releases this so that other threads can access it
-
Constructor Details
-
AsynchronousReaderWriter
Create the reader/writer.- Parameters:
device- the serial communication device.
-
-
Method Details
-
setReplyEndString
Set the reply string termination- Parameters:
replyEndString- temination of reply
-
setCommandEndString
Set the string termination for a command- Parameters:
commandEndString- termination of command
-
setReplyChecker
Set the reply checker- Parameters:
replyChecker-
-
handleCommand
Handles commands which do not need a reply.- Parameters:
command- the command to send
-
lock
public void lock()Locks use of this for current thread- See Also:
-
sendCommandAndGetReply
Sends a command to the hardware and reads back a data reply.- Parameters:
command- the command sent to the hardware- Returns:
- the reply
- Throws:
DeviceException
-
unLock
public void unLock()Releases this so that other threads can access it- See Also:
-