M500 USER MANUAL AND PROGRAMMER SDK
Page 25
The C# API
M500_BC
structure contains a 2D data structure.
unsafe
public
struct
M500_BC
{
public
BC_1D
d1;
// 1D (linear)
public
BC_2D
d2;
// 2D (PDF417)
public
int
iMajor;
public
int
iMinor;
public
int
iOrient;
// Orientation
public
int
iTry;
public
fixed
byte
cModel[8];
}
If the PDF417 barcode is found the iOrient element will
The
iOrient
element has four enumerated values of the card orinetation and zero for unknown.
0 = Unknown orientation
1 = Normal orientation (Front of card is on the right).
2 = Front on the right but upside down.
3 = Front is on the left.
4 = Front is on the left and upside down.
The main element of the 2D barcode structure is the length (zero if not decoded).
unsafe
public
struct
BC_2D
{
public
short
nLen;
// Length
…
}
After getting the barcode call back check the length to determine if the data is valid. For example, to
check if the PDF417 data was decoded check the length in “
nLen
”
.
m_BC.d2.nLen
// Length of valid data in aryP417
The C# API
M500_
DATA
structure has byte arrays to access the PDF417 and mag stripe data.
Check “
nLen
” to determine the number of valid bytes.
public
struct
M500_DATA
{
public
byte
[]
aryP417
; // Byte array to PDF417
public
byte
[]
aryT1
;
// Byte array to magnetic track 1
public
byte
[]
aryT2
;
// Byte array to magnetic track 2
public
byte
[]
aryT3
;
// Byte array to magnetic track 3
}