Class AsynchronousReaderWriter

java.lang.Object
gda.device.temperature.AsynchronousReaderWriter

public class AsynchronousReaderWriter extends Object
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 Details

    • AsynchronousReaderWriter

      public AsynchronousReaderWriter(Serial device)
      Create the reader/writer.
      Parameters:
      device - the serial communication device.
  • Method Details

    • setReplyEndString

      public void setReplyEndString(String replyEndString)
      Set the reply string termination
      Parameters:
      replyEndString - temination of reply
    • setCommandEndString

      public void setCommandEndString(String commandEndString)
      Set the string termination for a command
      Parameters:
      commandEndString - termination of command
    • setReplyChecker

      public void setReplyChecker(ReplyChecker replyChecker)
      Set the reply checker
      Parameters:
      replyChecker -
    • handleCommand

      public void handleCommand(String command)
      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

      public String sendCommandAndGetReply(String command) throws DeviceException
      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: