From: leslie Date: Sun, 22 Mar 2009 04:59:36 +0000 (+0800) Subject: smartcards: add single reset mode X-Git-Tag: 0.9.2~50 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=99c7d018331fff7f87a1431bb53eaac724ff0088;p=sasc-ng.git smartcards: add single reset mode --- diff --git a/smartcard.c b/smartcard.c index f0715f7..b592404 100644 --- a/smartcard.c +++ b/smartcard.c @@ -78,7 +78,7 @@ protected: const struct CardConfig *cfg; unsigned char sb[SB_LEN]; struct Atr atr; - bool localecho; + bool localecho, singlereset; // char devName[256]; int currMode; @@ -106,7 +106,8 @@ static const char *serModes[] = { 0,"8e2","8o2","8n2" }; cSmartCardSlot::cSmartCardSlot(void) { card=0; cfg=0; usecount=0; slotnum=-1; currMode=SM_NONE; clock=ISO_FREQ; - firstRun=true; needsReset=false; dead=false; localecho=true; + firstRun=true; needsReset=false; dead=false; + localecho=true; singlereset=false; } cSmartCardSlot::~cSmartCardSlot() @@ -223,9 +224,10 @@ void cSmartCardSlot::Action(void) else if(DeviceIsInserted()) { if(!dead) { PRINTF(L_CORE_SC,"%d: new card inserted",slotnum); + bool resetdone=false; for(int mode=SM_NONE+1 ; modeName()); @@ -1080,6 +1082,7 @@ protected: // virtual bool Reset(void); public: + cSmartCardSlotCCID(void); virtual bool IsoRead(const unsigned char *cmd, unsigned char *data); virtual bool IsoWrite(const unsigned char *cmd, const unsigned char *data); virtual int RawRead(unsigned char *data, int len, int to=0) { return -1; } @@ -1088,6 +1091,11 @@ public: static cSmartCardSlotLinkReg __scs_ccid("ccid"); +cSmartCardSlotCCID::cSmartCardSlotCCID(void) +{ + singlereset=true; +} + bool cSmartCardSlotCCID::DeviceOpen(const char *cfg) { if(!cfg || sscanf(cfg,"%255[^:]",devName)==1) {