IDTech Universal SDK  1.0.35.036
API reference for C++
libIDT_UniPayI_V.h File Reference

UniPay 1.5 API. More...

#include "IDTDef.h"

Go to the source code of this file.

Macros

#define IN
 
#define OUT
 
#define IN_OUT
 

Typedefs

typedef void(* pMessageHotplug) (int, int)
 
typedef void(* pSendDataLog) (BYTE *, int)
 
typedef void(* pReadDataLog) (BYTE *, int)
 
typedef void(* pEMV_callBack) (int, int, BYTE *, int, IDTTransactionData *, EMV_Callback *, int)
 
typedef void(* pMSR_callBack) (int, IDTMSRData)
 
typedef void(* pMSR_callBackp) (int, IDTMSRData *)
 
typedef void(* pPIN_callBack) (int, IDTPINData *)
 
typedef void(* pCMR_callBack) (int, IDTCMRData *)
 
typedef void(* pCSFS_callBack) (BYTE status)
 
typedef void(* ftpComm_callBack) (int, int, int)
 
typedef void(* httpComm_callBack) (BYTE *, int)
 
typedef void(* v4Comm_callBack) (BYTE, BYTE, BYTE *, int)
 

Functions

void registerHotplugCallBk (pMessageHotplug pMsgHotplug)
 
void registerLogCallBk (pSendDataLog pFSend, pReadDataLog pFRead)
 
void emv_registerCallBk (pEMV_callBack pEMVf)
 
void msr_registerCallBk (pMSR_callBack pMSRf)
 
void msr_registerCallBkp (pMSR_callBackp pMSRf)
 
void pin_registerCallBk (pPIN_callBack pPINf)
 
void device_registerCameraCallBk (pCMR_callBack pCMRf)
 
void device_registerCardStatusFrontSwitchCallBk (pCSFS_callBack pCSFSf)
 
void comm_registerHTTPCallback (httpComm_callBack cBack)
 
void comm_registerV4Callback (v4Comm_callBack cBack)
 
char * SDK_Version ()
 
int setAbsoluteLibraryPath (const char *absoluteLibraryPath)
 
int device_init ()
 
int device_setCurrentDevice (int deviceType)
 
int device_close ()
 
void device_getIDGStatusCodeString (IN int returnCode, OUT char *despcrition)
 
int device_isConnected ()
 
int device_isAttached (int deviceType)
 
int device_getFirmwareVersion (OUT char *firmwareVersion)
 
int device_getFirmwareVersion_Len (OUT char *firmwareVersion, IN_OUT int *firmwareVersionLen)
 
int device_pingDevice ()
 
int device_getCurrentDeviceType ()
 
int device_SendDataCommandNEO (IN int cmd, IN int subCmd, IN BYTE *data, IN int dataLen, OUT BYTE *response, IN_OUT int *respLen)
 
int device_enablePassThrough (int enablePassThrough)
 
int device_setMerchantRecord (int index, int enabled, char *merchantID, char *merchantURL)
 
int device_getMerchantRecord (IN int index, OUT BYTE *record)
 
int device_getMerchantRecord_Len (IN int index, OUT BYTE *record, IN_OUT int *recordLen)
 
int device_getSDKWaitTime ()
 
void device_setSDKWaitTime (int waitTime)
 
int device_getThreadStackSize ()
 
void device_setThreadStackSize (int threadSize)
 
int config_getSerialNumber (OUT char *sNumber)
 
int config_getSerialNumber_Len (OUT char *sNumber, IN_OUT int *sNumberLen)
 
void emv_allowFallback (IN int allow)
 
void emv_setAutoAuthenticateTransaction (IN int authenticate)
 
void emv_setAutoCompleteTransaction (IN int complete)
 
int emv_getAutoAuthenticateTransaction ()
 
int emv_getAutoCompleteTransaction ()
 
int emv_startTransaction (IN double amount, IN double amtOther, IN int exponent, IN int type, IN int timeout, IN BYTE *tags, IN int tagsLen, IN int forceOnline)
 
int emv_activateTransaction (IN int timeout, IN BYTE *tags, IN int tagsLen, IN int forceOnline)
 
int emv_authenticateTransaction (IN BYTE *updatedTLV, IN int updatedTLVLen)
 
int emv_authenticateTransactionWithTimeout (IN int timeout, IN BYTE *updatedTLV, IN int updatedTLVLen)
 
int emv_completeTransaction (IN int commError, IN BYTE *authCode, IN int authCodeLen, IN BYTE *iad, IN int iadLen, IN BYTE *tlvScripts, IN int tlvScriptsLen, IN BYTE *tlv, IN int tlvLen)
 
