com.rscja.deviceapi

## Class PSAM

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

- All Implemented Interfaces:
    IPSAM

      public class PSAM
      extends java.lang.Object
      implements IPSAM

  PSAM操作类
  PSAM operation type

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

  Author:
    liuruifeng

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `executeCmd(java.lang.String hexCmd, java.lang.String hexData)` 执行PSAM命令 Execute PSAM command
    `boolean` | `free()` 释放PSAM Release PSAM
    `static PSAM` | `getInstance()` 获取PSAM操作实例 Acquire PSAM operation Instance
    `boolean` | `init()` 初始化PSAM Initialize PSAM
    `boolean` | `isPowerOn()`
    `boolean` | `Upgrade(int packageCount, int index, int currSize, byte[] data)` 固件升级 Firmware upgrade

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

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

- - ### Method Detail

    - #### getInstance

          public static PSAM getInstance()

      获取PSAM操作实例
      Acquire PSAM operation Instance
      Returns:
        PSAM操作实例
        PSAM operation Instance

    - #### init

          public boolean init()

      初始化PSAM
      Initialize PSAM
      Specified by:
        `init` in interface `IPSAM`
      Returns:

    - #### free

          public boolean free()

      释放PSAM
      Release PSAM
      Specified by:
        `free` in interface `IPSAM`
      Returns:

    - #### executeCmd

          public java.lang.String executeCmd(java.lang.String hexCmd,
                                             java.lang.String hexData)

      执行PSAM命令
      Execute PSAM command
      Specified by:
        `executeCmd` in interface `IPSAM`
      Parameters:
        `hexCmd` - 十六进制命令code
        nexdecimal command code
        `hexData` - 十六进制命令内容
        hexdecimal command content
      Returns:
        command return value

    - #### Upgrade

          public boolean Upgrade(int packageCount,
                                 int index,
                                 int currSize,
                                 byte[] data)

      固件升级
      Firmware upgrade
      Specified by:
        `Upgrade` in interface `IPSAM`
      Parameters:
        `packageCount` - 包的数量
        package amount
        `index` - 当前为第几个包
        current package
        `currSize` - 当前包大小
        current package size
        `data` - 包数据
        package data
      Returns:
        true成功，false失败

    - #### isPowerOn

          public boolean isPowerOn()

      Specified by:
        `isPowerOn` in interface `IPSAM`