atrhandler.c File Reference

This keeps track of smartcard protocols, timing issues and ATR (Answer-to-Reset) handling. More...

#include "config.h"
#include <syslog.h>
#include <string.h>
#include "misc.h"
#include "pcsclite.h"
#include "debuglog.h"
#include "atrhandler.h"

Go to the source code of this file.

Functions

short ATRDecodeAtr (PSMARTCARD_EXTENSION psExtension, PUCHAR pucAtr, DWORD dwLength)
 parse an ATR


Detailed Description

This keeps track of smartcard protocols, timing issues and ATR (Answer-to-Reset) handling.

Note:
use ./configure --enable-debugatr to enable debug messages to be logged.

Definition in file atrhandler.c.


Function Documentation

short ATRDecodeAtr ( PSMARTCARD_EXTENSION  psExtension,
PUCHAR  pucAtr,
DWORD  dwLength 
)

parse an ATR

Parameters:
[out] psExtension 
[in] pucAtr ATR
[in] dwLength ATR length
Returns:

Return values:
0 Atr must have TS and T0
0 Unable to decode TS byte
0 Unable to decode LNS
0 Unable do decode T protocol
0 Maximum attribute size
1 Success

Definition at line 44 of file atrhandler.c.

References _SMARTCARD_EXTENSION::ATR, _SMARTCARD_EXTENSION::_CardCapabilities::AvailableProtocols, _SMARTCARD_EXTENSION::_CardCapabilities::_T0::BGT, _SMARTCARD_EXTENSION::_CardCapabilities::_T1::BGT, _SMARTCARD_EXTENSION::_CardCapabilities::_T0::BWT, _SMARTCARD_EXTENSION::_CardCapabilities::_T1::BWT, _SMARTCARD_EXTENSION::CardCapabilities, _SMARTCARD_EXTENSION::_CardCapabilities::_T0::CGT, _SMARTCARD_EXTENSION::_CardCapabilities::_T1::CGT, _SMARTCARD_EXTENSION::_CardCapabilities::Convention, _SMARTCARD_EXTENSION::_CardCapabilities::CurrentProtocol, _SMARTCARD_EXTENSION::_CardCapabilities::_T0::CWT, _SMARTCARD_EXTENSION::_CardCapabilities::_T1::CWT, _SMARTCARD_EXTENSION::_ATR::HistoryLength, _SMARTCARD_EXTENSION::_ATR::HistoryValue, _SMARTCARD_EXTENSION::_ATR::Length, Log2, Log3, Log4, Log9, LogXxd, MAX_ATR_SIZE, PCSC_LOG_DEBUG, SCARD_CONVENTION_DIRECT, SCARD_CONVENTION_INVERSE, SCARD_PROTOCOL_T0, SCARD_PROTOCOL_T1, SCARD_PROTOCOL_T15, SCARD_PROTOCOL_UNSET, _SMARTCARD_EXTENSION::_CardCapabilities::T0, _SMARTCARD_EXTENSION::_CardCapabilities::T1, _SMARTCARD_EXTENSION::_ATR::Value, _SMARTCARD_EXTENSION::_CardCapabilities::_T0::WT, and _SMARTCARD_EXTENSION::_CardCapabilities::_T1::WT.

Referenced by IFDPowerICC(), IFDStatusICC(), PHGetAvailableProtocols(), and PHGetDefaultProtocol().


Generated on Mon Aug 27 13:41:04 2007 for pcsc-lite by  doxygen 1.5.2