Permalink
Browse files

rfidiot-cli.py set WAIT to pass when any TAG present and add CHANGE f…

…or requesting new TAG
  • Loading branch information...
1 parent e04474c commit 052522b85dcb071685bcac3cda30afa8950b0fef @AdamLaurie committed Oct 25, 2012
Showing with 13 additions and 5 deletions.
  1. +11 −3 rfidiot-cli.py
  2. +2 −2 script.txt
View
@@ -49,6 +49,7 @@
print ' AID <AID|"ALL"|"ANY"> Select ISO 7816 AID'
print ' AIDS List well known AIDs'
print ' APDU <CLA> <INS> <P1> <P2> <LC> <DATA> <LE> Send raw ISO 7816 APDU (use "" for empty elements)'
+ print ' CHANGE <MESSAGE> Print message and wait for TAG to change'
print ' FILE <"A|H"> <ASCII|HEX> Select ISO 7816 FILE'
print ' HSS <SPEED> High Speed Select TAG. SPEED values are:'
print ' 1 == 106 kBaud'
@@ -70,7 +71,7 @@
print ' PROMPT <MESSAGE> Print message and wait for Y/N answer (exit if N)'
print ' SCRIPT <FILE> Read commands from FILE (see script.txt for example)'
print ' SELECT Select TAG'
- print ' WAIT <MESSAGE> Print message and wait for TAG to change'
+ print ' WAIT <MESSAGE> Print message and wait for TAG'
print
print ' Commands will be executed sequentially and must be combined as appropriate.'
print ' Block numbers must be specified in HEX.'
@@ -157,6 +158,15 @@
else:
print ' Failed: '+card.ISO7816ErrorCodes[card.errorcode]
continue
+ if command == 'CHANGE':
+ message= args.pop()
+ print
+ current= card.uid
+ card.waitfortag(message)
+ while card.uid == current or card.uid == '':
+ card.waitfortag('')
+ print
+ continue
if command == 'FILE':
mode= args.pop().upper()
if mode == 'A':
@@ -490,8 +500,6 @@
print
current= card.uid
card.waitfortag(message)
- while card.uid == current or card.uid == '':
- card.waitfortag('')
print
continue
print
View
@@ -11,9 +11,9 @@ mf key a 112233445566 mf auth a 0
#mf write 0 mifare.dat
# blank lines are ignored
-prompt 'Continue (Y/N)?'
mf dump 0 3
-wait 'Waiting for you to change TAG!'
+prompt 'Remove TAG and continue (Y/N)?'
+wait 'Place a TAG on reader...' identify change 'Now provide a different TAG...' identify
select
select # comments are allowed on end of lines

0 comments on commit 052522b

Please sign in to comment.