com.unitech.lib.protocol

## Interface IProtocol

- All Known Implementing Classes:
    Protocol, ProtocolHT730, ProtocolRG768, ProtocolRP902

      public interface IProtocol

- - ### Method Summary

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

- - ### Method Detail

    - #### post

          ResultCode post(byte[] data)

      Send data to module
      Parameters:
        `data` - The byte array to send to module.
      Returns:
        The result of post

    - #### send

          Response send(byte[] data,
                        int timeout)

      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

          int read(byte[] data,
                   int length)

    - #### write

          int write(byte[] data,
                    int length)

    - #### clearBuffer

          void clearBuffer()

    - #### triggerEvent

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