IDTech Android SDK Guide  1.00.077
API reference for UniPay 1.5
com.idtechproducts.device.IDT_UniPayI_V Class Reference

Public Member Functions

 IDT_UniPayI_V (OnReceiverListener callback, Context context)
 
boolean device_setDeviceType (ReaderInfo.DEVICE_TYPE deviceType)
 
 IDT_UniPayI_V (OnReceiverListener callback, Context context, boolean isTTK)
 
boolean device_setDeviceType (ReaderInfo.DEVICE_TYPE deviceType, boolean isTTK)
 
boolean device_isTTK ()
 
int device_getDRS (ResDataStruct respData)
 
int device_selfCheck ()
 
int device_rebootDevice ()
 
void setIDT_Device (FirmwareUpdateTool fwTool)
 
DEVICE_TYPE device_getDeviceType ()
 
void registerListen ()
 
void unregisterListen ()
 
void release ()
 
String config_getSDKVersion ()
 
String config_getXMLVersionInfo ()
 
String phone_getInfoManufacture ()
 
String phone_getInfoModel ()
 
void log_setVerboseLoggingEnable (boolean enable)
 
void log_setSaveLogEnable (boolean enable)
 
int log_deleteLogs ()
 
void config_setXMLFileNameWithPath (String path)
 
boolean config_loadingConfigurationXMLFile (boolean updateAutomatically)
 
boolean device_connectWithProfile (StructConfigParameters profile)
 
int emv_getEMVKernelVersion (StringBuilder version)
 
int emv_getEMVKernelCheckValue (ResDataStruct respData)
 
int emv_getEMVConfigurationCheckValue (ResDataStruct respData)
 
void device_ConnectWithoutValidation (boolean noValidate)
 
boolean device_connect ()
 
boolean device_isConnected ()
 
int device_startRKI ()
 
int autoConfig_start (String strXMLFilename)
 
void autoConfig_stop ()
 
int device_getFirmwareVersion (StringBuilder version)
 
int device_ReviewAudioJackSetting (ResDataStruct respData)
 
int config_getSerialNumber (StringBuilder serialNumber)
 
int config_getModelNumber (StringBuilder modNumber)
 
int device_getKSN (ResDataStruct ksn)
 
int device_setMerchantRecord (int index, boolean enabled, String merchantID, String merchantURL)
 
int device_getMerchantRecord (int index, ResDataStruct respData)
 
String device_getResponseCodeString (int errorCode)
 
int device_sendDataCommand (String cmd, boolean calcLRC, String data, ResDataStruct respData)
 
int device_sendDataCommand (String cmd, boolean calcLRC, String data, ResDataStruct respData, int timeout)
 
int device_updateFirmware (String[] commands)
 
int icc_getICCReaderStatus (ICCReaderStatusStruct ICCStatus)
 
int icc_powerOnICC (ResDataStruct atrPPS)
 
int icc_powerOffICC (ResDataStruct respData)
 
int icc_passthroughOnICC ()
 
int icc_passthroughOffICC ()
 
int icc_exchangeAPDU (byte[] dataAPDU, ResDataStruct response)
 
int emv_retrieveApplicationData (String aid, ResDataStruct respData)
 
int emv_removeApplicationData (String aid, ResDataStruct respData)
 
int emv_setApplicationData (String aid, byte[] TLV, ResDataStruct respData)
 
int emv_retrieveTerminalData (ResDataStruct respData)
 
int emv_removeTerminalData (ResDataStruct respData)
 
int emv_setTerminalData (byte[] TLV, ResDataStruct respData)
 
int emv_retrieveAidList (ResDataStruct respData)
 
int emv_retrieveCAPK (byte[] data, ResDataStruct respData)
 
int emv_removeCAPK (byte[] capk, ResDataStruct respData)
 
int emv_setCAPK (byte[] key, ResDataStruct respData)
 
int emv_retrieveCAPKList (ResDataStruct respData)
 
int emv_retrieveCRL (ResDataStruct respData)
 
int emv_removeCRL (byte[] crlList, ResDataStruct respData)
 
int emv_setCRL (byte[] crlList, ResDataStruct respData)
 
int emv_startTransaction (double amount, double amtOther, int type, final int timeout, byte[] tags, boolean forceOnline)
 
int emv_cancelTransaction (ResDataStruct respData)
 
void emv_lcdControlResponse (byte mode, byte data)
 
int emv_authenticateTransaction (byte[] tags)
 
int emv_completeTransaction (boolean commError, byte[] authCode, byte[] iad, byte[] tlvScripts, byte[] tags)
 
int emv_retrieveTransactionResult (byte[] tags, Map< String, Map< String, byte[]>> retrievedTags)
 
