SpringCard PC/SC API for .NET  18.10.10
Access PC/SC couplers and smart cards from .NET applications
SpringCard.PCSC.SCardReader Class Reference

The SCardReader object is used to monitor one PC/SC reader (i.e. wait for card events) More...

Inheritance diagram for SpringCard.PCSC.SCardReader:
SpringCard.PCSC.ZeroDriver.SCardReader_CcidOver

Public Member Functions

 SCardReader (uint Scope, string ReaderName)
 Create a SCardReader for the given PC/SC scope and reader name.
 
 SCardReader (string ReaderName)
 Create a SCardReader for the given and reader name.
 
void Release ()
 
virtual SCardChannel CreateChannel ()
 Create a SCardChannel object from this reader.
 
SCardChannel GetChannel ()
 Create a SCardChannel object from this reader. More...
 
delegate void StatusChangeCallback (uint ReaderState, CardBuffer CardAtr)
 Definition of the callback that will be called by the background thread launched by StartMonitor() everytime the status of the reader is changed. More...
 
void StartMonitor (StatusChangeCallback callback)
 Create a background thread to monitor the reader associated to the object. Everytime the status of the reader is changed, the callback is invoked.
 
void StopMonitor ()
 Stop the background thread previously launched by StartMonitor().
 
bool Control (CardBuffer cctrl, out CardBuffer rctrl)
 Send a direct command the reader through SCARD.Control() and retrieve its answer.
 
CardBuffer Control (CardBuffer cctrl)
 Send a direct command the reader through SCARD.Control() and retrieve its answer.
 
bool Control (CAPDU cctrl, out RAPDU rctrl)
 Send a direct command the reader through SCARD.Control() and retrieve its answer.
 
RAPDU Control (CAPDU cctrl)
 Send a direct command the reader through SCARD.Control() and retrieve its answer.
 

Protected Member Functions

virtual void StatusChangeMonitor ()
 

Protected Attributes

uint _last_error
 
string _reader_name
 
StatusChangeCallback _status_change_callback = null
 
volatile bool _status_change_running = false
 

Properties

uint Scope [get]
 The PC/SC context handle. See SCARD.CreateContext()
 
string Name [get]
 The name of the reader.
 
uint Status [get]
 Current status of the reader.
 
string StatusAsString [get]
 Current status of the reader, using SCARD.ReaderStatusToString() as formatter.
 
bool CardPresent [get]
 Is there a card in the reader?
 
bool CardAvailable [get]
 Is there a card in the reader, and the card has not been connected by another application yet?
 
CardBuffer CardAtr [get]
 The ATR of the card in the reader. null if no card is present.
 
uint LastError [get]
 Return the last error encountered by this SCardReader.
 
string LastErrorAsString [get]
 Return the last error encountered by this SCardChannel, as a string.
 

Detailed Description

The SCardReader object is used to monitor one PC/SC reader (i.e. wait for card events)

Member Function Documentation

◆ GetChannel()

SCardChannel SpringCard.PCSC.SCardReader.GetChannel ( )

Create a SCardChannel object from this reader.

◆ StatusChangeCallback()

delegate void SpringCard.PCSC.SCardReader.StatusChangeCallback ( uint  ReaderState,
CardBuffer  CardAtr 
)

Definition of the callback that will be called by the background thread launched by StartMonitor() everytime the status of the reader is changed.

Warning
The callback is invoked in the context of a background thread. This implies that it is not allowed to access the GUI's components directly.

The documentation for this class was generated from the following file: