There are two strategies for estalishing instances to the classes. There is a single-device project, and there could be a multi-device project.
A single device project is meant for an application that will only target a single IDTech device. A multi-device project would be expected to switch between different IDTech devices.
The SDK is made up of a class for for each device. In addition, there is the main class file "IDT_Device". The "IDT_Device" class is the main class for executing all API calls on all devices. The individual device class files ("IDT_VP3300", "IDT_MiniSmartII") contain the API calls that are meant just for that device. The individual device class files call the API methods in IDT_Device class. Think of the individual device class files as a filter of what can be executed in the IDT_Device class.
The pros of using an individual device class for executing all commands:
- It defines the target device automatically
- It filters out commands only applicable to that device The cons of using an individual device class:
- You cannot use any other devices with your application
The pros of using IDT_Device class for executing all commands:
- You can switch between different devices and still use the same API command The cons of using IDT_Device class for executing all commands:
- You must explicity tell the SDK which device you want to talk to first
- There are many commands in IDT_Device not applicable to all devices, causing potential confusion.
Examples:
Getting Firmware Version from VP3300 using it's individual device class
string firmwareVersion = "";
RETURN_CODE rt = IDT_VP3300.SharedController.device_getFirmwareVersion(ref firmwareVersion);
Getting Firmware Version from VP3300 and UniPay 1.5 using IDT_Device device class
string firmwareVersion = "";
IDT_Device.setDeviceType(IDT_DEVICE_Types.IDT_DEVICE_VP3300, DEVICE_INTERFACE_Types.DEVICE_INTERFACE_USB);
RETURN_CODE rt = IDT_Device.SharedController.device_getFirmwareVersion(ref firmwareVersion);
IDT_Device.setDeviceType(IDT_DEVICE_Types.IDT_DEVICE_UNIPAYI_V, DEVICE_INTERFACE_Types.DEVICE_INTERFACE_USB);
rt = IDT_Device.SharedController.device_getFirmwareVersion(ref firmwareVersion);
When you execute "setDeviceType", you must pass, as a minimum, the Device Type, and also the Interface.
Device Types:
public enum IDT_DEVICE_Types
{
IDT_DEVICE_NONE = -1,
IDT_DEVICE_BTPAY = 0,
IDT_DEVICE_BTMAG = 1,
IDT_DEVICE_UNIPAY = 2,
IDT_DEVICE_UNIPAYI_V = 3,
IDT_DEVICE_UNIMAG = 4,
IDT_DEVICE_SPECTRUM_PRO = 5,
IDT_DEVICE_MINISMARTII = 6,
IDT_DEVICE_AUGUSTA = 7,
IDT_DEVICE_AUGUSTA_KB = 8,
IDT_DEVICE_KIOSKIII = 9,
IDT_DEVICE_CM100 = 10,
IDT_DEVICE_VENDI = 11,
IDT_DEVICE_L100 = 12,
IDT_DEVICE_VENDIII = 13,
IDT_DEVICE_VP3300 = 14,
IDT_DEVICE_VP8800 = 15,
IDT_DEVICE_SECUREMAG = 16,
IDT_DEVICE_BTPAY_MINI = 17,
IDT_DEVICE_K100 = 18,
IDT_DEVICE_NEO2 = 19,
IDT_DEVICE_TMS = 20,
IDT_DEVICE_SECUREKEY = 21,
IDT_DEVICE_SREDKEY2 = 22,
IDT_DEVICE_PIP = 23,
COUNT = 24
}
Interfaces (only available interfaces will be USB, Serial, IP):
public enum DEVICE_INTERFACE_Types
{
DEVICE_INTERFACE_UNKNOWN = 0,
DEVICE_INTERFACE_AUDIO_JACK = 1,
DEVICE_INTERFACE_USB = 2,
DEVICE_INTERFACE_BLE = 3,
DEVICE_INTERFACE_SERIAL = 4,
DEVICE_INTERFACE_BT = 5,
DEVICE_INTERFACE_IP = 6
}
In this document, most all code example will be using IDT_NEO2 class, but be aware that can be substituted for and another individual device class, or the IDT_Device class.
The API reference lists the commands available for each device. The IDT_Device class is not listed in this API reference. Please refer to an individual device class reference when working with IDT_Device class methods.