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

KioskIII 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 ctls_registerCallBk (pMSR_callBack pCTLSf)
 
void ctls_registerCallBkp (pMSR_callBackp pCTLSf)
 
void pin_registerCallBk (pPIN_callBack pPINf)
 
void device_registerCameraCallBk (pCMR_callBack pCMRf)
 
void device_registerCardStatusFrontSwitchCallBk (pCSFS_callBack pCSFSf)
 
char * SDK_Version ()
 
int setAbsoluteLibraryPath (const char *absoluteLibraryPath)
 
int device_init ()
 
int rs232_device_init (int deviceType, int port_number, int brate)
 
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_controlUserInterface (IN BYTE *values)
 
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_setBurstMode (IN BYTE mode)
 
int device_setPollMode (IN BYTE mode)
 
int device_setMerchantRecord (int index, int enabled, char *merchantID, char *merchantURL)
 
int device_getTransactionResults (IDTMSRData *cardData)
 
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)
 
int device_startRKI (IN const char *caPath, IN int isProduction)
 
void device_setRKI_URL (IN char *rkiURL, IN int rkiURLLen)
 
int ctls_startTransaction (IN double amount, IN double amtOther, IN int type, IN const int _timeout, IN BYTE *tags, IN int tagsLen)
 
int ctls_activateTransaction (IN const int _timeout, IN BYTE *tags, IN int tagsLen)
 
int ctls_cancelTransaction ()
 
int ctls_retrieveApplicationData (IN BYTE *AID, IN int AIDLen, OUT BYTE *tlv, IN_OUT int *tlvLen)
 
int ctls_setApplicationData (IN BYTE *tlv, IN int tlvLen)
 
int ctls_removeApplicationData (IN BYTE *AID, IN int AIDLen)
 
int ctls_removeAllApplicationData ()
 
int ctls_retrieveAIDList (OUT BYTE *AIDList, IN_OUT int *AIDListLen)
 
int ctls_retrieveTerminalData (OUT BYTE *tlv, IN_OUT int *tlvLen)
 
int ctls_setTerminalData (IN BYTE *tlv, IN int tlvLen)
 
int ctls_retrieveCAPK (IN BYTE *capk, IN int capkLen, OUT BYTE *key, IN_OUT int *keyLen)
 
int ctls_setCAPK (IN BYTE *capk, IN int capkLen)
 
int ctls_removeCAPK (IN BYTE *capk, IN int capkLen)
 
int ctls_removeAllCAPK ()
 
int ctls_retrieveCAPKList (OUT BYTE *keys, IN_OUT int *keysLen)
 
int ctls_setConfigurationGroup (IN BYTE *tlv, IN int tlvLen)
 
int ctls_getConfigurationGroup (IN int group, OUT BYTE *tlv, OUT int *tlvLen)
 
int ctls_getAllConfigurationGroups (OUT BYTE *tlv, IN_OUT int *tlvLen)
 
int ctls_removeConfigurationGroup (int group)
 
void parseMSRData (IN BYTE *resData, IN int resLen, IN_OUT IDTMSRData *cardData)
 

Detailed Description

KioskIII API.

KioskIII 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

◆ 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

◆ ctls_activateTransaction()

int ctls_activateTransaction ( IN const int  _timeout,
IN BYTE *  tags,
IN int  tagsLen 
)

Start CTLS Transaction Request

Authorizes the CTLS transaction for an ICC card

The tags will be returned in the callback routine.

Parameters
timeoutTimeout value in seconds.
tagsThe tags to be included in the request. Passed as TLV stream. Example, tag 9F0C with amount 0x000000000100 would be 0x9F0C06000000000100
tagsLenThe length of tags data buffer.

>>>>>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

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString() Note: if auto poll is on, it will returm the error IDG_P2_STATUS_CODE_COMMAND_NOT_ALLOWED

