Fixed read.py in rfid-read feature (because removes trailing zeros)
This commit is contained in:
parent
348e784259
commit
e757cc2a15
|
@ -27,10 +27,31 @@ if status != MIFAREReader.MI_OK:
|
||||||
exit(127);
|
exit(127);
|
||||||
|
|
||||||
# [6] Print UID
|
# [6] Print UID
|
||||||
suid = str(hex(uid[0]))[2:];
|
hexCode = [];
|
||||||
suid += '-' + str(hex(uid[1]))[2:];
|
hexcode.append( str(hex(uid[0]))[2:] );
|
||||||
suid += '-' + str(hex(uid[2]))[2:];
|
hexcode.append( str(hex(uid[1]))[2:] );
|
||||||
suid += '-' + str(hex(uid[3]))[2:];
|
hexcode.append( str(hex(uid[2]))[2:] );
|
||||||
|
hexcode.append( str(hex(uid[3]))[2:] );
|
||||||
|
|
||||||
|
|
||||||
|
if( len(hexCode[0]) == 1 ):
|
||||||
|
hexCode[0] = '0' + hexCode[0];
|
||||||
|
|
||||||
|
if( len(hexCode[1]) == 1 ):
|
||||||
|
hexCode[1] = '0' + hexCode[1];
|
||||||
|
|
||||||
|
if( len(hexCode[2]) == 1 ):
|
||||||
|
hexCode[2] = '0' + hexCode[2];
|
||||||
|
|
||||||
|
if( len(hexCode[3]) == 1 ):
|
||||||
|
hexCode[3] = '0' + hexCode[3];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
suid = hexCode[0];
|
||||||
|
suid += '-' + hexCode[1];
|
||||||
|
suid += '-' + hexCode[2];
|
||||||
|
suid += '-' + hexCode[3];
|
||||||
|
|
||||||
print suid;
|
print suid;
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
Loading…
Reference in New Issue