diff --git a/software/config.js b/software/config.js index 2318d01..2ea2d41 100644 --- a/software/config.js +++ b/software/config.js @@ -3,4 +3,5 @@ bindPort : 57005, logFile : "./access.log", sockFile : "/tmp/card9.sock" + accounts9 : "https://accounts.net9.org" }; \ No newline at end of file diff --git a/software/utils/ProtocolBinarify.js b/software/utils/ProtocolBinarify.js new file mode 100644 index 0000000..c6424bb --- /dev/null +++ b/software/utils/ProtocolBinarify.js @@ -0,0 +1,8 @@ +module.exports = { + command: function(type){ + return new Buffer([0xA1, 0x01, 0x01, 0x00, type]); + } + response: function(type){ + return new Buffer([0xA1, 0x03, 0x01, 0x00, type]); + } +}; \ No newline at end of file diff --git a/software/utils/defines.js b/software/utils/defines.js new file mode 100644 index 0000000..5c93dfb --- /dev/null +++ b/software/utils/defines.js @@ -0,0 +1,29 @@ +module.exports = { + event: 0, + command: 1, + request: 2, + response: 3, + events: { + cardDidScan: 0, + doorDidOpen: 1, + doorDidClose: 2, + doorReleaseDidTriggered: 3, + alarmDidOn: 4, + alarmDidOff: 5, + doorWillOpen: 6, + alarmWillOff: 7, + }, + commands: { + doDoorOpen: 0, + doAlarmOn: 1, + doAlarmOff: 2, + }, + requests: { + auth: 0, + }, + responses: { + negative: 0, + positive: 1, + natural: 2, + }, +} \ No newline at end of file