reko_rfid
v1.0.4
Published
rfid reader client
Downloads
8
Readme
reko_rfid
rfid reader client
Build Setup
emmmm 你猜怎么装来着 npm i reko_rfid --save ?
main.js
import reko_rfid from 'reko_rfid'
Vue.use(reko_rfid);
your page
<reko_rfid ref="reko_rfid"></reko_rfid>
执行初始化 返回client对象
var listener ={
set_callback:res=>{
if(res.code)
{
res.code枚举如下
debug_send = -100,
debug_receive = -200,
未定义 = -1,
获取读写器模块信息 = 1000,
设置发射功率 = 1001,
获取发射功率 = 1002,
读取卡信息 = 1003,
停止轮询卡信息 = 1004,
其他内容自己看去
}
else{
自己印res看看是个啥
}
}
};
this.$refs.reko_rfid.init(listener,s=>{
this.rfid_client =s;
});
//初始化(debug bool 类型 标记是否开启debug)
rfid_client.rfid_init(debug);
//开始读卡
rfid_client.rfid_read_card();
//停止读卡
rfid_client.rfid_end_read_card();
//获取硬件版本
rfid_client.rfid_get_hard_version();
//获取发射功率
rfid_client.rfid_get_pa_power();
//设置发射功率 (value int 类型 设置功率值)
rfid_client.rfid_set_pa_power(value);
For detailed explanation on how things work, consult the docs for vue-loader.