NFC capability started

This commit is contained in:
Conor Patrick
2018-07-22 23:40:27 -04:00
parent bfd14ec6bf
commit 58ec4b16c5
10 changed files with 1112 additions and 35 deletions

32
tools/nfcmon.py Normal file
View File

@@ -0,0 +1,32 @@
import datetime,sys
from binascii import hexlify
import Chameleon
def verboseLog(text):
formatString = "[{}] {}"
timeString = datetime.datetime.utcnow()
print(formatString.format(timeString, text), )
chameleon = Chameleon.Device(verboseLog)
p = None
for p in Chameleon.Device.listDevices():
break
if p:
chameleon.connect(p)
else:
raise RuntimeError('No chameleon mini connected')
chameleon.execCmd('LOGMODE=LIVE')
while 1:
b = chameleon.read(1,20)
h = hexlify(b)
h = h.decode()
sys.stdout.write(h)
sys.stdout.flush()
chameleon.execCmd('LOGMODE=NONE')