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 void
BeginTransaction()
Begin a transaction with the readervoid
delete()
static void
doJavaCallBack(int iKey, long lRet, long ulState)
void
EndTransaction()
End the transactionPTEID_Card
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.PTEID_CardContactInterface
getCardContactInterface()
Get the card interface used on the current used card
Returns the interface of the current cardPTEID_CardType
getCardType()
Return the type of the card in the reader.
Throw PTEID_ExNoCardPresent exception if no card is present.PTEID_EIDCard
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.java.lang.String
getName()
Return the name of the reader.boolean
isCardChanged(PTEID_ulwrapper ulOldId)
Return true if a card has changed since the last called (with the same ulOldId parameter).boolean
isCardPresent()
Return true if a card is present and false otherwise.boolean
isPinpad()
void
releaseCard()
Release the card.
void
releaseCard(boolean bAllReference)
Release the card.
long
SetEventCallback(Callback callback, java.lang.Object pvRef)
Specify a callback function to be called each time a
card is inserted/remove in/from this reader.
void
StopEventCallback(long ulHandle)
To tell that the callbacks are not longer needed.
-
-
-
Method Detail
-
delete
public void delete()
- Overrides:
delete
in classPTEID_Object
-
doJavaCallBack
public static void doJavaCallBack(int iKey, long lRet, long ulState)
-
getName
public java.lang.String getName() throws PTEID_Exception
Return the name of the reader.- Throws:
PTEID_Exception
-
isCardPresent
public boolean isCardPresent() throws PTEID_Exception
Return true if a card is present and false otherwise.- Throws:
PTEID_Exception
-
isPinpad
public boolean isPinpad()
-
releaseCard
public void releaseCard(boolean bAllReference) throws PTEID_Exception
Release 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_Exception
Release 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_Exception
To 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_Exception
Begin a transaction with the reader- Throws:
PTEID_Exception
-
EndTransaction
public void EndTransaction() throws PTEID_Exception
End the transaction- Throws:
PTEID_Exception
-
-