int emv_cancelTransaction ()
 
int emv_retrieveApplicationData (IN BYTE *AID, IN int AIDLen, OUT BYTE *tlv, IN_OUT int *tlvLen)
 
int emv_setApplicationData (IN BYTE *name, IN int nameLen, IN BYTE *tlv, IN int tlvLen)
 
int emv_setApplicationDataTLV (IN BYTE *tlv, IN int tlvLen)
 
int emv_removeApplicationData (IN BYTE *AID, IN int AIDLen)
 
int emv_removeAllApplicationData ()
 
int emv_retrieveAIDList (OUT BYTE *AIDList, IN_OUT int *AIDListLen)
 
int emv_retrieveTerminalData (OUT BYTE *tlv, IN_OUT int *tlvLen)
 
int emv_setTerminalData (IN BYTE *tlv, IN int tlvLen)
 
int emv_setTerminalMajorConfiguration (IN int configuration)
 
int emv_retrieveCAPK (IN BYTE *capk, IN int capkLen, OUT BYTE *key, IN_OUT int *keyLen)
 
int emv_setCAPK (IN BYTE *capk, IN int capkLen)
 
int emv_removeCAPK (IN BYTE *capk, IN int capkLen)
 
int emv_removeAllCAPK ()
 
int emv_retrieveCAPKList (OUT BYTE *keys, IN_OUT int *keysLen)
 
int emv_retrieveCRL (OUT BYTE *list, IN_OUT int *lssLen)
 
int emv_setCRL (IN BYTE *list, IN int lsLen)
 
int emv_removeCRL (IN BYTE *list, IN int lsLen)
 
int emv_removeAllCRL ()
 
int icc_getICCReaderStatus (OUT BYTE *status)
 
int icc_powerOnICC (OUT BYTE *ATR, IN_OUT int *inLen)
 
int icc_powerOffICC ()
 
int icc_exchangeAPDU (IN BYTE *c_APDU, IN int cLen, OUT BYTE *reData, IN_OUT int *reLen)
 
int msr_cancelMSRSwipe ()
 
int msr_startMSRSwipe (IN int _timeout)
 
void parseMSRData (IN BYTE *resData, IN int resLen, IN_OUT IDTMSRData *cardData)
 

Detailed Description

UniPay 1.5 API.

UniPay 1.5 Global API methods.

Macro Definition Documentation

◆ IN

#define IN

INPUT parameter.

◆ IN_OUT

#define IN_OUT

INPUT / OUTPUT PARAMETER.

◆ OUT

#define OUT

OUTPUT parameter.

Typedef Documentation

◆ ftpComm_callBack

typedef void(* ftpComm_callBack) (int, int, int)

Define the comm callback function to get FTP file transfer status
It should be passed as a parameter in a FTP request, Signature (int, int, int) = response code, current block, total blocks RESPONSE CODES: 100 = FILE DOWNLOAD STARTED 101 = FILE BLOCK XX OF XX RECEIVED 102 = FILE DOWNLOAD COMPLETED 103 = FILE DOWNLOAD TERMINATED PREMATURELY

◆ httpComm_callBack

typedef void(* httpComm_callBack) (BYTE *, int)

Define the comm callback function to get the async url data
It should be registered using the comm_registerHTTPCallback

◆ pCMR_callBack

typedef void(* pCMR_callBack) (int, IDTCMRData *)

Define the camera callback function to get the image data
It should be registered using the device_registerCameraCallBk,

◆ pCSFS_callBack

typedef void(* pCSFS_callBack) (BYTE status)

Define the card status and front switch callback function to get card and front switch status
It should be registered using the device_registerCardStatusFrontSwitchCallBk,

◆ pEMV_callBack

typedef void(* pEMV_callBack) (int, int, BYTE *, int, IDTTransactionData *, EMV_Callback *, int)

Define the EMV callback function to get the transaction message/data/result.
It should be registered using the emv_registerCallBk,

◆ pMessageHotplug

typedef void(* pMessageHotplug) (int, int)

Define the USB hot-plug callback function to monitor the info when plug in/out the reader.
It should be registered using the registerHotplugCallBk, The first integer parameter is device type, and the second integer parameter is either 0: Device Plugged Out or 1: Device Plugged In

◆ pMSR_callBack

typedef void(* pMSR_callBack) (int, IDTMSRData)

Define the MSR callback function to get the MSR card data
It should be registered using the msr_registerCallBk, this callback function is for backward compatibility

◆ pMSR_callBackp

