Package smartcard :: Module ATR :: Class ATR
[hide private]
[frames] | no frames]

Class ATR

source code


ATR class.

Instance Methods [hide private]
 
__init__(self, bytes)
Construct a new atr from bytes.
source code
 
__checksyncbyte__(self)
Check validity of TS.
source code
 
__initInstance__(self)
Parse ATR and initialize members:
source code
 
getChecksum(self)
Return the checksum of the ATR.
source code
 
getHistoricalBytes(self)
Return historical bytes.
source code
 
getHistoricalBytesCount(self)
Return count of historical bytes.
source code
 
getInterfaceBytesCount(self)
Return count of interface bytes.
source code
 
getTA1(self)
Return TA1 byte.
source code
 
getTB1(self)
Return TB1 byte.
source code
 
getTC1(self)
Return TC1 byte.
source code
 
getTD1(self)
Return TD1 byte.
source code
 
getBitRateFactor(self)
Return bit rate factor.
source code
 
getClockRateConversion(self)
Return clock rate conversion.
source code
 
getProgrammingCurrent(self)
Return maximum programming current.
source code
 
getProgrammingVoltage(self)
Return programming voltage.
source code
 
getGuardTime(self)
Return extra guard time.
source code
 
getSupportedProtocols(self)
Returns a dictionnary of supported protocols.
source code
 
isT0Supported(self)
Return True if T=0 is supported.
source code
 
isT1Supported(self)
Return True if T=1 is supported.
source code
 
isT15Supported(self)
Return True if T=15 is supported.
source code
 
dump(self)
Dump the details of an ATR.
source code
 
__str__(self)
Returns a string representation of the ATR as a strem of bytes.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  clockrateconversion = [372, 372, 558, 744, 1116, 1488, 1860, '...
  bitratefactor = ['RFU', 1, 2, 4, 8, 16, 32, 'RFU', 12, 20, 'RF...
  currenttable = [25, 50, 100, 'RFU']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bytes)
(Constructor)

source code 

Construct a new atr from bytes.

Overrides: object.__init__

__initInstance__(self)

source code 

Parse ATR and initialize members:

  • TS: initial character
  • T0: format character
  • TA[n], TB[n], TC[n], TD[n], for n=0,1,...: protocol parameters

Note: protocol parameters indices start at 0, e.g. TA[0], TA[1] correspond to the ISO standard TA1, TA2 parameters

  • historicalBytes: the ATR T1, T2, ..., TK historical bytes
  • TCK: checksum byte (only for protocols different from T=0)
  • FI: clock rate conversion factor
  • DI: voltage adjustment factor
  • PI1: programming voltage factor
  • II: maximum programming current factor
  • N: extra guard time

getChecksum(self)

source code 

Return the checksum of the ATR. Checksum is mandatory only for T=1.

__str__(self)
(Informal representation operator)

source code 

Returns a string representation of the ATR as a strem of bytes.

Overrides: object.__str__

Class Variable Details [hide private]

clockrateconversion

Value:
[372,
 372,
 558,
 744,
 1116,
 1488,
 1860,
 'RFU',
...

bitratefactor

Value:
['RFU',
 1,
 2,
 4,
 8,
 16,
 32,
 'RFU',
...