Increase space, fix zerofill in emem_print, disable DEBUG, dumper util

Note: emem_print output format has been changed
serial
informatic 2016-07-22 23:58:00 +02:00
parent e04883e09f
commit dc3227a7cb
5 changed files with 25 additions and 4 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
*~
*.swp
arduino/eeprom.bin
arduino/.build

18
admin/doorman_dump Executable file
View File

@ -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(),

View File

@ -1,4 +1,4 @@
url = '/dev/ttyACM1'
url = '/dev/ttyACM0'
serial = dict(
baudrate = 19200,
timeout = 60,

View File

@ -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.

View File

@ -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();