int device_reviewAllSetting (ResDataStruct respData)
 
int msr_defaultAllSetting ()
 
int msr_getSingleSetting (byte funcID, byte[] response)
 
int msr_setSingleSetting (byte funcID, byte setData)
 
int msr_cancelMSRSwipe ()
 
int msr_startMSRSwipe ()
 
int ctls_startTransaction ()
 
int ctls_cancelTransaction ()
 

Static Public Member Functions

static void useUSBIntentFilter ()
 
static IDT_Device getIDT_Device ()
 
static void emv_allowFallback (boolean allow)
 
static void emv_setAutoAuthenticateTransaction (boolean auto)
 
static boolean emv_getAutoAuthenticateTransaction ()
 
static void emv_setAutoCompleteTransaction (boolean auto)
 
static boolean emv_getAutoCompleteTransaction ()
 

Constructor & Destructor Documentation

com.idtechproducts.device.IDT_UniPayI_V.IDT_UniPayI_V ( OnReceiverListener  callback,
Context  context 
)

It is the constructor of the main class IDT_UniPayI_V. When it is called, the SDK will create the Instance for IDT_UniPayI_V device. The interface OnReceiverListner needs to be implemented in the application.

Parameters
callbackOnReceiverListener callback
contextApplication context
com.idtechproducts.device.IDT_UniPayI_V.IDT_UniPayI_V ( OnReceiverListener  callback,
Context  context,
boolean  isTTK 
)

It is the constructor of the main class IDT_UniPayI_V. When it is called, the SDK will create the Instance for IDT_UniPayI_V device. The interface OnReceiverListner needs to be implemented in the application.

Parameters
callbackOnReceiverListener callback
contextApplication context
isTTKTrue if TTK device

Member Function Documentation

int com.idtechproducts.device.IDT_UniPayI_V.autoConfig_start ( String  strXMLFilename)

start Auto Config to search the profile.

Parameters
strXMLFilenameInput the customized XML file as the templates to search the profile.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
void com.idtechproducts.device.IDT_UniPayI_V.autoConfig_stop ( )

stop Auto Config.

Returns
null.
int com.idtechproducts.device.IDT_UniPayI_V.config_getModelNumber ( StringBuilder  modNumber)

Get the model number of device.

Parameters
modNumberreturns Model Number string.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
String com.idtechproducts.device.IDT_UniPayI_V.config_getSDKVersion ( )

READER CONFIG API LIST Get the version of SDK.

Parameters
sdkVersionfor version string.
Returns
success or error code.
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.config_getSerialNumber ( StringBuilder  serialNumber)

Get the serial number of device.

Parameters
serialNumberreturns Serial Number string.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
String com.idtechproducts.device.IDT_UniPayI_V.config_getXMLVersionInfo ( )

Get XML configuration version.

Returns
the version info.
boolean com.idtechproducts.device.IDT_UniPayI_V.config_loadingConfigurationXMLFile ( boolean  updateAutomatically)

Load XML Configuration File.

Parameters
xmlFilename,XMLConfiguration File Name.
Returns
none
void com.idtechproducts.device.IDT_UniPayI_V.config_setXMLFileNameWithPath ( String  path)

set XML Configuration File Name with the full path.

Parameters
xmlFilename,XMLConfiguration File Name.
Returns
none
int com.idtechproducts.device.IDT_UniPayI_V.ctls_cancelTransaction ( )

Cancel CTLS Transaction

Cancels the currently executing CTLS transaction.

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.ctls_startTransaction ( )

Enable CTLS interface. Returns encrypted data by call back function.
The function swipeMSRData in interface OnReceiverListener will be called if contactless data received.

See also
OnReceiverListener
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
boolean com.idtechproducts.device.IDT_UniPayI_V.device_connect ( )

Connect the device.

This will attempt to connect to reader. For audio connection: it will first attempt to set the IDTech reader to the correct baud rate compatible with the Android Audio hardware Then it will attempt to recognize the reader that is attached by polling for model information

Returns
true: success, false: fail.
void com.idtechproducts.device.IDT_UniPayI_V.device_ConnectWithoutValidation ( boolean  noValidate)

Set connection mode to connect to the device without validation

This will tell the SDK to connect to a reader with supplied device type For audio connection: it will not attempt to set the IDTech reader to the correct baud rate compatible with the Android Audio hardware and will assume the hardware baud rate is correct. It will not attempt to validate an IDTech reader is connected. It will assume an IDTech reader is connected and charged

NOTE: It is left to the integrator to make the decision to validate the reader is connected. One method is execute device_getFirmware and evaluate the response. If there is a response, then a reader from IDTech. If it is an expected response (known firmware string), then the specific reader model can be verified.

