IDTech Windows SDK Guide  1.00.029
API reference for UniPay
IDTechSDK.IDT_UniPay Class Reference

Public Member Functions

RETURN_CODE device_getFirmwareVersion (ref string response)
 
RETURN_CODE device_getBootloaderVersion (ref string response)
 
RETURN_CODE config_getModelNumber (ref string response)
 
RETURN_CODE config_getSerialNumber (ref string response)
 
bool config_setCmdTimeOutDuration (int newTimeOut)
 
RETURN_CODE device_getBatteryVoltage (ref string voltage)
 
RETURN_CODE device_rebootDevice ()
 
RETURN_CODE device_sendDataCommand (string cmd, bool calcLRC, ref byte[] response)
 
RETURN_CODE icc_exchangeAPDU (string c_APDU, ref byte[] response)
 
RETURN_CODE icc_getAPDU_KSN (ref byte[] ksn)
 
RETURN_CODE icc_getICCReaderStatus (ref byte status)
 
RETURN_CODE icc_getKeyFormatForICCDUKPT (ref byte format)
 
RETURN_CODE icc_getKeyTypeForICCDUKPT (ref byte type)
 
RETURN_CODE icc_powerOffICC ()
 
RETURN_CODE icc_powerOnICC (ref byte[] ATR)
 
RETURN_CODE icc_setKeyFormatForICCDUKPT (byte encryption)
 
RETURN_CODE icc_setKeyTypeForICCDUKPT (byte encryption)
 
RETURN_CODE msr_cancelMSRSwipe ()
 
RETURN_CODE msr_getClearPANID (ref byte value)
 
RETURN_CODE msr_getExpirationMask (ref byte value)
 
RETURN_CODE msr_getSwipeEncryption (ref byte encryption)
 
RETURN_CODE msr_getSwipeForcedEncryptionOption (ref byte option)
 
RETURN_CODE msr_getSwipeMaskOption (ref byte option)
 
RETURN_CODE msr_setClearPANID (byte val)
 
RETURN_CODE msr_setExpirationMask (bool mask)
 
RETURN_CODE msr_setSwipeEncryption (byte encryption)
 
RETURN_CODE msr_setSwipeForcedEncryptionOption (bool track1, bool track2, bool track3, bool track3card0)
 
RETURN_CODE msr_setSetting (byte setting, byte[] value)
 
RETURN_CODE msr_getSetting (byte setting, ref byte[] value)
 
RETURN_CODE msr_setSwipeMaskOption (bool track1, bool track2, bool track3)
 
RETURN_CODE msr_startMSRSwipe (int timeout)
 

Static Public Member Functions

static void loadDLLs ()
 
static void setCallback (CallBack my_Callback)
 
static void setCallback (IntPtr my_Callback, SynchronizationContext context)
 
static String SDK_Version ()
 

Properties

static IDT_UniPay SharedController [get]
 

Detailed Description

Class for UniPay MSR/ICC reader

Member Function Documentation

RETURN_CODE IDTechSDK.IDT_UniPay.config_getModelNumber ( ref string  response)

Polls device for Model Number

Parameters
responseReturns Model Number
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.config_getSerialNumber ( ref string  response)

Polls device for Serial Number

Parameters
responseReturns Serial Number
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
bool IDTechSDK.IDT_UniPay.config_setCmdTimeOutDuration ( int  newTimeOut)

Command Acknowledgement Timout

Sets the amount of seconds to wait for an {ACK} to a command before a timeout. Responses should normally be received under one second. Default is 3 seconds

Parameters
newTimeOutTimout value. Valid range 1 - 60 seconds
Returns
Success flag. Determines if value was set and in range.
RETURN_CODE IDTechSDK.IDT_UniPay.device_getBatteryVoltage ( ref string  voltage)

Polls device for Battery Voltage