typedef void(* pMSR_callBackp) (int, IDTMSRData *)

Define the MSR callback function to get pointer to the MSR card data
It should be registered using the msr_registerCallBk, this callback function is recommended instead of pMSR_callBack

◆ pPIN_callBack

typedef void(* pPIN_callBack) (int, IDTPINData *)

Define the PINPad callback function to get the input PIN Pad data
It should be registered using the pin_registerCallBk,

◆ pReadDataLog

typedef void(* pReadDataLog) (BYTE *, int)

Define the read response callback function to monitor the reading response from the reader.
It should be registered using the registerLogCallBk,

◆ pSendDataLog

typedef void(* pSendDataLog) (BYTE *, int)

Define the send command callback function to monitor the sending command into the reader.
It should be registered using the registerLogCallBk,

◆ v4Comm_callBack

typedef void(* v4Comm_callBack) (BYTE, BYTE, BYTE *, int)

Define the comm callback function to receive the V4 Protocol packets received by the device from an external source (IP/USB/RS-232) It should be registered using the comm_registerV4Callback, Data callback will contain command, sub-command, and data from V4 packet

Function Documentation

◆ comm_registerHTTPCallback()

void comm_registerHTTPCallback ( httpComm_callBack  cBack)

Register Comm HTTP Async Callback

Parameters
cBack- HTTP Comm callback

◆ comm_registerV4Callback()

void comm_registerV4Callback ( v4Comm_callBack  cBack)

Register External V4 Protocol commands Callback

Parameters
cBack- V4 Protocol Comm callback

◆ config_getSerialNumber()

int config_getSerialNumber ( OUT char *  sNumber)

DEPRECATED : please use config_getSerialNumber_Len(OUT char* sNumber, IN_OUT int *sNumberLen)

Polls device for Serial Number

Parameters
sNumberReturns Serial Number; needs to have at least 64 bytes of memory
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString

◆ config_getSerialNumber_Len()

int config_getSerialNumber_Len ( OUT char *  sNumber,
IN_OUT int *  sNumberLen 
)

Polls device for Serial Number

Parameters
sNumberReturns Serial Number
sNumberLenLength of Serial Number
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString

◆ device_close()

int device_close ( )

Close the device

Returns
RETURN_CODE: 0: success, 0x0A: failed

◆ device_enablePassThrough()

int device_enablePassThrough ( int  enablePassThrough)

Enable Pass Through

Enables Pass Through Mode for direct communication with L1 interface (power on icc, send apdu, etc).

Parameters
enablePassThrough1 = pass through ON, 0 = pass through OFF
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_getCurrentDeviceType()

int device_getCurrentDeviceType ( )

Get current active device type

Returns
: return the device type defined as DEVICE_TYPE in the IDTDef.h

◆ device_getFirmwareVersion()

int device_getFirmwareVersion ( OUT char *  firmwareVersion)

DEPRECATED : please use device_getFirmwareVersion_Len(OUT char* firmwareVersion, IN_OUT int *firmwareVersionLen)

Polls device for Firmware Version

Parameters
firmwareVersionResponse returned of Firmware Version; needs to have at least 128 bytes of memory
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_getFirmwareVersion_Len()

int device_getFirmwareVersion_Len ( OUT char *  firmwareVersion,
IN_OUT int *  firmwareVersionLen 
)

Polls device for Firmware Version

Parameters
firmwareVersionResponse returned of Firmware Version
firmwareVersionLenLength of Firmware Version
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_getIDGStatusCodeString()

void device_getIDGStatusCodeString ( IN int  returnCode,
OUT char *  despcrition 
)

Review the return code description.

