beautypg.com

Icc_send(), E 77) – Maxim Integrated 73S12xxF Software User Manual

Page 77

background image


UG_12xxF_016

73S12xxF Software User Guide

Rev. 1.50

77

ICC_Send()

Purpose

Transmit a data command to the Smart Card interface and wais for the answer from
the Smart Card. This function is responsible for the Smart Card command format
analysis which computes the correct command case (1, 2 Short, 3 Short or 4 Short).
The API assumes that the data record size is 255 bytes or less which is why it
supports short cases only.


Synopsis

AR_ICC_RC ICC_Send (

IN enum ICC_ID eIccId,

IN unsigned int unIccCommandLength,

IN unsigned char *pucIccCommand,

OUT unsigned int *punIccResponseLength,

OUT unsigned char *pucIccResponse,

OUT unsigned char *pucSW1,

OUT unsigned char *pucSW2,

OUT BOOLEAN *pbitStatusJustAfterHeader );

Parameters

eIccId: Input parameter
Specifies which Smart Card interface is to be activated. Possible values are:

ICC_1ST 0, (Internal)
ICC_2ND 1, (External)

ICC_9TH 8 (External)

unIccCommandLength: Input parameter
Specifies the number of bytes of data pointed to by puclccCommand.

pucIccCommand: Input parameter
Specifies the command to be transmitted to the Smart Card interface.

punIccResponseLength: Output parameter
Specifies the number of bytes of response data pointed to by puclccResponse. (The
length value does not include the status bytes SW1/SW2).

pucIccResponse: Output parameter
Contains the response of the Smart Card (SW1/SW2 not included).

pucSW1: Output parameter
Contains the received SW1value.

pucSW2: Output parameter
Contains the received SW2 value.

pbStatusJustAfterHeader: Output parameter
This boolean parameter specifies if the status bytes have been received just after the
header (TRUE) or after the data (FALSE) [Useful for the EMV Tests suite]. This
parameter must be taken into account only if the

ICC_Configure()

command sets the

pbIccWarningStatusBytesManagementT0 bit.

Return Codes AR_ICC_OK

Successful operation: the command was successfully transmitted to the Smart
Card and a valid response was received.

AR_ICC_ERR_BAD_PARAM

An inconsistent command was specified. The API was unable to compute the
command case value.

AR_ICC_ERR_CARD_MUTE

The Smart Card is mute.

AR_ICC_ERR_CARD_ABSENT

No Smart Card is inserted.

AR_ICC_ERR_CARD_DISCONNECTED

The Smart Card was removed during the activation operation.