setContactlessKernelAppData

abstract fun setContactlessKernelAppData(tKernelType: KernelType, tContactlessAppConfig: TypeParameterModal): NexusRet

Loads application-specific configuration data into the contactless EMV kernel.

This method configures the contactless EMV kernel with application-specific parameters and settings for a specific kernel type (e.g., VISA, MASTERCARD, AMEX). The configuration data includes Application Identifier (AID) information, transaction limits, terminal capabilities, and other EMV parameters required for contactless card transaction processing.

Prerequisites:

  • EMV kernel environment must be initialized via initializeKernelEnvironment

  • This method is part of the contactless application data loading sequence

Kernel type significance: The tKernelType parameter distinguishes between different contactless payment scheme implementations (VISA payWave, Mastercard PayPass, etc.), each with specific processing requirements and parameter sets.

Usage sequence: This method is part of a multi-step contactless application configuration process:

  1. Call this method one or more times to load application configurations for different kernel types

  2. Call endContactlessKernelAppDataLoad to finalize and commit all loaded configurations

Thread safety: This method should be called from a single thread during the application data loading sequence to ensure data consistency and prevent configuration corruption.

Exceptions: This function MUST NOT throw any exception. Any error must be indicated through NexusRet Any unexpected error must be mapped as NexusRet.INTERR

Implementation notes:

  • Log detailed information about each kernel type and application configuration loaded

  • Ensure proper error handling for malformed or invalid configuration data

Return

NexusRet indicating the configuration loading result:

  • NexusRet.OK: Application configuration loaded successfully into the specified kernel

  • NexusRet.INTERR: Internal error during configuration loading

  • Other values: Specific configuration errors as defined by the implementation

Example usage:

val visaContactlessConfig = TypeParameterModal(
aid = "A0000000031010",
// ... other VISA-specific configuration parameters
)

val mastercardContactlessConfig = TypeParameterModal(
aid = "A0000000041010",
// ... other Mastercard-specific configuration parameters
)

// Load VISA contactless configuration
val visaResult = emvPort.setContactlessKernelAppData(KernelType.VISA, visaContactlessConfig)
if (visaResult == NexusRet.OK) {
println("VISA contactless configuration loaded successfully")
}

// Load Mastercard contactless configuration
val mcResult = emvPort.setContactlessKernelAppData(KernelType.MASTERCARD, mastercardContactlessConfig)
if (mcResult == NexusRet.OK) {
println("Mastercard contactless configuration loaded successfully")
}

// After loading all configurations, finalize the process
emvPort.endContactlessKernelAppDataLoad()

Timber log suggestion: Log tKernelType, AID from tContactlessAppConfig, and status on success or failure.

Parameters

tKernelType

A KernelType enum value specifying the contactless kernel implementation (e.g., VISA, MASTERCARD, AMEX) that will process this application configuration. Each kernel type has specific processing rules and parameter requirements.

tContactlessAppConfig

A TypeParameterModal object containing the complete application configuration data to be loaded into the specified contactless EMV kernel. This includes the Application Identifier (AID), associated EMV parameters, transaction limits, and other application-specific settings required for contactless card processing.