[Pcsclite-cvs-commit] r5414 - in /trunk/PCSC/src: eventhandler.c winscard.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Mon Nov 22 16:08:50 UTC 2010
Author: rousseau
Date: Mon Nov 22 16:08:35 2010
New Revision: 5414
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5414
Log:
Log the new powerState value at DEBUG level
Modified:
trunk/PCSC/src/eventhandler.c
trunk/PCSC/src/winscard.c
Modified: trunk/PCSC/src/eventhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/eventhandler.c?rev=5414&op=diff
==============================================================================
--- trunk/PCSC/src/eventhandler.c (original)
+++ trunk/PCSC/src/eventhandler.c Mon Nov 22 16:08:35 2010
@@ -256,6 +256,7 @@
{
readerState = SCARD_PRESENT | SCARD_POWERED | SCARD_NEGOTIABLE;
rContext->powerState = POWER_STATE_POWERED;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_POWERED");
if (rContext->readerState->cardAtrLength > 0)
{
@@ -270,6 +271,7 @@
{
readerState = SCARD_PRESENT | SCARD_SWALLOWED;
rContext->powerState = POWER_STATE_UNPOWERED;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED");
Log3(PCSC_LOG_ERROR, "Error powering up card: %d 0x%04X", rv, rv);
}
#endif
@@ -350,6 +352,7 @@
rContext->readerState->cardProtocol = SCARD_PROTOCOL_UNDEFINED;
rContext->readerState->readerState = SCARD_PRESENT;
rContext->powerState = POWER_STATE_UNPOWERED;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED");
readerState = SCARD_PRESENT;
rv = IFD_SUCCESS;
Log1(PCSC_LOG_INFO, "Skip card power on");
@@ -369,11 +372,13 @@
{
rContext->readerState->readerState = SCARD_PRESENT | SCARD_POWERED | SCARD_NEGOTIABLE;
rContext->powerState = POWER_STATE_POWERED;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_POWERED");
}
else
{
rContext->readerState->readerState = SCARD_PRESENT | SCARD_SWALLOWED;
rContext->powerState = POWER_STATE_UNPOWERED;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED");
rContext->readerState->cardAtrLength = 0;
}
#endif
@@ -440,6 +445,7 @@
/* power down */
IFDPowerICC(rContext, IFD_POWER_DOWN, NULL, NULL);
rContext->powerState = POWER_STATE_UNPOWERED;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED");
/* the protocol is unset after a power down */
rContext->readerState->cardProtocol = SCARD_PROTOCOL_UNDEFINED;
@@ -447,9 +453,12 @@
/* the card was in use */
if (POWER_STATE_GRACE_PERIOD == rContext->powerState)
+ {
/* the next state should be UNPOWERED unless the
* card is used again */
rContext->powerState = POWER_STATE_POWERED;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_POWERED");
+ }
#endif
if (rContext->hLockId == 0xFFFF)
Modified: trunk/PCSC/src/winscard.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard.c?rev=5414&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Mon Nov 22 16:08:35 2010
@@ -323,6 +323,7 @@
/* the card is now in use */
rContext->powerState = POWER_STATE_INUSE;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_INUSE");
}
/*******************************************
@@ -806,6 +807,7 @@
return rv;
Log2(PCSC_LOG_DEBUG, "Active Contexts: %d", rContext->contexts);
+ Log2(PCSC_LOG_DEBUG, "dwDisposition: %d", dwDisposition);
if (dwDisposition == SCARD_RESET_CARD ||
dwDisposition == SCARD_UNPOWER_CARD)
@@ -831,6 +833,7 @@
#ifdef DISABLE_AUTO_POWER_ON
rContext->powerState = POWER_STATE_UNPOWERED;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_UNPOWERED");
#else
rv = IFDPowerICC(rContext, IFD_POWER_UP,
rContext->readerState->cardAtr, &dwAtrLen);
@@ -960,9 +963,13 @@
{
#ifdef DISABLE_AUTO_POWER_ON
if (SCARD_RESET_CARD == dwDisposition)
+ {
rContext->powerState = POWER_STATE_GRACE_PERIOD;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_GRACE_PERIOD");
+ }
#else
rContext->powerState = POWER_STATE_GRACE_PERIOD;
+ Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_GRACE_PERIOD");
#endif
}
More information about the Pcsclite-cvs-commit
mailing list