[Pcsclite-cvs-commit] r4357 - /trunk/PCSC/UnitaryTests/control_get_firmware.py

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Jul 31 09:01:43 UTC 2009


Author: rousseau
Date: Fri Jul 31 09:01:43 2009
New Revision: 4357

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4357
Log:
get firmware version of Gemalto readers

Added:
    trunk/PCSC/UnitaryTests/control_get_firmware.py   (with props)

Added: trunk/PCSC/UnitaryTests/control_get_firmware.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/UnitaryTests/control_get_firmware.py?rev=4357&op=file
==============================================================================
--- trunk/PCSC/UnitaryTests/control_get_firmware.py (added)
+++ trunk/PCSC/UnitaryTests/control_get_firmware.py Fri Jul 31 09:01:43 2009
@@ -1,0 +1,33 @@
+#! /usr/bin/env python
+
+#   control_get_firmware.py: get firmware version of Gemalto readers
+#   Copyright (C) 2009  Ludovic Rousseau
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program; if not, write to the Free Software Foundation, Inc.,
+#   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from smartcard.pcsc.PCSCReader import readers
+from smartcard.pcsc.PCSCPart10 import *
+from smartcard.util import toHexString
+
+for reader in readers():
+    cardConnection = reader.createConnection()
+    cardConnection.connect(mode=SCARD_SHARE_DIRECT)
+
+    get_firmware = [ 0x02 ]
+    IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE = SCARD_CTL_CODE(1)
+    res = cardConnection.control(IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE, get_firmware)
+    print "Reader:", reader
+    print "Firmware:", "".join(map(chr, res))
+

Propchange: trunk/PCSC/UnitaryTests/control_get_firmware.py
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pcsclite-cvs-commit mailing list