[Pcsclite-cvs-commit] r4671 - /trunk/PCSC/UnitaryTests/control_switch_interface.py
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Fri Jan 15 12:56:21 UTC 2010
Author: rousseau
Date: Fri Jan 15 12:56:21 2010
New Revision: 4671
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4671
Log:
improve documentation and output
Modified:
trunk/PCSC/UnitaryTests/control_switch_interface.py
Modified: trunk/PCSC/UnitaryTests/control_switch_interface.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/UnitaryTests/control_switch_interface.py?rev=4671&op=diff
==============================================================================
--- trunk/PCSC/UnitaryTests/control_switch_interface.py (original)
+++ trunk/PCSC/UnitaryTests/control_switch_interface.py Fri Jan 15 12:56:21 2010
@@ -29,20 +29,25 @@
switch_interface = [0x52, 0xF8, 0x04, 0x01, 0x00, interface]
IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE = SCARD_CTL_CODE(1)
- print "Reader:", reader,
+ print "Reader:", reader, "=>",
try:
res = cardConnection.control(IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE,
switch_interface)
except:
print "FAILED"
else:
- print res
+ if res != [0, 0, 0, 0]:
+ print "Failed: ", map(hex, res)
+ else:
+ print "Success"
if __name__ == "__main__":
import sys
+ # 01h = Switch to contactless interface
+ # 02h = Switch to contact interface
+
# switch to contactless by default
- # use 2 as argument on the command line to switch to contact
interface = 0x01
if len(sys.argv) > 1:
interface = int(sys.argv[1])
More information about the Pcsclite-cvs-commit
mailing list