Barcode2DWithSoft

com.zebra.adc.decoder

## Class Barcode2DWithSoft

- java.lang.Object
- - com.zebra.adc.decoder.Barcode2DWithSoft

-     public class Barcode2DWithSoft
      extends java.lang.Object

  二维软解码操作类 2D soft decoding operate class

  注意：
  Attention:
  1、使用前请确认您的机器已安装此模块。
  1. Make sure the module is installed before using your device.
  2、要正常使用模块需要在\libs\armeabi\目录放置相应的.so文件。
  2. put the related .so file in directory \libs\armeabi\ then the module can be used normally.
  3、在操作设备前需要调用 `open(Context)` 打开设备，使用完后调用 `close()` 3. call the `open(Context)` to switch on the device before using, call the `close()` to switch off device after using.
  关闭设备
  switch off device
  4、需要申请摄像头权限
  4. Need camera access

  Author:
    liuruifeng

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Barcode2DWithSoft.CODETYPE`
    `static class` | `Barcode2DWithSoft.HardwareType` 扫描头类型
    `static interface` | `Barcode2DWithSoft.PictureCallback` 拍照回调接口(只支持mot扫描头) capture call-back interface(supports MOTO scanning module only)
    `static interface` | `Barcode2DWithSoft.ScanCallback` 扫码回调接口(只支持moto扫描头) scanning barcode call-back interface
    `static class` | `Barcode2DWithSoft.ScanerParamNum` 扫描头参数编号(只支持moto扫描头) Scanning module parameter codes( supports MOTO scanning module only)
    `static class` | `Barcode2DWithSoft.ScanerParamVal` 扫描头参数值(只支持moto扫描头) Scanning module parameter value(support MOTO scanning module only)
    `static class` | `Barcode2DWithSoft.ScanerPropertyNum` 扫描头属性编号(只支持mot扫描头) Scanning module property code( supports MOTO module only)
    `static interface` | `Barcode2DWithSoft.VideoCallback` 视频回调接口(只支持mot扫描头) vedio call-back interface(supports scanning module only)

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `close()` 关闭二维扫描设备 Switch off 2D barcode scannning device
    `void` | `disableAllCodeTypes()` 禁用所有类型条码识别 deactivate all types of barcodes identification
    `void` | `enableAllCodeTypes()` 开启所有类型条码识别 activate all types of barcodes identification
    `boolean` | `enableBarcode(SymbologyConfiguration.BarcodeSymbologyID symbologyID, SymbologyConfig symbolog)` 开启条码(此函数目前只支持6603扫描头) activate barcode(this formula supports 6603 scanning module only)
    `com.imagealgorithmlab.barcode.SymbologySettingItem[]` | `getCodeTypeList()`
    `Decoder` | `getDecoder()`
    `Barcode2DWithSoft.HardwareType` | `getHardwareType()`
    `static Barcode2DWithSoft` | `getInstance()` 获取二维软解码操作实例 Acquire 2D soft decode operation example
    `int` | `getNumParameter(int paramNum)` 获取扫描头参数(此函数目前只支持moto扫描头) Acquire scanning module parameter(this formula supports MOTO scanning module only)
    `int` | `getNumProperty(int propNum)` 获取扫描头属性(此函数目前只支持moto扫描头) acquire scanning module property(this formula supports MOTO scanning module only)
    `static int` | `getScannerIdFromCamera(Context context)` 此函数目前只支持moto 扫描头 This formula supports MOTO scanning module only.
    `static int` | `getScannerIdFromCamera2(Context context)` 此函数目前只支持moto 扫描头 This formula supports MOTO scanning module only.
    `java.lang.String` | `getStrParameter(int paramNum)` 获取扫描头参数(此函数目前只支持moto扫描头) acquire scanning module parameter(this formula supports MOTO scanning module only)
    `java.lang.String` | `getStrProperty(int propNum)` 获取扫描头属性(此函数目前只支持moto扫描头) acquire scanning module property(this formula supports MOTO scanning module only)
    `boolean` | `isPowerOn()` 判断设备是否上电 Determine whether the device is powered on.
    `static boolean` | `isUpAndroid7()`
    `boolean` | `open(Context context)` 打开二维扫描设备 Switch on 2D scanning device
    `int` | `readCameraState()` 读取camera状态 read camera status
    `int` | `readScannerCameraId()` 读取camera id read camera id
    `void` | `scan()` 触发二维条码扫描 Trigger 2D barcode scanning function
    `boolean` | `setCodeTypeOnAndOff_IA400S(Barcode2DWithSoft.CODETYPE codetype, boolean enable)` 只支持擎亚扫描头
    `void` | `setDefaultParameters()` 重置扫描头参数(此函数目前只支持moto扫描头) reset scanning module parameter(this formula supports MOTO scanning module only)
    `void` | `setLicense_IA400S(java.lang.String license_IA400S)`
    `void` | `setNoDisplayMode()` 此函数目前只支持moto扫描头 This formula supports MOTO scanning module only
    `boolean` | `setParameter(int paramNum, int paramVal)` 设置扫描头参数(此函数目前只支持moto扫描头) Setup scanning module parameter( this formula supports MOTO scanning module only)
    `boolean` | `setParameter(int paramNum, java.lang.String paramVal)` 设置扫描头参数(此函数目前只支持moto扫描头)
    `void` | `setPreviewDisplay(SurfaceHolder holder)` 设置预览控件(只支持mot扫描头) setup preview control( supports MOTO scanning module only.)
    `void` | `setScanCallback(Barcode2DWithSoft.ScanCallback sc)` 设置回调对象接收条码数据 Setup call-back target to acquire barcode data.
    `void` | `setTimeOut(int time)` 设置超时时间 setup time-out duration
    `boolean` | `startHandsFree()` 设置连续扫描(只支持moto扫描头) Setup continuous scanning function(supports MOTO scanning module only)
    `void` | `startPreview()` 启动预览(只支持mot扫描头) activate preview(suppots MOTO scanning module only)
    `void` | `startViewFinder(Barcode2DWithSoft.VideoCallback cb)` 开始捕捉帧视频模式(只支持mot扫描头) Start capture frame vedio mode(support MOTO scanning module only)
    `boolean` | `stopHandsFree()` 停止连续扫描(只支持moto扫描头) Stop continuous scanning (support MOTO scanning module)
    `void` | `stopPreview()` 停止预览(只支持mot扫描头) Stop preview(supports MOTO scanning module only)
    `void` | `stopScan()` 终止扫描 Scanning terminated
    `void` | `takePicture(Barcode2DWithSoft.PictureCallback cb)` 扫描头拍照(只支持moto扫描头) scanning module capture(supports MOTO scanning module)
    `void` | `writeCameraState(int status)` 写入camera状态 write in camera status
    `void` | `writeScannerCameraId(int id)` 写入camera id write in camera id
    `void` | `writeScannerState(int status)` 写入2D软解码扫描头状态 write in 2D soft decode scanning module status

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

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

- - ### Method Detail

    - #### isPowerOn

          public boolean isPowerOn()

      判断设备是否上电
      Determine whether the device is powered on.
      Returns:
        返回上电状态
        return power-on status

    - #### getInstance

          public static Barcode2DWithSoft getInstance()

      获取二维软解码操作实例
      Acquire 2D soft decode operation example
      Returns:
        二维软解码操作实例
        2D soft decode operation example

    - #### open

          public boolean open(Context context)

      打开二维扫描设备
      Switch on 2D scanning device
      Parameters:
        `context` - Context
      Returns:
        返回上电状态
        return power-on status

    - #### getScannerIdFromCamera

          public static int getScannerIdFromCamera(Context context)

      此函数目前只支持moto 扫描头
      This formula supports MOTO scanning module only.
      Parameters:
        `context` - Context
      Returns:
        return

    - #### getScannerIdFromCamera2

          public static int getScannerIdFromCamera2(Context context)

      此函数目前只支持moto 扫描头
      This formula supports MOTO scanning module only.
      Parameters:
        `context` - Context
      Returns:
        return

    - #### scan

          public void scan()

      触发二维条码扫描
      Trigger 2D barcode scanning function

    - #### stopScan

          public void stopScan()

      终止扫描
      Scanning terminated

    - #### setScanCallback

          public void setScanCallback(Barcode2DWithSoft.ScanCallback sc)

      设置回调对象接收条码数据
      Setup call-back target to acquire barcode data.
      Parameters:
        `sc` - 回调对象
        Call-back target

    - #### setNoDisplayMode

          public void setNoDisplayMode()

      此函数目前只支持moto扫描头
      This formula supports MOTO scanning module only

    - #### setParameter

          public boolean setParameter(int paramNum,
                                      int paramVal)

      设置扫描头参数(此函数目前只支持moto扫描头)
      Setup scanning module parameter( this formula supports MOTO scanning module only)
      Parameters:
        `paramNum` - paramNum
        `paramVal` - paramVal
      Returns:

    - #### setParameter

          public boolean setParameter(int paramNum,
                                      java.lang.String paramVal)

      设置扫描头参数(此函数目前只支持moto扫描头)
      Parameters:
        `paramNum` - paramNum
        `paramVal` - paramVal
      Returns:

    - #### getNumParameter

          public int getNumParameter(int paramNum)

      获取扫描头参数(此函数目前只支持moto扫描头)
      Acquire scanning module parameter(this formula supports MOTO scanning module only)
      Parameters:
        `paramNum` - paramNum
      Returns:
        错误则返回-1
        error return -1

    - #### getStrParameter

          public java.lang.String getStrParameter(int paramNum)

      获取扫描头参数(此函数目前只支持moto扫描头)
      acquire scanning module parameter(this formula supports MOTO scanning module only)
      Parameters:
        `paramNum` - paramNum
      Returns:
        错误则返回-1
        error returns -1

    - #### setDefaultParameters

          public void setDefaultParameters()

      重置扫描头参数(此函数目前只支持moto扫描头)
      reset scanning module parameter(this formula supports MOTO scanning module only)

    - #### getNumProperty

          public int getNumProperty(int propNum)

      获取扫描头属性(此函数目前只支持moto扫描头)
      acquire scanning module property(this formula supports MOTO scanning module only)
      Parameters:
        `propNum` - propNum
      Returns:
        错误则返回-1
        error returns -1

    - #### getStrProperty

          public java.lang.String getStrProperty(int propNum)

      获取扫描头属性(此函数目前只支持moto扫描头)
      acquire scanning module property(this formula supports MOTO scanning module only)
      Parameters:
        `paramNum` - paramNum
      Returns:
        错误则返回-1
        error returns -1

    - #### enableAllCodeTypes

          public void enableAllCodeTypes()

      开启所有类型条码识别
      activate all types of barcodes identification

    - #### disableAllCodeTypes

          public void disableAllCodeTypes()

      禁用所有类型条码识别
      deactivate all types of barcodes identification

    - #### enableBarcode

          public boolean enableBarcode(SymbologyConfiguration.BarcodeSymbologyID symbologyID,
                                       SymbologyConfig symbolog)

      开启条码(此函数目前只支持6603扫描头)
      activate barcode(this formula supports 6603 scanning module only)
      Parameters:
        `symbologyID` - 要开启的条码ID
        symbologyID barcode ID needs to be activated
        `symbolog` - 具体条码参数
        symbolog detailed barcode parameter
      Returns:
        true表示成功，false表示失败
        true means success, false means failure

    - #### takePicture

          public void takePicture(Barcode2DWithSoft.PictureCallback cb)

      扫描头拍照(只支持moto扫描头)
      scanning module capture(supports MOTO scanning module)
      Parameters:
        `cb拍照回调接口
        ` - cb capture call-back interface

    - #### setPreviewDisplay

          public void setPreviewDisplay(SurfaceHolder holder)
                                 throws java.io.IOException

      设置预览控件(只支持mot扫描头)
      setup preview control( supports MOTO scanning module only.)
      Parameters:
        `holder` - SurfaceHolder
      Throws:
        `java.io.IOException`

    - #### startViewFinder

          public void startViewFinder(Barcode2DWithSoft.VideoCallback cb)

      开始捕捉帧视频模式(只支持mot扫描头)
      Start capture frame vedio mode(support MOTO scanning module only)
      Parameters:
        `cb` -

    - #### startPreview

          public void startPreview()

      启动预览(只支持mot扫描头)
      activate preview(suppots MOTO scanning module only)

    - #### stopPreview

          public void stopPreview()

      停止预览(只支持mot扫描头)
      Stop preview(supports MOTO scanning module only)

    - #### close

          public boolean close()

      关闭二维扫描设备
      Switch off 2D barcode scannning device
      Returns:
        true成功，false失败
        true means success, false means failure

    - #### writeScannerState

          public void writeScannerState(int status)

      写入2D软解码扫描头状态
      write in 2D soft decode scanning module status

    - #### writeCameraState

          public void writeCameraState(int status)

      写入camera状态
      write in camera status

    - #### readCameraState

          public int readCameraState()

      读取camera状态
      read camera status

    - #### writeScannerCameraId

          public void writeScannerCameraId(int id)

      写入camera id
      write in camera id

    - #### getDecoder

          public Decoder getDecoder()

    - #### setTimeOut

          public void setTimeOut(int time)

      设置超时时间
      setup time-out duration
      Parameters:
        `time` -

    - #### readScannerCameraId

          public int readScannerCameraId()

      读取camera id
      read camera id
      Returns:
        返回id，小于0标识无效id
        return id, marked invalid id if it is smaller than 0.

    - #### startHandsFree

          public boolean startHandsFree()

      设置连续扫描(只支持moto扫描头)
      Setup continuous scanning function(supports MOTO scanning module only)
      Returns:
        true:设置成功，false:设置失败
        ture: setup success, false: setup failure

    - #### stopHandsFree

          public boolean stopHandsFree()

      停止连续扫描(只支持moto扫描头)
      Stop continuous scanning (support MOTO scanning module)
      Returns:
        true:设置成功，false:设置失败
        true: setup success, false: setup failed

    - #### getCodeTypeList

          public com.imagealgorithmlab.barcode.SymbologySettingItem[] getCodeTypeList()

    - #### setCodeTypeOnAndOff_IA400S

          public boolean setCodeTypeOnAndOff_IA400S(Barcode2DWithSoft.CODETYPE codetype,
                                                    boolean enable)

      只支持擎亚扫描头
      Parameters:
        `codetype` -
        `enable` -
      Returns:

    - #### setLicense_IA400S

          public void setLicense_IA400S(java.lang.String license_IA400S)

      Parameters:
        `license_IA400S` - 擎亚扫描头授权码

    - #### getHardwareType

          public Barcode2DWithSoft.HardwareType getHardwareType()

    - #### isUpAndroid7

          public static boolean isUpAndroid7()