## Printer Device Driver

[prev][next][parent][TOC]

### Bidirectional Protocol Converters

A protocol converter is responsible for generating the commands to issue to the printer and for being able to interpret data sent by the printer.

The spooler(PMSPL.DLL) exports two new entry points, as does each bidirectional protocol converter:

SplProtSendCmd-route generic Query or Set request to bidirectional- software protocol-specific converter to create command, send command to printer, and wait for printer response.

SplProtXlateCmd-convert printer to host message into generic bidirectional command/response packets.

Protocol converters may optionally export SplProtWrite if they need to wrap print job data in a bidirectional-software protocol header.

The spooler handles all inter-process communication for the protocol converter. All calls for sending print jobs, querying, or setting printer configurations are done from the single spooler process.

See the OS/2 Presentation Device Driver Reference for detailed information on these APIs, their syntax, and their parameters.

SplProtSendCmd Called by PrtQuery, PrtSet, SplPdQuery, or SplPdSet to convert generic commands and pass bidirectional protocol-specific commands to the printer.

SplProtXlateCmd Called only by port drivers when processing the BIDI_WAIT_ ALERT(8016h) command to convert a protocol specific message received from the printer into a generic command structure that can be used by the port driver and spooler.

SplProtWrite Optional API called by PrtWrite to put a bidirectional protocol wrapper around print data being sent to the printer.