IDTech Windows SDK Guide  3.2.4.393
API reference for Visual Studio .Net
IDTechSDK.IDT_K100 Class Reference

Public Member Functions

RETURN_CODE device_getFirmwareVersion (ref string response)
 
RETURN_CODE device_StartRKI (int type)
 
RETURN_CODE device_sendDataCommand (string cmd, bool calcLRC, ref byte[] response)
 
RETURN_CODE device_sendDataCommand_ext (string cmd, bool calcLRC, ref byte[] response, int timeout, bool noResponse)
 
RETURN_CODE config_getModelNumber (ref string response)
 
bool config_setCmdTimeOutDuration (int newTimeOut)
 
RETURN_CODE pin_getEncryptedPIN (int keyType, string PAN, string message, int timeout, bool isAES=false, string ident="")
 
RETURN_CODE pin_getFunctionKey ()
 
RETURN_CODE pin_sendBeep (int frequency, int duration)
 
RETURN_CODE device_rebootDevice ()
 
RETURN_CODE pin_cancelPINEntry ()
 
RETURN_CODE device_getKeyStatus (ref byte[] status)
 
RETURN_CODE pin_enableKeypad ()
 
RETURN_CODE device_startRKI (bool isTest)
 
RETURN_CODE device_getDateTimeString (ref string str)
 
RETURN_CODE config_setBaudRate (int baud)
 
RETURN_CODE config_getBaudRate (ref int baud)
 
RETURN_CODE device_getRKIStatus (bool isProd, bool isMultiKey, ref string status, ref Dictionary< string, RKI_KEY_TYPE > keys, string ident="")
 
RETURN_CODE device_getAnyRKIStatus (bool isMultiKey, ref string status, ref Dictionary< string, RKI_KEY_TYPE > keys, string ident="")
 
RETURN_CODE device_updateFirmwareFromZip (byte[] zipfile, string ident="", bool isForeground=false)
 
RETURN_CODE device_sendConfigurationFromZip (byte[] zip, string filename, VC_OPERATION_TYPE type, bool matchFW, string ident="", bool isForeground=false)
 
RETURN_CODE device_sendConfiguration (string filename, VC_OPERATION_TYPE type, bool matchFW, string ident="", bool isForeground=false)
 
RETURN_CODE device_readConfigurationToMemory (string memo, Configs.InstallRules rules, List< Configs.DeviceCommand > cmds, string ident="", bool isForeground=false)
 
RETURN_CODE device_getConfigurationFromMemory (ref string json, string ident="")
 
RETURN_CODE device_RemoteKeyInjection (RKI_KEY_TYPE type, string keyName, string ident="", bool performOnForeground=false)
 

Static Public Member Functions

static bool useSerialPort (int port)
 
static int getCommandTimeout ()
 
static void setCommandTimeout (int milliseconds)
 
static bool useSerialPort (int port, int baud)
 
static bool useSerialPortLinux (string path)
 
static bool useSerialPortLinux (string path, int baud)
 
static bool closeSerialPort ()
 
static bool closeUSB ()
 
static void initSC ()
 
static void setCallback (CallBack my_Callback)
 
static void setCallback (IntPtr my_Callback, SynchronizationContext context)
 
static String SDK_Version ()
 

Properties

static IDT_K100 SharedController [get]
 

Member Function Documentation

static bool IDTechSDK.IDT_K100.closeSerialPort ( )
static

Close Serial Port Interface

Instructs SDK to close the Serial Port if connected to K100

Returns
bool TRUE=successful, FALSE=failure
static bool IDTechSDK.IDT_K100.closeUSB ( )
static

Close USB

Instructs SDK to close the USB if connected to K100

Returns
bool TRUE=successful, FALSE=failure
RETURN_CODE IDTechSDK.IDT_K100.config_getBaudRate ( ref int  baud)

Get Baud Rate

Gets the buad rate for RS-232 communication.

Parameters
baud
  • 2 = 2400
  • 3 = 4800
  • 4 = 9600
  • 6 = 19200
  • 7 = 38400
  • 9 = 115200
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_K100.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_K100.config_setBaudRate ( int  baud)

