diff options
author | Piotr Dobrowolski <admin@tastycode.pl> | 2016-07-22 23:58:00 +0200 |
---|---|---|
committer | Piotr Dobrowolski <admin@tastycode.pl> | 2016-07-22 23:58:00 +0200 |
commit | dc3227a7cbfcc965f13989e1b2ffbc92663f3f93 (patch) | |
tree | 5ac84c745637cc7a54b2e36b32b199e5f1443464 | |
parent | e04883e09f8aea5c21c0f438b6bdeae23f3972be (diff) | |
download | doorman-dc3227a7cbfcc965f13989e1b2ffbc92663f3f93.tar.gz doorman-dc3227a7cbfcc965f13989e1b2ffbc92663f3f93.tar.bz2 doorman-dc3227a7cbfcc965f13989e1b2ffbc92663f3f93.zip |
Increase space, fix zerofill in emem_print, disable DEBUG, dumper util
Note: emem_print output format has been changed
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | admin/doorman_dump | 18 | ||||
-rw-r--r-- | admin/options.py | 2 | ||||
-rw-r--r-- | arduino/src/config.h | 4 | ||||
-rw-r--r-- | arduino/src/emem.cpp | 4 |
5 files changed, 25 insertions, 4 deletions
@@ -2,3 +2,4 @@ *~ *.swp arduino/eeprom.bin +arduino/.build diff --git a/admin/doorman_dump b/admin/doorman_dump new file mode 100755 index 0000000..f1b0a7c --- /dev/null +++ b/admin/doorman_dump @@ -0,0 +1,18 @@ +#!/usr/bin/env python2 + +from sys import argv + +from lib.actions import scan +from lib.proto import Proto +from lib.storage import get_card +from lib.password import get_token +from lib.command import signed_command +import options + +if __name__ == '__main__': + url = argv[1] if len(argv) > 1 else options.url + token = get_token() + proto = Proto(url) + proto.send(signed_command(command='P', hash=options.empty_hash, uid=0, token=token)) + while True: + print proto.fd.readline(), diff --git a/admin/options.py b/admin/options.py index 5b63d32..a8dc32a 100644 --- a/admin/options.py +++ b/admin/options.py @@ -1,4 +1,4 @@ -url = '/dev/ttyACM1' +url = '/dev/ttyACM0' serial = dict( baudrate = 19200, timeout = 60, diff --git a/arduino/src/config.h b/arduino/src/config.h index d941578..f6ace33 100644 --- a/arduino/src/config.h +++ b/arduino/src/config.h @@ -7,13 +7,13 @@ /** First record ID. */ #define ENEM_MIN_ADR (1) /** Last record ID. */ -#define EMEM_MAX_ADR (100) +#define EMEM_MAX_ADR (140) /** Invalid record ID. */ #define EMEM_INV_ADR (0) /** Size of stored hash. */ #define EMEM_HASH_SIZE (32) /** Flag that indicates (if defined) verbose mode (for diagnostic) */ -#define DEBUG 1 +// #define DEBUG 1 /** * Flag that indicates (if defined) keyboard simulation mode (for diagnostic). * In this mode keyboard always return pin. diff --git a/arduino/src/emem.cpp b/arduino/src/emem.cpp index ae9fc83..432c76f 100644 --- a/arduino/src/emem.cpp +++ b/arduino/src/emem.cpp @@ -128,8 +128,10 @@ void emem_print() { Serial.print(ii,HEX); Serial.print(','); Serial.print(id,HEX); + Serial.print(','); for (int jj=0;jj<EMEM_HASH_SIZE;jj++){ - Serial.print(','); + if(*(g_Hash+jj) < 16) + Serial.print('0'); Serial.print(*(g_Hash+jj),HEX); } Serial.println(); |