我一直在研究hid万能5325 cl,并试图获得ATR值。我在Ubuntu上使用pcscd和pyscard库。系统自动获得ATR使用T0协议,但我需要原始返回。在使用helloprox或万能软件的窗口上,我可以得到我需要的东西,但在ubuntu上,尽管我已经更改了协议,但ATR没有改变。
下面是我使用的代码:
class PrintObserver(CardObserver):
"""A simple card observer that is notified
when cards are inserted/removed from the system and
prints the list of cards
"""
def update(self, observable, actions):
(addedcards, removedcards) = actions
for card in addedcards:
card.connection=card.createConnection()
card.connection.connect(protocol=CardConnection.RAW_protocol)
binary_atr=bin(int(toHexString(card.connection.getATR()).replace(" ",""), 16))
binary_atr=binary_atr[len(binary_atr)-24:len(binary_atr)-1]
print int(binary_atr,2)
for card in removedcards:
print "-Removed: ", toHexString(card.atr)
if __name__ == '__main__':
cardmonitor = CardMonitor()
cardobserver = PrintObserver()
cardmonitor.addObserver(cardobserver)
#Get Ports
config=ConfigParser.ConfigParser()
config.read('../config.ini')
Read_Port=int(config.get('CardReaderSocketPorts','Read',0))
Write_Port=int(config.get('CardReaderSocketPorts','Write',0))
# Initialise socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_address = ('localhost', Read_Port)
return_address = ('localhost', Write_Port)
sock.bind(server_address)
while 1:
message, address = sock.recvfrom(4096)
if message:
parsed_json=json.loads(message)
#Single Line
if parsed_json['set'].upper()=="Stop":
sock.sendto('{"success":"True"}',return_address)
break
# don't forget to remove observer, or the
# monitor will poll forever...
cardmonitor.deleteObserver(cardobserver)发布于 2016-06-30 10:46:14
联系了Omnikey支持,解决了问题。与开发人员指南一样,我正在寻找配置文件"/etc/cmrfid.ini“来更改prox格式。文件名改为"/etc/Omnikey.ini“
发布于 2016-06-28 20:14:50
有些考虑可能会有所帮助,即使它们没有添加到完整的答案中:
因此,我的建议是,联系Omnikey支持,如何从Linux出发。根据我的经验,他们是合作的。
https://stackoverflow.com/questions/38070499
复制相似问题