Set Baud Rate

Sets the buad rate for RS-232 communication.

Parameters
baud
  • 2 = 2400
  • 3 = 4800
  • 4 = 9600
  • 6 = 19200
  • 7 = 38400
  • 9 = 115200
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
bool IDTechSDK.IDT_K100.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_K100.device_getAnyRKIStatus ( bool  isMultiKey,
ref string  status,
ref Dictionary< string, RKI_KEY_TYPE >  keys,
string  ident = "" 
)

Get RKI Status Polls the RKI servers to validate device RKI eligiblity. Note: if device type is known in advance (production or demo device), it is more efficient to use device_getRKIStatus instead

Parameters
isMultiKeyTrue = MultiKey, False = SingleKey
statusRKI status returned as a string
keysReturns all available keys
identDevice ID to send command to. If not specified, current SDK default device will be used.
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString(). When no data is available, return code = RETURN_CODE_NO_DATA_AVAILABLE
RETURN_CODE IDTechSDK.IDT_K100.device_getConfigurationFromMemory ( ref string  json,
string  ident = "" 
)

Read Device Configuration From Memory Retrieves the ViVOconfig configuration data from memory after a successful device_readConfigurationToMemory

Parameters
jsonReturns the .json file data that can be saved to disk
identDevice ID to send command to. If not specified, current SDK default device will be used.
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString(). When no data is available, return code = RETURN_CODE_NO_DATA_AVAILABLE
RETURN_CODE IDTechSDK.IDT_K100.device_getDateTimeString ( ref string  str)

Get Date Time String

Gets current system date and time of the device.

Parameters
strThe Date/Time string
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_K100.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_K100.device_getKeyStatus ( ref byte[]  status)

Get Key Status

Gets the status of loaded keys

