![]() |
IDTech Android SDK Guide
1.00.042
API reference for MiniSmart II
|
Public Member Functions | |
IDT_MiniSmartII (OnReceiverListener callback, Context context) | |
boolean | device_setDeviceType (ReaderInfo.DEVICE_TYPE deviceType) |
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) |
boolean | device_isConnected () |
int | device_startRKI () |
int | autoConfig_start (String strXMLFilename) |
void | autoConfig_stop () |
int | device_getFirmwareVersion (StringBuilder version) |
int | config_getSerialNumber (StringBuilder serialNumber) |
int | config_getModelNumber (StringBuilder modNumber) |
int | device_getKSN (ResDataStruct ksn) |
String | device_getResponseCodeString (int errorCode) |
int | device_sendDataCommand (String cmd, boolean calcLRC, String data, ResDataStruct respData) |
int | icc_reviewAllSetting (ICCSettingStruct iccSetting) |
int | icc_getICCReaderStatus (ICCReaderStatusStruct ICCStatus) |
int | icc_powerOnICC (ResDataStruct atrPPS) |
int | icc_passthroughOnICC () |
int | icc_passthroughOffICC () |
int | icc_powerOffICC (ResDataStruct respData) |
int | icc_exchangeAPDU (byte[] dataAPDU, APDUResponseStruct 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) |
Static Public Member Functions | |
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 () |
com.idtechproducts.device.IDT_MiniSmartII.IDT_MiniSmartII | ( | OnReceiverListener | callback, |
Context | context | ||
) |
It is the constructor of the main class IDT_MiniSmartII. When it is called, the SDK will create the Instance for IDT_MiniSmartII device. The interface OnReceiverListner needs to be implemented in the application.
callback | OnReceiverListener callback |
context | Application context |
int com.idtechproducts.device.IDT_MiniSmartII.autoConfig_start | ( | String | strXMLFilename | ) |
start Auto Config to search the profile.
strXMLFilename | Input the customized XML file as the templates to search the profile. |
void com.idtechproducts.device.IDT_MiniSmartII.autoConfig_stop | ( | ) |
stop Auto Config.
int com.idtechproducts.device.IDT_MiniSmartII.config_getModelNumber | ( | StringBuilder | modNumber | ) |
Get the model number of device.
modNumber | returns Model Number string. |
String com.idtechproducts.device.IDT_MiniSmartII.config_getSDKVersion | ( | ) |
READER CONFIG API LIST Get the version of SDK.
sdkVersion | for version string. |
int com.idtechproducts.device.IDT_MiniSmartII.config_getSerialNumber | ( | StringBuilder | serialNumber | ) |
Get the serial number of device.
serialNumber | returns Serial Number string. |
String com.idtechproducts.device.IDT_MiniSmartII.config_getXMLVersionInfo | ( | ) |
Get XML configuration version.
boolean com.idtechproducts.device.IDT_MiniSmartII.config_loadingConfigurationXMLFile | ( | boolean | updateAutomatically | ) |
Load XML Configuration File.
xmlFilename,XML | Configuration File Name. |
void com.idtechproducts.device.IDT_MiniSmartII.config_setXMLFileNameWithPath | ( | String | path | ) |
set XML Configuration File Name with the full path.
xmlFilename,XML | Configuration File Name. |
boolean com.idtechproducts.device.IDT_MiniSmartII.device_connectWithProfile | ( | StructConfigParameters | profile | ) |
connect the device with Profile.
profile,the | profile is the one which is the result from Auto config. |
DEVICE_TYPE com.idtechproducts.device.IDT_MiniSmartII.device_getDeviceType | ( | ) |
Gets type of device
int com.idtechproducts.device.IDT_MiniSmartII.device_getFirmwareVersion | ( | StringBuilder | version | ) |
DEVICE INFO API Get the firmware version of device.
version | for version string. |
int com.idtechproducts.device.IDT_MiniSmartII.device_getKSN | ( | ResDataStruct | ksn | ) |
Get the Account DUKPT Key KSN of device.
10-byte | KSN |
String com.idtechproducts.device.IDT_MiniSmartII.device_getResponseCodeString | ( | int | errorCode | ) |
Get Response Code String
Interpret a response code and return string description.
errorCode | Error code, range 0x0000 - 0xFFFF, example 0x0300 |
boolean com.idtechproducts.device.IDT_MiniSmartII.device_isConnected | ( | ) |
get the status if the device connected.
int com.idtechproducts.device.IDT_MiniSmartII.device_sendDataCommand | ( | String | cmd, |
boolean | calcLRC, | ||
String | data, | ||
ResDataStruct | respData | ||
) |
Send a direct command to device
Sends a command represented by the provide string to the device.
cmd | NSData representation of command to execute |
calcLRC | If TRUE , this will wrap command with start/length/lrc/sum/end: '{STX}{Len_Low}{Len_High} data {CheckLRC} {CheckSUM} {ETX}' |
data | Command data (if applicable) for IDG, not used for NGA |
response | Returns response ResDataStruct.respData |
boolean com.idtechproducts.device.IDT_MiniSmartII.device_setDeviceType | ( | ReaderInfo.DEVICE_TYPE | deviceType | ) |
Defines connection USB
deviceType | DEVICE_TYPE.DEVICE_MINISMART_II |
int com.idtechproducts.device.IDT_MiniSmartII.device_startRKI | ( | ) |
Start remote key injection.
|
static |
Allow fallback for EMV transactions. Default is TRUE
allow | TRUE = allow fallback, FALSE = don't allow fallback |
int com.idtechproducts.device.IDT_MiniSmartII.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.
tags | TLV stream that can be used to update the following values:
|
int com.idtechproducts.device.IDT_MiniSmartII.emv_cancelTransaction | ( | ResDataStruct | respData | ) |
Cancel EMV Transaction
Cancels the currently executing EMV transaction.
int com.idtechproducts.device.IDT_MiniSmartII.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.
commError | Communication 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. |
authCode | Authorization code from host. Two bytes. Example 0x3030. (Tag value 8A). Required |
iad | Issuer Authentication Data, if any. Example 0x11223344556677883030 (tag value 91). |
tlvScripts | 71/72 scripts, if any |
tags | Additional TVL data to return with transaction results (if any) |
|
static |
Gets Auto Authentication for EMV Transactions Check the boolean value of Auto Authentication.
|
static |
Gets Auto Completion for EMV Transactions Check the boolean value of Auto Completion.
void com.idtechproducts.device.IDT_MiniSmartII.emv_lcdControlResponse | ( | byte | mode, |
byte | data | ||
) |
Callback Response LCD Display
Provides menu selection responses to the kernel after a callback was received lcdDisplay delegate.
mode | The choices are as follows
|
selection | Line number in hex (0x01, 0x02), or 'C'/'E' of function key |
int com.idtechproducts.device.IDT_MiniSmartII.emv_removeApplicationData | ( | String | aid, |
ResDataStruct | respData | ||
) |
Remove Application Data
Removes the Application Data as specified by the AID name passed as a parameter
aid | Aid file to remove. |
respData | Status Code in ResDataStruct.statusCode. If no application data exists, status code will be 0x60. Format error status code 0x05 |
int com.idtechproducts.device.IDT_MiniSmartII.emv_removeCAPK | ( | byte[] | capk, |
ResDataStruct | respData | ||
) |
Remove Certificate Authority Public Key
Removes the CAPK as specified by the RID/Index
capk | 6 byte CAPK = 5 bytes RID + 1 byte INDEX |
respData | Status Code in ResDataStruct.statusCode. |
int com.idtechproducts.device.IDT_MiniSmartII.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
crlList | containing 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] |
respData | Status Code in ResDataStruct.statusCode. |
int com.idtechproducts.device.IDT_MiniSmartII.emv_removeTerminalData | ( | ResDataStruct | respData | ) |
Remove Terminal Data
Removes the Terminal Data.
respData | Status Code in ResDataStruct.statusCode. |
int com.idtechproducts.device.IDT_MiniSmartII.emv_retrieveAidList | ( | ResDataStruct | respData | ) |
Retrieve Aid List
Returns all the AID names installed on the terminal.
respData | Array of AID string names passed back in ResDataStruct.stringArray. Status Code in ResDataStruct.statusCode. If no AIDs exists, status code will be 0x60 |
int com.idtechproducts.device.IDT_MiniSmartII.emv_retrieveApplicationData | ( | String | aid, |
ResDataStruct | respData | ||
) |
Retrieve Application Data
Retrieves the TLV values of a provide AID.
aid | Aid file to retrieve. |
respData | Returns TLV in ResDataStruct.resData. Status Code in ResDataStruct.statusCode. If no application data exists, status code will be 0x60 |
int com.idtechproducts.device.IDT_MiniSmartII.emv_retrieveCAPK | ( | byte[] | data, |
ResDataStruct | respData | ||
) |
Retrieve Certificate Authority Public Key
Retrieves the CAPK as specified by the RID/Index passed as a parameter.
capk | 6 bytes CAPK = 5 bytes RID + 1 byte Index |
key | Response 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:
|
int com.idtechproducts.device.IDT_MiniSmartII.emv_retrieveCAPKList | ( | ResDataStruct | respData | ) |
Retrieve the Certificate Authority Public Key list
Returns all the CAPK RID and Index installed on the terminal.
respData | ResDataStruct.resData = [key1][key2]...[keyn], each key 6 bytes where key = 5 bytes RID + 1 byte index |
int com.idtechproducts.device.IDT_MiniSmartII.emv_retrieveCRL | ( | ResDataStruct | respData | ) |
Retrieve the Certificate Revocation List
Returns the CRL entries on the terminal.
key | Response returned in ResDataStruct.resData: list [CRL1][CRL2]...[CRLn], each CRL 9 bytes where CRL = 5 bytes RID + 1 byte index + 3 bytes serial number |
int com.idtechproducts.device.IDT_MiniSmartII.emv_retrieveTerminalData | ( | ResDataStruct | respData | ) |
Retrieve Terminal Data
Retrieves the TLV values of a the terminal.
respData | Returns TLV in ResDataStruct.resData. Status Code in ResDataStruct.statusCode. If no terminal data exists, status code will be 0x60 |
int com.idtechproducts.device.IDT_MiniSmartII.emv_setApplicationData | ( | String | aid, |
byte[] | TLV, | ||
ResDataStruct | respData | ||
) |
Set Application Data
Sets the Application Data as specified by the application name and TLV data
name | Application name, 10-32 ASCII hex characters representing 5-16 bytes Example "a0000000031010" |
tlv | Application data in TLV format. |
respData | Status Code in ResDataStruct.statusCode. If AID list is full, status code will be 0x61. Format error status code 0x05 |
|
static |
Sets Auto Authentication for EMV Transactions Tells the SDK to automatically execute Authenticate Transaction after StartEMV Transaction. TRUE by default
|
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_MiniSmartII.emv_setCAPK | ( | byte[] | key, |
ResDataStruct | respData | ||
) |
Set Certificate Authority Public Key
Sets the CAPK as specified by the CAKey structure
key | CAKey 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] Where:
|
respData | Status Code in ResDataStruct.statusCode. |
int com.idtechproducts.device.IDT_MiniSmartII.emv_setCRL | ( | byte[] | crlList, |
ResDataStruct | respData | ||
) |
Set Certificate Revocation List
Sets the CRL
list | CRL 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] |
int com.idtechproducts.device.IDT_MiniSmartII.emv_setTerminalData | ( | byte[] | TLV, |
ResDataStruct | respData | ||
) |
Set Terminal Data
Sets the Terminal Data as specified by the TerminalData structure passed as a parameter
TLV | TerminalData configuration file. |
respData | Status Code in ResDataStruct.statusCode. If Flash error, status code will be 0x62. Format error status code 0x05 |
int com.idtechproducts.device.IDT_MiniSmartII.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.
amount | Transaction amount value (tag value 9F02) |
amtOther | Other amount value, if any (tag value 9F03) |
type | Transaction type (tag value 9C). |
timeout | Timeout value in seconds. |
tags | Any 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. |
forceOnline | TRUE = 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 |
int com.idtechproducts.device.IDT_MiniSmartII.icc_exchangeAPDU | ( | byte[] | dataAPDU, |
APDUResponseStruct | 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 |
response | Unencrypted/encrypted parsed APDU response |
int com.idtechproducts.device.IDT_MiniSmartII.icc_getICCReaderStatus | ( | ICCReaderStatusStruct | ICCStatus | ) |
Get Reader Status
Returns the reader status
status | Pointer 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 |
int com.idtechproducts.device.IDT_MiniSmartII.icc_passthroughOffICC | ( | ) |
Disables pass through mode for ICC. Required when executing transactions (start EMV, start MSR, authenticate transaction)
int com.idtechproducts.device.IDT_MiniSmartII.icc_passthroughOnICC | ( | ) |
Enables pass through mode for ICC. Required when direct ICC commands are required (power on/off ICC, exchange APDU)
int com.idtechproducts.device.IDT_MiniSmartII.icc_powerOffICC | ( | ResDataStruct | respData | ) |
Power Off ICC
Powers down the ICC
int com.idtechproducts.device.IDT_MiniSmartII.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.
options | the options is optional. please see PowerOnStructure class for more information. |
atrPPS | the class for ATR string. the ATR string is following:
|
int com.idtechproducts.device.IDT_MiniSmartII.icc_reviewAllSetting | ( | ICCSettingStruct | iccSetting | ) |
Review all setting of ICC status.
iccSetting | for ICC setting. please see class ICCSettingStruct for more information. mainCardTypeOption: 0x00 ISO, 0xFF EMV timeout: default value 8 readingCharacteristics: 0x30 ICC Function Off, 0x31 ICC Function Enable & Notification Off, 0x32 ICC Function Enable & Notification On prePANIDLen: Default is 4 postPANIDLen: Default is 4 maskCharWithASCII: Default is 0x2A maskCharWithBCD: Default is 0x0C CTL2Interval: Default is 0x0C |
int com.idtechproducts.device.IDT_MiniSmartII.log_deleteLogs | ( | ) |
void com.idtechproducts.device.IDT_MiniSmartII.log_setSaveLogEnable | ( | boolean | enable | ) |
Enable/Disable save the log into the root path of SD card.
enableShowLog,true | enable save the log, the log includes the .txt text log and .wav signals file. false: disable save the log. |
void com.idtechproducts.device.IDT_MiniSmartII.log_setVerboseLoggingEnable | ( | boolean | enable | ) |
Enable/Disable Verbose Logging show in the logcat view window.
enableShowLog,true | enable to show the log in the logcat view window. false: disable to show the log in the logcat view window. |
String com.idtechproducts.device.IDT_MiniSmartII.phone_getInfoManufacture | ( | ) |
Get manufacture version.
String com.idtechproducts.device.IDT_MiniSmartII.phone_getInfoModel | ( | ) |
Get phones's model number information.
void com.idtechproducts.device.IDT_MiniSmartII.registerListen | ( | ) |
General API:registerListen.
registerListen to enable SDK detect the phone jack plug in/off notification
void com.idtechproducts.device.IDT_MiniSmartII.release | ( | ) |
release, make the SDK in the idle status.
void com.idtechproducts.device.IDT_MiniSmartII.setIDT_Device | ( | FirmwareUpdateTool | fwTool | ) |
For System Use Only
fwTool | Parameter for firmware update |
void com.idtechproducts.device.IDT_MiniSmartII.unregisterListen | ( | ) |
unregisterListen to disable the detect