NOTE ON APPLEPAY VAS: To enable ApplePay VAS, first a merchant record must be defined in one of the six available index positions (1-6) using device_setMerchantRecord, then container tag FFEE06 must be sent as part of the additional tags parameter of ctls_startTransaction. Tag FFEE06 must contain tag 9F26 and 9F22, and can optionanally contain tags 9F2B and DFO1. Example FFEE06189F220201009F2604000000009F2B050100000000DF010101 9F22 = two bytes = ApplePay Terminal Applicaiton Version Number. Hard defined as 0100 for now. (required) 9F26 = four bytes = ApplePay Terminal Capabilities Information (required)

  • Byte 1 = RFU
  • Byte 2 = Terminal Type
  • - Bit 8 = VAS Support (1=on, 0 = off)
  • - Bit 7 = Touch ID Required (1=on, 0 = off)
  • - Bit 6 = RFU
  • - Bit 5 = RFU
  • - Bit 1,2,3,4
  • - - 0 = Payment Terminal
  • - - 1 = Transit Terminal
  • - - 2 = Access Terminal
  • - - 3 = Wireless Handoff Terminal
  • - - 4 = App Handoff Terminal
  • - - 15 = Other Terminal
  • Byte 3 = RFU
  • Byte 4 = Terminal Mode
  • - 0 = ApplePay VAS OR ApplePay
  • - 1 = ApplePay VAS AND ApplePay
  • - 2 = ApplePay VAS ONLY
  • - 3 = ApplePay ONLY 9F2B = 5 bytes = ApplePay VAS Filter. Each byte filters for that specific merchant index (optional) DF01 = 1 byte = ApplePay VAS Protocol. (optional)
  • - Bit 1 : 1 = URL VAS, 0 = Full VAS
  • - Bit 2 : 1 = VAS Beeps, 0 = No VAS Beeps
  • - Bit 3 : 1 = Silent Comm Error, 2 = EMEA Comm Error
  • - Bit 4-8 : RFU

◆ ctls_cancelTransaction()

int ctls_cancelTransaction ( )

Cancel EMV Transaction

Cancels the currently executing EMV transaction.

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ ctls_getAllConfigurationGroups()

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

Retrieve All Configuration Groups

Returns all the Configuration Groups installed on the terminal for CTLS

Parameters
tlvThe TLV elements data
tlvLenthe length of tlv data buffer.
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ ctls_getConfigurationGroup()

int ctls_getConfigurationGroup ( IN int  group,
OUT BYTE *  tlv,
OUT int *  tlvLen 
)

Get Configuration Group

Retrieves the Configuration for the specified Group.

Parameters
groupConfiguration Group
tlvreturn data
tlvLenthe length of tlv data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ ctls_registerCallBk()

void ctls_registerCallBk ( pMSR_callBack  pCTLSf)

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

◆ ctls_registerCallBkp()

void ctls_registerCallBkp ( pMSR_callBackp  pCTLSf)

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

◆ ctls_removeAllApplicationData()

int ctls_removeAllApplicationData ( )

Remove All Application Data

Removes all the Application Data

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ ctls_removeAllCAPK()

int ctls_removeAllCAPK ( )

Remove All Certificate Authority Public Key

Removes all the CAPK

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ ctls_removeApplicationData()

int ctls_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()

◆ ctls_removeCAPK()

int ctls_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()

◆ ctls_removeConfigurationGroup()

int ctls_removeConfigurationGroup ( int  group)

Remove Configuration Group

Removes the Configuration as specified by the Group. Must not by group 0

Parameters
groupConfiguration Group
Return values
RETURN_CODEValues can be parsed with device_getIDGStatusCodeString()

◆ ctls_retrieveAIDList()

int ctls_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()

◆ ctls_retrieveApplicationData()

int ctls_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()

◆ ctls_retrieveCAPK()

int ctls_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()

◆ ctls_retrieveCAPKList()

int ctls_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()

◆ ctls_retrieveTerminalData()

int ctls_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()

◆ ctls_setApplicationData()

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

Set Application Data by AID

Sets the Application Data for CTLS as specified by TLV data

Parameters
tlvApplication data in TLV format The first tag of the TLV data must be the group number (FFE4). The second tag of the TLV data must be the AID (9F06)

Example valid TLV, for Group #2, AID a0000000035010: "ffe401029f0607a0000000051010ffe10101ffe50110ffe30114ffe20106"

Parameters
tlvLenthe length of tlv data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ ctls_setCAPK()

int ctls_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()

◆ ctls_setConfigurationGroup()

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

Set Configuration Group

Sets the Configuration Group for CTLS as specified by the TLV data

