Class SerialController

All Implemented Interfaces:
Device, Configurable, Findable, gda.observable.IObservable

public class SerialController extends DeviceBase
A Distributed Controller class for Serial devices
  • Constructor Details

    • SerialController

      public SerialController()
  • Method Details

    • configure

      public void configure() throws FactoryException
      Description copied from class: ConfigurableBase
      Default implementation for classes that do not have to do any specific configuration.
      Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
      Throws:
      FactoryException - if there is an error in configuration e.g. required variable not set or cannot connect to device
    • getByteSize

      public int getByteSize()
      Returns:
      the no. data bits
    • setByteSize

      public void setByteSize(int i)
      Parameters:
      i - int number of data bits
    • getBaudRate

      public int getBaudRate()
      Returns:
      int value of bits/second
    • setBaudRate

      public void setBaudRate(int i)
      Parameters:
      i - int value of bits/second
    • getCommandTerminator

      public String getCommandTerminator()
      Returns:
      the String command terminator
    • setCommandTerminator

      public void setCommandTerminator(String terminator)
      Parameters:
      terminator - the String command terminator
    • getErrorChars

      public String getErrorChars()
      Returns:
      String errorChars
    • setErrorChars

      public void setErrorChars(String chars)
      Parameters:
      chars - String error Chars
    • getFlowControl

      public String getFlowControl()
      Returns:
      String flow control
    • setFlowControl

      public void setFlowControl(String str)
      Parameters:
      str - String flow control
    • getParity

      public String getParity()
      Returns:
      String parity
    • setParity

      public void setParity(String str)
      Parameters:
      str - String parity
    • getReplyTerminator

      public String getReplyTerminator()
      Returns:
      String reply Terminator
    • setReplyTerminator

      public void setReplyTerminator(String terminator)
      Parameters:
      terminator - String reply Terminator
    • getSerialDeviceName

      public String getSerialDeviceName()
      Returns:
      String Serial Device Name
    • setSerialDeviceName

      public void setSerialDeviceName(String name)
      Parameters:
      name - String Serial Device Name
    • getSerialTimeout

      public int getSerialTimeout()
      Returns:
      int serial timeout
    • setSerialTimeout

      public void setSerialTimeout(int t)
      Parameters:
      t - int serial timeout
    • getStopBits

      public int getStopBits()
      Returns:
      int stop bits
    • setStopBits

      public void setStopBits(int i)
      Parameters:
      i - int stop bits
    • close

      public void close()
      Description copied from interface: Device
      Close and unconfigure the device.
      Specified by:
      close in interface Device
      Overrides:
      close in class DeviceBase
    • sendCommand

      public void sendCommand(String command) throws DeviceException
      Send a command to the serial port
      Parameters:
      command - String serial device command
      Throws:
      DeviceException
    • getReply

      public String getReply() throws DeviceException
      Returns:
      reply
      Throws:
      DeviceException