Parameters
returnCodethe response result.
description
Return values
thestring for description of response result
  • 0: "no error, beginning task";
  • 1: "no response from reader";
  • 2: "invalid response data";
  • 01: " Incorrect Header Tag";
  • 02: " Unknown Command";
  • 03: " Unknown Sub-Command";
  • 04: " CRC Error in Frame";
  • 05: " Incorrect Parameter";
  • 06: " Parameter Not Supported";
  • 07: " Mal-formatted Data";
  • 08: " Timeout";
  • 0A: " Failed / NACK";
  • 0B: " Command not Allowed";
  • 0C: " Sub-Command not Allowed";
  • 0D: " Buffer Overflow (Data Length too large for reader buffer)";
  • 0E: " User Interface Event";
  • 10: " Need clear firmware(apply in boot loader only)";
  • 11: " Communication type not supported, VT-1, burst, etc. Need encrypted firmware (apply in boot loader only)";
  • 12: " Secure interface is not functional or is in an intermediate state.";
  • 13: " Data field is not mod 8";
  • 14: " Pad 0x80 not found where expected";
  • 15: " Specified key type is invalid";
  • 16: " Could not retrieve key from the SAM (InitSecureComm)";
  • 17: " Hash code problem";
  • 18: " Could not store the key into the SAM (InstallKey)";
  • 19: " Frame is too large";
  • 1A: " Unit powered up in authentication state but POS must resend the InitSecureComm command";
  • 1B: " The EEPROM may not be initialized because SecCommInterface does not make sense";
  • 1C: " Problem encoding APDU Module-Specific Status Codes ";
  • 20: " Unsupported Index (ILM) SAM Transceiver error - problem communicating with the SAM (Key Mgr)";
  • 21: " Unexpected Sequence Counter in multiple frames for single bitmap (ILM)Length error in data returned from the SAM (Key Mgr) - 22: " Improper bit map (ILM)"; - 23: " Request Online Authorization"; - 24: " ViVOCard3 raw data read successful"; - 25: " Message index not available (ILM) ViVOcomm activate transaction card type (ViVOcomm)"; - 26: " Version Information Mismatch (ILM)"; - 27: " Not sending commands in correct index message index (ILM)"; - 28: " Time out or next expected message not received (ILM)"; - 29: " ILM languages not available for viewing (ILM)"; - 2A: " Other language not supported (ILM)"; - 41: " from 41 to 4F, Module-specific errors for Key Manager";
  • 50: " Auto-Switch OK";
  • 51: " Auto-Switch failed";
  • 70: " Antenna Error 80h Use another card";
  • 81: " Insert or swipe card";
  • 90: " Data encryption Key does not exist";
  • 91: " Data encryption Key KSN exhausted";

◆ device_getMerchantRecord()

int device_getMerchantRecord ( IN int  index,
OUT BYTE *  record 
)

DEPRECATED : please use device_getMerchantRecord_Len(IN int index, OUT BYTE * record, IN_OUT int *recordLen)

Get Merchant Record

Gets the merchant record for the device.

Parameters
indexMerchant Record index, valid values 1-6
record;needs to have at least 99 bytes of memory response 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_getIDGStatusCodeString()
See also
ErrorCode

◆ device_getMerchantRecord_Len()

int device_getMerchantRecord_Len ( IN int  index,
OUT BYTE *  record,
IN_OUT int *  recordLen 
)

Get Merchant Record

Gets the merchant record for the device.

Parameters
indexMerchant Record index, valid values 1-6
recordresponse 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
recordLenLength of record
Returns
success or error code. Values can be parsed with device_getIDGStatusCodeString()
See also
ErrorCode

◆ device_getSDKWaitTime()

int device_getSDKWaitTime ( )

Get SDK Wait Time

Get the SDK wait time for transactions

Returns
SDK wait time in seconds

◆ device_getThreadStackSize()

int device_getThreadStackSize ( )

Get Thread Stack Size

Get the stack size setting for newly created threads

Returns
Thread Stack Size

◆ device_init()

int device_init ( )

Initial the device by USB
It will detect the device and trying connect.
The connect status can be checked by device_isConnected().
Note: after the function returns success, the function device_setCurrentDevice() has to be called to set the device type.

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_isAttached()

int device_isAttached ( int  deviceType)

Check if the device is attached to the USB port The function device_init() must be called before this function.

Parameters
deviceType,thedevice type of the USB device
Returns
1 if the device is attached, or 0 if the device is not attached

◆ device_isConnected()

int device_isConnected ( )

Check the device conntected status

Returns
DEVICE_DISCONNECT=0, or DEVICE_CONNECTED = 1

◆ device_pingDevice()

int device_pingDevice ( )

Ping Device

Pings the reader. If connected, returns success. Otherwise, returns timeout.

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_registerCameraCallBk()

void device_registerCameraCallBk ( pCMR_callBack  pCMRf)

To register the camera callback function to get the image data. (Pass NULL to disable the callback.)

◆ device_registerCardStatusFrontSwitchCallBk()

void device_registerCardStatusFrontSwitchCallBk ( pCSFS_callBack  pCSFSf)

To register the card status and front switch callback function to get status. (Pass NULL to disable the callback.)

◆ device_SendDataCommandNEO()

int device_SendDataCommandNEO ( IN int  cmd,
IN int  subCmd,
IN BYTE *  data,
IN int  dataLen,
OUT BYTE *  response,
IN_OUT int *  respLen 
)

Send a Command to device

Sends a command to the device .