Parameters
validateTRUE = no validation, FALSE = validate (normal operation)
Returns
none.
boolean com.idtechproducts.device.IDT_UniPayI_V.device_connectWithProfile ( StructConfigParameters  profile)

connect the device with Profile.

Parameters
profile,theprofile is the one which is the result from Auto config.
Returns
true: success, false: fail.
DEVICE_TYPE com.idtechproducts.device.IDT_UniPayI_V.device_getDeviceType ( )

Gets type of device

int com.idtechproducts.device.IDT_UniPayI_V.device_getDRS ( ResDataStruct  respData)

Get DRS

Parameters
respData.resDataResponse Body is <DRS sourceblk="" number>=""> <SourceBlk1> … [<SourceBlkN>] Where: DRS –Destructive Reset <DRS sourceblk="" number>=""> is 2 bytes, format is NumL NumH. It is Number of <SourceBlkX> <SourceBlkX> is n bytes, Format is <SourceID> <SourceLen> <SourceData> <SourceID> is 1 byte <SourceLen> is 1 byte, it is length of <SourceData>

Item | SourceID | SourceLen | SourceData

Master Chip Check Value Error | 00 | 1 | 01 – Application Error

Slave Chip Check Value Error | 01 | 1 | 01 – Application Error

Korea Self-Test Error | 02 | 1 | 0x01 – EMV L2 Configuration Check Value Error

| | | 0x02 – Future Key Check Value Error

Battery | 10 | 1 | 01 – Battery Error

Tamper Switch | 11 | 1 | Bit 0 – Tamper Switch 1 (0-No, 1-Error) | | | Bit 1 – Tamper Switch 2 (0-No, 1-Error) | | | Bit 2 – Tamper Switch 3 (0-No, 1-Error) | | | Bit 3 – Tamper Switch 4 (0-No, 1-Error) | | | Bit 4 – Tamper Switch 5 (0-No, 1-Error)

| | | Bit 5 – Tamper Switch 6 (0-No, 1-Error)

Temperature | 12 | 1 | 01 –TemperatureHigh or Low

Voltage | 13 | 1 | 01 –Voltage High or Low

Other | 1F | 4 | Reg31~24bits, Reg23~16bits, | | | Reg15~8bits, Reg7~0bits

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_getFirmwareVersion ( StringBuilder  version)

DEVICE INFO API Get the firmware version of device.

Parameters
versionfor version string.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_getKSN ( ResDataStruct  ksn)

Get the Account DUKPT Key KSN of device.

Parameters
10-byteKSN
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_getMerchantRecord ( int  index,
ResDataStruct  respData 
)

Get Merchant Record

Sets the burst mode for the device.

Parameters
respDataresponse data from reader. Merchant Record Index: 1 byte enabled: 1 byte Merchant ID: 32 bytes Length of Merchant URL: 1 byte Merchant URL: 64 bytes
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
String com.idtechproducts.device.IDT_UniPayI_V.device_getResponseCodeString ( int  errorCode)

Get Response Code String

Interpret a response code and return string description.

Parameters
errorCodeError code, range 0x0000 - 0xFFFF, example 0x0300
Returns
Verbose error description
boolean com.idtechproducts.device.IDT_UniPayI_V.device_isConnected ( )

get the status if the device connected.

Returns
true: connected, false: disconnected
boolean com.idtechproducts.device.IDT_UniPayI_V.device_isTTK ( )

Check if the device is TTK

Returns
true if it is TTK, otherwise false.
int com.idtechproducts.device.IDT_UniPayI_V.device_rebootDevice ( )

Reboot device.The device will restart and need to reconnect device if success.

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_reviewAllSetting ( ResDataStruct  respData)

Review All Configuration Settings

it returns the current values for all the parameters that can be set using the Set Configuration command. Each parameter is returned as a TLV data object.

Parameters
respDataReturns TLV in ResDataStruct.resData. Status Code in ResDataStruct.statusCode.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_ReviewAudioJackSetting ( ResDataStruct  respData)

Retrieves Audio Jack setting.

Parameters
responseresponse[0]: baud rate of the device connected.
response[1]: level option of the device output signals.
response[2]: the number of prefix "55", and end with "66".
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_selfCheck ( )

Self check for TTK If Self-Check function Failed, then work into De-activation State. If device work into De-activation State, All Sensitive Data will be erased and it need be fixed in Manufacture.

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_sendDataCommand ( String  cmd,
boolean  calcLRC,
String  data,
ResDataStruct  respData 
)

Sends a Direct Command Sends a NEO IDG ViVOtech 2.0 command

