赞
踩
对于一个学校项目,我们试图在ntag213(Mifare UltralightC180bytes)上编写,但我们无法在其上编写。除此之外,该库可以很好地阅读超轻C/ntag213。在
相同的设置、库和硬件在Mifare 1K标记1024kB上运行良好。在
是否有人已经使用MFRC522读卡器和Mifare超轻C标记(ntag213)在PYTHON中对这个库进行了这样的操作?在def MFRC522_Write(self, blockAddr, writeData):
buff = []
buff.append(self.PICC_WRITE)
buff.append(blockAddr)
crc = self.CalulateCRC(buff)
buff.append(crc[0])
buff.append(crc[1])
(status, backData, backLen) = self.MFRC522_ToCard(self.PCD_TRANSCEIVE, buff)
#because of a timeout in function ToCard, backdata after this is empty!!!!!!!!!
if not(status == self.MI_OK) or not(backLen == 4) or not((backData[0] & 0x0F) == 0x0A):
status = self.MI_ERR
print str(backLen)+" backdata &0x0F == 0x0A "+str(backData[0]&0x0F)
if status == self.MI_OK:
i = 0
buf = []
while i < 16:
buf.append(writeData[i])
i = i + 1
crc = self.CalulateCRC(buf)
buf.append(crc[0])
buf.append(crc[1])
(status, backData, backLen) = self.MFRC522_ToCard(self.PCD_TRANSCEIVE,buf)
if not(status == self.MI_OK) or not(backLen == 4) or not((backData[0] & 0x0F) == 0x0A):
print "Error while writing"
if status == self.MI_OK:
print "Data written"
因此,我们正在查看ToCard函数以查找错误:
^{pr2}$
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。