Parameters
cmdbuffer of command to execute.
cmdLen,thelength of the buffer cmd.
databuffer of IDG command data.
dataLen,thelength of the buffer data.
responseResponse data
respLen,thelength of Response data
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString() Send a Command to NEO device

Sends a command to the NEO device .

Parameters
cmdcommand to execute.
subCmd,subcommand to execute.
databuffer of NEO command data.
dataLen,thelength of the buffer data.
responseResponse data
respLen,thelength of Response data
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_setCurrentDevice()

int device_setCurrentDevice ( int  deviceType)

Sets the current device to talk to
The connect status can be checked by device_isConnected().

Parameters
deviceTypeDevice to connect to
enum DEVICE_TYPE {
IDT_DEVICE_UNKNOWN=0,
IDT_DEVICE_AUGUSTA_HID,
IDT_DEVICE_AUGUSTA_KB,
IDT_DEVICE_AUGUSTA_S_HID,
IDT_DEVICE_AUGUSTA_S_KB,
IDT_DEVICE_AUGUSTA_S_TTK_HID,
IDT_DEVICE_SPECTRUM_PRO,
IDT_DEVICE_MINISMART_II,
IDT_DEVICE_L80,
IDT_DEVICE_L100,
IDT_DEVICE_UNIPAY,
IDT_DEVICE_UNIPAY_I_V,
IDT_DEVICE_VP3300_AJ,
IDT_DEVICE_KIOSK_III,
IDT_DEVICE_KIOSK_III_S,
IDT_DEVICE_PIP_READER,
IDT_DEVICE_VENDI,
IDT_DEVICE_VP3300_USB,
IDT_DEVICE_UNIPAY_I_V_TTK,
IDT_DEVICE_VP3300_BT,
IDT_DEVICE_VP8800,
IDT_DEVICE_SREDKEY2_HID,
IDT_DEVICE_SREDKEY2_KB,
IDT_DEVICE_NEO2,
IDT_DEVICE_MINISMART_II_COM = IDT_DEVICE_NEO2+5,
IDT_DEVICE_SPECTRUM_PRO_COM,
IDT_DEVICE_KIOSK_III_COM,
IDT_DEVICE_KIOSK_III_S_COM,
IDT_DEVICE_PIP_READER_COM,
IDT_DEVICE_VP3300_COM,
IDT_DEVICE_NEO2_COM,
IDT_DEVICE_MAX_DEVICES = IDT_DEVICE_NEO2_COM+5
};
Returns
RETURN_CODE: 1: success, 0: failed

◆ device_setMerchantRecord()

int device_setMerchantRecord ( int  index,
int  enabled,
char *  merchantID,
char *  merchantURL 
)

Set Merchant Record Sets the merchant record for ApplePay VAS

Parameters
indexMerchant Record index, valid values 1-6
enabledMerchant Enabled/Valid flag
merchantIDMerchant unique identifer registered with Apple. Example com.idtechproducts.applePay
merchantURLMerchant URL, when applicable
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_setSDKWaitTime()

void device_setSDKWaitTime ( int  waitTime)

Set SDK Wait Time

Set the SDK wait time for transactions

Parameters
waitTimeThe SDK wait time for transaction in seconds. The Maximum is 2147483 seconds.

◆ device_setThreadStackSize()

void device_setThreadStackSize ( int  threadSize)

Set Thread Stack Size

Set the stack size setting for newly created threads

◆ emv_activateTransaction()

int emv_activateTransaction ( IN int  timeout,
IN BYTE *  tags,
IN int  tagsLen,
IN int  forceOnline 
)

Start EMV Transaction Request

Authorizes the EMV transaction for an ICC card

The tags will be returned in the callback routine.

Parameters
timeoutTimeout value in seconds.
tagsTags to be included in the request. Passed as a TLV stream. Example, tag 9F0C with amount 0x000000000100 would be 0x9F0C06000000000100
tagsLenLength of tags
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 = DFEE1A079F029F36959F37
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString >>>>>IMPORTANT: parameters for amount and amtOther MUST BE PASSED AS A DOUBLE VALUE WITH DECIMAL POINT. Example, do not pass 1, but instead pass 1.0 or 1.00. Otherwise, results will be unpredictable

◆ emv_allowFallback()

void emv_allowFallback ( IN int  allow)

Allow fallback for EMV transactions. Default is TRUE

Parameters
allowTRUE = allow fallback, FALSE = don't allow fallback

◆ emv_authenticateTransaction()

