pcsc-lite 2.3.0
atrhandler.c File Reference

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

#include "config.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 (int *availableProtocols, int *currentProtocol, PUCHAR pucAtr, DWORD dwLength)
 parse an ATR
 

Detailed Description

This keeps track of smart card 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

◆ ATRDecodeAtr()

short ATRDecodeAtr ( int * availableProtocols,
int * currentProtocol,
PUCHAR pucAtr,
DWORD dwLength )

parse an ATR

Parameters
[out]availableProtocolsavailable protocols
[out]currentProtocolcurrent protocol
[in]pucAtrATR
[in]dwLengthATR length
Returns
Return values
-1Atr must have TS and T0
-2Unable to decode TS byte
-3Unable to decode LNS
-4Unable do decode T protocol
-5Maximum attribute size
0Success

Definition at line 66 of file atrhandler.c.