fix mifare and NTAG cohabitation

This commit is contained in:
danjperron
2024-01-17 19:48:38 -05:00
parent db28b9fba2
commit 12d4ac0408
2 changed files with 9 additions and 3 deletions

View File

@@ -42,8 +42,14 @@ try:
#reader.writeNTAGPage(5,data) #reader.writeNTAGPage(5,data)
#reader.MFRC522_Dump_NTAG(uid,Start=5,End=6) #reader.MFRC522_Dump_NTAG(uid,Start=5,End=6)
else: else:
defaultKey = [255,255,255,255,255,255] (stat, tag_type) = reader.request(reader.REQIDL)
reader.MFRC522_DumpClassic1K(uid,Start=0, End=64, keyA=defaultKey) if stat == reader.OK:
(stat, uid2) = reader.SelectTagSN()
if stat == reader.OK:
if uid != uid2:
continue
defaultKey = [255,255,255,255,255,255]
reader.MFRC522_DumpClassic1K(uid,Start=0, End=64, keyA=defaultKey)
PreviousCard = uid PreviousCard = uid
else: else:
pass pass

View File

@@ -472,5 +472,5 @@ class MFRC522:
self.NTAG= self.NTAG_216 self.NTAG= self.NTAG_216
self.NTAG_MaxPage = 230 self.NTAG_MaxPage = 230
return True return True
return false return False