Class BlueRSCmdInt

  • All Implemented Interfaces:
    Ippc32, Actionable

    public class BlueRSCmdInt
    extends Task
    Interface for the BlueRS driver to send and receive positive integer values.
    • Field Detail

      • disconnected

        public static final int disconnected
        No connection to a partner module established.
        See Also:
        Constant Field Values
      • connecting

        public static final int connecting
        Try to connect to a partner module.
        See Also:
        Constant Field Values
      • connected

        public static final int connected
        The BlueRS module is connected to a partner module.
        See Also:
        Constant Field Values
      • disconnecting

        public static final int disconnecting
        Try to disconnect from a partner module.
        See Also:
        Constant Field Values
      • wrongMode

        public static final int wrongMode
        The command can not be executed in the actual mode
        See Also:
        Constant Field Values
      • illegalCmd

        public static final int illegalCmd
        Illegal command format. (The command to send is less the 1)
        See Also:
        Constant Field Values
      • bufferEmpty

        public static final int bufferEmpty
        No received command to read.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BlueRSCmdInt

        public BlueRSCmdInt()
    • Method Detail

      • action

        public void action()
        Description copied from class: Task
        Action to be performed by the task
        Specified by:
        action in interface Actionable
        Overrides:
        action in class Task
      • sendCommand

        public static int sendCommand​(int cmd)
        Sends a command to the partner module
        Parameters:
        cmd - , the command to send
        Returns:
        success if the command was successfully sent, illegalCmd if the command is less then 0, wrongMode if no connection is established
      • connect

        public static int connect​(String partner)
        Tries to connect to a partner module
        Parameters:
        partner - the address of the partner module.
        Returns:
        success if the connection process has been initiated, wrongMode if the module is not disconnected.
      • disconnect

        public static int disconnect()
        Tries to disconnect from a partner module.
        Returns:
        success if the disconnection process has been initiated, wrongMode if the module is not connected.
      • getReceivedCmd

        public static int getReceivedCmd()
        Get a received command
        Returns:
        the received command, bufferEmpty if no command is available.