Parameters
tlvConfiguration Group Data in TLV format The first tag of the TLV data must be the group number (FFE4). A second tag must exist
tlvLenthe length of tlv data buffer
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ ctls_setTerminalData()

int ctls_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 ctls_getConfigurationGroup(int group), and deleted with ctls_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()

◆ ctls_startTransaction()

int ctls_startTransaction ( IN double  amount,
IN double  amtOther,
IN int  type,
IN const int  _timeout,
IN BYTE *  tags,
IN int  tagsLen 
)

Start CTLS Transaction Request

Authorizes the CTLS 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
typeTransaction type (tag value 9C).
timeoutTimeout value in seconds.
tagsAny other tags to be included in the request. Passed as 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.
tagsLenThe length of tags data buffer.

>>>>>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

Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString() Note: if auto poll is on, it will returm the error IDG_P2_STATUS_CODE_COMMAND_NOT_ALLOWED

NOTE ON APPLEPAY VAS: To enable ApplePay VAS, first a merchant record must be defined in one of the six available index positions (1-6) using device_setMerchantRecord, then container tag FFEE06 must be sent as part of the additional tags parameter of ctls_startTransaction. Tag FFEE06 must contain tag 9F26 and 9F22, and can optionanally contain tags 9F2B and DFO1. Example FFEE06189F220201009F2604000000009F2B050100000000DF010101 9F22 = two bytes = ApplePay Terminal Applicaiton Version Number. Hard defined as 0100 for now. (required) 9F26 = four bytes = ApplePay Terminal Capabilities Information (required)

  • Byte 1 = RFU
  • Byte 2 = Terminal Type
  • - Bit 8 = VAS Support (1=on, 0 = off)
  • - Bit 7 = Touch ID Required (1=on, 0 = off)
  • - Bit 6 = RFU
  • - Bit 5 = RFU
  • - Bit 1,2,3,4
  • - - 0 = Payment Terminal
  • - - 1 = Transit Terminal
  • - - 2 = Access Terminal
  • - - 3 = Wireless Handoff Terminal
  • - - 4 = App Handoff Terminal
  • - - 15 = Other Terminal
  • Byte 3 = RFU
  • Byte 4 = Terminal Mode
  • - 0 = ApplePay VAS OR ApplePay
  • - 1 = ApplePay VAS AND ApplePay
  • - 2 = ApplePay VAS ONLY
  • - 3 = ApplePay ONLY 9F2B = 5 bytes = ApplePay VAS Filter. Each byte filters for that specific merchant index (optional) DF01 = 1 byte = ApplePay VAS Protocol. (optional)
  • - Bit 1 : 1 = URL VAS, 0 = Full VAS
  • - Bit 2 : 1 = VAS Beeps, 0 = No VAS Beeps
  • - Bit 3 : 1 = Silent Comm Error, 2 = EMEA Comm Error
  • - Bit 4-8 : RFU

◆ device_close()

int device_close ( )

Close the device

Returns
RETURN_CODE: 0: success, 0x0A: failed

◆ device_controlUserInterface()

int device_controlUserInterface ( IN BYTE *  values)

Control User Interface

Controls the User Interface: Display, Beep, LED

Parameters
valuesFour bytes to control the user interface Byte[0] = LCD Message Messages 00-07 are normally controlled by the reader.
  • 00h: Idle Message (Welcome)
  • 01h: Present card (Please Present Card)
  • 02h: Time Out or Transaction cancel (No Card)
  • 03h: Transaction between reader and card is in the middle (Processing...)
  • 04h: Transaction Pass (Thank You)
  • 05h: Transaction Fail (Fail)
  • 06h: Amount (Amount $ 0.00 Tap Card)
  • 07h: Balance or Offline Available funds (Balance $ 0.00) Messages 08-0B are controlled by the terminal
  • 08h: Insert or Swipe card (Use Chip & PIN)
  • 09h: Try Again(Tap Again)
  • 0Ah: Tells the customer to present only one card (Present 1 card only)
  • 0Bh: Tells the customer to wait for authentication/authorization (Wait)
  • FFh: indicates the command is setting the LED/Buzzer only. Byte[1] = Beep Indicator
  • 00h: No beep
  • 01h: Single beep
  • 02h: Double beep
  • 03h: Three short beeps
  • 04h: Four short beeps
  • 05h: One long beep of 200 ms
  • 06h: One long beep of 400 ms
  • 07h: One long beep of 600 ms
  • 08h: One long beep of 800 ms Byte[2] = LED Number
  • 00h: LED 0 (Power LED) 01h: LED 1
  • 02h: LED 2
  • 03h: LED 3
  • FFh: All LEDs Byte[3] = LED Status
  • 00h: LED Off
  • 01h: LED On
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_enablePassThrough()