Parameters
commandTwo bytes command (including subCommand) as per NEO IDG Reference Guide (UniPayIII)
calcLRCNot used for IDG devices
dataCommand data (if applicable) for IDG devices
responseReturns response ResDataStruct.resData. Status Code in ResDataStruct.statusCode
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_sendDataCommand ( String  cmd,
boolean  calcLRC,
String  data,
ResDataStruct  respData,
int  timeout 
)

Sends a Direct Command Sends a NEO IDG ViVOtech 2.0 command

Parameters
commandTwo bytes command (including subCommand) as per NEO IDG Reference Guide (UniPayIII)
calcLRCNot used for IDG devices
dataCommand data (if applicable) for IDG devices
responseReturns response ResDataStruct.resData. Status Code in ResDataStruct.statusCode
timeoutCommand timeout
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
boolean com.idtechproducts.device.IDT_UniPayI_V.device_setDeviceType ( ReaderInfo.DEVICE_TYPE  deviceType)

Defines connection USB or Audio Jack

Parameters
deviceTypeDEVICE_TYPE.DEVICE_UNIPAY_I_V or DEVICE_TYPE.DEVICE_UNIPAY_I_V_USB
boolean com.idtechproducts.device.IDT_UniPayI_V.device_setDeviceType ( ReaderInfo.DEVICE_TYPE  deviceType,
boolean  isTTK 
)

Defines connection USB or Audio Jack

Parameters
deviceTypeDEVICE_TYPE.DEVICE_UNIPAY_I_V or DEVICE_TYPE.DEVICE_UNIPAY_I_V_USB
isTTKTrue if TTK device
int com.idtechproducts.device.IDT_UniPayI_V.device_setMerchantRecord ( int  index,
boolean  enabled,
String  merchantID,
String  merchantURL 
)

Set Merchant Record

Sets the burst mode for the device.

Parameters
indexMerchant Record Index. The valid value is 1–6.
enabled1: The Merchant ID is valid, 0: The Merchant ID is not valid.
merchantIDThe tag is 9F25.
merchantURLThe tag is 9F29.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_startRKI ( )

Start remote key injection.

Returns
success or error code.
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.device_updateFirmware ( String[]  commands)

DEVICE INFO API Update the firmware of device.

Parameters
commandsfor all the lines/commands of the firmware text file.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
static void com.idtechproducts.device.IDT_UniPayI_V.emv_allowFallback ( boolean  allow)
static

Allow fallback for EMV transactions. Default is TRUE

Parameters
allowTRUE = allow fallback, FALSE = don't allow fallback
int com.idtechproducts.device.IDT_UniPayI_V.emv_authenticateTransaction ( byte[]  tags)

Authenticate EMV Transaction Request

Authenticates the EMV transaction for an ICC card. Execute this after receiving response with result code 0x10 to emv_startTransaction

The tags will be returned in the callback routine.

Parameters
tagsTLV stream that can be used to update the following values:
  • 9F02: Amount
  • 9F03: Other amount
  • 9C: Transaction type
  • 5F57: Account type In addition tag DFEE1A can be sent to specify tag list to include in results. Example four tags 9F02, 9F36, 95, 9F37 to be included in response = DFEE1A079F029F369f9F37
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_cancelTransaction ( ResDataStruct  respData)

Cancel EMV Transaction

Cancels the currently executing EMV transaction.

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_completeTransaction ( boolean  commError,
byte[]  authCode,
byte[]  iad,
byte[]  tlvScripts,
byte[]  tags 
)

Complete EMV Transaction Request

Completes the EMV transaction for an ICC card when online authorization request is received from emv_authenticateTransaction

The tags will be returned in the callback routine.

Parameters
commErrorCommunication error with host. Set to TRUE if host was unreachable, or FALSE if host response received. If Communication error, authCode, iad, tlvScripts can be null.
authCodeAuthorization code from host. Two bytes. Example 0x3030. (Tag value 8A). Required
iadIssuer Authentication Data, if any. Example 0x11223344556677883030 (tag value 91).
tlvScripts71/72 scripts, if any
tagsAdditional TVL data to return with transaction results (if any)
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
static boolean com.idtechproducts.device.IDT_UniPayI_V.emv_getAutoAuthenticateTransaction ( )
static

Gets Auto Authentication for EMV Transactions Check the boolean value of Auto Authentication.

static boolean com.idtechproducts.device.IDT_UniPayI_V.emv_getAutoCompleteTransaction ( )
static

Gets Auto Completion for EMV Transactions Check the boolean value of Auto Completion.

int com.idtechproducts.device.IDT_UniPayI_V.emv_getEMVConfigurationCheckValue ( ResDataStruct  respData)

Get EMV Kernel configuration check value info

