# Psam_AS **Repository Path**: speedata_1/Psam_AS ## Basic Information - **Project Name**: Psam_AS - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: custom_zhanrui - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-06-22 - **Last Updated**: 2025-12-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Psam showdoc在线API文档:https://www.showdoc.com.cn/12704/109430 ## 固件升级 需要将升级包放到sd卡根目录下 psam_upload下有三个文件 out_rc523_1boot normalNopps.bin dyn.bin disboot.bin 固件升级功能作为高危操作默认不开放,必要情况下请联系技术支持获取。 ## API 1. initDev 初始化设备 1. PsamPower 软使能 1. WriteCmd 写指令 1. resetDev 硬件gpio复位 1. releaseDev 释放设备 1. WriteOriginalCmd 发送原始数据(aabb开头的数据) 1. warmReset 热复位 - 枚举 PowerType |字段|说明| |:---- |:------- | |Psam1 |卡1 | |Psam2 |卡2 | ------------ - IPsam 获取操作实例 ``` { IPsam psam = PsamManager.getPsamIntance(); } ``` - 软使能 函数原型|void PsamPower(PowerType type) | ------- |------- |功能描述 |模块软使能| |参数描述 |PowerType type 卡1/卡2 | |返回类型 |无| - 初始化设备 |函数原型|void initDev(String serialport, int braut, DeviceControl.PowerType power_typeint, Context context, int ... gpio )throws IOException; | ------- |------- |功能描述 |指定参数初始化模块| |参数描述 |String serialport 串口号 | |参数描述 |int braut 波特率 | |参数描述 |DeviceControl.PowerType power_typeint 上电类型 | |参数描述 |Context context 上下文| |参数描述 |int ... gpio 上电gpio | |返回类型 |失败抛出异常| |函数原型|void initDev(Context context) throws IOException; | ------- |------- |功能描述 |自动初始化模块,此方法依赖fastjson.jar| |参数描述 |Context context 上下文| |返回类型 |失败抛出异常| **初始化示例** ``` //自动初始化模块 psam.initDev(this); ``` - 使能卡 函数原型|byte[] PsamPower(IPsam.PowerType type) | ------- |------- |功能描述 |使能卡| |参数描述 |IPsam.PowerType 卡1或者卡2| |返回类型 |byte[] 上电返回的数据 | - 发送指令 |函数原型|byte[] WriteCmd(byte[] data, PowerType type) throws UnsupportedEncodingException | ------- |------- |功能描述 |发送指令 最大读取1024字节 延时为10ms 此方法基本耗时会在15ms以上| |参数描述 |byte[] data 发送的数据| |参数描述 |IPsam.PowerType type 卡槽| |返回类型 |byte[] 模块返回数据 | - 发送指令 |函数原型|byte[] WriteCmd(byte[] data, PowerType type,int len,int delay) throws UnsupportedEncodingException | ------- |------- |功能描述 |发送指令| |参数描述 |byte[] data 发送的数据| |参数描述 |IPsam.PowerType type 卡槽| |参数描述 |int len 读取数据的最大长度| |参数描述 |int delay 长度不满足或者没有数据时的最大延时| |返回类型 |byte[] 模块返回数据 | - 硬件复位 |函数原型|void resetDev(DeviceControl.PowerType type,int Gpio) | ------- |------- |功能描述 |输入指定参数进行硬件gpio复位| |参数描述 |DeviceControl.PowerType 上电类型| |参数描述 |int Gpio| |返回类型 |无 | |函数原型|void resetDev() | ------- |------- |功能描述 |硬件复位gpio 按照自动匹配参数 给电平复位 | |参数描述 |无| |返回类型 |无 | - 释放设备 函数原型|void releaseDev() throws IOException | ------- |------- |功能描述 |释放设备| |参数描述 |无 程序退出时需调用此方法| |返回类型 |无 | - 发送原始数据 |函数原型|byte[] WriteOriginalCmd(byte[] data) throws UnsupportedEncodingException | |:------- | |功能描述 |发送原始数据 aabb开头的数据包 aabb是模块标准协议头| |参数描述 |遵循模块协议数据| |返回类型 |byte[] 返回模块回应数据 可能为null| - 热复位 |函数原型|byte[] warmReset(PowerType type) | |:------- | |功能描述 |热复位| |参数描述 |IPsam.PowerType type 卡槽| |返回类型 |byte[] 成功返回ATR信息 ATR信息可参考https://blog.csdn.net/creator_ly/article/details/79622197| 技术支持电话(微信): 155 4266 8023 技术咨询QQ号: 华北:2428726264 华南:241271329 华东:2480737278 921071740 北京思必拓科技有限责任公司 网址 https://www.speedata.cn/ 福建新大陆自动识别技术有限公司 网址 https://www.nlscan.com/