class documentation

class ATR:

Constructor: ATR(atr)

View In Hierarchy

Parse and represent Answer to Reset sequences.

Answer to Reset sequences are defined in ISO 7816-3, section 8.

Method __init__ Parse ATR and initialize members:
Method __str__ Render the ATR as a space-separated string of uppercase hexadecimal pairs.
Method dump Deprecated. Replace usage with `print(ATR.render())`
Method getBitRateFactor Return bit rate factor.
Method getChecksum Return the checksum of the ATR. Checksum is mandatory only for T=1.
Method getClockRateConversion Return clock rate conversion.
Method getGuardTime Return extra guard time.
Method getHistoricalBytes Return historical bytes.
Method getHistoricalBytesCount Return count of historical bytes.
Method getInterfaceBytesCount Return count of interface bytes.
Method getProgrammingCurrent Return maximum programming current.
Method getProgrammingVoltage Return programming voltage.
Method getSupportedProtocols Returns a dictionary of supported protocols.
Method getTA1 Return TA1 byte.
Method getTB1 Return TB1 byte.
Method getTC1 Return TC1 byte.
Method getTD1 Return TD1 byte.
Method isT0Supported Return True if T=0 is supported.
Method isT15Supported Return True if T=15 is supported.
Method isT1Supported Return True if T=1 is supported.
Method render Render the ATR to a readable format.
Class Variable bitratefactor Undocumented
Class Variable clockrateconversion Undocumented
Class Variable currenttable Undocumented
Instance Variable atr Undocumented
Instance Variable checksumOK Undocumented
Instance Variable DI Undocumented
Instance Variable FI Undocumented
Instance Variable hasChecksum Undocumented
Instance Variable historicalBytes Undocumented
Instance Variable II Undocumented
Instance Variable interfaceBytesCount Undocumented
Instance Variable K Undocumented
Instance Variable N Undocumented
Instance Variable PI1 Undocumented
Instance Variable T0 Undocumented
Instance Variable TA Undocumented
Instance Variable TB Undocumented
Instance Variable TC Undocumented
Instance Variable TCK Undocumented
Instance Variable TD Undocumented
Instance Variable TS Undocumented
Instance Variable Y Undocumented
Property hasTA Deprecated. Replace usage with `ATR.TA[i] is not None`.
Property hasTB Deprecated. Replace usage with `ATR.TB[i] is not None`.
Property hasTC Deprecated. Replace usage with `ATR.TC[i] is not None`.
Property hasTD Deprecated. Replace usage with `ATR.TD[i] is not None`.
def __init__(self, atr: list[int]):

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
def __str__(self) -> str:

Render the ATR as a space-separated string of uppercase hexadecimal pairs.

def dump(self):

Deprecated. Replace usage with `print(ATR.render())`

def getBitRateFactor(self) -> int | str:

Return bit rate factor.

def getChecksum(self) -> int | None:

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

def getClockRateConversion(self) -> int | str:

Return clock rate conversion.

def getGuardTime(self) -> int | None:

Return extra guard time.

def getHistoricalBytes(self) -> list[int]:

Return historical bytes.

def getHistoricalBytesCount(self) -> int:

Return count of historical bytes.

def getInterfaceBytesCount(self) -> int:

Return count of interface bytes.

def getProgrammingCurrent(self) -> int | str:

Return maximum programming current.

def getProgrammingVoltage(self) -> int:

Return programming voltage.

def getSupportedProtocols(self) -> dict[str, bool]:

Returns a dictionary of supported protocols.

def getTA1(self) -> int | None:

Return TA1 byte.

def getTB1(self) -> int | None:

Return TB1 byte.

def getTC1(self) -> int | None:

Return TC1 byte.

def getTD1(self) -> int | None:

Return TD1 byte.

def isT0Supported(self) -> bool:

Return True if T=0 is supported.

def isT15Supported(self) -> bool:

Return True if T=15 is supported.

def isT1Supported(self) -> bool:

Return True if T=1 is supported.

def render(self) -> str:

Render the ATR to a readable format.

bitratefactor: list[int | str] =

Undocumented

clockrateconversion: list[int | str] =

Undocumented

currenttable: list[int | str] =

Undocumented

atr =

Undocumented

checksumOK: bool | None =

Undocumented

DI: int | None =

Undocumented

FI: int | None =

Undocumented

hasChecksum =

Undocumented

historicalBytes =

Undocumented

II: int | None =

Undocumented

interfaceBytesCount =

Undocumented

K =

Undocumented

N =

Undocumented

PI1: int | None =

Undocumented

T0 =

Undocumented

TA: list[None | int] =

Undocumented

TB: list[None | int] =

Undocumented

TC: list[None | int] =

Undocumented

TCK: int | None =

Undocumented

TD: list[None | int] =

Undocumented

TS =

Undocumented

Y: list[int] =

Undocumented

@property
hasTA: list[bool] =

Deprecated. Replace usage with `ATR.TA[i] is not None`.

@property
hasTB: list[bool] =

Deprecated. Replace usage with `ATR.TB[i] is not None`.

@property
hasTC: list[bool] =

Deprecated. Replace usage with `ATR.TC[i] is not None`.

@property
hasTD: list[bool] =

Deprecated. Replace usage with `ATR.TD[i] is not None`.