int emv_authenticateTransaction ( IN BYTE *  updatedTLV,
IN int  updatedTLVLen 
)

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
updatedTLVTLV 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 = DFEE1A079F029F36959F37
updatedTLVLen
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString

◆ emv_authenticateTransactionWithTimeout()

int emv_authenticateTransactionWithTimeout ( IN int  timeout,
IN BYTE *  updatedTLV,
IN int  updatedTLVLen 
)

Authenticate EMV Transaction Request with Timeout

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
timeoutTimeout value in seconds.
updatedTLVTLV 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 = DFEE1A079F029F36959F37
updatedTLVLen
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString

◆ emv_cancelTransaction()

int emv_cancelTransaction ( )

Cancel EMV Transaction

Cancels the currently executing EMV transaction.

Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString()

◆ emv_completeTransaction()

int emv_completeTransaction ( IN int  commError,
IN BYTE *  authCode,
IN int  authCodeLen,
IN BYTE *  iad,
IN int  iadLen,
IN BYTE *  tlvScripts,
IN int  tlvScriptsLen,
IN BYTE *  tlv,
IN int  tlvLen 
)

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(1) if host was unreachable, or FALSE(0) 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
authCodeLenthe length of authCode
iadIssuer Authentication Data, if any. Example 0x11223344556677883030 (tag value 91).
iadLenthe length of iadLen
tlvScripts71/72 scripts, if any
tlvScriptsLenthe length of tlvScriptsLen
tlvAdditional TLV data to return with transaction results (if any)
tlvLenthe length of tlv
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString

◆ emv_getAutoAuthenticateTransaction()

int emv_getAutoAuthenticateTransaction ( )

Gets auto authenticate value for EMV transactions.

Returns
RETURN_CODE: TRUE = auto authenticate, FALSE = manually authenticate

◆ emv_getAutoCompleteTransaction()

int emv_getAutoCompleteTransaction ( )

Gets auto complete value for EMV transactions.

Returns
RETURN_CODE: TRUE = auto complete, FALSE = manually complete

◆ emv_registerCallBk()

void emv_registerCallBk ( pEMV_callBack  pEMVf)

To register the emv callback function to get the EMV processing response. (Pass NULL to disable the callback.)

◆ emv_removeAllApplicationData()

int emv_removeAllApplicationData ( )

Remove All Application Data

Removes all the Application Data

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_removeAllCAPK()

int emv_removeAllCAPK ( )

Remove All Certificate Authority Public Key

Removes all the CAPK

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_removeAllCRL()

int emv_removeAllCRL ( )

Remove All Certificate Revocation List Entries

Removes all CRLEntry entries

Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString()

◆ emv_removeApplicationData()

int emv_removeApplicationData ( IN BYTE *  AID,
IN int  AIDLen 
)

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

Parameters
AIDName of ApplicationID Must be between 5 and 16 bytes
AIDLenthe length of AID data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_removeCAPK()

int emv_removeCAPK ( IN BYTE *  capk,
IN int  capkLen 
)

Remove Certificate Authority Public Key

Removes the CAPK as specified by the RID/Index

Parameters
capk6 byte CAPK = 5 bytes RID + 1 byte INDEX
capkLenthe length of capk data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_removeCRL()

int emv_removeCRL ( IN BYTE *  list,
IN int  lsLen 
)

Retrieve the Certificate Revocation List

Returns the CRL entries on the terminal.

Parameters
list[CRL1][CRL2]...[CRLn], each CRL 9 bytes where CRL = 5 bytes RID + 1 byte index + 3 bytes serial number
lssLenthe length of list data buffer
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString()

◆ emv_retrieveAIDList()

int emv_retrieveAIDList ( OUT BYTE *  AIDList,
IN_OUT int *  AIDListLen 
)

Retrieve AID list

Returns all the AID names installed on the terminal for CTLS. .

Parameters
AIDListarray of AID name byte arrays
AIDListLenthe length of AIDList array buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_retrieveApplicationData()

int emv_retrieveApplicationData ( IN BYTE *  AID,
IN int  AIDLen,
OUT BYTE *  tlv,
IN_OUT int *  tlvLen 
)

Retrieve Application Data by AID

Retrieves the Application Data as specified by the AID name passed as a parameter.

Parameters
AIDName of ApplicationID. Must be between 5 and 16 bytes
AIDLenthe length of AID data buffer.
tlvThe TLV elements of the requested AID
tlvLenthe length of tlv data buffer.
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_retrieveCAPK()

int emv_retrieveCAPK ( IN BYTE *  capk,
IN int  capkLen,
OUT BYTE *  key,
IN_OUT int *  keyLen 
)

