SmartCardEmulation

Constructors

Link copied to clipboard
constructor(cdp: CDP)

Types

Link copied to clipboard
@Serializable
data class BeginTransactionRequestedParameter(val requestId: String, val handle: Int)

Fired when |SCardBeginTransaction| is called.

Link copied to clipboard
@Serializable
data class CancelRequestedParameter(val requestId: String, val contextId: Int)

Fired when |SCardCancel| is called.

Link copied to clipboard

Maps to |SCARD_*| connection state values.

Link copied to clipboard
@Serializable
data class ConnectRequestedParameter(val requestId: String, val contextId: Int, val reader: String, val shareMode: SmartCardEmulation.ShareMode, val preferredProtocols: SmartCardEmulation.ProtocolSet)

Fired when |SCardConnect| is called.

Link copied to clipboard
@Serializable
data class ControlRequestedParameter(val requestId: String, val handle: Int, val controlCode: Int, val data: String)

Fired when |SCardControl| is called.

Link copied to clipboard
@Serializable
data class DisconnectRequestedParameter(val requestId: String, val handle: Int, val disposition: SmartCardEmulation.Disposition)

Fired when |SCardDisconnect| is called.

Link copied to clipboard

Indicates what the reader should do with the card.

Link copied to clipboard
@Serializable
data class EndTransactionRequestedParameter(val requestId: String, val handle: Int, val disposition: SmartCardEmulation.Disposition)

Fired when |SCardEndTransaction| is called.

Link copied to clipboard
@Serializable
data class EstablishContextRequestedParameter(val requestId: String)

Fired when |SCardEstablishContext| is called.

Link copied to clipboard
@Serializable
data class GetAttribRequestedParameter(val requestId: String, val handle: Int, val attribId: Int)

Fired when |SCardGetAttrib| is called.

Link copied to clipboard
@Serializable
data class GetStatusChangeRequestedParameter(val requestId: String, val contextId: Int, val readerStates: List<SmartCardEmulation.ReaderStateIn>, val timeout: Int? = null)

Fired when |SCardGetStatusChange| is called. Timeout is specified in milliseconds.

Link copied to clipboard
@Serializable
data class ListReadersRequestedParameter(val requestId: String, val contextId: Int)

Fired when |SCardListReaders| is called.

Link copied to clipboard

Maps to the |SCARD_PROTOCOL_*| values.

Link copied to clipboard
@Serializable
data class ProtocolSet(val t0: Boolean? = null, val t1: Boolean? = null, val raw: Boolean? = null)

Maps to the |SCARD_PROTOCOL_*| flags.

Link copied to clipboard
@Serializable
data class ReaderStateFlags(val unaware: Boolean? = null, val ignore: Boolean? = null, val changed: Boolean? = null, val unknown: Boolean? = null, val unavailable: Boolean? = null, val empty: Boolean? = null, val present: Boolean? = null, val exclusive: Boolean? = null, val inuse: Boolean? = null, val mute: Boolean? = null, val unpowered: Boolean? = null)

Maps to the |SCARD_STATE_*| flags.

Link copied to clipboard
@Serializable
data class ReaderStateIn(val reader: String, val currentState: SmartCardEmulation.ReaderStateFlags, val currentInsertionCount: Int)
Link copied to clipboard
@Serializable
data class ReaderStateOut(val reader: String, val eventState: SmartCardEmulation.ReaderStateFlags, val eventCount: Int, val atr: String)
Link copied to clipboard
@Serializable
data class ReleaseContextRequestedParameter(val requestId: String, val contextId: Int)

Fired when |SCardReleaseContext| is called.

Link copied to clipboard
@Serializable
data class ReportBeginTransactionResultParameter(val requestId: String, val handle: Int)
Link copied to clipboard
@Serializable
data class ReportConnectResultParameter(val requestId: String, val handle: Int, val activeProtocol: SmartCardEmulation.Protocol? = null)
Link copied to clipboard
@Serializable
data class ReportDataResultParameter(val requestId: String, val data: String)
Link copied to clipboard
@Serializable
data class ReportErrorParameter(val requestId: String, val resultCode: SmartCardEmulation.ResultCode)
Link copied to clipboard
@Serializable
data class ReportEstablishContextResultParameter(val requestId: String, val contextId: Int)
Link copied to clipboard
@Serializable
data class ReportGetStatusChangeResultParameter(val requestId: String, val readerStates: List<SmartCardEmulation.ReaderStateOut>)
Link copied to clipboard
@Serializable
data class ReportListReadersResultParameter(val requestId: String, val readers: List<String>)
Link copied to clipboard
@Serializable
data class ReportPlainResultParameter(val requestId: String)
Link copied to clipboard
@Serializable
data class ReportReleaseContextResultParameter(val requestId: String)
Link copied to clipboard
@Serializable
data class ReportStatusResultParameter(val requestId: String, val readerName: String, val state: SmartCardEmulation.ConnectionState, val atr: String, val protocol: SmartCardEmulation.Protocol? = null)
Link copied to clipboard

