fix readSectorBlock
This commit is contained in:
10
mfrc522.py
10
mfrc522.py
@@ -345,14 +345,12 @@ class MFRC522:
|
|||||||
return self.write(absoluteBlock, data)
|
return self.write(absoluteBlock, data)
|
||||||
return self.ERR
|
return self.ERR
|
||||||
|
|
||||||
def readSectorBlock(self,uid ,sector, block, data,keyA=None, keyB = None):
|
def readSectorBlock(self,uid ,sector, block, keyA=None, keyB = None):
|
||||||
absoluteBlock = sector * 4 + (block % 4)
|
absoluteBlock = sector * 4 + (block % 4)
|
||||||
if page > 63 :
|
if absoluteBlock > 63 :
|
||||||
return self.ERR, None
|
return self.ERR, None
|
||||||
if len(data) != 16:
|
if self.authKeys(uid,absoluteBlock,keyA,keyB) != self.ERR :
|
||||||
return self.ERR, None
|
return self.read(absoluteBlock)
|
||||||
if self.authKeys(uid,page,KeyA,KeyB) != self.ERR :
|
|
||||||
return self.read(page)
|
|
||||||
return self.ERR, None
|
return self.ERR, None
|
||||||
|
|
||||||
def MFRC522_DumpClassic1K(self,uid, Start=0, End=64, keyA=None, keyB=None):
|
def MFRC522_DumpClassic1K(self,uid, Start=0, End=64, keyA=None, keyB=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user