opensc/man/sc_detect_card_presence.3

37 lines
1.2 KiB
Groff

.TH sc_detect_card_presence 3 "April 2003" "OpenSC Programmer's Manual
.SH NAME
sc_detect_card_presence \- detect whether a card is present in a reader
.SH SYNOPSIS
.nf
.B #include <opensc.h>
.sp
.BI "int sc_detect_card_presence(sc_reader_t *" reader ",
.BI " int " slot ");
.fi
.SH DESCRIPTION
This function is used to detect the presence of a smart card in
a card reader device. The \fIslot\fP parameter identifies the
card reader's slot. Slots are numbered consecutively, starting at
\fB0\fP.
.SH RETURN VALUE
If a card is present, a positive value is returned that is a combination
of the following flags:
.TP
.B SC_SLOT_CARD_PRESENT
A card was detected.
.TP
.B SC_SLOT_CARD_CHANGED
The card was inserted and/or removed since the last call. Note that
this flag is not entirely reliable depending on the OS platform and
middleware. CT\-API doesn't support it at all, for instance, while PC/SC
on Windows occasionally returns false CHANGE events.
.PP
If an error occurred, a negative error code is returned, as described
in \fbsc_error\fP(3).
.SH SEE ALSO
.BR sc_establish_context (3),
.BR sc_wait_for_event (3),
.BR sc_connect_card (3).
.SH AUTHOR
This manual page was written by Olaf Kirch <okir@suse.de>