com.pavolibrary.commands

## Class LedAPI

- java.lang.Object
- - com.pavolibrary.commands.LedAPI

-     public class LedAPI
      extends java.lang.Object

  Created by swm on 2020-01-04

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `FAIL`
    `static int` | `SUCCESS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LedAPI(android.content.Context mContext)` LED Display API

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearbuffer()` 清空接收缓存区 Empty receive buffer
    `int` | `connect(java.lang.String serialPort, int baudRate, int flowControl)` 创建连接 Create connection
    `int` | `disconnect()` 断开连接 disconnect
    `boolean` | `isConnect()` 是否连接 Is it connected
    `boolean` | `LED_ClearLine()` 清除光标行 Clear cursor line
    `boolean` | `LED_ClearScreen()` 清屏 Clear display screen
    `boolean` | `LED_Display(java.lang.String data, java.lang.String charset)` 发送文本到客显 Write string to display
    `boolean` | `LED_Init()` 初始化 Initialize display
    `boolean` | `LED_MoveCursor(int n)` 光标移动到指定位置 Move cursor to specified position
    `boolean` | `LED_SetBaudRate(int n)` 设置波特率 Set BaudRate to display
    `boolean` | `LED_SetCursorFlag(int n)` 设置光标状态 Set cursor flag
    `boolean` | `LED_SetStatusLight(int n)` 设置状态小灯显示 Set status light
    `int` | `setBaudrate(int _baudRate)` 设置波特率 setup baud rate

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

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

- - ### Field Detail

    - #### SUCCESS

          public static final int SUCCESS

      See Also:
        Constant Field Values

    - #### FAIL

          public static final int FAIL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LedAPI

          public LedAPI(android.content.Context mContext)

      LED Display API
      Parameters:
        `mContext` -

  - ### Method Detail

    - #### connect

          public int connect(java.lang.String serialPort,
                             int baudRate,
                             int flowControl)

      创建连接 Create connection
      Parameters:
        `serialPort` - 端口号
        `baudRate` - 波特率
        `flowControl` - 流控 0:no 1:yes
      Returns:
        0:success

    - #### setBaudrate

          public int setBaudrate(int _baudRate)

      设置波特率 setup baud rate
      Parameters:
        `_baudRate` - 波特率
      Returns:
        0:success

    - #### disconnect

          public int disconnect()

      断开连接 disconnect
      Returns:
        0:success

    - #### isConnect

          public boolean isConnect()

      是否连接 Is it connected
      Returns:
        true:Connected

    - #### clearbuffer

          public void clearbuffer()

      清空接收缓存区 Empty receive buffer

    - #### LED_SetCursorFlag

          public boolean LED_SetCursorFlag(int n)

      设置光标状态 Set cursor flag
      Parameters:
        `n` - 0<=n<=1 n=0 光标暗 n=1 光标亮
      Returns:

    - #### LED_MoveCursor

          public boolean LED_MoveCursor(int n)

      光标移动到指定位置 Move cursor to specified position
      Parameters:
        `n` - 1<=n<=8
      Returns:

    - #### LED_SetStatusLight

          public boolean LED_SetStatusLight(int n)

      设置状态小灯显示 Set status light
      Parameters:
        `n` - 0<=n<=4 n=0 全暗 None n=1 单价 Price n=2 总计 Total n=3 收款 Collect n=4 找零 Change
      Returns:

    - #### LED_ClearScreen

          public boolean LED_ClearScreen()

      清屏 Clear display screen
      Returns:

    - #### LED_ClearLine

          public boolean LED_ClearLine()

      清除光标行 Clear cursor line
      Returns:

    - #### LED_Init

          public boolean LED_Init()

      初始化 Initialize display
      Returns:

    - #### LED_Display

          public boolean LED_Display(java.lang.String data,
                                     java.lang.String charset)

      发送文本到客显 Write string to display
      Parameters:
        `data` - 文本内容(数字和小数点)
      Returns:

    - #### LED_SetBaudRate

          public boolean LED_SetBaudRate(int n)

      设置波特率 Set BaudRate to display
      Parameters:
        `n` - 0 ≦ n ≦ 2 n = 0, 9600 n = 1, 4800 n = 2, 2400
      Returns: