File: sc_check_sw.xml

package info (click to toggle)
opensc 0.11.1-2etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,284 kB
  • ctags: 7,257
  • sloc: ansic: 69,499; sh: 9,480; xml: 4,191; makefile: 346; lex: 92; perl: 25
file content (49 lines) | stat: -rw-r--r-- 1,329 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8"?>
<refentry id="scchecksw">
	<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
	<refmeta>
		<refentrytitle>sc_check_sw</refentrytitle>
		<manvolnum>3</manvolnum>
		<refmiscinfo>opensc</refmiscinfo>
	</refmeta>

	<refnamediv>
		<refname>sc_check_sw</refname>
		<refpurpose>Check return status from a card transaction</refpurpose>
	</refnamediv>

	<refsect1>
		<title>Synopsis</title>
		<para>
		<programlisting>
#include &lt;opensc.h&gt;

int sc_check_sw(struct sc_card *card, int sw1, int sw2);
		</programlisting>
		</para>
	</refsect1>

	<refsect1>
		<title>Description</title>
		<para>
			This function checks the return status as given in <emphasis>sw1</emphasis>
			and <emphasis>sw2</emphasis> against the card-specific errors of
			<emphasis>card</emphasis>. These are set by <link
				linkend="sctransmitapdu">sc_transmit_apdu()</link> in the
			<structfield>apdu.sw1</structfield> and <structfield>apdu.sw2</structfield>
			fields, respectively.
		</para>

		<para>
			The function should be called after every APDU transmission, to convert the
			card's status code to an OpenSC error code.
		</para>
	</refsect1>

	<refsect1>
		<title>Return value</title>
		<para>
			Returns 0 if successful, or a negative value in case of error.
		</para>
	</refsect1>
</refentry>