amt-sol.js 954 B

1234567891011121314151617181920
  1. /**
  2. * @description Serial-over-LAN Handling Module
  3. * @author Ylian Saint-Hilaire
  4. */
  5. // meshservice meshcmd.js amtterm --host 192.168.2.186 --pass P@ssw0rd
  6. // Construct a Intel AMT Serial-over-LAN object
  7. module.exports = function CreateAmtRemoteSol() {
  8. var obj = {};
  9. obj.protocol = 1; // Serial-over-LAN
  10. obj.debug = false;
  11. obj.onData = null;
  12. obj.xxStateChange = function (newstate) { if (obj.debug) console.log('SOL-StateChange', newstate); if (newstate == 0) { obj.Stop(); } if (newstate == 3) { obj.Start(); } }
  13. obj.Start = function () { if (obj.debug) { console.log('SOL-Start'); } }
  14. obj.Stop = function () { if (obj.debug) { console.log('SOL-Stop'); } }
  15. obj.ProcessData = function (data) { if (obj.debug) { console.log('SOL-ProcessData', data); } if (obj.onData) { obj.onData(obj, data); } }
  16. obj.Send = function(text) { if (obj.debug) { console.log('SOL-Send', text); } obj.parent.Send(text); }
  17. return obj;
  18. }