Retrieve Certificate Authority Public Key

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

Parameters
capk6 bytes CAPK = 5 bytes RID + 1 byte Index
capkLenthe length of capk data buffer
keyResponse returned as a 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:
  • 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.
keyLenthe length of key data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_retrieveCAPKList()

int emv_retrieveCAPKList ( OUT BYTE *  keys,
IN_OUT int *  keysLen 
)

Retrieve the Certificate Authority Public Key list

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

Parameters
keys[key1][key2]...[keyn], each key 6 bytes where key = 5 bytes RID + 1 byte index
keysLenthe length of keys data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_retrieveCRL()

int emv_retrieveCRL ( OUT BYTE *  list,
IN_OUT int *  lssLen 
)

Retrieve the Certificate Revocation List

Returns the CRL entries on the terminal.

Parameters
list[CRL1][CRL2]...[CRLn], each CRL 9 bytes where CRL = 5 bytes RID + 1 byte index + 3 bytes serial number
lssLenthe length of list data buffer
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString()

◆ emv_retrieveTerminalData()

int emv_retrieveTerminalData ( OUT BYTE *  tlv,
IN_OUT int *  tlvLen 
)

Retrieve Terminal Data

Retrieves the Terminal Data for CTLS. This is configuration group 0 (Tag FFEE - > FFEE0100). The terminal data can also be retrieved by ctls_getConfigurationGroup(0).

Parameters
tlvResponse returned as a TLV
tlvLenthe length of tlv data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_setApplicationData()

int emv_setApplicationData ( IN BYTE *  name,
IN int  nameLen,
IN BYTE *  tlv,
IN int  tlvLen 
)

Set Application Data by AID

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"
nameLenthe length of name data buffer of Application name,
tlvApplication data in TLV format
tlvLenthe length of tlv data buffer
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString()

◆ emv_setApplicationDataTLV()

int emv_setApplicationDataTLV ( IN BYTE *  tlv,
IN int  tlvLen 
)

Set Application Data by TLV

Sets the Application Data as specified by the TLV data

Parameters
tlvApplication data in TLV format The first tag of the TLV data must be the group number (DFEE2D). The second tag of the TLV data must be the AID (9F06) Example valid TLV, for Group #2, AID a0000000035010: "dfee2d01029f0607a0000000051010ffe10101ffe50110ffe30114ffe20106"
tlvLenthe length of tlv data buffer
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString()

◆ emv_setAutoAuthenticateTransaction()

void emv_setAutoAuthenticateTransaction ( IN int  authenticate)

Enables authenticate for EMV transactions. If a emv_startTranaction results in code 0x0010 (start transaction success), then emv_authenticateTransaction can automatically execute if parameter is set to TRUE

Parameters
authenticateTRUE = auto authenticate, FALSE = manually authenticate

◆ emv_setAutoCompleteTransaction()

void emv_setAutoCompleteTransaction ( IN int  complete)

Enables complete for EMV transactions. If a emv_authenticateTranaction results in code 0x0004 (go online), then emv_completeTransaction can automatically execute if parameter is set to TRUE

Parameters
completeTRUE = auto complete, FALSE = manually complete

◆ emv_setCAPK()

int emv_setCAPK ( IN BYTE *  capk,
IN int  capkLen 
)

Set Certificate Authority Public Key

Sets the CAPK as specified by the CAKey structure

Parameters
capkCAKey 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:
  • 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.
capkLenthe length of capk data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ emv_setCRL()

int emv_setCRL ( IN BYTE *  list,
IN int  lsLen 
)

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]
lsLenthe length of list data buffer
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString()

◆ emv_setTerminalData()

int emv_setTerminalData ( IN BYTE *  tlv,
IN int  tlvLen 
)

Set Terminal Data

Sets the Terminal Data for CTLS as specified by the TLV. The first TLV must be Configuration Group Number (Tag FFE4). The terminal global data is group 0, so the first TLV would be FFE40100. Other groups can be defined using this method (1 or greater), and those can be retrieved with emv_getConfigurationGroup(int group), and deleted with emv_removeConfigurationGroup(int group). You cannot delete group 0.

Parameters
tlvTerminalData configuration file
tlvLenthe length of tlv data buffer
Return values
RETURN_CODEValues can be parsed with device_getIDGStatusCodeString()

◆ emv_setTerminalMajorConfiguration()

int emv_setTerminalMajorConfiguration ( IN int  configuration)

Sets the terminal major configuration in ICS .

