sc_detect_card_presence(3)

NAME
sc_detect_card_presence - detect whether a card is present in a reader

SYNOPSIS
#include <opensc.h>

int sc_detect_card_presence(sc_reader_t *reader,
                            int slot);

DESCRIPTION
This function is used to detect the presence of a smart card in a card reader device. The slot parameter identifies the card reader's slot. Slots are numbered consecutively, starting at 0.

RETURN VALUE
If a card is present, a positive value is returned that is a combination of the following flags:

SC_SLOT_CARD_PRESENT
    A card was detected.

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. CTAPI doesn't support it at all, for instance, while PCSC on Windows occasionally returns false CHANGE events.

If an error occurred, a negative error code is returned, as described in sc_error(3).

SEE ALSO
sc_establish_context(3), sc_wait_for_event(3), sc_connect_card(3).

AUTHOR
This manual page was written by Olaf Kirch <okir@suse.de>