当前位置:   article > 正文

mfrc522 c语言程序,用mxgxw/MFRC522python库和MFRC522读卡器在raspi2上编写ntag213(Mifare ultralightc)...

rc522 ntag213

对于一个学校项目,我们试图在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}$

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/67746
推荐阅读
相关标签
  

闽ICP备14008679号