[Pcsclite-cvs-commit] r6256 - /trunk/PCSC/UnitaryTests/FEATURE_CCID_ESC_COMMAND_Gemalto_features.py

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Wed Apr 4 20:05:14 UTC 2012


Author: rousseau
Date: Wed Apr  4 20:05:12 2012
New Revision: 6256

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6256
Log:
Catch control() exception

If the driver is not configured with
DRIVER_OPTION_CCID_EXCHANGE_AUTHORIZED then the control() will fail with
a SmartcardException() exception.

Modified:
    trunk/PCSC/UnitaryTests/FEATURE_CCID_ESC_COMMAND_Gemalto_features.py

Modified: trunk/PCSC/UnitaryTests/FEATURE_CCID_ESC_COMMAND_Gemalto_features.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/UnitaryTests/FEATURE_CCID_ESC_COMMAND_Gemalto_features.py?rev=6256&op=diff
==============================================================================
--- trunk/PCSC/UnitaryTests/FEATURE_CCID_ESC_COMMAND_Gemalto_features.py (original)
+++ trunk/PCSC/UnitaryTests/FEATURE_CCID_ESC_COMMAND_Gemalto_features.py Wed Apr  4 20:05:12 2012
@@ -21,6 +21,7 @@
 from smartcard.System import readers
 from smartcard.pcsc.PCSCPart10 import (SCARD_SHARE_DIRECT,
     SCARD_LEAVE_CARD, FEATURE_CCID_ESC_COMMAND, getFeatureRequest, hasFeature)
+from smartcard.Exceptions import SmartcardException
 
 
 def test_bit(value, bit):
@@ -43,7 +44,12 @@
     # Proprietary command for Gemalto readers
     # This is implemented by the Gemalto Pinpad v2 and C200 readers
     firmware_features = [0x6A]
-    res = card_connection.control(ccid_esc_command, firmware_features)
+    try:
+        res = card_connection.control(ccid_esc_command, firmware_features)
+    except SmartcardException, ex:
+        print "Failed:", ex
+        return
+
     print res
     print "LogicalLCDLineNumber (Logical number of LCD lines):", res[0]
     print "LogicalLCDRowNumber (Logical number of characters per LCD line):", res[1]




More information about the Pcsclite-cvs-commit mailing list