mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-10 21:33:38 +00:00
Updated AMT detection/test
This commit is contained in:
@@ -68,12 +68,26 @@ function coreInfo()
|
|||||||
switch(J.action)
|
switch(J.action)
|
||||||
{
|
{
|
||||||
case 'coreinfo':
|
case 'coreinfo':
|
||||||
handler.coreinfo = true;
|
if (!handler.coreinfo)
|
||||||
console.log(' -> Core Info received..............[OK]');
|
{
|
||||||
console.log('');
|
handler.coreinfo = true;
|
||||||
console.log(' ' + J.osdesc);
|
console.log(' -> Core Info received..............[OK]');
|
||||||
console.log(' ' + J.value);
|
console.log('');
|
||||||
console.log('');
|
console.log(' ' + J.osdesc);
|
||||||
|
console.log(' ' + J.value);
|
||||||
|
console.log('');
|
||||||
|
}
|
||||||
|
if (J.intelamt && J.intelamt.microlms == 'CONNECTED')
|
||||||
|
{
|
||||||
|
if (!handler.microlms)
|
||||||
|
{
|
||||||
|
handler.microlms = true;
|
||||||
|
console.log(' -> Micro LMS.....................[CONNECTED]');
|
||||||
|
|
||||||
|
this.removeListener('command', handler);
|
||||||
|
handler.promise._res();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (process.argv.includes('--showCoreInfo="1"'))
|
if (process.argv.includes('--showCoreInfo="1"'))
|
||||||
{
|
{
|
||||||
console.log('\n' + JSON.stringify(J) + '\n');
|
console.log('\n' + JSON.stringify(J) + '\n');
|
||||||
@@ -81,38 +95,68 @@ function coreInfo()
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case 'smbios':
|
case 'smbios':
|
||||||
handler.rcount++;
|
if (!handler.smbios)
|
||||||
console.log(' -> SMBIOS Info received.............[OK]');
|
|
||||||
var tables = null;
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
tables = require('smbios').parse(J.value);
|
handler.smbios = true;
|
||||||
console.log(' -> AMT Support...................[' + ((tables.amtInfo && tables.amtInfo.AMT == true) ? 'YES' : 'NO') + ']');
|
console.log(' -> SMBIOS Info received.............[OK]');
|
||||||
|
var tables = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tables = require('smbios').parse(J.value);
|
||||||
|
handler.amt = tables.amtInfo && tables.amtInfo.AMT;
|
||||||
|
console.log(' -> AMT Support...................[' + ((tables.amtInfo && tables.amtInfo.AMT == true) ? 'YES' : 'NO') + ']');
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
handler.promise._rej(' -> (Parse Error).................[FAILED]');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!handler.amt) { handler.promise._res(); }
|
||||||
}
|
}
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
console.log(' -> (Parse Error).................[FAILED]');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.argv.includes('--smbios="1"'))
|
if (process.argv.includes('--smbios="1"'))
|
||||||
{
|
{
|
||||||
console.log(JSON.stringify(tables));
|
console.log(JSON.stringify(tables));
|
||||||
//console.log('\n' + JSON.stringify(J) + '\n');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(handler.rcount>0 && handler.coreinfo)
|
|
||||||
{
|
|
||||||
this.removeListener('command', handler);
|
|
||||||
handler.promise._res();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
ret.handler.promise = ret;
|
ret.handler.promise = ret;
|
||||||
ret.handler.coreinfo = false;
|
ret.handler.coreinfo = false;
|
||||||
ret.handler.rcount = 0;
|
ret.handler.smbios = false;
|
||||||
|
ret.handler.microlms = false;
|
||||||
|
ret.handler.amt = false;
|
||||||
ret.tester.on('command', ret.handler);
|
ret.tester.on('command', ret.handler);
|
||||||
|
|
||||||
|
ret.handler.timeout = setTimeout(function (r)
|
||||||
|
{
|
||||||
|
if(!r.handler.coreinfo)
|
||||||
|
{
|
||||||
|
// Core Info was never recevied
|
||||||
|
r._rej(' -> Core Info received..............[FAILED]')
|
||||||
|
}
|
||||||
|
else if(r.handler.amt)
|
||||||
|
{
|
||||||
|
// AMT support, so check Micro LMS
|
||||||
|
if(r.handler.microlms)
|
||||||
|
{
|
||||||
|
r._res();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No MicroLMS, so let's check to make sure there is an LMS service running
|
||||||
|
console.log(' -> Micro LMS.....................[NO]');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No AMT Support
|
||||||
|
r._res();
|
||||||
|
}
|
||||||
|
}, 5000, ret);
|
||||||
|
|
||||||
require('MeshAgent').emit('Connected', 3);
|
require('MeshAgent').emit('Connected', 3);
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
|
|||||||
Reference in New Issue
Block a user