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