Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何捕获RFID卡&x27;通过使用Python2.7在读卡器上闪烁卡来获取UID?_Python_Python 2.7_Smartcard_Rfid_Smartcard Reader - Fatal编程技术网

如何捕获RFID卡&x27;通过使用Python2.7在读卡器上闪烁卡来获取UID?

如何捕获RFID卡&x27;通过使用Python2.7在读卡器上闪烁卡来获取UID?,python,python-2.7,smartcard,rfid,smartcard-reader,Python,Python 2.7,Smartcard,Rfid,Smartcard Reader,我有一个RFID项目,希望系统检测读卡器上的卡,因为它在读取范围内,捕获UID并继续该过程。到目前为止,我已经放置了一个名为ScanCard的按钮,在其中我放置了读卡功能,它将返回卡的UID。我只使用了两种ATR。想摆脱扫描卡按钮,想自动扫描功能。我在Windows7上使用Python2.7和HID万能钥匙读卡器 atr = "3B 8F 80 01 80 4F 0C A0 00 00 03 06 0A 00 18 00 00 00 00 7A" cardtype = ATRCardType(

我有一个RFID项目,希望系统检测读卡器上的卡,因为它在读取范围内,捕获UID并继续该过程。到目前为止,我已经放置了一个名为ScanCard的按钮,在其中我放置了读卡功能,它将返回卡的UID。我只使用了两种ATR。想摆脱扫描卡按钮,想自动扫描功能。我在Windows7上使用Python2.7和HID万能钥匙读卡器

atr = "3B 8F 80 01 80 4F 0C A0 00 00 03 06 0A 00 18 00 00 00 00 7A"

cardtype = ATRCardType( toBytes( "%s" %(atr) ))

cardrequest = CardRequest( timeout=1, cardType=cardtype )

cardservice = cardrequest.waitforcard()

cardservice.connection.connect()

SELECT = [0xFF, 0xCA, 0x00, 0x00, 0x00]

apdu = SELECT

print 'sending ' + toHexString(apdu)

response, sw1, sw2 = cardservice.connection.transmit( apdu )

print 'response: ', response, ' status words: ', "%x %x" % (sw1, sw2)

tagid = toHexString(response).replace(' ','')

print "tagid ",tagid

id = tagid

print" UID is",id

上面的代码就是我现在所遵循的。我需要保持等待卡不受限制,有什么最佳方法可以做到这一点?

也许可以尝试,例如我链接到的监控部分。

您尝试了什么?我已经发布了一个答案,但那只是一个快速的谷歌搜索。嗨,pyscard支持omneykey 5421非接触式阅读器吗?ThanksCCID设备符合PCSC标准,因此如果它不支持该读卡器,我会非常惊讶。1386 Isropox卡II的ADPU是什么?我在网上任何地方都找不到它。谢谢你advanced@Pototo没有,这似乎不是一张支持APDU的卡。虽然有些存储卡也有一个APDU层,但已经为智能卡定义了APDU(使用CPU)。接近卡:不太可能。