Npcp driver i/o controls – Intermec 700 User Manual

Page 225

Advertising
background image

Printer Support

Chapter 5

201

700 Series Color Mobile Computer User’s Manual

NPCP Driver I/O Controls

An application uses the DeviceIoControl() function to specify an printer
operation to be performed. Certain I/O controls are required to bind and
close communication sessions with the printer, and must be completed
before any other commands to the driver can execute properly.
The function returns TRUE to indicate the device successfully completed
its specified I/O control operation, otherwise it returns FALSE. The
following I/O control codes are defined:

#define IOCTL_NPCP_CANCEL
CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x400,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_NPCP_BIND
CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x401,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_NPCP_CLOSE
CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x402,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_NPCP_ERROR
CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x403,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_NPCP_FLUSH
CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x404,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_NPCP_IOCTL
CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x405,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_NPCP_PRTVER
CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x406,METHOD_BUFFERED,FILE_ANY_ACCESS)

S IOCTL_NPCP_CANCEL

This cancels all printing at the printer. It flushes the printer buffers and
reinitializes the printer to its default state. No parameters are required.

S IOCTL_NPCP_BIND

This command is required before any data is sent or received by the
printer. Once the driver is opened, the application must bind the com-
munications session with the printer before any data can be sent or re-
ceived by the printer. If an error occurs during the bind, the application
may use IOCTL_NPCP_ERROR to get the current extended error
code. No parameters are required.

S IOCTL_NPCP_CLOSE

This command closes the current session with the printer. This function
always returns TRUE. No parameters are required.

S IOCTL_NPCP_ERROR

This command returns the extended NPCP error code in PL/N format.
The word returned will contain the PL/N compatible error code in the
low byte and completion flags in the high byte. If the frame that re-
turned an error was not received correctly by the printer the
FRAME_NOT_ACKED bit will be set in the high byte. This operation
always returns TRUE. An output buffer of at least 2 bytes is required.
See “NPCP Error Codes” on page 203.

S IOCTL_NPCP_FLUSH

This command allows the application to poll the printer for errors while
the report is completing the print process at the printer. If an error oc-
curs during the polling process, the operation will return FALSE and
the application can get the extended error code by using
IOCTL_NPCP_ERROR. No parameters are required.

Advertising