[Pcsclite-cvs-commit] r5978 - /trunk/PCSC/src/spy/pcsc-spy.py

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Sep 27 08:47:50 UTC 2011


Author: rousseau
Date: Tue Sep 27 08:47:50 2011
New Revision: 5978

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5978
Log:
Display dwActiveProtocol parameter in human form

Modified:
    trunk/PCSC/src/spy/pcsc-spy.py

Modified: trunk/PCSC/src/spy/pcsc-spy.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/spy/pcsc-spy.py?rev=5978&op=diff
==============================================================================
--- trunk/PCSC/src/spy/pcsc-spy.py (original)
+++ trunk/PCSC/src/spy/pcsc-spy.py Tue Sep 27 08:47:50 2011
@@ -138,6 +138,21 @@
         self.log_in("dwPreferredProtocols: %s (%s)" % (dwPreferredProtocols,
             ", ".join(PreferredProtocols)))
 
+    def log_out_dwActiveProtocol(self):
+        """ log dwActiveProtocol OUT parameter """
+        dwActiveProtocol = self.filedesc.readline().strip()
+        protocol = int(dwActiveProtocol, 16)
+        if protocol & 1:
+            protocol = "T=0"
+        elif protocol & 2:
+            protocol = "T=1"
+        elif protocol & 4:
+            protocol = "RAW"
+        elif protocol & 8:
+            protocol = "T=15"
+        self.log_out("dwActiveProtocol: %s (%s)" % (dwActiveProtocol,
+            protocol))
+
     def log_out_hContext(self):
         """ log hContext OUT parameter """
         hContext = self.filedesc.readline().strip()
@@ -248,7 +263,7 @@
         self.log_in2("phCard")
         self.log_in2("pdwActiveProtocol")
         self.log_out2("phCard")
-        self.log_out2("pdwActiveProtocol")
+        self.log_out_dwActiveProtocol()
         self._log_rv()
 
     def _SCardTransmit(self):
@@ -311,7 +326,7 @@
         self.log_in_dwShareMode()
         self.log_in_dwPreferredProtocols()
         self.log_in2("dwInitialization")
-        self.log_out2("dwActiveProtocol")
+        self.log_out_dwActiveProtocol()
         self._log_rv()
 
     def _SCardDisconnect(self):




More information about the Pcsclite-cvs-commit mailing list