var Q=require("queue");function amt_heci(){var d=require("events").inherits(this);d.createEvent("error");var u=require("heci");this._ObjectID="pthi";this._rq=new Q();this._setupPTHI=function b(){this._amt=u.create();this._amt.BiosVersionLen=65;this._amt.UnicodeStringLen=20;this._amt.Parent=this;this._amt.on("error",function E(G){if(this.Parent._rq.isEmpty()){this.Parent.emit("error",G)}else{var I=this.Parent._rq.deQueue();var H=I.optional;var F=I.func;H.unshift({Status:-1});F.apply(this.Parent,H);if(!this.Parent._rq.isEmpty()){this.connect(u.GUIDS.AMT,{noPipeline:1})}}});this._amt.on("connect",function D(){this.on("data",function F(H){var I=this.Parent.getCommand(H);var K=this.Parent._rq.deQueue();var J=K.optional;var G=K.func;J.unshift(I);G.apply(this.Parent,J);if(this.Parent._rq.isEmpty()){this.Parent._amt.disconnect();this.Parent._amt=null}else{this.write(this.Parent._rq.peekQueue().send)}});this.write(this.Parent._rq.peekQueue().send)})};function A(D){var E=D.indexOf("\0");if(E>=0){return D.substring(0,E)}else{return D}}this.getCommand=function g(D){var E=D.length==0?(this._rq.peekQueue().cmd|8388608):D.readUInt32LE(4);var F={IsResponse:(E&8388608)==8388608?true:false,Command:(E&8388607),Status:D.length!=0?D.readUInt32LE(12):-1,Data:D.length!=0?D.slice(16):null};return(F)};this.sendCommand=function x(){if(arguments.length<3||typeof(arguments[0])!="number"||typeof(arguments[1])!="object"||typeof(arguments[2])!="function"){throw ("invalid parameters")}var D=[];for(var F=3;F0){M.BiosVersion=M.BiosVersion.substring(0,M.BiosVersion.indexOf("\0"))}K.unshift(M)}else{K.unshift(null)}H.apply(this,K)},D,F)};function C(F,E){if((E==null)&&(typeof(E)!="number")){return null}if(F==null){F=""}var G="";for(var D=0;D0){I.unshift(H.Data.slice(2,2+J).toString())}else{I.unshift(null)}}else{I.unshift(null)}G.apply(this,I)},D,F)};this.getHashHandles=function k(D){var F=[];for(var E=1;E0){this.getCertHashEntry(F.shift(),this._getHashEntrySink,E,G,D,F)}else{G.unshift(D);E.apply(this,G)}};this.getLocalSystemAccount=function m(D){var F=[];for(var E=1;E>24)&255)+"."+((J>>16)&255)+"."+((J>>8)&255)+"."+(J&255);N.unshift(M);K.apply(this,N)}else{N.unshift(null);K.apply(this,N)}},D,I)};this.unprovision=function B(G,D){var H=[];for(var F=2;F