eID middleware |

# be::portugal::eid::PTEID_ReaderContext Class Reference

This class represent a reader. More...

Inheritance diagram for be::portugal::eid::PTEID_ReaderContext:

List of all members.

## Public Member Functions

override void | Dispose ()
| PTEID_ReaderContext (PTEID_FileType fileType, string fileName)
| Construct using a fileType and fileName.
| PTEID_ReaderContext (PTEID_FileType fileType, PTEID_ByteArray data)
| Construct using a fileType and its content (for compatibility with SetRawFile).
| PTEID_ReaderContext (PTEID_RawData_Eid data)
| Construct using Raw data for Eid.
| PTEID_ReaderContext (PTEID_RawData_Sis data)
| Construct using Raw data for Sis.
string | getName ()
| Return the name of the reader.
bool | isCardPresent ()
| Return true if a card is present and false otherwise.
void | releaseCard (bool bAllReference)
| Release the card.
void | releaseCard ()
| Release the card.
bool | isCardChanged (ref uint ulOldId)
| Return true if a card has changed since the last called (with the same ulOldId parameter).
PTEID_CardType | getCardType ()
| Return the type of the card in the reader.
PTEID_Card | getCard ()
| Get the card in the reader.
PTEID_EIDCard | getEIDCard ()
| Get the EIDcard in the reader.
PTEID_KidsCard | getKidsCard ()
| Get the KidsCard in the reader.
PTEID_ForeignerCard | getForeignerCard ()
| Get the ForeignerCard in the reader.
PTEID_SISCard | getSISCard ()
| Get the SISCard in the reader.
uint | SetEventCallback (PTEID_SetEventDelegate callback, IntPtr pvRef)
| Specify a callback function to be called each time a card is inserted/remove in/from this reader.
void | StopEventCallback (uint ulHandle)
| To tell that the callbacks are not longer needed.
void | BeginTransaction ()
| Begin a transaction with the reader.
void | EndTransaction ()
| End the transaction.
bool | isVirtualReader ()
| Return true if this is a virtual reader (create from a file).

## 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, getEIDCard, getKidsCard, getForeignerCard or getSISCard.

## Constructor & Destructor Documentation

be::portugal::eid::PTEID_ReaderContext::PTEID_ReaderContext | ( | PTEID_FileType | fileType,
|  | string | fileName |
| ) |  |  | `[inline]`

Construct using a fileType and fileName.

No physical reader are connected.

be::portugal::eid::PTEID_ReaderContext::PTEID_ReaderContext | ( | PTEID_FileType | fileType,
|  | PTEID_ByteArray | data |
| ) |  |  | `[inline]`

Construct using a fileType and its content (for compatibility with SetRawFile).

No physical reader are connected.

be::portugal::eid::PTEID_ReaderContext::PTEID_ReaderContext | ( | PTEID_RawData_Eid | data | ) | `[inline]`

Construct using Raw data for Eid.

No physical reader are connected.

be::portugal::eid::PTEID_ReaderContext::PTEID_ReaderContext | ( | PTEID_RawData_Sis | data | ) | `[inline]`

Construct using Raw data for Sis.

No physical reader are connected.

## Member Function Documentation

void be::portugal::eid::PTEID_ReaderContext::BeginTransaction | ( |  | ) | `[inline]`

Begin a transaction with the reader.

override void be::portugal::eid::PTEID_ReaderContext::Dispose | ( |  | ) | `[inline, virtual]`

Reimplemented from be::portugal::eid::PTEID_Object.

void be::portugal::eid::PTEID_ReaderContext::EndTransaction | ( |  | ) | `[inline]`

End the transaction.

PTEID_Card be::portugal::eid::PTEID_ReaderContext::getCard | ( |  | ) | `[inline]`

Get the card in the reader.

Instantiation is made regarding the type of the card (PTEID_EIDCard, PTEID_KidsCard, PTEID_ForeignerCard or PTEID_SISCard).

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.

PTEID_CardType be::portugal::eid::PTEID_ReaderContext::getCardType | ( |  | ) | `[inline]`

Return the type of the card in the reader.

Throw PTEID_ExNoCardPresent exception if no card is present.

PTEID_EIDCard be::portugal::eid::PTEID_ReaderContext::getEIDCard | ( |  | ) | `[inline]`

Get the EIDcard in the reader.

Instantiation is made regarding the type of the card (PTEID_EIDCard, PTEID_KidsCard, PTEID_ForeignerCard). 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.

PTEID_ForeignerCard be::portugal::eid::PTEID_ReaderContext::getForeignerCard | ( |  | ) | `[inline]`

Get the ForeignerCard in the reader.

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown. If the card is not a ForeignerCard, exception PTEID_ExCardBadType is thrown.

PTEID_KidsCard be::portugal::eid::PTEID_ReaderContext::getKidsCard | ( |  | ) | `[inline]`

Get the KidsCard in the reader.

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown. If the card is not a KidsCard, exception PTEID_ExCardBadType is thrown.

string be::portugal::eid::PTEID_ReaderContext::getName | ( |  | ) | `[inline]`

Return the name of the reader.

PTEID_SISCard be::portugal::eid::PTEID_ReaderContext::getSISCard | ( |  | ) | `[inline]`

Get the SISCard in the reader.

If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown. If the card is not a SISCard, exception PTEID_ExCardBadType is thrown.

bool be::portugal::eid::PTEID_ReaderContext::isCardChanged | ( | ref uint | ulOldId | ) | `[inline]`

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

bool be::portugal::eid::PTEID_ReaderContext::isCardPresent | ( |  | ) | `[inline]`

Return true if a card is present and false otherwise.

bool be::portugal::eid::PTEID_ReaderContext::isVirtualReader | ( |  | ) | `[inline]`

Return true if this is a virtual reader (create from a file).

void be::portugal::eid::PTEID_ReaderContext::releaseCard | ( |  | ) | `[inline]`

Release the card.

void be::portugal::eid::PTEID_ReaderContext::releaseCard | ( | bool | bAllReference | ) | `[inline]`

Release the card.

Parameters:

  | bAllReference | If true all the invalid reference/pointer are destroyed. PUT THIS PARAMETER TO TRUE IS THREAD UNSAFE. You have to be sure that you will not use any old reference/pointer after this release

uint be::portugal::eid::PTEID_ReaderContext::SetEventCallback | ( | PTEID_SetEventDelegate | callback,
|  | IntPtr | pvRef |
| ) |  |  | `[inline]`

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

void be::portugal::eid::PTEID_ReaderContext::StopEventCallback | ( | uint | ulHandle | ) | `[inline]`

To tell that the callbacks are not longer needed.

Parameters:

  | ulHandle | is the handle return by SetEventCallback