Indicates the PC/SC error code.

Link copied to clipboard
@Serializable
data class SetAttribRequestedParameter(val requestId: String, val handle: Int, val attribId: Int, val data: String)

Fired when |SCardSetAttrib| is called.

Link copied to clipboard

Maps to the |SCARD_SHARE_*| values.

Link copied to clipboard
@Serializable
data class StatusRequestedParameter(val requestId: String, val handle: Int)

Fired when |SCardStatus| is called.

Link copied to clipboard
@Serializable
data class TransmitRequestedParameter(val requestId: String, val handle: Int, val data: String, val protocol: SmartCardEmulation.Protocol? = null)

Fired when |SCardTransmit| is called.

Properties

Link copied to clipboard

Fired when |SCardBeginTransaction| is called.

Link copied to clipboard

Fired when |SCardCancel| is called.

Link copied to clipboard

Fired when |SCardConnect| is called.

Link copied to clipboard

Fired when |SCardControl| is called.

Link copied to clipboard

Fired when |SCardDisconnect| is called.

Link copied to clipboard

Fired when |SCardEndTransaction| is called.

Link copied to clipboard

Fired when |SCardEstablishContext| is called.

Link copied to clipboard

Fired when |SCardGetAttrib| is called.

Link copied to clipboard

Fired when |SCardGetStatusChange| is called. Timeout is specified in milliseconds.

Link copied to clipboard

Fired when |SCardListReaders| is called.

Link copied to clipboard

Fired when |SCardReleaseContext| is called.

Link copied to clipboard

Fired when |SCardSetAttrib| is called.

Link copied to clipboard

Fired when |SCardStatus| is called.

Link copied to clipboard

Fired when |SCardTransmit| is called.

Functions

Link copied to clipboard
suspend fun disable(mode: CommandMode = CommandMode.DEFAULT)

Disables the |SmartCardEmulation| domain.

Link copied to clipboard
suspend fun enable(mode: CommandMode = CommandMode.DEFAULT)

Enables the |SmartCardEmulation| domain.

Link copied to clipboard
suspend fun reportBeginTransactionResult(requestId: String, handle: Int)

Reports the result of a |SCardBeginTransaction| call. On success, this creates a new transaction object.

Link copied to clipboard
suspend fun reportConnectResult(requestId: String, handle: Int, activeProtocol: SmartCardEmulation.Protocol? = null)

Reports the successful result of a |SCardConnect| call.

Link copied to clipboard
suspend fun reportDataResult(args: SmartCardEmulation.ReportDataResultParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun reportDataResult(requestId: String, data: String)

Reports the successful result of a call that sends back data on success. Used for |SCardTransmit|, |SCardControl|, and |SCardGetAttrib|.

Link copied to clipboard
suspend fun reportError(args: SmartCardEmulation.ReportErrorParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun reportError(requestId: String, resultCode: SmartCardEmulation.ResultCode)

Reports an error result for the given request.

Link copied to clipboard
suspend fun reportEstablishContextResult(requestId: String, contextId: Int)

Reports the successful result of a |SCardEstablishContext| call.

Link copied to clipboard

Reports the successful result of a |SCardGetStatusChange| call.

Link copied to clipboard
suspend fun reportListReadersResult(requestId: String, readers: List<String>)

Reports the successful result of a |SCardListReaders| call.

Link copied to clipboard
suspend fun reportPlainResult(requestId: String)
suspend fun reportPlainResult(args: SmartCardEmulation.ReportPlainResultParameter, mode: CommandMode = CommandMode.DEFAULT)

Reports the successful result of a call that returns only a result code. Used for: |SCardCancel|, |SCardDisconnect|, |SCardSetAttrib|, |SCardEndTransaction|.

Link copied to clipboard
suspend fun reportReleaseContextResult(requestId: String)

Reports the successful result of a |SCardReleaseContext| call.

Link copied to clipboard
suspend fun reportStatusResult(args: SmartCardEmulation.ReportStatusResultParameter, mode: CommandMode = CommandMode.DEFAULT)
suspend fun reportStatusResult(requestId: String, readerName: String, state: SmartCardEmulation.ConnectionState, atr: String, protocol: SmartCardEmulation.Protocol? = null)

Reports the successful result of a |SCardStatus| call.