Parameters
responseResponse returned of Kernel configuration check value info
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_getEMVKernelCheckValue ( ResDataStruct  respData)

Get EMV Kernel check value info

Parameters
responseResponse returned of Kernel check value info
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_getEMVKernelVersion ( StringBuilder  version)

Polls device for EMV Kernel Version

Parameters
responseResponse returned of Kernel Version
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
void com.idtechproducts.device.IDT_UniPayI_V.emv_lcdControlResponse ( byte  mode,
byte  data 
)

Callback Response LCD Display

Provides menu selection responses to the kernel after a callback was received lcdDisplay delegate.

Parameters
modeThe choices are as follows
  • 0x00 Cancel
  • 0x01 Menu Display
  • 0x02 Normal Display get Function Key supply either 0x43 ('C') for Cancel, or 0x45 ('E') for Enter/accept
  • 0x08 Language Menu Display
selectionLine number in hex (0x01, 0x02), or 'C'/'E' of function key
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
int com.idtechproducts.device.IDT_UniPayI_V.emv_removeApplicationData ( String  aid,
ResDataStruct  respData 
)

Remove Application Data

Removes the Application Data as specified by the AID name passed as a parameter

Parameters
aidAid file to remove.
respDataStatus Code in ResDataStruct.statusCode. If no application data exists, status code will be 0x60. Format error status code 0x05
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_removeCAPK ( byte[]  capk,
ResDataStruct  respData 
)

Remove Certificate Authority Public Key

Removes the CAPK as specified by the RID/Index

Parameters
capk6 byte CAPK = 5 bytes RID + 1 byte INDEX
respDataStatus Code in ResDataStruct.statusCode.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_removeCRL ( byte[]  crlList,
ResDataStruct  respData 
)

Remove Certificate Revocation List Entries

Removes CRLEntries as specified by the RID and Index and serial number passed as 9 bytes

Parameters
crlListcontaining the list of CRL to remove: [CRL1][CRL2]...[CRLn] where each [CRL] is 9 bytes: [5 bytes RID][1 byte CAPK Index][3 bytes serial number]
respDataStatus Code in ResDataStruct.statusCode.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_removeTerminalData ( ResDataStruct  respData)

Remove Terminal Data

Removes the Terminal Data.

Parameters
respDataStatus Code in ResDataStruct.statusCode.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_retrieveAidList ( ResDataStruct  respData)

Retrieve Aid List

Returns all the AID names installed on the terminal.

Parameters
respDataArray of AID string names passed back in ResDataStruct.stringArray. Status Code in ResDataStruct.statusCode. If no AIDs exists, status code will be 0x60
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_retrieveApplicationData ( String  aid,
ResDataStruct  respData 
)

Retrieve Application Data

Retrieves the TLV values of a provide AID.

Parameters
aidAid file to retrieve.
respDataReturns TLV in ResDataStruct.resData. Status Code in ResDataStruct.statusCode. If no application data exists, status code will be 0x60
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_retrieveCAPK ( byte[]  data,
ResDataStruct  respData 
)

Retrieve Certificate Authority Public Key

Retrieves the CAPK as specified by the RID/Index passed as a parameter.

Parameters
capk6 bytes CAPK = 5 bytes RID + 1 byte Index
keyResponse returned in ResDataStruct.resData: [5 bytes RID][1 byte Index][1 byte Hash Algorithm][1 byte Encryption Algorithm][20 bytes HashValue][4 bytes Public Key Exponent][2 bytes Modulus Length][Variable bytes Modulus] Where:
  • Hash Algorithm: The only algorithm supported is SHA-1.The value is set to 0x01
  • Encryption Algorithm: The encryption algorithm in which this key is used. Currently support only one type: RSA. The value is set to 0x01.
  • HashValue: Which is calculated using SHA-1 over the following fields: RID & Index & Modulus & Exponent
  • Public Key Exponent: Actually, the real length of the exponent is either one byte or 3 bytes. It can have two values: 3 (Format is 0x00 00 00 03), or 65537 (Format is 0x00 01 00 01)
  • Modulus Length: LenL LenH Indicated the length of the next field.
  • Modulus: This is the modulus field of the public key. Its length is specified in the field above.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_retrieveCAPKList ( ResDataStruct  respData)

Retrieve the Certificate Authority Public Key list

Returns all the CAPK RID and Index installed on the terminal.

Parameters
respDataResDataStruct.resData = [key1][key2]...[keyn], each key 6 bytes where key = 5 bytes RID + 1 byte index
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_retrieveCRL ( ResDataStruct  respData)

Retrieve the Certificate Revocation List

Returns the CRL entries on the terminal.

