-
2.6 Returns the system error code
Function Description:
Returns the system error code, which is returned by GetLastError. It will also return the description
of the error in buffer if it is not NULL.
Function call:
DWORD
USI_GetLastSysError
(
LPTSTR
buffer
,
int
len
);
Parameter: (output)
buffer:
LPTSTR:
Data buffer for error message
len:
int:
Length of error message.
Return:
Returns the system error code, which is returned by system function GetLastError. It will also return
the description of the error in buffer retrieved by system function FormatMessage if it is not NULL.
For a complete list of error codes, refer to the SDK header file WINERROR.H.
2.7 Get scan data
Function Description:
Retrieves the scan data into the buffer. Returns the length of characters. It also returns the barcode
type if type is not NULL. Return 0 means that the buffer is too short to hold the data.
USI_GetData should be called when SM_DATAREADY message is received. Or call
USI_ResetData to discard the data. Both of them will reset the data buffer so that next scan data
can come in.
If the data buffer is not empty and a new scan data occurs, it will be discarded and an error
message SM_ERROR with code of SERR_DATALOST will be sent.
Function call:
UINT
USI_GetData
(
LPBYTE
buffer
,
UINT
len
,
UINT
*
type
);
Parameter: (input)
len :
UINT:
Len specifies the maximum length of the buffer.
Parameter: (output)
buffer:
LPBYTE:
Data buffer for storing scanned data
type:
UINT:
barcode type which is defined on USI.H.
Please refer to below list
BCT_CODE_39 //
Code
39
BCT_CODABAR //
CodaBar
BCT_CODE_128 //
Code
128
BCT_INTERLEAVED_2OF5
// Interleaves 2 of 5
BCT_CODE_93 //
Code
93
BCT_UPC_A
// UPC A
BCT_UPC_A_2SUPPS
// UPC A with 2 Supps
BCT_UPC_A_5SUPPS
// UPC A with 5 Supps
BCT_UPC_E0
// UPC E
BCT_UPC_E0_2SUPPS
// UPC E with 2 Supps
BCT_UPC_E0_5SUPPS
// UPC E with 5 Supps
BCT_EAN_8
// EAN 8
BCT_EAN_8_2SUPPS
// EAN 8 with 2 Supps
BCT_EAN_8_5SUPPS
// EAN 8 with 5 Supps
BCT_EAN_13
// EAN 13
BCT_EAN_13_2SUPPS
// EAN 13 with 2 Supps
BCT_EAN_13_5SUPPS
// EAN 13 with 5 Supps
BCT_MSI_PLESSEY
// MSI Plessey