1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-02-26 09:23:36 +00:00

linux update

This commit is contained in:
Bryan Roe
2020-05-27 16:57:57 -07:00
parent b24a9ec638
commit 2c3585627b
3 changed files with 338 additions and 37 deletions

View File

@@ -398,20 +398,25 @@ function amt_heci() {
fn.apply(this, opt);
}, callback, optional);
}
this.getProtocolVersion = function getProtocolVersion(callback) {
this.getProtocolVersion = function getProtocolVersion(callback)
{
var optional = [];
for (var i = 1; i < arguments.length; ++i) { opt.push(arguments[i]); }
heci.doIoctl(heci.IOCTL.HECI_VERSION, Buffer.alloc(5), Buffer.alloc(5), function (status, buffer, self, fn, opt) {
if (!this._tmpSession) { this._tmpSession = heci.create(); this._tmpSession.parent = this;}
this._tmpSession.doIoctl(heci.IOCTL.HECI_VERSION, Buffer.alloc(5), Buffer.alloc(5), function (status, buffer, self, fn, opt)
{
if (status == 0) {
var result = buffer.readUInt8(0).toString() + '.' + buffer.readUInt8(1).toString() + '.' + buffer.readUInt8(2).toString() + '.' + buffer.readUInt16BE(3).toString();
opt.unshift(result);
fn.apply(self, opt);
}
else {
else
{
opt.unshift(null);
fn.apply(self, opt);
}
}, this, callback, optional);
}
}