Parameters
keyResponse returned in ResDataStruct.resData: list [CRL1][CRL2]...[CRLn], each CRL 9 bytes where CRL = 5 bytes RID + 1 byte index + 3 bytes serial number
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_retrieveTerminalData ( ResDataStruct  respData)

Retrieve Terminal Data

Retrieves the TLV values of a the terminal.

Parameters
respDataReturns TLV in ResDataStruct.resData. Status Code in ResDataStruct.statusCode. If no terminal data exists, status code will be 0x60
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_retrieveTransactionResult ( byte[]  tags,
Map< String, Map< String, byte[]>>  retrievedTags 
)

Retrieve Transaction Results

Retrieves specified EMV tags from the currently executing transaction.

Parameters
tagsTags to be retrieved. Example 0x9F028A will retrieve tags 9F02 and 8A
tlvAll requested tags returned as unencrypted, encrypted and masked tags. The tlv Map will contain a Map with key "tags" that has the unencrypted tag data, a Map with the key "masked" that has the masked tag data, and a Map with the key "encrypted" that has the encrypted tag data
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
int com.idtechproducts.device.IDT_UniPayI_V.emv_setApplicationData ( String  aid,
byte[]  TLV,
ResDataStruct  respData 
)

Set Application Data

Sets the Application Data as specified by the application name and TLV data

Parameters
nameApplication name, 10-32 ASCII hex characters representing 5-16 bytes Example "a0000000031010"
tlvApplication data in TLV format.
respDataStatus Code in ResDataStruct.statusCode. If AID list is full, status code will be 0x61. Format error status code 0x05
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
static void com.idtechproducts.device.IDT_UniPayI_V.emv_setAutoAuthenticateTransaction ( boolean  auto)
static

Sets Auto Authentication for EMV Transactions Tells the SDK to automatically execute Authenticate Transaction after StartEMV Transaction. TRUE by default

static void com.idtechproducts.device.IDT_UniPayI_V.emv_setAutoCompleteTransaction ( boolean  auto)
static

Sets Auto Completion for EMV Transactions Tells the SDK to automatically execute Complete Transaction after EMV Authentication. FALSE by default

int com.idtechproducts.device.IDT_UniPayI_V.emv_setCAPK ( byte[]  key,
ResDataStruct  respData 
)

Set Certificate Authority Public Key

Sets the CAPK as specified by the CAKey structure

Parameters
keyCAKey format: [5 bytes RID][1 byte Index][1 byte Hash Algorithm][1 byte Encryption Algorithm][20 bytes HashValue][4 bytes Public Key Exponent][2 bytes Modulus Length][Variable bytes Modulus][2 bytes MAC Length][Variable bytes MAC Data] Where:
  • Hash Algorithm: The only algorithm supported is SHA-1.The value is set to 0x01
  • Encryption Algorithm: The encryption algorithm in which this key is used. Currently support only one type: RSA. The value is set to 0x01.
  • HashValue: Which is calculated using SHA-1 over the following fields: RID & Index & Modulus & Exponent
  • Public Key Exponent: Actually, the real length of the exponent is either one byte or 3 bytes. It can have two values: 3 (Format is 0x00 00 00 03), or 65537 (Format is 0x00 01 00 01)
  • Modulus Length: LenL LenH Indicated the length of the next field.
  • Modulus: This is the modulus field of the public key. Its length is specified in the field above.
  • MAC Length: LenL LenH Indicated the length of the next field. For Non-PCI device, it is 0x00 0x00. For PCI device, it is 0x1E 0x00.
  • MAC Data: For Non-PCI device, i does not exist. For PCI device, it is 30 bytes data consists of [2 bytes MAC Value Length][16 bytes MAC Value][2 bytes MAC Key KSN Length][10 bytes MAC Key KSN] Where:
    • MAC Value Length: 0x10 0x00
    • MAC value: MAC-HOST.
    • MAC Key KSN Length: 0x0A 0x00
    • MAC Key KSN: MAC DUKPT Key KSN
respDataStatus Code in ResDataStruct.statusCode.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_setCRL ( byte[]  crlList,
ResDataStruct  respData 
)

Set Certificate Revocation List

Sets the CRL

Parameters
listCRL Entries containing the RID, Index, and serial numbers to set [CRL1][CRL2]...[CRLn] where each [CRL] is 9 bytes: [5 bytes RID][1 byte CAPK Index][3 bytes serial number]
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_setTerminalData ( byte[]  TLV,
ResDataStruct  respData 
)

Set Terminal Data

Sets the Terminal Data as specified by the TerminalData structure passed as a parameter

Parameters
TLVTerminalData configuration file.
respDataStatus Code in ResDataStruct.statusCode. If Flash error, status code will be 0x62. Format error status code 0x05
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.emv_startTransaction ( double  amount,
double  amtOther,
int  type,
final int  timeout,
byte[]  tags,
boolean  forceOnline 
)

