6.6 Sample Project Tutorial
21
break
;
case
DeviceState.CommandTimeout:
SetOutputText(
"Callback:CommandTimeout
\
n"
);
//Command timeout has occurred for IDT_DEVICE_TYPES type
break
;
case
DeviceState.ToSwipe:
//Awaiting a swipe for IDT_DEVICE_TYPES type
SetOutputText(
"Callback:ToSwipe
\
n"
);
break
;
case
DeviceState.MSRDecodeError:
//Awaiting a swipe for IDT_DEVICE_TYPES type
SetOutputText(
"Callback:MSRDecodeError
\
n"
);
break
;
case
DeviceState.ToTap:
//Awaiting a contactless tap for IDT_DEVICE_TYPES type
SetOutputText(
"Callback:ToTap
\
n"
);
break
;
case
DeviceState.SwipeTimeout:
//Waiting for swipe timed out
SetOutputText(
"Callback:SwipeTimeout
\
n"
);
break
;
case
DeviceState.TransactionCancelled:
//Transaction has been cancelled
SetOutputText(
"Callback:TransactionCancelled
\
n"
);
break
;
case
DeviceState.EMVTimeout:
//Waiting for EMV transaction to complete timed out
SetOutputText(
"Callback:EMVTimeout
\
n"
);
break
;
case
DeviceState.TransactionFailed:
//Transaction failed to complete
SetOutputText(
"Callback:TransactionFailed
\
n"
);
break
;
case
DeviceState.EMVCallback:
//Callback during EMV transaction retrieved from EMV_Callback emvCallback
SetOutputText(
"Callback:EMVCallback
\
n"
);
break
;
default
:
break
;
}
}
private
void
displayCardData(IDTTransactionData cardData)
{
string
text =
""
;
if
(cardData.Event == EVENT_TRANSACTION_DATA_Types.EVENT_TRANSACTION_DATA_CARD_DATA)
{
SetOutputText(
"Data received: (Length ["
+ cardData.msr_rawData.Length.ToString() +
"])
\
n"
+
string
.Concat(cardData.msr_rawData.ToArray().Select(b => b.ToString(
"X2"
)).ToArray()) +
"
\
r
\
n"
);
"Data received: (Length ["
+ cardData.msr_rawData.Length.
ToString() +
"])
\
n"
+
string
.Concat(cardData.msr_rawData.ToArray().Select(b => b.ToString(
"X2"
)).ToArray()))
;
}
if
(cardData.device_RSN != null && cardData.device_RSN.Length > 0)
text +=
"Serial Number: "
+ cardData.devi
"
\
r
\
n"
;
if
(cardData.msr_track1Length > 0)
text +=
"Track 1: "
+ cardData.msr_
"
\
r
\
n"
;
if
(cardData.msr_encTrack1 != null)
text +=
"Track 1 Encrypted: "
+ Common.getHexStringFromBytes(cardData.msr_encTrack1) +
"
\
r
\
n"
;
if
(cardData.msr_hashTrack1 != null)
text +=
"Track 1 Hash: "
+ Common.getHexStringFromBytes(cardData.msr_hashTrack1) +
"
\
r
\
n"
;
if
(cardData.msr_track2Length > 0)
text +=
"Track 2: "
+ cardData.msr_
"
\
r
\
n"
;
if
(cardData.msr_encTrack2 != null)
text +=
"Track 2 Encrypted: "
+ Common.getHexStringFromBytes(cardData.msr_encTrack2) +
"
\
r
\
n"
;
IDTech Windows SDK Guide for Kiosk III/IV #80136501-001