Changes:
pcsc-lite-1.8.7: Ludovic Rousseau
28 November 2012
- Fix a problem when a reader is unplugged (and the reader is still in use)
I moved my blog from https://ludovicrousseau.blogspot.com/ to https://blog.apdu.fr/ . Why? I wanted to move away from Blogger (owne...
SCardListReaders()
. The list of available readers and selection of the reader to use is not available from the lua code. The reader selection is done by the cardpeek application using C code directly.function hex_tostring(data)
local r = ""
local i
for i=0,#data-1 do
r = r .. string.char(data[i])
end
return r
end
if card.connect() then
card.tree_startup("ATR")
-- Select applet
select = bytes.new(8, "00 A4 04 00 0A A0 00 00 00 62 03 01 0C 06 01")
sw, resp = card.send(select)
print(string.format("SW: %X", sw))
print(resp)
-- Send command
command = bytes.new(8, "00 00 00 00")
sw, resp = card.send(command)
print(string.format("SW: %X", sw))
print(hex_tostring(resp))
card.disconnect()
end
print()
statement. You could also send the output to cardpeek using log.print()
instead.SW: 9000 SW: 9000 Hello world!