Start EMV Transaction Request

Authorizes the EMV transaction for an ICC card

The tags will be returned in the callback routine.

Parameters
amountTransaction amount value (tag value 9F02)
amtOtherOther amount value, if any (tag value 9F03)
typeTransaction type (tag value 9C).
timeoutTimeout value in seconds.
tagsAny other tags to be included in the request. Passed as a string. Example, tag 9F0C with amount 0x000000000100 would be "9F0C06000000000100" If tags 9F02 (amount),9F03 (other amount), or 9C (transaction type) are included, they will take priority over these values supplied as individual parameters to this method.
forceOnlineTRUE = do not allow offline approval, FALSE = allow ICC to approve offline if terminal capable Note: To request tags to be included in default response, use tag DFEE1A, and specify tag list. Example four tags 9F02, 9F36, 95, 9F37 to be included in response = DFEE1A079F029F369f9F37
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.icc_exchangeAPDU ( byte[]  dataAPDU,
ResDataStruct  response 
)

Exchange APDU

Sends an APDU packet to the ICC. If successful, response is returned in APDUResult class instance in response parameter.

Parameters
dataAPDUAPDU data packet
responseUnencrypted/encrypted parsed APDU response
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.icc_getICCReaderStatus ( ICCReaderStatusStruct  ICCStatus)

Get Reader Status

Returns the reader status

Parameters
statusPointer that will return with the ICCReaderStatus results. bit 0: 0 = ICC Power Not Ready, 1 = ICC Powered bit 1: 0 = Card not seated, 1 = card seated
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.icc_passthroughOffICC ( )

Disables pass through mode for ICC. Required when executing transactions (start EMV, start MSR, authenticate transaction)

Returns
success or error code.
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.icc_passthroughOnICC ( )

Enables pass through mode for ICC. Required when direct ICC commands are required (power on/off ICC, exchange APDU)

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.icc_powerOffICC ( ResDataStruct  respData)

Power Off ICC

Powers down the ICC

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode If Success, empty If Failure, ASCII encoded data of error string
int com.idtechproducts.device.IDT_UniPayI_V.icc_powerOnICC ( ResDataStruct  atrPPS)

Power up the currently selected microprocessor card in the ICC reader. It follows the ISO7816-3 power up sequence and returns the ATR as its response.

