mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-19 09:43:20 +00:00
Much improved, better stability, lots of fixes
This commit is contained in:
36
Debug/heci.js
Normal file
36
Debug/heci.js
Normal file
@@ -0,0 +1,36 @@
|
||||
var heci = require('heci');
|
||||
var amt = null;
|
||||
|
||||
console.log("Starting HECI test...");
|
||||
console.log("LME GUID = " + heci.GUIDS.LME.toString('hex'));
|
||||
console.log("AMT GUID = " + heci.GUIDS.AMT.toString('hex'));
|
||||
heci.doIoctl(heci.IOCTL.HECI_VERSION, null, new Buffer(16), OnVersion);
|
||||
|
||||
function OnVersion(status, buffer, arg)
|
||||
{
|
||||
if(status == 0)
|
||||
{
|
||||
console.log("HECI Driver Version = " + buffer[0] + "." + buffer[1]);
|
||||
console.log("Attempting to create AMT/HECI connection");
|
||||
amt = heci.create();
|
||||
amt.connect(heci.GUIDS.AMT);
|
||||
amt.on('connect', OnAMT);
|
||||
amt.on('error', function (e) { console.log(e); });
|
||||
}
|
||||
else {
|
||||
console.log("Could not determine HECI Driver Version");
|
||||
}
|
||||
}
|
||||
function OnAMT()
|
||||
{
|
||||
console.log('AMT Connected');
|
||||
amt.on('data', OnAMTData);
|
||||
|
||||
var header = Buffer.from('010100001A00000400000000', 'hex');
|
||||
amt.write(header);
|
||||
}
|
||||
|
||||
function OnAMTData(chunk)
|
||||
{
|
||||
console.log('Received ' + chunk.length + ' bytes of AMT Data');
|
||||
}
|
||||
Reference in New Issue
Block a user