Parameters
statusBlocks of 4 bytes, format is {Key Index and Key Name} {key slot} {key status}: {Key Index and Key Name} is 1 byte.
  • 0x14 = LCL Key Encryption Key (Master or KEK)
  • 0x01 = PIN DUKPT Key
  • 0x0C = RKI-KEK DUKPT Key
  • 0x08 = PIN Master Key
  • 0x0D = Pairing BDK Key (PINPAD) {keyslot is 2 bytes.Range is 0–9999 {key status} is 1byte. 0 – Not Exist, 1 – Exist, 0xFF – (Stop. Only Valid for DUKPT Key)
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_K100.device_getRKIStatus ( bool  isProd,
bool  isMultiKey,
ref string  status,
ref Dictionary< string, RKI_KEY_TYPE >  keys,
string  ident = "" 
)

Get RKI Status From Specified Server Polls the RKI server to validate device RKI eligiblity

Parameters
isProdTRUE = poll production RKI server, FALSE = poll demo RKI server
isMultiKeyTrue = MultiKey, False = SingleKey
statusRKI status returned as a string
keysReturns dictionary of available keys
identDevice ID to send command to. If not specified, current SDK default device will be used.
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString(). When no data is available, return code = RETURN_CODE_NO_DATA_AVAILABLE
RETURN_CODE IDTechSDK.IDT_K100.device_readConfigurationToMemory ( string  memo,
Configs.InstallRules  rules,
List< Configs.DeviceCommand >  cmds,
string  ident = "",
bool  isForeground = false 
)

Read Device Configuration To Memory Executes a ViVOconfig read of device settings and stores the results in memory

Once a ViVOconfig read starts, all messages will be returned to the callback as DeviceState.ViVOconfig. The ViVOconfig operation is complete when the return code from a DeviceState.ViVOconfig message is one of the following values:

  • RETURN_CODE_SDK_VIVOCONFIG_READ_CONFIG_SUCCESS = Read process completed successfully. Execute device_getConfigurationFromMemory to retrieve the configuration data
  • RETURN_CODE_SDK_VIVOCONFIG_READ_CONFIG_FAILED = Read process FAILED.

    Parameters
    memoOptional: populates the memo field of the captured .json file
    rulesOptional: populates the .json file with available install rules
    cmdsOptional: populates the .json file with commands to execute
    identDevice ID to send command to. If not specified, current SDK default device will be used.
    isForegroundIf TRUE, will block program until update complete. Otherwise, FALSE performs update on background.
    Returns
    RETURN_CODE: Values can be parsed with errorCode.getErrorString(). When no data is available, return code = RETURN_CODE_NO_DATA_AVAILABLE
RETURN_CODE IDTechSDK.IDT_K100.device_rebootDevice ( )

Reboot Device

Executes a command to restart the device.

  • Card data is cleared, resetting card status bits.
  • Response data of the previous command is cleared.
  • Resetting firmware.

    Returns
    RETURN_CODE: Values can be parsed with device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_K100.device_RemoteKeyInjection ( RKI_KEY_TYPE  type,
string  keyName,
string  ident = "",
bool  performOnForeground = false 
)

Remote Key Injection Performs a remote key injection for the device

Parameters
typeRemote Key Injection Type
keyNameName of key (optional)
identDevice ID to send command to. If not specified, current SDK default device will be used.
performOnForegroundTRUE = block during process (default is false)
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString(). When no data is available, return code = RETURN_CODE_NO_DATA_AVAILABLE
RETURN_CODE IDTechSDK.IDT_K100.device_sendConfiguration ( string  filename,
VC_OPERATION_TYPE  type,
bool  matchFW,
string  ident = "",
bool  isForeground = false 
)

Send Configuration Executes a ViVOconfig update or verify to a device

Once a ViVOconfig write or verify starts, all messages will be returned to the callback as DeviceState.ViVOconfig. The ViVOconfig operation is complete when the return code from a DeviceState.ViVOconfig message is one of the following values:

  • RETURN_CODE_SDK_VIVOCONFIG_VERIFY_SUCCESS = Verification process completed successfully. No differences found.
  • RETURN_CODE_SDK_VIVOCONFIG_VERIFY_SUCCESS_WITH_WARNING = Verification process completed with warnings.
  • RETURN_CODE_SDK_VIVOCONFIG_VERIFY_FAILED = Verification process FAILED
  • RETURN_CODE_SDK_VIVOCONFIG_WRITE_SUCCESS = Write process completed successfully.
  • RETURN_CODE_SDK_VIVOCONFIG_WRITE_SUCCESS_WITH_WARNING = Write process completed with warnings
  • RETURN_CODE_SDK_VIVOCONFIG_WRITE_FAILED = Write process FAILED

    Parameters
    filenameThe .json configuration file to update the device with NOTE: You can also use this parameter to pass the path of where the .json file is located at on local storage instead
    filenameThe name of the .json configuration file
    typeVC_OPERATION_TYPE
  • VC_OPERATION_TYPE_WRITE = Write File To Device, Hash must validate
  • VC_OPERATION_TYPE_VERIFY = Verify Device With File
  • VC_OPERATION_TYPE_WRITE_IGNORE_HASH = Write File To Device, Ignore Hash
  • VC_OPERATION_TYPE_WRITE_FIX_HASH = Write File To Device, Fix Hash If Necessary
    Parameters
    matchFWTRUE = Device FW must match file FW, FALSE = Don't validate device FW against file
    identDevice ID to send command to. If not specified, current SDK default device will be used.
    isForegroundIf TRUE, will block program until update complete. Otherwise, FALSE performs update on background.
    Returns
    RETURN_CODE: Values can be parsed with errorCode.getErrorString(). When no data is available, return code = RETURN_CODE_NO_DATA_AVAILABLE
RETURN_CODE IDTechSDK.IDT_K100.device_sendConfigurationFromZip ( byte[]  zip,
string  filename,
VC_OPERATION_TYPE  type,
bool  matchFW,
string  ident = "",
bool  isForeground = false 
)

Send Configuration From Zip Executes a ViVOconfig update or verify to a device using files from a .zip archive

Once a ViVOconfig write or update starts, all messages will be returned to the callback as DeviceState.ViVOconfig. The ViVOconfig operation is complete when the return code from a DeviceState.ViVOconfig message is one of the following values:

  • RETURN_CODE_SDK_VIVOCONFIG_VERIFY_SUCCESS = Verification process completed successfully. No differences found.
  • RETURN_CODE_SDK_VIVOCONFIG_VERIFY_SUCCESS_WITH_WARNING = Verification process completed with warnings.
  • RETURN_CODE_SDK_VIVOCONFIG_VERIFY_FAILED = Verification process FAILED
  • RETURN_CODE_SDK_VIVOCONFIG_WRITE_SUCCESS = Write process completed successfully.
  • RETURN_CODE_SDK_VIVOCONFIG_WRITE_SUCCESS_WITH_WARNING = Write process completed with warnings
  • RETURN_CODE_SDK_VIVOCONFIG_WRITE_FAILED = Write process FAILED

    Parameters
    zip.Zip archive containing the .json configuration file and also any associated image assets NOTE: You can also use this parameter to pass the path of where the .zip file is located at on local storage instead
    filenameThe name of the .json configuration file
    typeVC_OPERATION_TYPE
  • VC_OPERATION_TYPE_WRITE = Write File To Device, Hash must validate
  • VC_OPERATION_TYPE_VERIFY = Verify Device With File
  • VC_OPERATION_TYPE_WRITE_IGNORE_HASH = Write File To Device, Ignore Hash
  • VC_OPERATION_TYPE_WRITE_FIX_HASH = Write File To Device, Fix Hash If Necessary
    Parameters
    matchFWTRUE = Device FW must match file FW, FALSE = Don't validate device FW against file
    identDevice ID to send command to. If not specified, current SDK default device will be used.
    isForegroundIf TRUE, will block program until update complete. Otherwise, FALSE performs update on background.
    Returns
    RETURN_CODE: Values can be parsed with errorCode.getErrorString(). When no data is available, return code = RETURN_CODE_NO_DATA_AVAILABLE
RETURN_CODE IDTechSDK.IDT_K100.device_sendDataCommand ( string  cmd,
bool  calcLRC,
ref byte[]  response 
)

Send a data command to the device

Sends a command to the device.

Parameters
cmdString 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 device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_K100.device_sendDataCommand_ext ( string  cmd,
bool  calcLRC,
ref byte[]  response,
int  timeout,
bool  noResponse 
)

Send a data command to the device - extended

Sends a command to the device.

Parameters
cmdString representation of command to execute
calcLRCIf TRUE, this will wrap command as NGA with start/length/lrc/sum/end: '{STX}{Len_Low}{Len_High} data {CheckLRC} {CheckSUM} {ETX}'
responseResponse data
timeoutTimeout value waiting for response, in milliseconds (1000 = 1 second)
noResponseif TRUE, this will not wait for a response and immediately return SUCCESS
calcITPIf TRUE, this will wrap command as ITP with start/end/lrc: '{STX} data {ETX}{CheckLRC}'
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_K100.device_StartRKI ( int  type)

Start Remote Key Injection

Starts a remote key injection request with IDTech RKI servers. Set/Get RKI url with IDT_Device.RKI_URL.

Parameters
type0 = Symmetric RKI Demo Unit 1 = Symmetric RKI Production Unit 2 = PKI-RKI Demo Unit 3 = PKI-RKI Production Unit
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_K100.device_startRKI ( bool  isTest)

Start Remote Key Injection

Starts a remote key injection request with IDTech RKI servers.

Parameters
isTestTRUE = Demo Device, FALSE = Production Device
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
RETURN_CODE IDTechSDK.IDT_K100.device_updateFirmwareFromZip ( byte[]  zipfile,
string  ident = "",
bool  isForeground = false 
)

Update Firmware From Zip

Performs one or more device firmware updates from firmware files passed as a compressed archive with a valid configuration file (.json format)

Parameters
zipfileZip file containing on or more firmware update files and a .json configuration file
identDevice ID to send command to. If not specified, current SDK default device will be used.
isForegroundIf TRUE, will block program until firmware update complete. Otherwise, FALSE performs FW update on background.
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString(string ident = "")
static int IDTechSDK.IDT_K100.getCommandTimeout ( )
static

Get Command Timeout

Gets the default timeout (in milliseconds) waiting for a blocking command response

Return values
timeTime
RETURN_CODE IDTechSDK.IDT_K100.pin_cancelPINEntry ( )

Cancel PIN Entry

Cancel “Get Function Key” & “Get Encrypted PIN” & “Get Numeric” & “Get Amount”

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

Enable Keypad

Captures keypad button presses until Timeout reached, or pin_cancelPINEntry is executed, whichever comes first

Timeout is hardwired to 3 minutes
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_K100.pin_getEncryptedPIN ( int  keyType,
string  PAN,
string  message,
int  timeout,
bool  isAES = false,
string  ident = "" 
)

Get Encrypted PIN

Requests PIN Entry

Parameters
keyType
  • 0x00- MKSK-TDES: External Plaintext PAN
  • 0x01- DUKPT-TDES: External Plaintext PAN
  • 0x10 MKSK-TDES: External Ciphertext PAN
  • 0x11 DUKPT-TDES: External Ciphertext PAN
PANAccount Number
messageMessage to display

Timeout is hard wired 3 minutes

Parameters
isAESset to TRUE if PEK is AES, not TDES
identDevice ID to send command to. If not specified, current SDK default device will be used.
Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_K100.pin_getFunctionKey ( )

Get Function Key

Captures a function key

  • Backspace = B
  • Cancel = C
  • Enter = E
  • * = *
  • # = #
  • Help = ?
  • Function Key 1 = F1
  • Function Key 2 = F2
  • Function Key 3 = F3

Timeout hard wired 3 minutes

Returns
RETURN_CODE: Values can be parsed with errorCode.getErrorString()
RETURN_CODE IDTechSDK.IDT_K100.pin_sendBeep ( int  frequency,
int  duration 
)

Send Beep

Executes a beep request.

Parameters
frequencyFrequency, range 200-20000Hz
durationDuration, range 16-65535ms
Returns
RETURN_CODE: Values can be parsed with device_getResponseCodeString
static String IDTechSDK.IDT_K100.SDK_Version ( )
static

SDK Version

  • All Devices

Returns the current version of SDK

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

Set Callback

Sets the class callback
static void IDTechSDK.IDT_K100.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
static void IDTechSDK.IDT_K100.setCommandTimeout ( int  milliseconds)
static

Set Command Timeout

Sets the default timeout (in milliseconds) waiting for a blocking command response

Parameters
millisecondsTime
static bool IDTechSDK.IDT_K100.useSerialPort ( int  port)
static

Use Serial Port Interface

Instructs SDK to attempt to use the Serial Port for communication with K100 using default baud rate

Parameters
portSerial Port to use. Example COM1 = 1.
Returns
bool TRUE=successful, FALSE=failure
static bool IDTechSDK.IDT_K100.useSerialPort ( int  port,
int  baud 
)
static

Use Serial Port Interface with baud rate K100

Parameters
portSerial Port to use. Example COM1 = 1.
baudBaud rate to override default. Example 115200;
Returns
bool TRUE=successful, FALSE=failure
static bool IDTechSDK.IDT_K100.useSerialPortLinux ( string  path)
static

Use Serial Port Interface on Linux

Instructs SDK to attempt to use the Serial Port for communication with BTMag using default baud rate on Linux implementations

Parameters
pathPath to use. Example /dev/ttyUSB*
Returns
bool TRUE=successful, FALSE=failure
static bool IDTechSDK.IDT_K100.useSerialPortLinux ( string  path,
int  baud 
)
static

Use Serial Port Interface on Linux with baud rate

Instructs SDK to attempt to use the Serial Port for communication with BTPay on Linux implementations

Parameters
pathPath to use. Example /dev/ttyUSB*
baudBaud rate to override default. Example 115200;
Returns
bool TRUE=successful, FALSE=failure

Property Documentation

IDT_K100 IDTechSDK.IDT_K100.SharedController
staticget

Singleton Instance

Establishes an singleton instance of IDT_K100 class.

Returns
Instance of IDT_K100

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