![]() |
UniPay SDK Guide for Android
0.02.011
API reference
|
Public Member Functions | |
IDT_Device (OnReceiverListener callback, Context contex) | |
void | registerListen () |
void | unregisterListen () |
void | release () |
String | config_getXMLVersionInfo () |
String | phone_getInfoManufacture () |
String | phone_getInfoModel () |
void | log_setVerboseLoggingEnable (boolean enableShowLog) |
void | log_setSaveLogEnable (boolean enable) |
int | log_deleteLogs () |
void | config_setXMLFileNameWithPath (String xmlFilename) |
boolean | config_loadingConfigurationXMLFile (boolean updateAutomatically) |
boolean | device_connect () |
void | device_disconnect () |
boolean | device_isConnected () |
boolean | device_connectWithProfile (StructConfigParameters profile) |
boolean | msr_isSwipeCardRunning () |
int | config_getSDKVersion (StringBuilder sdkVersion) |
int | config_getModelNumber (StringBuilder modNumber) |
int | config_getSerialNumber (StringBuilder serialNumber) |
int | config_setSerialNumber (String serNumber) |
int | config_getDateTime (StringBuilder dateTime) |
int | config_setDateTime (String dateTime) |
int | config_getInterfaceDeviceSN (StringBuilder serialNumber) |
int | config_setInterfaceDeviceSN (String serNumber) |
int | config_getTerminalIdentification (StringBuilder termIden) |
int | config_setTerminalIdentification (String termIden) |
int | device_getFirmwareVersion (StringBuilder version) |
int | device_getBatteryVoltage (StringBuilder batteryInfo) |
int | device_ReviewAudioJackSetting (int response[]) |
int | device_rebootDevice () |
int | device_enableBeep (boolean enable) |
int | device_sendBeep (int frequency, int duration) |
int | device_sendCommandDirectIO (String hexCommand, ResDataStruct respData) |
String | device_getResponseCodeString (int errorCode) |
int | icc_getICCReaderStatus (ICCReaderStatusStruct ICCStatus) |
int | icc_powerOnICC (PowerOnStructure options, ResDataStruct atrPPS) |
int | icc_powerOffICC () |
int | icc_exchangeAPDU (byte[] dataAPDU, APDUResponseStruct response) |
int | icc_exchangeEncryptedAPDU (byte[] dataAPDU, byte[] ksn, APDUResponseStruct response) |
int | icc_exchangeMultiAPDU (byte[] dataAPDU, ResDataStruct respData) |
int | icc_getCurrentKSN (ResDataStruct resKSN) |
int | icc_Set3VThen5V () |
int | icc_Set5V () |
int | icc_enableNotification (boolean enableNotifyICCStatus) |
int | icc_setICCConnector (byte connector) |
int | icc_setProAndPostPanLength (int prePanCtrlDataLen, int postPanCtrlDataLen) |
int | icc_setAsciiMask (byte maskWithAscii) |
int | icc_setBCDMask (byte maskWithBCD) |
int | icc_defaultSetting () |
int | icc_reviewAllSetting (ICCSettingStruct iccSetting) |
int | lcd_clearDisplay (byte control) |
int | lcd_savePromptDisplay (int numPrompt, String message) |
int | lcd_displayPrompt (int numLine, int numPrompt) |
int | lcd_displayMessage (int numLine, String message) |
int | lcd_enableSleepMode (boolean sleepMode) |
int | lcd_defaultSetting () |
int | lcd_getSetting (boolean[] sleepMode) |
int | msr_reviewAllSetting (MSRSettingStruct msrSetting) |
int | msr_defaultAllSetting () |
int | msr_getSingleSetting (byte funcID, byte[] response) |
int | msr_setSingleSetting (byte funcID, byte setData) |
int | msr_startMSRSwipe () |
int | msr_cancelMSRSwipe () |
int | autoConfig_start (String strXMLFilename, boolean fastSearch) |
void | autoConfig_stop () |
void | stopWaitingTask () |
boolean | setWaitingMSRResponseTimeout (int timeoutValue) |
boolean | setWaitingExchangeAPDUResponseTimeout (int timeoutValue) |
boolean | setWaitingPINResponseTimeout (int timeoutValue) |
void | setEMVListener (OnReceiverListener callback) |
ReaderType | getAttachedReaderType () |
SupportStatus | getSupportStatus (ReaderType readerType) |
SupportStatus | getSupportStatus () |
Data Fields | |
UMLog | LOG |
The IDTech Framework is an Android Framework that will be provided by IDTech as the main interface between Android applications and UniPay reader processing solutions. The purpose of this document is to describe the requirements of the frameworks as well as the interface definitions and requirements needed for any Android applications wishing to deploy with the payment application.
|
inline |
It is the constructor of the main class IDT_Device. When it is called, the SDK will create the Instance for UniPay reader device. The interface UniPayReaderMsg as the callback function need be implemented in the application.
It's better to call the constructor When android activity is created.
|
inline |
start Auto Config to search the profile.
strXMLFilename | Input the customized XML file as the templates to search the profile. |
fastSearch | There are two steps to search the profile: First to search in the templates inside of XML file, Second is to search with emumerate posible templates by experiense. If fastSearch is true, the search will skip the second step. If fastSearch is false, the search will cover the two steps. |
|
inline |
stop Auto Config.
|
inline |
Get the date and time of device.
dateTime | the device's date and time, 20121123122459. |
|
inline |
Get interface device's serial number.
serialNumber | for interface device's serial number string. |
|
inline |
Get the model number of device.
modNumber | for Model Number. |
|
inline |
READER CONFIG API LIST Get the version of SDK.
sdkVersion | for version string. |
|
inline |
Get the serial number of device.
serialNumber | for Serial Number. |
|
inline |
Get Get terminal identification.
termIden | for device terminal identification string. |
|
inline |
Get XML configuration version.
|
inline |
Load XML Configuration File.
xmlFilename,XML | Configuration File Name. |
|
inline |
Set the date and time to device.
dateTime | the date and time in hex string,12 characters.If date is: 2012/11/23 12:24:59, dateTime should be 121123122459. |
|
inline |
Set Interface device's serial number. EMV serial Number can be set only once.
serNumber | for Serial Number string;8 bytes '0' ~ '9', or 'a' ~ 'z', or 'A' ~ 'Z'. |
|
inline |
Set the serial number to device.
serNumber | for Serial Number string; 9 (UniPay) or 10 (UniPay II) bytes ASCII, from 0x20 to 0x7F. |
|
inline |
Set terminal identification.
termIden | for terminal identification string;8 bytes '0' ~ '9', or 'a' ~ 'z', or 'A' ~ 'Z'. |
|
inline |
set XML Configuration File Name with the full path.
xmlFilename,XML | Configuration File Name. |
|
inline |
Connect the device.
|
inline |
connect the device with Profile.
profile,the | profile is the one which is the result from Auto config. |
|
inline |
Disconnect the device.
|
inline |
Control the device's beeper.
enable | true: enable beep, false: disable to beep. |
|
inline |
DEVICE INFO API Get the Battery Voltage information of device.
batteryInfo | for battery Voltage Info string. |
|
inline |
DEVICE INFO API Get the firmware version of device.
version | for version string. |
|
inline |
Get Response Code String.
errorCode | Error code returns by other APIs. |
|
inline |
get the status if the device connected.
|
inline |
Reboot device.The device will restart and need to reconnect device if success.
|
inline |
Retrieves Audio Jack setting.
response | response[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". |
|
inline |
Control the device's beeper.
frequency | the Frequency of beeper;the range from 1000 to 20000. |
duration | the duration of beeper; the range from 16 to 65536. |
|
inline |
Send the command body directly.
hexCommand | the command body to send to the device. For example, get the firmware version command: "724601" |
response | the response from the device. |
Usage about this API, for example to get the firmware version:
byte[] response = null;
device_sendCommandDirectIO("724601",response);
|
inline |
Return the type of reader currently attached and powered up.
Returns UNKNOWN If reader is not attached or not powered up, or if the reader type cannot be determined. Returns the reader type.
|
inline |
Return return the reader support status as specified in the configuration readerType: UNIPAYII file the SDK loaded. Returns the support status.
|
inline |
Return return the reader support status as specified in the configuration file the SDK loaded. Returns the support status.
|
inline |
|
inline |
Enable / Disable the ICC notification. When enable the notification, the SDK will always post the event when ICC card plug in or out.
enableNotifyICCStatus,true | enable the ICC status notification; false:disable the ICC status notification. |
|
inline |
Exchange APDU between the currently selected microprocessor card in the ICC reader. The max length of APDU is 512 bytes and the C-APDU is Plaintext.
dataAPDU | Plaintext APDU data buffer. |
response | the class for response APDU,please see class APDUResponseStruct for more information. The format of Raw response APDU Data Structure of [n bytes Encrypted R-APDU without Status Bytes] is below: 2 bytes Valid R-APDU Length + x bytes Valid R-APDU without Status Bytes + y bytes Padding. |
|
inline |
Exchange APDU between the currently selected microprocessor card in the ICC reader.
The max length of APDU is 512 bytes and the C-APDU is Encrypted.
dataAPDU | Encrypted APDU data buffer. The format of Raw C-APDU Data Structure of [m bytes Encrypted C-APDU] is below: m = 2 bytes Valid C-APDU Length + x bytes Valid C-APDU + y bytes Padding (0x00). |
ksn | 10 bytes Key Serial Number. |
response | the class for response APDU,please see class APDUResponseStruct for more information. The format of Raw response APDU Data Structure of [n bytes Encrypted R-APDU] is below:. 2 bytes Valid R-APDU Length + x bytes Valid R-APDU + y bytes Padding. |
|
inline |
Exchange Multiple APDUs between the currently selected microprocessor card in the ICC reader.
This API is for UniPay device only.
dataAPDU | Plaintext APDU data buffer. |
respData | the data buffer respond from the device RPDU Packet format as follows: [Number of APDU commands] [R-APDU 1 length] [R-APDU 1 Command] ' ' [R-APDU n length] [R-APDU n command] |
|
inline |
Get the current KSN for Smart card. * The KSN in the Response should be the KSN in the loop exchanging until ICC is powered off.
resKSN | the class for current KSN. |
|
inline |
Get ICC Reader microprocessor card status.
ICCStatus | the class for the microprocessor card status.please see ICCReaderStatusStruct class for more information. |
|
inline |
Power down the currently selected microprocessor card in the ICC reader.
|
inline |
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:
|
|
inline |
Review all setting of ICC status.
iccSetting | for ICC setting. please see class ICCSettingStruct for more information. |
|
inline |
Internal command Set ICC Voltage option, icc works on 3V then 5V
|
inline |
Internal command Set ICC Voltage option, icc works only on 5V
|
inline |
Set ASCII Mask Data. This setting will be valid in the display of TAG 57/5A at the EMV Level 2 transaction processing.
maskWithAscii,can | be from 0x20 to 0x7E, default is 0x2A(*) |
|
inline |
Set BCD Mask Data. This setting will be valid in the display of TAG 57/5A at the EMV Level 2 transaction processing.
maskWithAscii,can | be from 0x0A to 0x0F, default is 0x0C(*) |
|
inline |
Set the ICC or SAM connector.
connector,the | value to switch the ICC or SAM connector 0x00: use the ICC connector. 0x01: use the SAM connector. |
|
inline |
Set Pre/Post Pan Ctrl Data length. This setting will be valid in the display of TAG 57/5A at the EMV Level 2 transaction processing.
prePanCtrlDataLen,the | length to show the pre PAN character with plaintext |
postPanCtrlDataLen,the | length to show the post PAN character with plaintext |
|
inline |
LCD API LIST Clear Display.
control,0 | first line, 1: second line, 0xFF: clear all screen |
|
inline |
|
inline |
Display message.
numLine,the | index of line number, 0 or 1 |
message | Display line 2, up to 16 characters. |
|
inline |
Display the prompt message.
numLine,the | index of line number, 0 or 1 |
numPrompt,the | number of prompt, from 0 to 9 |
|
inline |
Enable the LCD to enter into sleep mode.
sleepMode,true:set | the device to sleep mode; false:exit sleep mode. |
|
inline |
Review LCD Setting.
sleepMode,sleepMode[0] | means the sleep mode true: the LCD is on the sleep mode, the back light turned off false: the LCD exist the sleep mode, the back light turned on |
|
inline |
Save prompt display message.
numPrompt,the | number of prompt, from 0 to 9 |
message | to Display, up to 16 characters. |
|
inline |
|
inline |
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. |
|
inline |
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. |
|
inline |
|
inline |
|
inline |
Get single setting of Mask and Encryption by Function ID.
funcID | function 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.
response | response[0] for setting data. |
|
inline |
get the status if the swipe card task running.
|
inline |
Review all setting of Mask and Encryption.
msrSetting | for MSR setting. please see class MSRSettingStruct for more information. |
|
inline |
Set single setting of Mask and Encryption by Function ID.
funcID | function 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.
setData | for setting data. |
|
inline |
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.
|
inline |
Get manufacture version.
|
inline |
Get phones's model number information.
|
inline |
General API:registerListen.
registerListen to enable SDK detect the phone jack plug in/off notification
|
inline |
release, make the SDK in the idle status.
|
inline |
Allows the EMV library to receive notifications from the OnReceiverListener
|
inline |
set the timeout for waiting Response from the reader.
the timeout works on the waiting for Exchange APDU,
timeoutValue | : the seconds value to wait the response, valid from 5 seconds to 10 seconds, |
|
inline |
set the timeout for waiting Response from the reader.
the timeout works on the waiting for swiping MSR.
timeoutValue | : the seconds value to wait the response, valid from 30 seconds to 35 seconds. |
|
inline |
set the timeout for waiting Response from the reader.
the timeout works on the waiting for getting the PIN/Numeric.
timeoutValue | : the seconds value to wait the response, valid from 30 seconds to 60 seconds, |
|
inline |
Stop the waiting task which wait the device response.
|
inline |
unregisterListen to disable the detect