项目作者: rafaneri

项目描述 :
PR9200 RFID
高级语言: TypeScript
项目地址: git://github.com/rafaneri/pr9200-rfid.git
创建时间: 2018-06-20T20:30:42Z
项目社区:https://github.com/rafaneri/pr9200-rfid

开源协议:MIT License

下载


Build Status
Coverage Status

pr9200-rfid

PR9200 RFID

Using the example

Download the repository, cd pr9200-rfid-master, edit the port name in example.js file and run npm install && node example.js.

How to use

  1. "use strict";
  2. const phychips = require('phychips-rcp');
  3. const pr9200reader = require('./dist');
  4. let reader = pr9200reader.Pr9200Reader.getInstance('/dev/tty.wchusbserial1d1130', {
  5. baudRate: 115200,
  6. dataBits: 8,
  7. stopBits: 1,
  8. parity: "none"
  9. });
  10. reader.on('ready', () => {
  11. console.log('Reader Connected');
  12. reader.writeCommand(phychips.ReaderControlProtocol.startAutoRead2())
  13. .then((packet) => {
  14. console.log('Auto Reader Initialized');
  15. });
  16. });
  17. reader.on('notification', (packet) => {
  18. console.log(packet.getEpc().toString('HEX'));
  19. });