Portuguese eID Middleware SDK  Version: 3.12.0
eIDMW::PTEID_ReaderContext Class Reference

#include <eidlib.h>

Public Member Functions

virtual PTEIDSDK_API ~PTEID_ReaderContext ()
 
PTEIDSDK_API const char * getName ()
 
PTEIDSDK_API bool isCardPresent ()
 
PTEIDSDK_API void releaseCard (bool bAllReference=false)
 
PTEIDSDK_API bool isCardChanged (unsigned long &ulOldId)
 
PTEIDSDK_API PTEID_CardType getCardType ()
 
PTEIDSDK_API PTEID_CardgetCard ()
 
PTEIDSDK_API PTEID_CardContactInterface getCardContactInterface ()
 
PTEIDSDK_API PTEID_EIDCardgetEIDCard ()
 
PTEIDSDK_API unsigned long SetEventCallback (void(*callback)(long lRet, unsigned long ulState, void *pvRef), void *pvRef)
 
PTEIDSDK_API void StopEventCallback (unsigned long ulHandle)
 
PTEIDSDK_API void BeginTransaction ()
 
PTEIDSDK_API void EndTransaction ()
 
- Public Member Functions inherited from eIDMW::PTEID_Object
virtual PTEIDSDK_API ~PTEID_Object ()=0
 
NOEXPORT_PTEIDSDK void Init (const SDK_Context *context, void *impl)
 
NOEXPORT_PTEIDSDK void Release ()
 

Friends

PTEID_ReaderContextPTEID_ReaderSet::getReader (APL_ReaderContext *pAplReader)
 

Additional Inherited Members

- Protected Member Functions inherited from eIDMW::PTEID_Object
 PTEID_Object (const SDK_Context *context, void *impl)
 
void addObject (PTEID_Object *impl)
 
void backupObject (unsigned long idx)
 
PTEID_ObjectgetObject (unsigned long idx)
 
PTEID_ObjectgetObject (void *impl)
 
void delObject (unsigned long idx)
 
void delObject (void *impl)
 
void checkContextStillOk () const
 
 PTEID_Object (const PTEID_Object &obj)
 
PTEID_Objectoperator= (const PTEID_Object &obj)
 
- Protected Attributes inherited from eIDMW::PTEID_Object
bool m_delimpl
 
void * m_impl
 
unsigned long m_ulIndexExtAdd
 
std::map< unsigned long, PTEID_Object * > m_objects
 
SDK_Context * m_context
 

Detailed Description

This class represent a reader. You get reader object from the ReaderSet either by its index (getReaderByNum) or by its name (getReaderByName). Once you have a reader object, you can check if a card is present (isCardPresent). Then you can ask which type of card is in the reader with getCardType() and then get a card object using one of this method : getCard or getEIDCard.

Constructor & Destructor Documentation

◆ ~PTEID_ReaderContext()

virtual PTEIDSDK_API eIDMW::PTEID_ReaderContext::~PTEID_ReaderContext ( )
virtual

Destructor

Member Function Documentation

◆ BeginTransaction()

PTEIDSDK_API void eIDMW::PTEID_ReaderContext::BeginTransaction ( )

Begin a transaction with the reader

◆ EndTransaction()

PTEIDSDK_API void eIDMW::PTEID_ReaderContext::EndTransaction ( )

End the transaction

◆ getCard()

PTEIDSDK_API PTEID_Card& eIDMW::PTEID_ReaderContext::getCard ( )

Get the card in the reader. Instantiation is made regarding the type of the card (PTEID_EIDCard).

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown. If the card type is not supported, exception PTEID_ExCardTypeUnknown is thrown.

◆ getCardContactInterface()

PTEIDSDK_API PTEID_CardContactInterface eIDMW::PTEID_ReaderContext::getCardContactInterface ( )

Get the card interface used on the current used card

Returns the interface of the current card

◆ getCardType()

PTEIDSDK_API PTEID_CardType eIDMW::PTEID_ReaderContext::getCardType ( )

Return the type of the card in the reader.

Throw PTEID_ExNoCardPresent exception if no card is present.

◆ getEIDCard()

PTEIDSDK_API PTEID_EIDCard& eIDMW::PTEID_ReaderContext::getEIDCard ( )

Get the EIDcard in the reader. Instantiation is made regarding the type of the card (PTEID_EIDCard).

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown. If the card is not an EIDcard, exception PTEID_ExCardBadType is thrown.

◆ getName()

PTEIDSDK_API const char* eIDMW::PTEID_ReaderContext::getName ( )

Return the name of the reader.

◆ isCardChanged()

PTEIDSDK_API bool eIDMW::PTEID_ReaderContext::isCardChanged ( unsigned long &  ulOldId)

Return true if a card has changed since the last called (with the same ulOldId parameter).

◆ isCardPresent()

PTEIDSDK_API bool eIDMW::PTEID_ReaderContext::isCardPresent ( )

Return true if a card is present and false otherwise.

◆ releaseCard()

PTEIDSDK_API void eIDMW::PTEID_ReaderContext::releaseCard ( bool  bAllReference = false)

Release the card.

Parameters
bAllReferenceIf true all the invalid reference/pointer are destroyed.
bAllReferencePUT THIS PARAMETER TO TRUE IS THREAD UNSAFE.
bAllReferenceYou have to be sure that you will not use any old reference/pointer after this release

◆ SetEventCallback()

PTEIDSDK_API unsigned long eIDMW::PTEID_ReaderContext::SetEventCallback ( void(*)(long lRet, unsigned long ulState, void *pvRef)  callback,
void *  pvRef 
)

Specify a callback function to be called each time a card is inserted/remove in/from this reader.

Returns
A handle can be used to stop the callbacks when they are no longer needed.

◆ StopEventCallback()

PTEIDSDK_API void eIDMW::PTEID_ReaderContext::StopEventCallback ( unsigned long  ulHandle)

To tell that the callbacks are not longer needed.

Parameters
ulHandleis the handle return by SetEventCallback

Friends And Related Function Documentation

◆ PTEID_ReaderSet::getReader

PTEID_ReaderContext& PTEID_ReaderSet::getReader ( APL_ReaderContext *  pAplReader)
friend

For internal use : This method must access protected constructor