Parameters
voltageReturns Battery Voltage as 4-chararacter string * 100. Example: "0186" = 1.86v. "1172" = 11.72v.
Return values
RETURN_CODE
  • 0x0000: Success: no error - RETURN_CODE_DO_SUCCESS
  • 0x0001: Disconnect: no response from reader - RETURN_CODE_ERR_DISCONNECT
  • 0x0002: Invalid Response: invalid response data - RETURN_CODE_ERR_CMD_RESPONSE
  • 0x0003: Timeout: time out for task or CMD - RETURN_CODE_ERR_TIMEDOUT
  • 0x0004: Invalid Parameter: wrong parameter - RETURN_CODE_ERR_INVALID_PARAMETER
  • 0x0005: MSR Busy: SDK is doing MSR or ICC task - RETURN_CODE_SDK_BUSY_MSR
  • 0x0006: PINPad Busy: SDK is doing PINPad task - RETURN_CODE_SDK_BUSY_PINPAD
  • 0x0007: Unknown: Unknown error - RETURN_CODE_ERR_OTHER
  • 0x0100 through 0xFFFF refer to errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.device_getBootloaderVersion ( ref string  response)

Polls device for Bootloader Version

Puts device in bootloader mode so it can return bootloader version. Remains in bootloader mode until timeout of 30 seconds is reached. During this time, only command that may be executed is device_getFirmwareVersion, which will return bootloader version

Parameters
responseResponse returned of Bootloader Version
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.device_getFirmwareVersion ( ref string  response)

Polls device for Firmware Version

Parameters
responseResponse returned of Firmware Version
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.device_rebootDevice ( )

Reboot Device

Executes a command to restart the device.

Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.device_sendDataCommand ( string  cmd,
bool  calcLRC,
ref byte[]  response 
)

Send a NSData object to device

Sends a command represented by the provide NSData object to the device through the accessory protocol.

Parameters
cmdNSData representation of command to execute
calcLRCIf TRUE, this will wrap command with start/length/lrc/sum/end: '{STX}{Len_Low}{Len_High} data {CheckLRC} {CheckSUM} {ETX}'
responseResponse data
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.icc_exchangeAPDU ( string  c_APDU,
ref byte[]  response 
)

Exchange APDU

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

Parameters
c_APDUAPDU data packet
responseUnencrypted/encrypted parsed APDU response
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.icc_getAPDU_KSN ( ref byte[]  ksn)

Get APDU KSN

Retrieves the KSN used in ICC Encypted APDU usage

