end Contact Kernel App Data Load
Finalizes and commits all staged contact application data into the EMV kernel.
This method completes the contact application data loading sequence by validating, processing, and activating all application configurations that were previously loaded via setContactKernelAppData calls. It saves the configuration data to persistent storage, and configures the contact EMV kernel for transaction processing.
Prerequisites:
EMV kernel environment must be initialized via initializeKernelEnvironment
At least one application configuration must be loaded via setContactKernelAppData
This method is the final step in the contact application data loading sequence
Post-conditions:
All staged contact application data is committed and active in the kernel
Contact EMV kernel is configured and ready for transaction processing
Application configurations are persisted to storage for future use
Usage sequence: This method must be called after all desired setContactKernelAppData calls:
// Load multiple application configurations
emvPort.setContactKernelAppData(visaConfig)
emvPort.setContactKernelAppData(mastercardConfig)
emvPort.setContactKernelAppData(amexConfig)
// Finalize and commit all configurations
val result = emvPort.endContactKernelAppDataLoad()Thread safety: This method should be called from the same thread that performed the setContactKernelAppData calls 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:
Validate that at least one application configuration was loaded before finalizing
Log detailed information about the number of applications committed and their AIDs
Ensure atomic operation where possible (all configurations committed or none)
Return
NexusRet indicating the finalization result:
NexusRet.OK: All contact application data committed successfully to the kernel
NexusRet.INTERR: Internal error during finalization or kernel configuration
Other values: Specific validation or configuration errors as defined by the implementation
Example usage:
// After loading all desired contact application configurations
val result = emvPort.endContactKernelAppDataLoad()
if (result == NexusRet.OK) {
// All contact applications committed successfully
println("Contact EMV kernel configured with all application data")
// Kernel is now ready for contact chip card transactions
} else {
// Handle finalization failure
println("Failed to finalize contact application data: $result")
// May need to reset and reload application configurations
}