summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Dobrowolski <admin@tastycode.pl>2016-07-22 23:58:00 +0200
committerPiotr Dobrowolski <admin@tastycode.pl>2016-07-22 23:58:00 +0200
commitdc3227a7cbfcc965f13989e1b2ffbc92663f3f93 (patch)
tree5ac84c745637cc7a54b2e36b32b199e5f1443464
parente04883e09f8aea5c21c0f438b6bdeae23f3972be (diff)
downloaddoorman-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--.gitignore1
-rwxr-xr-xadmin/doorman_dump18
-rw-r--r--admin/options.py2
-rw-r--r--arduino/src/config.h4
-rw-r--r--arduino/src/emem.cpp4
5 files changed, 25 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 403845c..3f514df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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();