1SC_CHECK_SW(3)               OpenSC API reference               SC_CHECK_SW(3)
2
3
4

NAME

6       sc_check_sw - Check return status from a card transaction
7

SYNOPSIS

9          #include <opensc.h>
10
11          int sc_check_sw(struct sc_card *card, int sw1, int sw2);
12
13
14

DESCRIPTION

16       This function checks the return status as given in sw1 and sw2 against
17       the card-specific errors of card. These are set by sc_transmit_apdu()
18       in the apdu.sw1 and apdu.sw2 fields, respectively.
19
20       The function should be called after every APDU transmission, to convert
21       the card's status code to an OpenSC error code.
22

RETURN VALUE

24       Returns 0 if successful, or a negative value in case of error.
25
26
27
28opensc                            05/04/2007                    SC_CHECK_SW(3)
Impressum