66
Appendix A. Sample C++ Cash Drawer Code for Windows
NOTE:
Requires installation of System Driver. Refer to the System Driver Installation
section for instructions.
//1. Open Cash Drawer
// IOCTL Codes
#define
GPD_TYPE 40000
#define
ADV_OPEN_CTL_CODE
CTL_CODE(GPD_TYPE, 0x900, METHOD_BUFFERED,
FILE_ANY_ACCESS)
#define
ADV_STATUS_CTL_CODE
CTL_CODE(GPD_TYPE, 0x901, METHOD_BUFFERED,
FILE_ANY_ACCESS)
void
OpenDrawer(UCHAR uWhichDrawer)
{
// uWhichDrawer = 1 => CD#1, uWhichDrawer = 2 => CD#2
HANDLE hFile;
BOOL bRet;
UCHAR uDrawer = uWhichDrawer;
// Open the driver
hFile = CreateFile(
"\\\\.\\ADVSYS"
,GENERIC_WRITE | GENERIC_READ,FILE_SHARE_READ |
FILE_SHARE_WRITE, NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if
(m_hFile == INVALID_HANDLE_VALUE)
{
AfxMessageBox(
"Unable to open Cash Drawer Device Driver!"
);
return
;
}
// Turn on the Cash Drawer Output (Fire the required solenoid)
bRet = DeviceIoControl(hFile, ADV_OPEN_CTL_CODE, &uDrawer,
sizeof
(uDrawer), NULL, 0, &ulBytesReturned,
NULL);
if
(bRet == FALSE || ulBytesReturned != 1)
{
AfxMessageBox(
"Failed to write to cash drawer driver"
);
CloseHandle(hFile);
return
;
}
CloseHandle(hFile);
}
//2. Get Cash Drawer Status
void
GetDrawerState()
{
HANDLE hFile;
BOOL bRet;
// Open the driver
hFile = CreateFile(TEXT(
"\\\\.\\ADVSYS"
),GENERIC_WRITE | GENERIC_READ,FILE_SHARE_READ |
FILE_SHARE_WRITE, NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if
(m_hFile == INVALID_HANDLE_VALUE)
{
AfxMessageBox(
"Unable to open Cash Drawer Device Driver!"
);
return
;
}
// Read the CD status
Summary of Contents for EP-55XX-AR10
Page 14: ...7 EP 55XX Series with 8 9 2nd Display Dimensions Unit mm...
Page 42: ...35 Jumper and Connector Locations of PEB 973D For EP 55XX AR20...
Page 46: ...39 Jumper and Connector Locations of INS8313B and GA D525E C6 For EP 55XX AR30 40...
Page 62: ...55 8 When installation is complete the WLAN utility will automatically appear on the desktop...
Page 71: ...64 7 Click Finish on the Installation Complete screen...