Microsoft Windows CE 3.0  

SmartcardT1Request

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The SmartcardT1Requestfunction copies data from the user buffer to a send buffer and checks the T=1 protocol status.

NTSTATUS SmartcardT1Request(
PSMARTCARD_EXTENSIONSmartcardExtension
);

Parameters

SmartcardExtension
Points to the smart card extension of the device.

Return Values

SmartcardT1Requestreturns an NTSTATUS value; STATUS_SUCCESS indicates that the buffer was successfully set up.

Remarks

Do not change any members of the T1_DATAstructure. They will be initialized automatically. The only member that can be safely modified is the NAD value. Changing of any member might lead to protocol errors.

SmartcardT1Requestcopies the data from the user buffer to SmartcardExtension->SmartcardRequest.Bufferembedded in a T=1 protocol frame and adjusts SmartcardExtension->SmartcardRequest.BufferLength. The driver must send this buffer to the smart card and read the answer of the card into SmartcardExtension->SmartcardReply.Buffer. The driver must then call SmartcardT1Reply, which checks the incoming protocol frame.

You can copy your header data to the buffer either before or after a call to SmartcardT1Request, depending on which is easier to do in your driver. If your driver needs to send header data to the reader before the actual T=1 data, you should set SmartcardExtension->SmartcardRequest.BufferLengthto the number of bytes you need for your header before you call this function. The packet consists of your header data followed by the T= 1 data.

A usual T=1 transmission can be done in the following way:

// Run this loop as long as the protocol requires
to send data do { // Copy data to
SmartcardExtension->SmartcardRequest.Buffer // embedded in a T=1
frame status = SmartcardT1Request(SmartcardExtension); if (status
!= STATUS_SUCCESS) return status; // Send T=1 frame to smart card
status = DriverSendDataToSmartcard(); if (status != STATUS_SUCCESS)
return status; // Now set appropiate timeout (This example
calculates. the time-out in ms) // Timeout =
SmartcardExtension->CardCapabilities.T1.BWT * //
(SmartcardExtension->T1.Wtx ? SmartcardExtension->T1.Wtx :
1); // receive T=1 frame from smart card status =
DriverReceiveDataFromSmartcard(); if (status != STATUS_SUCCESS)
return status; // Check T=1 protocol status and copy any data back
to user buffer status = SmartcardT1Reply(SmartcardExtension); }
while (status == STATUS_MORE_PROCESSING_REQUIRED); return
status;

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 3.0 and later      
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.


 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.