Parameters
ksnReturns the encrypted APDU packet KSN
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.icc_getICCReaderStatus ( ref 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 errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.icc_getKeyFormatForICCDUKPT ( ref byte  format)

Get Key Format For ICC DUKPT

Specifies how data will be encrypted with Data Key or PIN key (if DUKPT key loaded)

Parameters
formatResponse returned from method:
  • 'TDES': Encrypted card data with TDES if DUKPT Key had been loaded.(default)
  • 'AES': Encrypted card data with AES if DUKPT Key had been loaded.
  • 'NONE': No Encryption.
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.icc_getKeyTypeForICCDUKPT ( ref byte  type)

Get Key Type for ICC DUKPT

Specifies the key type used for ICC DUKPT encryption

Parameters
typeResponse returned from method:
  • 'DATA': Encrypted card data with Data Key DUKPT Key had been loaded.(default)
  • 'PIN': Encrypted card data with PIN Key if DUKPT Key had been loaded.
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.icc_powerOffICC ( )

Power Off ICC

Powers down the ICC

Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()

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

RETURN_CODE IDTechSDK.IDT_UniPay.icc_powerOnICC ( ref byte[]  ATR)

Power On ICC

Power up the currently selected microprocessor card in the ICC reader

Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.icc_setKeyFormatForICCDUKPT ( byte  encryption)

Set Key Format for ICC DUKPT

Sets how data will be encrypted, with either TDES or AES (if DUKPT key loaded)

Parameters
encryptionEncryption Type
  • 00: Encrypt with TDES
  • 01: Encrypt with AES
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.icc_setKeyTypeForICCDUKPT ( byte  encryption)

Set Key Type for ICC DUKPT Key

Sets which key the data will be encrypted with, with either Data Key or PIN key (if DUKPT key loaded)

Parameters
encryptionEncryption Type
  • 00: Encrypt with Data Key
  • 01: Encrypt with PIN Key
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
static void IDTechSDK.IDT_UniPay.loadDLLs ( )
static

Load DLL's

Instructs SDK to load device DLLs. Should be executed on SDK initialization.

RETURN_CODE IDTechSDK.IDT_UniPay.msr_cancelMSRSwipe ( )

Disable MSR Swipe Cancels MSR swipe request.

Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_getClearPANID ( ref byte  value)

Get Clear PAN Digits

Returns the number of digits that begin the PAN that will be in the clear

Parameters
valueNumber of digits in clear. Values are char '0' - '6':
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_getExpirationMask ( ref byte  value)

Get Expiration Masking

Get the flag that determines if to mask the expiration date

Parameters
value'0' = masked, '1' = not-masked
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_getSetting ( byte  setting,
ref byte[]  value 
)

Get MSR Setting value

Returns the encryption used for sweip data

Parameters
settingMSR Setting to retrieve
valueMSR Setting value
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_UniPay.msr_getSwipeEncryption ( ref byte  encryption)

Get Swipe Data Encryption

Returns the encryption used for sweip data

Parameters
encryption1 = TDES, 2 = AES, 0 = NONE
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_getSwipeForcedEncryptionOption ( ref byte  option)

Get Swipe Data Encryption

Gets the swipe force encryption options

Parameters
optionByte using lower four bits as flags. 0 = Force Encryption Off, 1 = Force Encryption On bit0 = Track 1 bit1 = Track 2 bit2 = Track 3 bit4 = Track 3 Card Option 0

Example: Response 0x03 = Track1/Track2 Forced Encryption, Track3/Track3-0 no Forced Encryption

Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_getSwipeMaskOption ( ref byte  option)

Get Swipe Mask Option

Gets the swipe mask/clear data sending option

Parameters
optionByte using lower three bits as flags. 0 = Mask Option Off, 1 = Mask Option On bit0 = Track 1 bit1 = Track 2 bit2 = Track 3

Example: Response 0x03 = Track1/Track2 Masked Option ON, Track3 Masked Option Off

Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_setClearPANID ( byte  val)

Set Clear PAN Digits

Sets the amount of digits shown in the clear (not masked) at the beginning of the returned PAN value

Parameters
valNumber of digits to show in clear. Range 0-6.
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_setExpirationMask ( bool  mask)

Set Expiration Masking

Sets the flag to mask the expiration date

Parameters
maskTRUE = mask expiration
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_setSetting ( byte  setting,
byte[]  value 
)

Set MSR Setting value

Parameters
settingMSR Setting to set
valueMSR Setting value
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_UniPay.msr_setSwipeEncryption ( byte  encryption)

Set Swipe Data Encryption

Sets the swipe encryption method

Parameters
encryption1 = TDES, 2 = AES
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_setSwipeForcedEncryptionOption ( bool  track1,
bool  track2,
bool  track3,
bool  track3card0 
)

Set Swipe Force Encryption

Sets the swipe force encryption options

Parameters
track1Force encrypt track 1
track2Force encrypt track 2
track3Force encrypt track 3
track3card0Force encrypt track 3 when card type is 0
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_setSwipeMaskOption ( bool  track1,
bool  track2,
bool  track3 
)

Set Swipe Mask Option

Sets the swipe mask/clear data sending option

Parameters
track1Mask track 1 allowed
track2Mask track 2 allowed
track3Mask track 3 allowed
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_UniPay.msr_startMSRSwipe ( int  timeout)

Enable MSR Swipe

Enables MSR, waiting for swipe to occur.

Parameters
timeoutSwipe Timeout Value
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
static String IDTechSDK.IDT_UniPay.SDK_Version ( )
static

SDK Version

  • All Devices

Returns the current version of SDK

Returns
Framework version
static void IDTechSDK.IDT_UniPay.setCallback ( CallBack  my_Callback)
static

Set Callback

Sets the class callback
static void IDTechSDK.IDT_UniPay.setCallback ( IntPtr  my_Callback,
SynchronizationContext  context 
)
static

Set Callback

Sets the class callback

Parameters
my_CallbackThe callback function to receive the response message from device. defined as follows. public unsafe delegate void MFCCallBack(Parameters parameters);
contextThe context of the UI thread

Property Documentation

IDT_UniPay IDTechSDK.IDT_UniPay.SharedController
staticget

Singleton Instance

Establishes an singleton instance of IDT_UniPay class.

Returns
Instance of IDT_UniPay

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