Operation Manual

Printer SupportChapter 5
167700 Series Color Mobile Computer User’s Manual
O’Neil Printer Driver
The DTR printer communications driver is a Stream Device Driv er
named ONEIL.DLL.
All applications use WIN32 API functions to access drivers. Applications
easily implement basic operations using the CreateFile(), WriteFile(),
DeviceIOControl() and CloseHandle() Win32 APIs.
The driver supports communications to 6804DM, 6804T, 6805A, 6806,
6808, 681T, PB20, and PB42 printers over a selected serial port.
DTR Driver Installation and Removal
Your application must use the RegisterDevice() function to install the
ONEIL.DDL device driver. Use “DTR” for the Device Name parameter,
“1” for the Device Driver index parameter, and any of these strings for the
last parameter:
S NULL (==0) Def aults to COM1 @ 9600
S “COM1” only COM port specified defaults to 9600
S “COM1:9600” sets to COM port and specified bit rate
S “COM1:19200” sets to COM port and specified bit rate
Use the HANDLE returned by RegisterDev ice() as the parameter to
DeregisterDevice(). The correct usage of the RegisterDevice() function call
is shown below. You may use DeregisterDevice() to uninstall the driver.
Install()
{
HANDLE hDevice;
TCHAR port[6];
port[0] = TCHAR(‘C’);
port[1] = TCHAR(‘O’);
port[2] = TCHAR(‘M’);
port[3] = TCHAR(‘1’);
port[4] = TCHAR(‘:’);
port[5] = TCHAR(0);
hDevice = RegisterDevice ( (TEXT(”DTR”), 1, TEXT(”\\WINDOWS\\ONEIL.DLL”),
(DWORD)port);
}
Opening the DTR Driver
The application opens the DTR driver by using the CreateFile() function.
The call can be implemented as follows:
hFile = CreateFile(_T(”DTR1:”), GENERIC_WRITE, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
The first parameter “DTR1:” must reflect the device name and index used
in the RegisterDevice() f unction call.