"use strict";(function(){var e=0;"use strict";var t=require("util");var n=require("events");var i=require("./deviceLink");function c(){n.EventEmitter.call(this);if(false===this instanceof c){return new c}var e=this;this.connectState="notConnected";this.deviceLinkInst=new i;this.deviceLinkInst.on("connected",function(){e.connectState="connected";e.emit("connected")});this.deviceLinkInst.on("complete_end",function(){e.emit("complete_end")});this.deviceLinkInst.on("error",function(t){e.emit("error",t)});this.deviceLinkInst.on("close",function(){e.emit("close");e.connectState="notConnected"})}t.inherits(c,n.EventEmitter);c.prototype.connect=function(t){var n=this;this.deviceSn="";if(e==1){console.log(t)}if(typeof t.host!=="undefined"){if(t.protocal==undefined){t.protocal="telnet"}}else if(typeof t.comNum!=="undefined"){t.protocal="serial"}this.deviceLinkInst.connect(t)};c.prototype.exec=function(e,t,n){var i=this;this.deviceLinkInst.exec(e,t,n)};c.prototype.clearCmdList=function(){this.deviceLinkInst.clearCmdList()};c.prototype.execMem=function(e,t,n){var i=this;this.deviceLinkInst.execMem(e,t,n)};c.prototype.execCmdList=function(e){this.deviceLinkInst.execCmdList(e)};c.prototype.clearCmdCache=function(){this.deviceLinkInst.clearCmdCache()};c.prototype.setEncoding=function(e){this.deviceLinkInst.setEncoding(e)};c.prototype.checkIfVsuDevice=function(){return this.deviceLinkInst.checkIfVsuDevice()};c.prototype.getDeviceSn=function(){var e;var t=this.isConnect();if(t){var n=this.deviceLinkInst.getDeviceInfo();e=n.seriaNo;if(e=="xxxxxxxx"){e=""}return e}else{return""}};c.prototype.isConnect=function(){return this.deviceLinkInst.isConnect()};c.prototype.getConnectState=function(){return this.deviceLinkInst.getConnectState()};c.prototype.disConnect=function(){return this.deviceLinkInst.disConnect()};c.prototype.getComList=function(e){var t=require("./serialClient");var n=new t;n.getComList(e)};module.exports=c})();