var Q=require("queue");function amt_heci(){var d=require("events").inherits(this);d.createEvent("error");var u=require("heci");var y=function(E){require("MeshAgent").SendCommand({action:"msg",type:"console",value:E})};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 F(H){if(this.Parent._rq.isEmpty()){this.Parent.emit("error",H)}else{var J=this.Parent._rq.deQueue();var I=J.optional;var G=J.func;I.unshift({Status:-1});G.apply(this.Parent,I);if(!this.Parent._rq.isEmpty()){this.connect(u.GUIDS.AMT,{noPipeline:1})}}});this._amt.on("connect",function E(){this.on("data",function G(I){var J=this.Parent.getCommand(I);var L=this.Parent._rq.deQueue();var K=L.optional;var H=L.func;K.unshift(J);H.apply(this.Parent,K);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 B(E){var F=E.indexOf("\0");if(F>=0){return E.substring(0,F)}else{return E}}this.getCommand=function g(E){var F=E.length==0?(this._rq.peekQueue().cmd|8388608):E.readUInt32LE(4);var G={IsResponse:(F&8388608)==8388608?true:false,Command:(F&8388607),Status:E.length!=0?E.readUInt32LE(12):-1,Data:E.length!=0?E.slice(16):null};return(G)};this.sendCommand=function x(){if(arguments.length<3||typeof(arguments[0])!="number"||typeof(arguments[1])!="object"||typeof(arguments[2])!="function"){throw ("invalid parameters")}var E=[];for(var G=3;G0){N.BiosVersion=N.BiosVersion.substring(0,N.BiosVersion.indexOf("\0"))}L.unshift(N)}else{L.unshift(null)}I.apply(this,L)},E,G)};function D(G,F){if((F==null)&&(typeof(F)!="number")){return null}if(G==null){G=""}var H="";for(var E=0;E0){J.unshift(I.Data.slice(2,2+K).toString())}else{J.unshift(null)}}else{J.unshift(null)}H.apply(this,J)},E,G)};this.getHashHandles=function k(E){var G=[];for(var F=1;F0){this.getCertHashEntry(G.shift(),this._getHashEntrySink,F,H,E,G)}else{H.unshift(E);F.apply(this,H)}};this.getLocalSystemAccount=function m(E){var G=[];for(var F=1;F>24)&255)+"."+((K>>16)&255)+"."+((K>>8)&255)+"."+(K&255);O.unshift(N);L.apply(this,O)}else{O.unshift(null);L.apply(this,O)}},E,J)};this.unprovision=function C(H,E){var I=[];for(var G=2;G