1SC_WAIT_FOR_EVENT(3) OpenSC API reference SC_WAIT_FOR_EVENT(3)
2
3
4
6 sc_wait_for_event - Wait for an event on a smart card reader
7
9 #include <opensc.h>
10
11 int sc_wait_for_event(sc_reader_t *readers[], int slots[], size_t numslots,
12 unsigned int event_mask,
13 int *reader, unsigned int *event, int timeout);
14
15
16
18 This function blocks until an event occurs on any of the readers/slots
19 specified. The readers and slots fields list the readers and respective
20 slots to be watched. num_slots holds the total number of slots passed.
21 The event_mask parameter specifies the types of events to wait for.
22 This may be a combination of the following flags:
23
24 SC_EVENT_CARD_REMOVED
25 A card was removed from the reader/slot.
26
27 SC_EVENT_CARD_INSERTED
28 A card was inserted into the reader/slot.
29
30 On returning, the reader parameter holds the reader which generated an
31 event, and event holds the event flag, as in event_mask.
32
33 The timeout parameter may be used to specify the maximum amount of time
34 to wait for an event, in milliseconds. This may be set to -1 to wait
35 forever.
36
38 Returns 0 if successful, 1 if a timeout occurred, or a negative value
39 in case of error.
40
41
42
43opensc 05/04/2007 SC_WAIT_FOR_EVENT(3)