com.unitech.lib.rpx.protocol

## Class ProtocolRP902

- java.lang.Object
- - com.unitech.lib.reader.protocol.Protocol
  - - com.unitech.lib.rpx.protocol.ProtocolRP902

- All Implemented Interfaces:
    IProtocol

      public class ProtocolRP902
      extends Protocol

- - ### Field Summary

    - ### Fields inherited from class com.unitech.lib.reader.protocol.Protocol

      `_baseTransport, _lastError, DEBUG, DETAIL, INFO, IO, TAG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProtocolRP902(BaseTransport baseTransport, IProtocolEventListener listener)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearBuffer()`
    `ResultCode` | `post(byte[] data)` Send data to module
    `int` | `read(byte[] data, int length)`
    `int` | `read(byte[] data, int offset, int length)`
    `Response` | `send(byte[] data, int timeout)` Send the data to module and receive the response
    `void` | `skipStopResponse(boolean skip)`
    `boolean` | `start()`
    `void` | `stop()`
    `void` | `triggerEvent(int cmd, int sub, java.lang.Object data)`
    `int` | `write(byte[] data, int length)`

    - ### Methods inherited from class com.unitech.lib.reader.protocol.Protocol

      `getTransport`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProtocolRP902

          public ProtocolRP902(BaseTransport baseTransport,
                               IProtocolEventListener listener)

  - ### Method Detail

    - #### start

          public boolean start()

      Specified by:
        `start` in class `Protocol`

    - #### stop

          public void stop()

      Specified by:
        `stop` in class `Protocol`

    - #### post

          public ResultCode post(byte[] data)

      Description copied from interface: `IProtocol`
      Send data to module
      Parameters:
        `data` - The byte array to send to module.
      Returns:
        The result of post

    - #### send

          public Response send(byte[] data,
                               int timeout)

      Description copied from interface: `IProtocol`
      Send the data to module and receive the response
      Parameters:
        `data` - The byte array to send to module.
        `timeout` - The timeout value to receive the response and unit is millisecond.
      Returns:
        The Response class contain the response from module

    - #### read

          public int read(byte[] data,
                          int length)

    - #### read

          public int read(byte[] data,
                          int offset,
                          int length)

    - #### clearBuffer

          public void clearBuffer()

    - #### write

          public int write(byte[] data,
                           int length)

    - #### skipStopResponse

          public void skipStopResponse(boolean skip)

    - #### triggerEvent

          public void triggerEvent(int cmd,
                                   int sub,
                                   java.lang.Object data)