diff --git a/hardware/Core.PcbDoc b/hardware/Core.PcbDoc index c35f1b6..4f39409 100755 --- a/hardware/Core.PcbDoc +++ b/hardware/Core.PcbDoc Binary files differ diff --git a/hardware/Sheet1.SchDoc b/hardware/Sheet1.SchDoc index f3406a5..50eef07 100755 --- a/hardware/Sheet1.SchDoc +++ b/hardware/Sheet1.SchDoc Binary files differ diff --git a/software/card9.js b/software/card9.js index 8473824..453a471 100755 --- a/software/card9.js +++ b/software/card9.js @@ -14,16 +14,28 @@ client: client, reason: 'System', }); + var timerId = setInterval(function(){ + c.write(encoder.command(defines.commands.heartBeep)); + }, 3000); + var cleanAction = function(){ + local.removeListener('command', commandListener); + c.end(); + clearInterval(timerId); + } + c.on('end', cleanAction); + c.on('error', cleanAction); c.on('end', function() { logger({ event: 'Client disconnected', client: client, reason: 'System', }); - local.removeListener('command', commandListener); }).on('error', function(){ - c.end(); - local.removeListener('command', commandListener); + logger({ + event: 'Client connection lost', + client: client, + reason: 'System', + }); }); var commandListener = function(command){ switch(command){ diff --git a/software/utils/defines.js b/software/utils/defines.js index 0c8a608..e7bfa3c 100644 --- a/software/utils/defines.js +++ b/software/utils/defines.js @@ -27,10 +27,12 @@ doDoorOpen: 0, doAlarmOn: 1, doAlarmOff: 2, + heartBeep: 3, map: [ "doDoorOpen", "doAlarmOn", "doAlarmOff", + "heartBeep" ], }, requests: {