Portuguese eID Middleware SDK Version: 3.14.0
Loading...
Searching...
No Matches
eIDMW::PTEID_ReaderContext Class Reference

#include <eidlib.h>

Public Member Functions

virtual PTEIDSDK_MULTIPASS_API ~PTEID_ReaderContext ()
 
PTEIDSDK_MULTIPASS_API const char * getName ()
 
PTEIDSDK_MULTIPASS_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 ICAO_CardgetICAOCard ()
 
PTEIDSDK_MULTIPASS_API PTEID_ByteArray getMultiPassToken ()
 
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 ()
 
PTEIDSDK_API void Recover ()
 
- 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 a 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 methods : getCard or getEIDCard.

Constructor & Destructor Documentation

◆ ~PTEID_ReaderContext()

virtual PTEIDSDK_MULTIPASS_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 type is not supported, exception PTEID_ExCardTypeUnknown is thrown.

◆ getICAOCard()

PTEIDSDK_API ICAO_Card & eIDMW::PTEID_ReaderContext::getICAOCard ( )

Get an instance of ICAO_Card if the smartcard chip present in reader is compatible with ICAO Doc 9303 specification

Example of compatible documents: newer PT eID cards of type PTEID_CARDTYPE_IAS5, resident permits, european identity cards and ePassports

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.

If the current card is not compatible with the ICAO specification, exception PTEID_ExCardTypeUnknown is thrown.

◆ getMultiPassToken()

PTEIDSDK_MULTIPASS_API PTEID_ByteArray eIDMW::PTEID_ReaderContext::getMultiPassToken ( )

Read the Multipass token information from the card present in the reader

This token is a free access unique value, not related to personal citizen data. Its purpose is to be used in some physical access control scenarios. This is the only useful information available on IAS v5 cards without access control on contactless interface.

The implementation uses Passive and Chip Authentication mechanisms defined in ICAO Doc 9303 Part 11 to counter the risk of receiving untrusted or cloned information.

Returns
A PTEID_ByteArray object containing the Multipass token which is a 16-byte value

◆ getName()

PTEIDSDK_MULTIPASS_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_MULTIPASS_API bool eIDMW::PTEID_ReaderContext::isCardPresent ( )

Return true if a card is present and false otherwise.

◆ Recover()

PTEIDSDK_API void eIDMW::PTEID_ReaderContext::Recover ( )

Recover the card when it's not responding properly anymore. This method attempts to reset the card connection and restore communication.

◆ 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(* callback )(long lRet, unsigned long ulState, void *pvRef),
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 Symbol Documentation

◆ PTEID_ReaderSet::getReader

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

For internal use : This method must access protected constructor