ccid_raw.py: Reset smartcard method
diff --git a/usb_application/ccid_raw.py b/usb_application/ccid_raw.py
index 9ac15d8..1a51b68 100755
--- a/usb_application/ccid_raw.py
+++ b/usb_application/ccid_raw.py
@@ -23,6 +23,14 @@
print 'State:', state
print 'Protocol:', protocol
print 'ATR:', smartcard.util.toHexString(atr, smartcard.util.HEX)
+ return array.array('B', atr)
+
+ def reset_card(self):
+ hresult, self.dwActiveProtocol = SCardReconnect(self.hcard, SCARD_SHARE_SHARED,
+ SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1, SCARD_RESET_CARD)
+ if hresult != SCARD_S_SUCCESS:
+ raise SmartcardException('Unable to retrieve Atr: ' +
+ SCardGetErrorMessage(hresult))
def connect_card(self):
hresult, self.hcard, self.dwActiveProtocol = SCardConnect(self.hcontext, self.reader,