EasyManua.ls Logo

IDTECH NEO2 - Page 66

Default Icon
153 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
56 Core Implementation NEO2: Swift
Implement the button press methods
@IBAction func getFirmware(_ sender: UIButton) {
var result: NSString?
let rt = IDT_NEO2.sharedController().device_getFirmwareVersion(&result)
logTextView.text = ""
if RETURN_CODE_DO_SUCCESS == rt {
appendMessageToLog("Get firmware: " + (result! as String))
} else {
displayReturnError("Get firmware", rt: rt)
}
}
@IBAction func startMSR_CTLS(_ sender: UIButton) {
let rt = IDT_NEO2.sharedController().ctls_startTransaction(1.00, type: 00,
timeout: 30, tags: nil)
logTextView.text = ""
if RETURN_CODE_DO_SUCCESS == rt {
appendMessageToLog("Enabled MSR / CTLS")
} else {
displayReturnError("Start MSR / CTLS", rt: rt)
}
}
@IBAction func startICCEMV(_ sender: UIButton) {
let rt = IDT_NEO2.sharedController().emv_startTransaction(1.00, amtOther: 0,
type: 0, timeout: 60, tags: nil, forceOnline: false, fallback: true)
logTextView.text = ""
if RETURN_CODE_DO_SUCCESS == rt {
appendMessageToLog("Start Transaction Command Accepted")
} else {
displayReturnError("Start ICC EMV", rt: rt)
}
}
@IBAction func completeICCEMV(_ sender: UIButton) {
let rt = IDT_NEO2.sharedController().emv_completeOnlineEMVTransaction(true,
hostResponseTags: IDTUtility.hex(toData: "8A023030"))
logTextView.text = ""
if RETURN_CODE_DO_SUCCESS == rt {
appendMessageToLog("Complete Transaction Command Accepted")
} else {
displayReturnError("Complete ICC EMV", rt: rt)
}
}
@IBAction func cancelTransaction(_ sender: UIButton) {
let rt = IDT_NEO2.sharedController().
ctls_cancelTransaction()
logTextView.text = ""
if RETURN_CODE_DO_SUCCESS == rt {
appendMessageToLog("Canceled transaction")
} else {
displayReturnError("Cancel transaction", rt: rt)
}
}
#80152504-001 IDTech iOS SDK Guide for NEO2

Table of Contents

Related product manuals