Gemalto sites: Corporate | Brasil | France | 日本 | Latin America | Developers | Tech Support | Enterprise Partners
PC/SC  
 
PC/SC, Personal computer/Smart Card is a standard framework for Smart Card access on Windows Platforms (included in Windows2000).  
 

Modifying Card / Reader Data Rate

Some smart cards are able to switch speed with a simple APDU command sent through SCardTransmit. The only PC/SC sanctioned way to change the card/reader data rate is through the PPS mechanism. To circumvent this limitation, Gemplus introduces a new vendor defined control code. (Not available on the Gcr420.)

When the smart card is ready to communicate at the new speed, send the switch speed command to the reader using the SCardControl function with dwControlCode equal to SCARD_CTL_CODE(2052). See the C code below for more details.

The following piece of C code switch the communication speed between the reader and the smart card to 115'200 Baud.


// Step 1. Tell the smart card to switch speeds.
// Do that here...

// Step 2. Tell the reader to switch to a new speed.

dwControlCode = SCARD_CTL_CODE(2052);
lpInBuffer[0] = 0x95;    // At 3.6864MHz, a F/D ratio of 512/16
nInBufferSize = 1;          // means a speed of 115200 Baud.
nOutBufferSize = 300;
return_code = SCardControl(hCard,
                                             dwControlCode,
                                             lpInBuffer,
                                             nInBufferSize,
                                             lpOutBuffer,
                                             nOutBufferSize,
                                             lpBytesReturned);
if   ((return_code != SCARD_S_SUCCESS) ||
     (*lpBytesReturned != 1) ||
     (lpOutBuffer[0] != 0x00))
{
    // Operation failed.
    // Reset the smart card here in order to use it again...

}

List of Possible Speeds for Serial Readers

BaudRate Possible TA1

9909 11h, 32h, 53h
13212 22h, 43h
14400 92h, B3h, D4h
15855 64h
19200 A3h, C4h
19819 12h, 33h, 54h
26425 23h, 44h
28800 93h, B4h, D5h
31710 65h
38400 A4h, C5h
39638 13h, 34h, 55h
52851 24h, 45h
57600 94h, B5h
76800 A5h
79277 14h, 35h
105703 25h
115200 95h
158554 15h

List of Possible Speeds for PCCard Readers

BaudRate Possible TA1
9909 11h, 32h, 53h
13212 22h, 43h
14400 92h, B3h, D4h
15855 64h
19200 A3h, C4h
19819 12h, 33h, 54h
26425 23h, 44h
28800 93h, B4h, D5h
31710 65h
38400 A4h, C5h

Remember however, that the computer to reader Baud rate is fixed. So theoretically, the actual computer to smart card Baud rate should be:

1/PC2SC = 1/PC2RDR + 1/RDR2SC *

In the example above if you used a Gcr410p, this gives:

1/PC2SC = 1/38400 + 1/115200, or PC2SC = 28800 Baud.

Compared to the default value, which is:

1/PC2SC = 1/38400 + 1/9909, or PC2SC = 7877 Baud.

* PC2SC is the computer to smart card Baud rate, PC2RDR is the computer to reader Baud rate and RDR2SC is the reader to smart card Baud rate.

 
EU Commitments | Sitemap | Disclaimer | © 2006-2008 Gemalto NV