Parameters
configurationA configuration value, range 1-23
  • 1 = 1C
  • 2 = 2C
  • 3 = 3C
  • 4 = 4C
  • 5 = 5C ...
  • 23 = 23C
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString()

◆ emv_startTransaction()

int emv_startTransaction ( IN double  amount,
IN double  amtOther,
IN int  exponent,
IN int  type,
IN int  timeout,
IN BYTE *  tags,
IN int  tagsLen,
IN int  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) - SEE IMPORTANT NOTE BELOW
amtOtherOther amount value, if any (tag value 9F03) - SEE IMPORTANT NOTE BELOW
exponentNumber of characters after decimal point
typeTransaction type (tag value 9C).
timeoutTimeout value in seconds.
tagsAny other tags to be included in the request. Passed as a TLV stream. Example, tag 9F0C with amount 0x000000000100 would be 0x9F0C06000000000100 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.
tagsLenLength of tags
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 = DFEE1A079F029F36959F37
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString >>>>>IMPORTANT: parameters for amount and amtOther MUST BE PASSED AS A DOUBLE VALUE WITH DECIMAL POINT. Example, do not pass 1, but instead pass 1.0 or 1.00. Otherwise, results will be unpredictable

◆ icc_exchangeAPDU()

int icc_exchangeAPDU ( IN BYTE *  c_APDU,
IN int  cLen,
OUT BYTE *  reData,
IN_OUT int *  reLen 
)

Exchange APDU with plain text For Non-SRED Augusta Only

Sends an APDU packet to the ICC. If successful, response is the APDU data in response parameter.

Parameters
c_APDUAPDU data packet
cLenAPDU data packet length
reDataUnencrypted APDU response
reLenUnencrypted APDU response data length
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString

◆ icc_getICCReaderStatus()

int icc_getICCReaderStatus ( OUT BYTE *  status)

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
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString

◆ icc_powerOffICC()

int icc_powerOffICC ( )

Power Off ICC

Powers down the ICC

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

If Success, empty If Failure, ASCII encoded data of error string

◆ icc_powerOnICC()

int icc_powerOnICC ( OUT BYTE *  ATR,
IN_OUT int *  inLen 
)

Power On ICC

Power up the currently selected microprocessor card in the ICC reader

Parameters
ATR,theATR data response when succeeded power on ICC,
inLen,thelength of ATR data
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ msr_cancelMSRSwipe()

int msr_cancelMSRSwipe ( )

Disable MSR Swipe Cancels MSR swipe request.

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ msr_registerCallBk()

void msr_registerCallBk ( pMSR_callBack  pMSRf)

To register the msr callback function to get the MSR card data. (Pass NULL to disable the callback.)

◆ msr_registerCallBkp()

void msr_registerCallBkp ( pMSR_callBackp  pMSRf)

To register the msr callback function to get the MSR card data pointer. (Pass NULL to disable the callback.)

◆ msr_startMSRSwipe()

int msr_startMSRSwipe ( IN int  _timeout)

Start MSR Swipe Enables MSR, waiting for swipe to occur. Allows track selection. Returns IDTMSRData instance to deviceDelegate::swipeMSRData:()

Parameters
timeoutSwipe Timeout Value
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString() Note: if auto poll mode is on, it will return command not allowed error

◆ parseMSRData()

void parseMSRData ( IN BYTE *  resData,
IN int  resLen,
IN_OUT IDTMSRData *  cardData 
)

Parser the MSR data from the buffer into IDTMSTData structure

Parameters
resDataMSR card data buffer
resLenthe length of resData
cardDatathe parser result with IDTMSTData structure

◆ pin_registerCallBk()

void pin_registerCallBk ( pPIN_callBack  pPINf)

To register the pin callback function to get the PINPad data. (Pass NULL to disable the callback.)

◆ registerHotplugCallBk()

void registerHotplugCallBk ( pMessageHotplug  pMsgHotplug)

To register the USB HID hot-plug callback function which implemented in the application to monitor the hotplug message from the SDK.

◆ registerLogCallBk()

void registerLogCallBk ( pSendDataLog  pFSend,
pReadDataLog  pFRead 
)

To register the log callback function which implemented in the application to monitor sending/reading data between application and reader.

◆ SDK_Version()

char* SDK_Version ( )

To Get SDK version

Returns
return the SDK version string

◆ setAbsoluteLibraryPath()

int setAbsoluteLibraryPath ( const char *  absoluteLibraryPath)

Set the path to use when searching for ID TECH's libraries. If this is not set, the libraries will be searched for with the system's default procedures.

Parameters
absoluteLibraryPathThe absolute path to ID TECH's libraries.
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()