Class FrcEmic2TextToSpeech

java.lang.Object
trclib.archive.TrcEmic2TextToSpeech
frclib.archive.FrcEmic2TextToSpeech

public class FrcEmic2TextToSpeech extends TrcEmic2TextToSpeech
This class implements a platform dependent Emic2 text to speech device that is connected to a Serial Port. It extends the TrcEmicTextToSpeech class to provide platform dependent asynchronous access to the serial port.
  • Field Details

    • DEF_SERIAL_PORT

      public static final edu.wpi.first.wpilibj.SerialPort.Port DEF_SERIAL_PORT
    • DEF_BAUD_RATE

      public static final int DEF_BAUD_RATE
      See Also:
    • DEF_DATA_BITS

      public static final int DEF_DATA_BITS
      See Also:
    • DEF_PARITY

      public static final edu.wpi.first.wpilibj.SerialPort.Parity DEF_PARITY
    • DEF_STOP_BITS

      public static final edu.wpi.first.wpilibj.SerialPort.StopBits DEF_STOP_BITS
  • Constructor Details

    • FrcEmic2TextToSpeech

      public FrcEmic2TextToSpeech(String instanceName, edu.wpi.first.wpilibj.SerialPort.Port port, int baudRate, int dataBits, edu.wpi.first.wpilibj.SerialPort.Parity parity, edu.wpi.first.wpilibj.SerialPort.StopBits stopBits)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      port - specifies the serial port on the RoboRIO.
      baudRate - specifies the baud rate.
      dataBits - specifies the number of data bits.
      parity - specifies the parity type.
      stopBits - specifies the number of stop bits.
    • FrcEmic2TextToSpeech

      public FrcEmic2TextToSpeech(String instanceName, edu.wpi.first.wpilibj.SerialPort.Port port, int baudRate)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      port - specifies the serial port on the RoboRIO.
      baudRate - specifies the baud rate.
    • FrcEmic2TextToSpeech

      public FrcEmic2TextToSpeech(String instanceName, edu.wpi.first.wpilibj.SerialPort.Port port)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      port - specifies the serial port on the RoboRIO.
  • Method Details

    • isEnabled

      public boolean isEnabled()
      This method checks if the device is enabled.
      Returns:
      true if device is enabled, false otherwise.
    • setEnabled

      public void setEnabled(boolean enabled)
      This method enables/disables the device to start/stop the communication
      Parameters:
      enabled - specifies true to enable device, false to disable.
    • asyncReadString

      public void asyncReadString(TrcEmic2TextToSpeech.RequestId requestId)
      This method issues an asynchronous read of a string from the device.
      Specified by:
      asyncReadString in class TrcEmic2TextToSpeech
      Parameters:
      requestId - specifies the ID to identify the request. Can be null if none was provided.
    • asyncWriteString

      public void asyncWriteString(String text, boolean preemptive)
      This method writes the string to the device asynchronously.
      Specified by:
      asyncWriteString in class TrcEmic2TextToSpeech
      Parameters:
      text - specifies the text string to be written to the device.
      preemptive - specifies true for immediate write without queuing, false otherwise.