com.pavolibrary.commands

## Class Dsp280API

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

-     public class Dsp280API
      extends java.lang.Object

  Created by swm on 2020-01-04

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `Dsp280API.UploadListener` Upload event listener

  - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Dsp280API(android.content.Context mContext)` 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
    `int` | `DSP_GetFirmwareVersion()` 获取设备固件版本(LCD) Get Firmware Version(LCD)
    `java.lang.String` | `DSP_GetModel()` 获取设备型号 Get device model
    `boolean` | `DSP_Init()` 初始化 Initialize display
    `boolean` | `DSP_Restart()` 重启客显 Restart display
    `boolean` | `DSP_SetDefaultStyle(int n)` 设置默认风格 Set default style.
    `boolean` | `DSP_ShowPicture(java.lang.String fileName, int x, int y)` 展示一张图片 Show a picture
    `boolean` | `DSP_ShowQrCode(java.lang.String text, int size, int x, int y)` 显示二维码 Show QrCode
    `boolean` | `DSP_ShowText(java.lang.String text, int size, int x, int y)` 显示文本内容 Show Text
    `boolean` | `DSP_SwitchStyle(int n)` 切换风格 Switch style.
    `int` | `DSP_UploadPicture(java.lang.String fileName, java.lang.String filePath, int width, int height)` 上传图片到客显 Upload pictures to display
    `boolean` | `isConnect()` 是否连接 Is it connected
    `boolean` | `LED_Display(java.lang.String data, int type)` 发送文本到客显 Write string to display
    `void` | `setUploadListener(Dsp280API.UploadListener mUploadListener)` Set Upload event listener

    - ### 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

    - #### Dsp280API

          public Dsp280API(android.content.Context mContext)

      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

    - #### 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

    - #### DSP_SetDefaultStyle

          public boolean DSP_SetDefaultStyle(int n)

      设置默认风格 Set default style.
      Parameters:
        `n` - 1,2,3,4
      Returns:

    - #### DSP_SwitchStyle

          public boolean DSP_SwitchStyle(int n)

      切换风格 Switch style.
      Parameters:
        `n` - 1,2,3,4
      Returns:

    - #### LED_Display

          public boolean LED_Display(java.lang.String data,
                                     int type)

      发送文本到客显 Write string to display
      Parameters:
        `data` -
        `type` - 0<=n<=4 * n=0 全暗 None * n=1 单价 Price * n=2 总计 Total * n=3 收款 Collect * n=4 找零 Change
      Returns:

    - #### DSP_Init

          public boolean DSP_Init()

      初始化 Initialize display
      Returns:
        true:success

    - #### DSP_Restart

          public boolean DSP_Restart()

      重启客显 Restart display
      Returns:
        true:success

    - #### DSP_GetModel

          public java.lang.String DSP_GetModel()

      获取设备型号 Get device model
      Returns:
        型号 model

    - #### DSP_GetFirmwareVersion

          public int DSP_GetFirmwareVersion()

      获取设备固件版本(LCD) Get Firmware Version(LCD)
      Returns:
        固件版本 Firmware Version

    - #### DSP_ShowPicture

          public boolean DSP_ShowPicture(java.lang.String fileName,
                                         int x,
                                         int y)

      展示一张图片 Show a picture
      Parameters:
        `fileName` -
        `x` -
        `y` -
      Returns:

    - #### DSP_ShowQrCode

          public boolean DSP_ShowQrCode(java.lang.String text,
                                        int size,
                                        int x,
                                        int y)

      显示二维码 Show QrCode
      Parameters:
        `text` - 二维码内容
        `size` - 二维码大小
        `x` - 横坐标
        `y` - 纵坐标
      Returns:

    - #### DSP_ShowText

          public boolean DSP_ShowText(java.lang.String text,
                                      int size,
                                      int x,
                                      int y)

      显示文本内容 Show Text
      Parameters:
        `text` - 文本内容
        `size` - 字体大小
        `x` - 横坐标
        `y` - 纵坐标
      Returns:

    - #### DSP_UploadPicture

          public int DSP_UploadPicture(java.lang.String fileName,
                                       java.lang.String filePath,
                                       int width,
                                       int height)

      上传图片到客显 Upload pictures to display
      Parameters:
        `fileName` - 文件名（固定）File name (fixed)
        `filePath` - 文件路径 File path
      Returns:
        0:success

    - #### setUploadListener

          public void setUploadListener(Dsp280API.UploadListener mUploadListener)

      Set Upload event listener
      Parameters:
        `mUploadListener` -