com.rscja.deviceapi

## Class Barcode1D

- java.lang.Object
- - com.rscja.deviceapi.Barcode1D

- All Implemented Interfaces:
    IBarcode1D

      public class Barcode1D
      extends java.lang.Object
      implements IBarcode1D

  一维条码操作类
  1D barcode operation class

  注意：
  Attention:
  1、使用前请确认您的机器已安装此模块。
  1. Make sure module is installed before using.
  2、要正常使用模块需要在\libs\armeabi\目录放置libDeviceAPI.so文件。
  2. Put the file libDeviceAPI.so in directory \libs\armeabi\ then module can be used normally.
  3、在操作设备前需要调用 `open()` 打开设备，使用完后调用 `close()`
  3. Before operating, call `open()`to switch on the device, after using call `Barcode1D#close()` to
  关闭设备
  switch off the device.

  Author:
    liuruifeng

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `close()` 关闭一维扫描设备 Switch off 1D barcode scanning device.
    `static Barcode1D` | `getInstance()` 获取一维条码操作实例 Acquire 1D barcode operation Instance.
    `boolean` | `isPowerOn()`
    `boolean` | `open()` 打开一维扫描设备 Switch on 1D scanning device.
    `boolean` | `open(Context context)` 打开一维扫描设备 Switch on 1D scanning device.
    `java.lang.String` | `scan()` 触发一次条码扫描 Enable barcode scanning for 1 time.
    `byte[]` | `scanBarcode()` 触发一次条码扫描 Enable barcode scanning for 1 time.
    `boolean` | `setBaudrate(int baudrate)`
    `void` | `setTimeOut(int time)` 设置超时时间 set time out.
    `boolean` | `stopScan()` 终止扫描 Scanning terminated

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

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

- - ### Method Detail

    - #### getInstance

          public static Barcode1D getInstance()
                                       throws ConfigurationException

      获取一维条码操作实例
      Acquire 1D barcode operation Instance.
      Returns:
        1D barcode operation example
      Throws:
        `ConfigurationException` - 配置错误异常
        Configuration Error

    - #### open

          public boolean open(Context context)

      打开一维扫描设备
      Switch on 1D scanning device.
      Specified by:
        `open` in interface `IBarcode1D`
      Parameters:
        `context` - Context
      Returns:
        true:成功,false:失败
        true:success,false:failuer

    - #### open

          public boolean open()

      打开一维扫描设备
      Switch on 1D scanning device.
      Specified by:
        `open` in interface `IBarcode1D`
      Returns:
        true:成功,false:失败
        true:success,false:failuer

    - #### setBaudrate

          public boolean setBaudrate(int baudrate)

      Specified by:
        `setBaudrate` in interface `IBarcode1D`

    - #### scan

          public java.lang.String scan()

      触发一次条码扫描
      Enable barcode scanning for 1 time.
      Specified by:
        `scan` in interface `IBarcode1D`
      Returns:
        扫描得到的条码信息
        scanning barcode infor that acquired.

    - #### scanBarcode

          public byte[] scanBarcode()

      触发一次条码扫描
      Enable barcode scanning for 1 time.
      Specified by:
        `scanBarcode` in interface `IBarcode1D`
      Returns:
        扫描得到的条码信息
        scanning barcode infor that acquired.

    - #### setTimeOut

          public void setTimeOut(int time)

      设置超时时间
      set time out.
      Specified by:
        `setTimeOut` in interface `IBarcode1D`
      Parameters:
        `time(500-10000` - ms) 超时时间
        TimeOut

    - #### stopScan

          public boolean stopScan()

      终止扫描
      Scanning terminated
      Specified by:
        `stopScan` in interface `IBarcode1D`
      Returns:
        true:成功，false:失败
        true:success, false:failuer

    - #### close

          public boolean close()

      关闭一维扫描设备
      Switch off 1D barcode scanning device.
      Specified by:
        `close` in interface `IBarcode1D`
      Returns:
        true:成功，false:失败
        true:success, false:failuer

    - #### isPowerOn

          public boolean isPowerOn()

      Specified by:
        `isPowerOn` in interface `IBarcode1D`