Package org.eclipse.keyple.plugin.pcsc
Interface PcscReader
-
- All Superinterfaces:
org.eclipse.keyple.core.common.KeypleReaderExtension
public interface PcscReader extends org.eclipse.keyple.core.common.KeypleReaderExtension
PC/SC specificKeypleReaderExtension
.Provides specific settings and methods for configuring a PC/SC reader.
- Since:
- 2.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PcscReader.DisconnectionMode
Action to be taken after the card is disconnected.static class
PcscReader.IsoProtocol
Available transmission protocols as defined by the PC/SC standard.static class
PcscReader.SharingMode
Connection mode to indicate if the application is willing to share the card with other applications.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PcscReader
setContactless(boolean contactless)
Sets the reader transmission mode.PcscReader
setDisconnectionMode(PcscReader.DisconnectionMode disconnectionMode)
Changes the action to be taken after disconnection (default valuePcscReader.DisconnectionMode.LEAVE
).PcscReader
setIsoProtocol(PcscReader.IsoProtocol isoProtocol)
Changes the protocol to be used by the PC/SC reader when connecting to the card (PcscReader.IsoProtocol.T0
,PcscReader.IsoProtocol.T1
, orPcscReader.IsoProtocol.TCL
), orPcscReader.IsoProtocol.ANY
to connect using any available protocol (default valuePcscReader.IsoProtocol.ANY
).PcscReader
setSharingMode(PcscReader.SharingMode sharingMode)
Changes the PC/SC sharing mode (default valuePcscReader.SharingMode.EXCLUSIVE
).
-
-
-
Method Detail
-
setSharingMode
PcscReader setSharingMode(PcscReader.SharingMode sharingMode)
Changes the PC/SC sharing mode (default valuePcscReader.SharingMode.EXCLUSIVE
).This mode will be used when a new
Card
is created.If a card is already inserted, changes immediately the mode in the current
Card
object.- Parameters:
sharingMode
- ThePcscReader.SharingMode
to use (must be not null).- Returns:
- This instance.
- Throws:
java.lang.IllegalArgumentException
- If sharingMode is nulljava.lang.IllegalStateException
- If the sharing mode setting failed.- Since:
- 2.0.0
-
setContactless
PcscReader setContactless(boolean contactless)
Sets the reader transmission mode.A PC/SC reader can be contact or contactless. There is no way by generic programming to know what type of technology a reader uses.
Thus, it is the responsibility of the application to give the reader the means to know his own type.
This can be done in two ways:
- by invoking this method,
- by giving the plugin the means to determine the type from the name of the reader. In the
latter case, the application does not need to call this method, the reader will determine
its type itself using the plugin parameters (see
PcscPluginFactoryBuilder
.
There is no default mode, so it is mandatory to set the mode by any of the above methods.
- Parameters:
contactless
- true to set contactless mode, false to set contact mode.- Returns:
- This instance.
- Since:
- 2.0.0
-
setIsoProtocol
PcscReader setIsoProtocol(PcscReader.IsoProtocol isoProtocol)
Changes the protocol to be used by the PC/SC reader when connecting to the card (PcscReader.IsoProtocol.T0
,PcscReader.IsoProtocol.T1
, orPcscReader.IsoProtocol.TCL
), orPcscReader.IsoProtocol.ANY
to connect using any available protocol (default valuePcscReader.IsoProtocol.ANY
).- Parameters:
isoProtocol
- ThePcscReader.IsoProtocol
to use (must be not null).- Returns:
- This instance.
- Throws:
java.lang.IllegalArgumentException
- If isoProtocol is null- Since:
- 2.0.0
-
setDisconnectionMode
PcscReader setDisconnectionMode(PcscReader.DisconnectionMode disconnectionMode)
Changes the action to be taken after disconnection (default valuePcscReader.DisconnectionMode.LEAVE
).The card is either reset or left as is.
The default value for this parameter if this method is not called is
PcscReader.DisconnectionMode.LEAVE
.- Parameters:
disconnectionMode
- ThePcscReader.DisconnectionMode
to use (must be not null).- Returns:
- This instance.
- Throws:
java.lang.IllegalArgumentException
- If disconnectionMode is null
-
-