Package pt.gov.cartaodecidadao
Class PTEID_ReaderContext
- java.lang.Object
-
- pt.gov.cartaodecidadao.PTEID_Object
-
- pt.gov.cartaodecidadao.PTEID_ReaderContext
-
public class PTEID_ReaderContext extends PTEID_Object
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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidBeginTransaction()Begin a transaction with the readervoiddelete()static voiddoJavaCallBack(int iKey, long lRet, long ulState)voidEndTransaction()End the transactionPTEID_CardgetCard()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.PTEID_CardContactInterfacegetCardContactInterface()Get the card interface used on the current used card
Returns the interface of the current cardPTEID_CardTypegetCardType()Return the type of the card in the reader.
Throw PTEID_ExNoCardPresent exception if no card is present.PTEID_EIDCardgetEIDCard()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.java.lang.StringgetName()Return the name of the reader.booleanisCardChanged(PTEID_ulwrapper ulOldId)Return true if a card has changed since the last called (with the same ulOldId parameter).booleanisCardPresent()Return true if a card is present and false otherwise.booleanisPinpad()voidreleaseCard()Release the card.
voidreleaseCard(boolean bAllReference)Release the card.
longSetEventCallback(Callback callback, java.lang.Object pvRef)Specify a callback function to be called each time a
card is inserted/remove in/from this reader.
voidStopEventCallback(long ulHandle)To tell that the callbacks are not longer needed.
-
-
-
Method Detail
-
delete
public void delete()
- Overrides:
deletein classPTEID_Object
-
doJavaCallBack
public static void doJavaCallBack(int iKey, long lRet, long ulState)
-
getName
public java.lang.String getName() throws PTEID_ExceptionReturn the name of the reader.- Throws:
PTEID_Exception
-
isCardPresent
public boolean isCardPresent() throws PTEID_ExceptionReturn true if a card is present and false otherwise.- Throws:
PTEID_Exception
-
isPinpad
public boolean isPinpad()
-
releaseCard
public void releaseCard(boolean bAllReference) throws PTEID_ExceptionRelease the card.
- Parameters:
bAllReference- If true all the invalid reference/pointer are destroyed.bAllReference- PUT THIS PARAMETER TO TRUE IS THREAD UNSAFE.bAllReference- You have to be sure that you will not use any old reference/pointer after this release- Throws:
PTEID_Exception
-
releaseCard
public void releaseCard() throws PTEID_ExceptionRelease the card.
- Throws:
PTEID_Exception
-
isCardChanged
public boolean isCardChanged(PTEID_ulwrapper ulOldId) throws PTEID_Exception
Return true if a card has changed since the last called (with the same ulOldId parameter).- Throws:
PTEID_Exception
-
getCardType
public PTEID_CardType getCardType() throws PTEID_Exception
Return the type of the card in the reader.
Throw PTEID_ExNoCardPresent exception if no card is present.- Throws:
PTEID_Exception
-
getCard
public PTEID_Card getCard() throws PTEID_Exception
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.- Throws:
PTEID_Exception
-
getCardContactInterface
public PTEID_CardContactInterface getCardContactInterface()
Get the card interface used on the current used card
Returns the interface of the current card
-
getEIDCard
public PTEID_EIDCard getEIDCard() throws PTEID_Exception
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.- Throws:
PTEID_Exception
-
SetEventCallback
public long SetEventCallback(Callback callback, java.lang.Object pvRef) throws PTEID_Exception
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.
- Throws:
PTEID_Exception
-
StopEventCallback
public void StopEventCallback(long ulHandle) throws PTEID_ExceptionTo tell that the callbacks are not longer needed.- Parameters:
ulHandle- is the handle return by SetEventCallback- Throws:
PTEID_Exception
-
BeginTransaction
public void BeginTransaction() throws PTEID_ExceptionBegin a transaction with the reader- Throws:
PTEID_Exception
-
EndTransaction
public void EndTransaction() throws PTEID_ExceptionEnd the transaction- Throws:
PTEID_Exception
-
-