Parameters
optionsthe options is optional.
please see PowerOnStructure class for more information.
See also
PowerOnStructure (not used for the UniPay II)
Parameters
atrPPSthe class for ATR string.
the ATR string is following:
  1. 2D01: Card Not Supported;
  2. 2D03: Card Not Supported, wants CRC;
  3. 690D: Command not supported on reader without ICC support;
  4. 8100: ICC error time out on power-up;
  5. 8200: invalid TS character received;
  6. 8500: PPS confirmation error;
  7. 8600: Unsupported F, D, or combination of F and D;
  8. 8700: protocol not supported EMV TD1 out of range;
  9. 8800: power not at proper level;
  10. 8900: ATR length too long;
  11. 8B01: EMV invalid TA1 byte value*;
  12. 8B02: EMV TB1 required*;
  13. 8B03: EMV Unsupported TB1 only 00 allowed*;
  14. 8B04: EMV Card Error, invalid BWI or CWI*;
  15. 8B06: EMV TB2 not allowed in ATR*;
  16. 8B07: EMV TC2 out of range*;
  17. 8B08: EMV TC2 out of range*;
  18. 8B09: per EMV96 TA3 must be > 0xF*;
  19. 8B10: ICC error on power-up;
  20. 8B11: EMV T=1 then TB3 required*;
  21. 8B12: Card Error, invalid BWI or CWI;
  22. 8B13: Card Error, invalid BWI or CWI;
  23. 8B17: EMV TC1/TB3 conflict*;
  24. 8B20: EMV TD2 out of range must be T=1*;
  25. 8C00: TCK error;
  26. A304: connector has no voltage setting;
  27. A305: ICC error on power-up invalid (SBLK(IFSD) exchange;
  28. E301: ICC error after session start
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.log_deleteLogs ( )

delete the log in the root path of SD card.

Returns
number of log files deleted
See also
log_setSaveLogEnable
void com.idtechproducts.device.IDT_UniPayI_V.log_setSaveLogEnable ( boolean  enable)

Enable/Disable save the log into the root path of SD card.

Parameters
enableShowLog,trueenable save the log, the log includes the .txt text log and .wav signals file. false: disable save the log.
Returns
none
See also
deleteLogs
void com.idtechproducts.device.IDT_UniPayI_V.log_setVerboseLoggingEnable ( boolean  enable)

Enable/Disable Verbose Logging show in the logcat view window.

Parameters
enableShowLog,trueenable to show the log in the logcat view window. false: disable to show the log in the logcat view window.
Returns
none
int com.idtechproducts.device.IDT_UniPayI_V.msr_cancelMSRSwipe ( )

Disable MSR swipe card.

Cancels MSR swipe request.

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.msr_defaultAllSetting ( )

Default all setting of Mask and Encryption.

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.msr_getSingleSetting ( byte  funcID,
byte[]  response 
)

Get single setting of Mask and Encryption by Function ID.

Parameters
funcIDfunction ID.
0x49:Leading PAN digits to display(0x00~0x06).
0x4A:Last PAN digits to display(0x00~0x04).
0x4B:Mask ASCII code track data(0x20~0x7E).
0x4C:Encryption type ('1'-'2'). '1' 3DES, '2' AES.
0x50:Mask or display expiration date(0x30 or 0x31);0x31:don't mask expiration date.
0x7E:Security Level ID.
0x84:Encryption Option (Forced encryption or not)
Bit 0 : T1 force encrypt
Bit 1 : T2 force encrypt
Bit 2 : T3 force encrypt
Bit 3 : T3 force encrypt when card type is 0

0x86:Masked / clear data sending option Bit 0 : T1 mask allowed
Bit 1 : T2 mask allowed
Bit 2 : T3 mask allowed

NOTE:
UniPay support 0x49,0x50,0x4C,0x7E,0x84 and 0x86.
UniPay II support 0x49,0x50,0x4A, 0x4B, 0x4C,0x7E,0x84 and 0x86.

Parameters
responseresponse[0] for setting data.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.msr_setSingleSetting ( byte  funcID,
byte  setData 
)

Set single setting of Mask and Encryption by Function ID.

Parameters
funcIDfunction ID.
0x49:Leading PAN digits to display(0x00~0x06).
0x4A:Last PAN digits to display(0x00~0x04).
0x4B:Mask ASCII code track data(0x20~0x7E).
0x4C:Encryption type ('1'-'2'). '1' 3DES, '2' AES.
0x50:Mask or display expiration date(0x30 or 0x31);0x31:don't mask expiration date.
0x7E:Security Level ID.
0x84:Encryption Option (Forced encryption or not)
Bit 0 : T1 force encrypt
Bit 1 : T2 force encrypt
Bit 2 : T3 force encrypt
Bit 3 : T3 force encrypt when card type is 0

0x86:Masked / clear data sending option Bit 0 : T1 mask allowed
Bit 1 : T2 mask allowed
Bit 2 : T3 mask allowed

NOTE:
UniPay support 0x49,0x50,0x4C,0x7E,0x84 and 0x86.
UniPay II support 0x49,0x50,0x4A, 0x4B, 0x4C,0x7E,0x84 and 0x86.

Parameters
setDatafor setting data.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
int com.idtechproducts.device.IDT_UniPayI_V.msr_startMSRSwipe ( )

Enable MSR swipe card. Returns encrypted MSR data or function key value by call back function. The function swipeMSRData in interface OnReceiverListener will be called if swiping card data received.

See also
OnReceiverListener
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode
String com.idtechproducts.device.IDT_UniPayI_V.phone_getInfoManufacture ( )

Get manufacture version.

Returns
the manufacture info
String com.idtechproducts.device.IDT_UniPayI_V.phone_getInfoModel ( )

Get phones's model number information.

Returns
the model number information.
void com.idtechproducts.device.IDT_UniPayI_V.registerListen ( )

General API:registerListen.

registerListen to enable SDK detect the phone jack plug in/off notification

void com.idtechproducts.device.IDT_UniPayI_V.release ( )

release, make the SDK in the idle status.

void com.idtechproducts.device.IDT_UniPayI_V.setIDT_Device ( FirmwareUpdateTool  fwTool)

For System Use Only

Parameters
fwToolParameter for firmware update
void com.idtechproducts.device.IDT_UniPayI_V.unregisterListen ( )

unregisterListen to disable the detect

static void com.idtechproducts.device.IDT_UniPayI_V.useUSBIntentFilter ( )
static

Use USB Intent Filter For USB Devices, you may opt to incorporate an Intent Filter that will automatically start your application when a specific USB device is attached. The SDK must be informed to bypass it's normal Enumeration of USB Devices when an Intent Filter is being use. This function MUST be called BEFORE device_setDeviceType() is executed if a USB Intent Filter is being utilized. https://developer.android.com/guide/topics/connectivity/usb/host.html


The documentation for this class was generated from the following file: