![]() |
IDTech iOS Framework Guide
1.1.088
API reference for UniPay
|
#import <IDT_UniPay.h>
Class Methods | |
(NSString *) | + SDK_version |
(IDT_UniPay *) | + sharedController |
Properties | |
id< IDT_UniPay_Delegate > | delegate |
Class to drive the IDT_UniPay device
- (void) attemptConnect |
Attempt connection
Requests a connection attempt. Internal use only.
- (RETURN_CODE) config_getModelNumber: | (NSString **) | response |
Polls device for Model Number
response | Returns Model Number |
- (RETURN_CODE) config_getSerialNumber: | (NSString **) | response |
Polls device for Serial Number
response | Returns Serial Number |
- (BOOL) config_setCmdTimeOutDuration: | (float) | nSecond |
Command Acknowledgement Timout
Sets the amount of seconds to wait for an {ACK} to a command before a timeout. Responses should normally be received under one second. Default is 3 seconds
nSecond | Timout value. Valid range .1 - 60 seconds |
- (RETURN_CODE) config_setSerialNumber: | (NSString *) | strSN |
Set Serial Number
Set device's serial number and Bluetooth name, then reboots device. Bluetooth name will be set as IDT_UniPay + Space + Serial number
strSN | Device serial number |
- (RETURN_CODE) device_cancelConnectToAudioReader |
Cancel Connect To Audio Reader
Cancels a connection attempt to an IDTech MSR device connected via the audio port.
- (RETURN_CODE) device_connectToAudioReader |
Connect To Audio Reader
Attemps to recognize and connect to an IDTech MSR device connected via the audio port.
- (RETURN_CODE) device_getBatteryVoltage: | (NSString **) | response |
Polls device for Battery Voltage
response | Returns Battery Voltage as 4-chararacter string * 100. Example: "0186" = 1.86v. "1172" = 11.72v. |
- (RETURN_CODE) device_getFirmwareVersion: | (NSString **) | response |
Polls device for Firmware Version
response | Response returned of Firmware Version |
- (RETURN_CODE) device_getKSN: | (int) | keySlot | |
ksn: | (NSData **) | ksn | |
Get Account KSN
Retrieves the KSN for a key slot
keySlot | 0x02=MSR DUKPT Key, 0x0C = Admin DUKPT Key, 0x22 = ICC DUKPT Key |
ksn | Returns the Account DUKPT KSN |
- (RETURN_CODE) device_getLevelAndBaud: | (NSString **) | response |
Get Level and Baude
response | The Baud Rate and Audio Level. |
- (NSString *) device_getResponseCodeString: | (int) | errorCode |
Get Response Code String
Interpret a IDT_UniPay response code and return string description.
errorCode | Error code, range 0x0000 - 0xFFFF, example 0x0300 |
HEX VALUE | Description |
---|---|
0x0000 | No error, beginning task |
0x0001 | No response from reader |
0x0002 | Invalid response data |
0x0003 | Time out for task or CMD |
0x0004 | Wrong parameter |
0x0005 | SDK is doing MSR or ICC task |
0x0006 | SDK is doing PINPad task |
0x0007 | SDK is doing Other task |
0x0300 | Key Type(TDES) of Session Key is not same as the related Master Key. |
0x0400 | Related Key was not loaded. |
0x0500 | Key Same. |
0x0702 | PAN is Error Key. |
0x0D00 | This Key had been loaded. |
0x0E00 | Base Time was loaded. |
0x1800 | Send “Cancel Command” after send “Get Encrypted PIN” &”Get Numeric “& “Get Amount” |
0x1900 | Press “Cancel” key after send “Get Encrypted PIN” &”Get Numeric “& “Get Amount” |
0x30FF | Security Chip is not connect |
0x3000 | Security Chip is deactivation & Device is In Removal Legally State. |
0x3101 | Security Chip is activation & Device is In Removal Legally State. |
0x5500 | No Admin DUKPT Key. |
0x5501 | Admin DUKPT Key STOP. |
0x5502 | Admin DUKPT Key KSN is Error. |
0x5503 | Get Authentication Code1 Failed. |
0x5504 | Validate Authentication Code Error. |
0x5505 | Encrypt or Decrypt data failed. |
0x5506 | Not Support the New Key Type. |
0x5507 | New Key Index is Error. |
0x5508 | Step Error. |
0x550F | Other Error. |
0x6000 | Save or Config Failed / Or Read Config Error. |
0x6200 | No Serial Number. |
0x6900 | Invalid Command - Protocol is right, but task ID is invalid. |
0x6A00 | Unsupported Command - Protocol and task ID are right, but command is invalid. |
0x6B00 | Unknown parameter in command - Protocol task ID and command are right, but parameter is invalid. |
0x7200 | Device is suspend (MKSK suspend or press password suspend). |
0x7300 | PIN DUKPT is STOP (21 bit 1). |
0x7400 | Device is Busy. |
0xE100 | Can not enter sleep mode. |
0xE200 | File has existed. |
0xE300 | File has not existed. |
0xE400 | Open File Error. |
0xE500 | SmartCard Error. |
0xE600 | Get MSR Card data is error. |
0xE700 | Command time out. |
0xE800 | File read or write is error. |
0xE900 | Active 1850 error! |
0xEA00 | Load bootloader error. |
0xEF00 | Protocol Error- STX or ETX or check error. |
0xEB00 | Picture is not exist. |
0x2C06 | no card seated to request ATR |
0x2D01 | Card Not Supported, |
0x2D03 | Card Not Supported, wants CRC |
0x690D | Command not supported on reader without ICC support |
0x8100 | ICC error time out on power-up |
0x8200 | invalid TS character received |
0x8500 | pps confirmation error |
0x8600 | Unsupported F, D, or combination of F and D |
0x8700 | protocol not supported EMV TD1 out of range |
0x8800 | power not at proper level |
0x8900 | ATR length too long |
0x8B01 | EMV invalid TA1 byte value |
0x8B02 | EMV TB1 required |
0x8B03 | EMV Unsupported TB1 only 00 allowed |
0x8B04 | EMV Card Error, invalid BWI or CWI |
0x8B06 | EMV TB2 not allowed in ATR |
0x8B07 | EMV TC2 out of range |
0x8B08 | EMV TC2 out of range |
0x8B09 | per EMV96 TA3 must be > 0xF |
0x8B10 | ICC error on power-up |
0x8B11 | EMV T=1 then TB3 required |
0x8B12 | Card Error, invalid BWI or CWI |
0x8B13 | Card Error, invalid BWI or CWI |
0x8B17 | EMV TC1/TB3 conflict* |
0x8B20 | EMV TD2 out of range must be T=1 |
0x8C00 | TCK error |
0xA304 | connector has no voltage setting |
0xA305 | ICC error on power-up invalid (SBLK(IFSD) exchange |
0xE301 | ICC error after session star |
0xFF00 | EMV: Request to go online |
0xFF01 | EMV: Accept the offline transaction |
0xFF02 | EMV: Decline the offline transaction |
0xFF03 | EMV: Accept the online transaction |
0xFF04 | EMV: Decline the online transaction |
0xFF05 | EMV: Application may fallback to magstripe technology |
0xFF06 | EMV: ICC detected that the conditions of use are not satisfied |
0xFF07 | EMV: ICC didn't accept transaction |
0xFF08 | EMV: Transaction was cancelled |
0xFF09 | EMV: Application was not selected by kernel or ICC format error or ICC missing data error |
0xFF0A | EMV: Transaction is terminated |
0xFF0B | EMV: Other EMV Error |
- (BOOL) device_isAudioReaderConnected |
Is Audio Reader Connected
Returns value on device connection status when device is an audio-type connected to headphone plug.
- (bool) device_isConnected: | (IDT_DEVICE_Types) | device |
Is Device Connected
Returns the connection status of the requested device
device | Check connectivity of device type |
- (RETURN_CODE) device_rebootDevice |
Reboot Device
Executes a command to restart the device.
- (RETURN_CODE) device_sendDataCommand: | (NSData *) | cmd | |
calcLRC: | (BOOL) | lrc | |
response: | (NSData **) | response | |
Send a NSData object to device
Sends a command represented by the provide NSData object to the device through the accessory protocol.
cmd | NSData representation of command to execute |
lrc | If TRUE , this will wrap command with start/length/lrc/sum/end: '{STX}{Len_Low}{Len_High} data {CheckLRC} {CheckSUM} {ETX}' |
response | Response data |
- (RETURN_CODE) device_setAudioVolume: | (float) | val |
Set Volume To Audio Reader
Set the iPhone’s volume for command communication with audio-based readers. The the range of iPhone’s volume is from 0.1 to 1.0.
val | Volume level from 0.1 to 1.0 |
- (RETURN_CODE) device_startRKI |
Start Remote Key Injection
Attempts to perform a Remote Key Injection with IDTech's RKI servers.
- (RETURN_CODE) icc_exchangeAPDU: | (NSData *) | dataAPDU | |
encrypted: | (BOOL) | encrypted | |
response: | (APDUResponse **) | response | |
Exchange APDU
Sends an APDU packet to the ICC. If successful, response is returned in APDUResult class instance in response parameter.
dataAPDU | APDU data packet |
encrypted | Send data encrypted for special case |
response | Unencrypted/encrypted parsed APDU response |
- (RETURN_CODE) icc_exchangeEncryptedAPDU: | (NSData *) | dataAPDU | |
response: | (APDUResponse **) | response | |
Exchange Encrypted APDU
UniPay
Sends an encrypted APDU packet to the ICC. If successful, response is returned in APDUResult class instance in response parameter.
dataAPDU | APDU data packet |
response | encrypted parsed APDU response |
- (RETURN_CODE) icc_exchangeMultiAPDU: | (NSArray *) | dataAPDU | |
response: | (NSData **) | response | |
Exchange Multi APDU
Sends multiple APDU commands within on command
dataAPDU | An array of NSData APDU commands |
response | The combined response of the multiple APDU commands |
- (RETURN_CODE) icc_getAPDU_KSN: | (NSData **) | ksn |
Get APDU KSN
Retrieves the KSN used in ICC Encypted APDU usage
ksn | Returns the encrypted APDU packet KSN |
- (RETURN_CODE) icc_getExpiryDateOption: | (NSString **) | response |
Get Expiry Date Option UniPay
Executes a command to get the Expiry Date Option.
response | Expiry Option..
|
- (RETURN_CODE) icc_getICCReaderStatus: | (ICCReaderStatus **) | readerStatus |
Get Reader Status
Returns the reader status
readerStatus | Pointer that will return with the ICCReaderStatus results. |
- (RETURN_CODE) icc_getKeyFormatForICCDUKPT: | (NSString **) | response |
Get Key Format For ICC DUKPT
Specifies how data will be encrypted with Data Key or PIN key (if DUKPT key loaded)
response | Response returned from method:
|
- (RETURN_CODE) icc_getKeyTypeForICCDUKPT: | (NSString **) | response |
Get Key Type for ICC DUKPT
Specifies the key type used for ICC DUKPT encryption
response | Response returned from method:
|
- (RETURN_CODE) icc_loadDUKPTKey: | (DUKPT_KEY_Type) | type | |
ksn: | (NSString *) | hexKSN | |
initialKey: | (NSString *) | hexInitKey | |
Loads the ICC DUKPT Key
Sets the key the data will be encrypted with
type | Key Type
|
hexKSN | Key Serial Number as a Hex string |
hexInitKey | Initial key as a Hex string |
- (RETURN_CODE) icc_powerOffICC: | (NSString **) | error |
Power Off ICC
Powers down the ICC
error | Returns the error, if any |
If Success, empty If Failure, ASCII encoded data of error string
- (RETURN_CODE) icc_powerOnICC: | (NSData **) | response |
Power On ICC
Power up the currently selected microprocessor card in the ICC reader
response | Response returned. If Success, ATR String. If Failure, ASCII encoded data of error string |
- (RETURN_CODE) icc_setICCNotification: | (BOOL) | turnON |
Set ICC Notifications
Determins if card insert/remove events are captured and sent to delegate UniPay_EventFunctionICC
turnON | TRUE = monitor ICC card events, FALSE = ignore ICC card events. Default value is FALSE/OFF. |
- (RETURN_CODE) icc_setKeyFormatForICCDUKPT: | (int) | encryption |
Set Key Format for ICC DUKPT
Sets how data will be encrypted, with either TDES or AES (if DUKPT key loaded)
encryption | Encryption Type
|
- (RETURN_CODE) icc_setKeyTypeForICCDUKPT: | (int) | encryption |
Set Key Type for ICC DUKPT Key
Sets which key the data will be encrypted with, with either Data Key or PIN key (if DUKPT key loaded)
encryption | Encryption Type
|
- (bool) isConnected |
Device Connected
- (RETURN_CODE) msr_cancelMSRSwipe |
Disable MSR Swipe
Cancels MSR swipe request.
- (RETURN_CODE) msr_getClearPANID: | (NSString **) | response |
Get Clear PAN Digits
Returns the number of digits that begin the PAN that will be in the clear
response | Number of digits in clear. Values are ASCII '0' - '6': |
- (RETURN_CODE) msr_getExpirationMask: | (NSString **) | response |
Get Expiration Masking
Get the flag that determines if to mask the expiration date
response | '0' = masked, '1' = not-masked |
- (RETURN_CODE) msr_getSwipeEncryption: | (NSString **) | response |
Get Swipe Data Encryption
Returns the encryption used for sweip data
response | 'TDES', 'AES', 'NONE' |
- (RETURN_CODE) msr_getSwipeForcedEncryptionOption: | (NSString **) | response |
Get Swipe Data Encryption
Gets the swipe force encryption options
response | A string with for flags separated by PIPE character f1|f2|f3|f4, example "1|0|0|1" where:
|
- (RETURN_CODE) msr_getSwipeMaskOption: | (NSString **) | response |
Get Swipe Mask Option
Gets the swipe mask/clear data sending option
response | A string with for flags separated by PIPE character f1|f2|f3, example "1|0|0" where:
|
- (RETURN_CODE) msr_setClearPANID: | (int) | digits |
Set Clear PAN Digits
Sets the amount of digits shown in the clear (not masked) at the beginning of the returned PAN value
digits | Number of digits to show in clear. Range 0-6. |
- (RETURN_CODE) msr_setExpirationMask: | (BOOL) | masked |
Set Expiration Masking
Sets the flag to mask the expiration date
masked | TRUE = mask expiration |
- (RETURN_CODE) msr_setSwipeEncryption: | (int) | encryption |
Set Swipe Data Encryption
Sets the swipe encryption method
encryption | 1 = TDES, 2 = AES |
- (RETURN_CODE) msr_setSwipeForcedEncryptionOption: | (BOOL) | track1 | |
track2: | (BOOL) | track2 | |
track3: | (BOOL) | track3 | |
track3card0: | (BOOL) | track3card0 | |
Set Swipe Force Encryption
Sets the swipe force encryption options
track1 | Force encrypt track 1 |
track2 | Force encrypt track 2 |
track3 | Force encrypt track 3 |
track3card0 | Force encrypt track 3 when card type is 0 |
- (RETURN_CODE) msr_setSwipeMaskOption: | (BOOL) | track1 | |
track2: | (BOOL) | track2 | |
track3: | (BOOL) | track3 | |
Set Swipe Mask Option
Sets the swipe mask/clear data sending option
track1 | Mask track 1 allowed |
track2 | Mask track 2 allowed |
track3 | Mask track 3 allowed |
- (RETURN_CODE) msr_startMSRSwipe: | (int) | track |
Enable MSR Swipe
Enables MSR, waiting for swipe to occur. Allows track selection. Returns IDTMSRData instance to deviceDelegate::swipeMSRData:()
track | Track Selection Option |
Track Selection Option | Val |
---|---|
Any Track | 0 |
Track 1 Only | 1 |
Track 2 Only | 2 |
Track 1 & Track 2 | 3 |
Track 3 Only | 4 |
Track 1 & Track 3 | 5 |
Track 2 & Track 3 | 6 |
All three Tracks | 7 |
+ (NSString*) SDK_version |
SDK Version
Returns the current version of IDTech.framework
+ (IDT_UniPay*) sharedController |
Singleton Instance
Establishes an singleton instance of IDT_UniPay class.
|
readwriteatomicstrong |