index.js
545 Bytes
/**
* 调用入口
*/
require("babel/register");
var con = require('./lib/connector');
var orders = require('./lib/interface');
var Uhf = require('./lib/directive/uhf');
var uhf = new Uhf();
//连接一个读写器
var test = new con({
host: '172.16.13.6',
port: '9761'
}, function (client) {
uhf.send(client, orders.openUhf);
setTimeout(function () {
uhf.send(client, orders.getVersion);
}, 2000);
}, function (client, data, err) {
uhf.receive(client, data);
if (err) {
console.log(err);
}
});