IDTech Windows SDK Guide  1.1.178.0 / NuGet 2.0.1.13
API reference for SREDKey2
Implement the callback function

There is a single method that will receive all callback information from the SDK. It uses DeviceState to determine which action to take.

private void MessageCallBack(IDTechSDK.IDT_DEVICE_Types type, DeviceState state, byte[] data, IDTTransactionData cardData, EMV_Callback emvCallback, RETURN_CODE transactionResultCode)
{
switch (state)
{
case DeviceState.DefaultDeviceTypeChange:
//The SDK is changing the default device to IDT_DEVICE_TYPES type
break;
case DeviceState.Connected:
//A connection has been made to IDT_DEVICE_TYPES type
break;
case DeviceState.Disconnected:
//A disconnection has occured with IDT_DEVICE_TYPES type
break;
case DeviceState.DataReceived:
//Low-level data received for IDT_DEVICE_TYPES type
break;
case DeviceState.DataSent:
//Low-level data sent for IDT_DEVICE_TYPES type
break;
case DeviceState.TransactionData:
//This will capture the cardData object from keypad entry or card swipe when device is in USB-HID Mode
//If the device is in USB-KB Mode, the transaction data will be output through the keyboard buffer
break;
default:
break;
}
}