Gemplus vendor attributes
Using Vendor Attributes
Gemplus has incorporated two settable vendor attributes to its drivers to
circumvent a few very specific problems. Generally, developers do not need to be aware of
these attributes.
Power Timeout
The power timeout attribute represents the duration of the power down upon cold reset.
Some double reset smart cards require a longer power down value than normal smart cards.
Conversely, a developer may want want to reduce this timeout to zero to reduce cold reset
delays. The default power timeout value is 750ms.
APDU Timeout
The APDU timeout attribute represents the maximum duration of a SCardTransmit call. When
this timeout is reached, the driver sends a timeout error to the smart card resource
manager, which in turn forwards the error to the application. This timeout value is most
useful in cases where the smart card can ask for more time to answer to the reader. Note
that the APDU timeout is used only for T=0 transactions on Gcr410p (GemCore R1-11 and
later). The default APDU timeout value is 60000ms.
Accessing Gemplus Attributes
Obtaining or setting vendor attributes is done through the SCardControl
function:
-
To get a vendor defined attribute use SCardControl with dwControlCode equal to
SCARD_CTL_CODE(2049).
-
To get power timeout set lpInBuffer to 82h 01h 07h 00h
-
To get APDU timeout set lpInBuffer to 83h 01h 07h 00h
-
lpOutBuffer will be filled with a DWORD (4 bytes). Times are in milliseconds.
-
To set a vendor defined attribute, use SCardControl with dwControlCode equal to
SCARD_CTL_CODE(2050).
-
To set power timeout set lpInBuffer to 82h 01h 07h 00h plus four bytes representing the
timeout value in ms. For instance, to set power timeout to 1000ms, lpInBuffer will be 83h
01h 07h 00h E8h 03h 00h 00h.
-
To set APDU timeout set lpInBuffer to 83h 01h 07h 00h plus four bytes representing the
timeout value in ms. For instance, to set APDU timeout to 4 minutes, lpInBuffer will be
83h 01h 07h 00h 80h A9h 03h 00h.
|