int device_enablePassThrough ( int  enablePassThrough)

Enable Pass Through - NEO

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_getTransactionResults()

int device_getTransactionResults ( IDTMSRData *  cardData)

Get Transaction Results Gets the transaction results when the reader is functioning in "Auto Poll" mode

Parameters
cardDataThe transaction results
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ 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 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_setBurstMode()

int device_setBurstMode ( IN BYTE  mode)

Send Burst Mode - NEO

Sets the burst mode for the device.

Parameters
mode0 = OFF, 1 = Always On, 2 = Auto Exit
Returns
success or error code. Values can be parsed with device_getIDGStatusCodeString
See also
ErrorCode

◆ 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 - NEO 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_setPollMode()

int device_setPollMode ( IN BYTE  mode)

Set Poll Mode - NEO

Sets the poll mode forthe device. Auto Poll keeps reader active, Poll On Demand only polls when requested by terminal

Parameters
mode0 = Auto Poll, 1 = Poll On Demand
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ device_setRKI_URL()

void device_setRKI_URL ( IN char *  rkiURL,
IN int  rkiURLLen 
)

Set the URL for RKI

Parameters
rkiURLThe URL for RKI (less than 100 characters). Pass NULL to reset to default URL
rkiURLLenThe length of rkiURL. Pass 0 to reset to default URL
Returns

◆ 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

◆ device_startRKI()

int device_startRKI ( IN const char *  caPath,
IN int  isProduction 
)

Start remote key injection.

Parameters
caPathThe path to ca-certificates.crt. It should be NULL, because the file is not used anymore.
isProduction1: The reader is a production unit, 0: The reader is not a production unit
Returns
success or error code.
See also
ErrorCode

◆ 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.)

◆ 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.

◆ rs232_device_init()

int rs232_device_init ( int  deviceType,
int  port_number,
int  brate 
)

Initial the device by RS232
It will try to connect to the device with provided deviceType, port_number, and brate.

Parameters
deviceTypeDevice to connect to
port_numberPort number of the device

Port nr. | Linux | Windows

| 0 | ttyS0 | COM1 | | 1 | ttyS1 | COM2 | | 2 | ttyS2 | COM3 | | 3 | ttyS3 | COM4 | | 4 | ttyS4 | COM5 | | 5 | ttyS5 | COM6 | | 6 | ttyS6 | COM7 | | 7 | ttyS7 | COM8 | | 8 | ttyS8 | COM9 | | 9 | ttyS9 | COM10 | | 10 | ttyS10 | COM11 | | 11 | ttyS11 | COM12 | | 12 | ttyS12 | COM13 | | 13 | ttyS13 | COM14 | | 14 | ttyS14 | COM15 | | 15 | ttyS15 | COM16 | | 16 | ttyUSB0 | n.a. | | 17 | ttyUSB1 | n.a. | | 18 | ttyUSB2 | n.a. | | 19 | ttyUSB3 | n.a. | | 20 | ttyUSB4 | n.a. | | 21 | ttyUSB5 | n.a. | | 22 | ttyAMA0 | n.a. | | 23 | ttyAMA1 | n.a. | | 24 | ttyACM0 | n.a. | | 25 | ttyACM1 | n.a. | | 26 | rfcomm0 | n.a. | | 27 | rfcomm1 | n.a. | | 28 | ircomm0 | n.a. | | 29 | ircomm1 | n.a. | | 30 | cuau0 | n.a. | | 31 | cuau1 | n.a. | | 32 | cuau2 | n.a. | | 33 | cuau3 | n.a. | | 34 | cuaU0 | n.a. | | 35 | cuaU1 | n.a. | | 36 | cuaU2 | n.a. | | 37 | cuaU3 | n.a. |

Parameters
brateBitrate of the device
Returns
RETURN_CODE: Values can be parsed with device_getIDGStatusCodeString()

◆ 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()