Command values: Difference between revisions
m Ak120 moved page BIDI SEND PASSTHRU(8001h) to Command values |
No edit summary |
||
Line 1: | Line 1: | ||
==BIDI_SEND_PASSTHRU== | |||
BIDI_SEND_PASSTHRU(1h) is a protocol-specific command that can be issued to the printer. This command does not return any response data to the caller. BIDI_SEND_PASSTHRU(1h) can be sent at any time, not just during a passthru session. See BIDI_START_PASSTHRU(1Ah) for more details. | BIDI_SEND_PASSTHRU(1h) is a protocol-specific command that can be issued to the printer. This command does not return any response data to the caller. BIDI_SEND_PASSTHRU(1h) can be sent at any time, not just during a passthru session. See BIDI_START_PASSTHRU(1Ah) for more details. | ||
==BIDI_STARTJOB== | |||
BIDI_STARTJOB(2h) is called by the port driver during SplPdOpen to signal the protocol converter that the print job is starting. The port driver should use the pPrtOpenStruct parameter in SplPdOpen to derive the parameters for this command. | |||
'''Note:''' The caller of PrtSet can set the following parameters in the PRTSTARTJOB data structure: | |||
* ulSpoolerJobID - set to -1 | |||
* ulInterpreterID - set to -1 | |||
This will let the spooler fill in the values based on the current job being sent to this printer port. | |||
==BIDI_ENDJOB== | |||
BIDI_ENDJOB(3h) is called by the port driver during SplPdClose to signal the end of the print job being sent to the printer. | |||
'''Note:''' For this and all other BIDI_xx_JOB command structures, the caller of PrtSet can set the following parameters in the PRTJOB data structure: | |||
* ulInterpreterID - set to -1 | |||
* ulPrinterJobID - set to -1 | |||
This will let the spooler fill in the values based on the current job being sent to this printer port. | |||
BIDI_HOLDJOB(4h) holds a job in the printer. | |||
BIDI_RELEASEJOB(5h) releases a job held in the printer. | |||
BIDI_CANCELJOB(6h) cancels a job in the printer. | |||
For all PRT_xx_JOB commands, if the caller does not know the printer job ID, the caller can set both InterpreterID and ulPrinterJobID to -1 and pass in the spooler job ID. The spooler will set the printer job ID based on information stored about the spooler job ID. | |||
BIDI_INIT_PORTDRV(8h) initializes a port driver. This command is sent during spooler initialization and when a port driver is first installed. BIDI_INIT_PORTDRV(8h) is called only once per port driver. No other commands are sent to the port driver until this command completes. As a result, a port driver that opens network adapters has the opportunity to do so while processing the BIDI_INIT_PORTDRV(8h) command. | |||
A port driver can spawn threads at this time, if another thread is needed in order to keep the printer connection active. | |||
'''Note:''' If the port driver returns an error, the spooler may unload the port driver. No jobs will be sent to this port driver until the BIDI_INIT_PORTDRV(8h) command succeeds. | |||
BIDI_RESET(9h) resets the printer. This command resets the printer to the state defined in ulResetValue. If the printer is connected using a network card, the network card is not reset. | |||
BIDI_SHUTDOWN(Ah) releases all threads waiting for this protocol converter and port driver. This command is used to shut down the protocol converter and port driver when disabling the spooler. The command is sent first to the protocol converter to shut down the port; then the port driver is called. | |||
BIDI_INIT(Bh) sets the printer to BIDI mode and changes the printer from unidirectional to bidirectional. BIDI_INIT is called after a BIDI_TERM call to restart bidirectional printing. | |||
BIDI_TERM(Ch) sets the printer to unidrectional mode. This tells the port driver and kernel device driver the port is set to unidirectional mode. | |||
BIDI_RESPONSE_FMT(Dh) sets the format of the printer-to-host messages. The spooler queries the protocol converter with BIDI_Q_RESPONSE_FMT(8018h). The spooler then passes this information to the port driver, using BIDI_RESPONSE_FMT. This allows the port driver to determine printer response message boundaries. | |||
BIDI_PACKET_SIZE(Eh) defines the printer-to-host maximum packet size. | |||
BIDI_SET_PORTDRV(19h) stores port driver configuration data. A port driver on a client implements SplPdRemoteSetPort by calling PrtQuery(BIDI_Q_PORTDRV(8019h)). This call gets the port driver configuration from the server. Next, the port driver displays the port configuration and, if the user changes anything, updates the server's port driver settings using PrtSet(BIDI_SET_PORTDRV). | |||
BIDI_START_PASSTHRU(1Ah) starts a passthru reading session. An application or printer driver that needs to issue a passthru query to the printer, and get its response, must establish a temporary passthru session. | |||
There can be only one passthru session active for a printer port. A passthru session is necessary in order to use the BIDI_READ_PASSTHRU(8001h) command structure. The passthru session receives all data returned by the printer via BIDI_READ_PASSTHRU(8001h). After the application has received its answer(s), it must use BIDI_END_PASSTHRU(1Bh) to allow other applications or printer drivers to get a passthru session. | |||
Giving a remote control panel display to the user is an example of using a passthru session. The printer driver uses BIDI_START_PASSTHRU, then sends any printer-specific commands using BIDI_SEND_PASSTHRU(1h). Next, the printer driver waits for the printer responses using BIDI_READ_PASSTHRU(8001h) and, finally, after the query is satisfied, the printer driver must use BIDI_END_PASSTHRU(1Bh). | |||
Passthru sessions must be responsive. The protocol converter will store only the last five (5) printer messages if a passthru session is active. If a passthru session is not active for more than three (3) minutes, the session can be terminated. | |||
BIDI_END_PASSTHRU(1Bh) terminates a passthru reading session. This command releases the port's passthru session and allows another application to start a temporary passthru session. | |||
BIDI_NOTIFY_ENDJOBCONNECT(20h) notifies the port driver that a job connection is not needed. The spooler sends this command to notify the port driver that no jobs are waiting for confirmation from the printer. | |||
BIDI_NOTIFY_ENDJOBCONNECT(20h) allows the port driver to know when the spooler is not currently using the printer for print jobs. It does not imply that the spooler will not use the printer again in the near future. | |||
BIDI_NOTIFY_PORT_SELECTED(21h) notifies the port driver that the port is selected in a print object. The spooler sends this command to notify the port driver that the output port is selected by a print queue. | |||
BIDI_NOTIFY_PORT_SELECTED(21h) allows the port driver to know that the spooler has a print queue connected to this printer and that jobs may be submitted to this printer. This command can assist the port driver in determining the type of connection necessary for the printer. | |||
BIDI_NOTIFY_PORT_RELEASED(22h) notifies the port driver that the port is no longer selected in a print object. The spooler sends this command to notify the port driver that the output port is no longer connected to a print queue. BIDI_NOTIFY_PORT_SELECTED(21h) allows the port driver to know that the spooler will not be sending print jobs to this printer. | |||
The port driver should not assume that no job can be sent to this port, because an application can still print OD_DIRECT to this port. BIDI_NOTIFY_PORT_RELEASED(22h) can assist the port driver in determining the type of connection necessary for the printer. | |||
BIDI_SET_DEVICE_ID(23h) sets the printer's device ID. The protocol converter calls PrtSet with this command structure to notify the spooler of the device ID of an attached printer. | |||
BIDI_SET_DEVICE_ID(23h) is used when the port driver is unable to determine the device ID during [[BIDI_Q_PORT(800Bh)]], and allows the protocol converter to retrieve the device ID. | |||
BIDI_ENABLE_ALERT(24h) enables alerts for the printer. This command is sent as a result of an application calling SplRegister to register for alerts. The alert(s) specified are enabled, in addition to any currently enabled alerts for the printer. | |||
BIDI_DISABLE_ALERT(25h) disables alerts for the printer. This command is sent as a result of an application calling SplUnRegister to unregister for alerts. Only the alert(s) specified are disabled. | |||
BIDI_ADD_VIRTUAL_PORT(26h) adds a virtual printer port. This command is sent to the port driver to notify it that a port for querying purposes only has been added. The port driver does not know about the printer port passed into SplPdSet when BIDI_ADD_VIRTUAL_PORT(26h) is sent. | |||
BIDI_DEL_VIRTUAL_PORT(27h) deletes a virtual printer port. This command is sent to the port driver when an application calls SplDeletePort to remove a virtual port. | |||
BIDI_DEL_PORT(28h) is sent to the protocol converter and the port driver after a spooler port has been removed, even if the port driver is the application removing the port. It is not sent when a virtual port is removed. The protocol converter and port driver can free any instance data stored for the printer port. | |||
'''Note:''' Port drivers are normally called to remove a port by the print object, but any application can remove a port by updating the system .INI file. |
Revision as of 08:46, 5 February 2018
BIDI_SEND_PASSTHRU
BIDI_SEND_PASSTHRU(1h) is a protocol-specific command that can be issued to the printer. This command does not return any response data to the caller. BIDI_SEND_PASSTHRU(1h) can be sent at any time, not just during a passthru session. See BIDI_START_PASSTHRU(1Ah) for more details.
BIDI_STARTJOB
BIDI_STARTJOB(2h) is called by the port driver during SplPdOpen to signal the protocol converter that the print job is starting. The port driver should use the pPrtOpenStruct parameter in SplPdOpen to derive the parameters for this command.
Note: The caller of PrtSet can set the following parameters in the PRTSTARTJOB data structure:
- ulSpoolerJobID - set to -1
- ulInterpreterID - set to -1
This will let the spooler fill in the values based on the current job being sent to this printer port.
BIDI_ENDJOB
BIDI_ENDJOB(3h) is called by the port driver during SplPdClose to signal the end of the print job being sent to the printer.
Note: For this and all other BIDI_xx_JOB command structures, the caller of PrtSet can set the following parameters in the PRTJOB data structure:
- ulInterpreterID - set to -1
- ulPrinterJobID - set to -1
This will let the spooler fill in the values based on the current job being sent to this printer port.
BIDI_HOLDJOB(4h) holds a job in the printer.
BIDI_RELEASEJOB(5h) releases a job held in the printer.
BIDI_CANCELJOB(6h) cancels a job in the printer.
For all PRT_xx_JOB commands, if the caller does not know the printer job ID, the caller can set both InterpreterID and ulPrinterJobID to -1 and pass in the spooler job ID. The spooler will set the printer job ID based on information stored about the spooler job ID.
BIDI_INIT_PORTDRV(8h) initializes a port driver. This command is sent during spooler initialization and when a port driver is first installed. BIDI_INIT_PORTDRV(8h) is called only once per port driver. No other commands are sent to the port driver until this command completes. As a result, a port driver that opens network adapters has the opportunity to do so while processing the BIDI_INIT_PORTDRV(8h) command.
A port driver can spawn threads at this time, if another thread is needed in order to keep the printer connection active.
Note: If the port driver returns an error, the spooler may unload the port driver. No jobs will be sent to this port driver until the BIDI_INIT_PORTDRV(8h) command succeeds.
BIDI_RESET(9h) resets the printer. This command resets the printer to the state defined in ulResetValue. If the printer is connected using a network card, the network card is not reset.
BIDI_SHUTDOWN(Ah) releases all threads waiting for this protocol converter and port driver. This command is used to shut down the protocol converter and port driver when disabling the spooler. The command is sent first to the protocol converter to shut down the port; then the port driver is called.
BIDI_INIT(Bh) sets the printer to BIDI mode and changes the printer from unidirectional to bidirectional. BIDI_INIT is called after a BIDI_TERM call to restart bidirectional printing.
BIDI_TERM(Ch) sets the printer to unidrectional mode. This tells the port driver and kernel device driver the port is set to unidirectional mode.
BIDI_RESPONSE_FMT(Dh) sets the format of the printer-to-host messages. The spooler queries the protocol converter with BIDI_Q_RESPONSE_FMT(8018h). The spooler then passes this information to the port driver, using BIDI_RESPONSE_FMT. This allows the port driver to determine printer response message boundaries.
BIDI_PACKET_SIZE(Eh) defines the printer-to-host maximum packet size.
BIDI_SET_PORTDRV(19h) stores port driver configuration data. A port driver on a client implements SplPdRemoteSetPort by calling PrtQuery(BIDI_Q_PORTDRV(8019h)). This call gets the port driver configuration from the server. Next, the port driver displays the port configuration and, if the user changes anything, updates the server's port driver settings using PrtSet(BIDI_SET_PORTDRV).
BIDI_START_PASSTHRU(1Ah) starts a passthru reading session. An application or printer driver that needs to issue a passthru query to the printer, and get its response, must establish a temporary passthru session.
There can be only one passthru session active for a printer port. A passthru session is necessary in order to use the BIDI_READ_PASSTHRU(8001h) command structure. The passthru session receives all data returned by the printer via BIDI_READ_PASSTHRU(8001h). After the application has received its answer(s), it must use BIDI_END_PASSTHRU(1Bh) to allow other applications or printer drivers to get a passthru session.
Giving a remote control panel display to the user is an example of using a passthru session. The printer driver uses BIDI_START_PASSTHRU, then sends any printer-specific commands using BIDI_SEND_PASSTHRU(1h). Next, the printer driver waits for the printer responses using BIDI_READ_PASSTHRU(8001h) and, finally, after the query is satisfied, the printer driver must use BIDI_END_PASSTHRU(1Bh).
Passthru sessions must be responsive. The protocol converter will store only the last five (5) printer messages if a passthru session is active. If a passthru session is not active for more than three (3) minutes, the session can be terminated.
BIDI_END_PASSTHRU(1Bh) terminates a passthru reading session. This command releases the port's passthru session and allows another application to start a temporary passthru session.
BIDI_NOTIFY_ENDJOBCONNECT(20h) notifies the port driver that a job connection is not needed. The spooler sends this command to notify the port driver that no jobs are waiting for confirmation from the printer.
BIDI_NOTIFY_ENDJOBCONNECT(20h) allows the port driver to know when the spooler is not currently using the printer for print jobs. It does not imply that the spooler will not use the printer again in the near future.
BIDI_NOTIFY_PORT_SELECTED(21h) notifies the port driver that the port is selected in a print object. The spooler sends this command to notify the port driver that the output port is selected by a print queue.
BIDI_NOTIFY_PORT_SELECTED(21h) allows the port driver to know that the spooler has a print queue connected to this printer and that jobs may be submitted to this printer. This command can assist the port driver in determining the type of connection necessary for the printer.
BIDI_NOTIFY_PORT_RELEASED(22h) notifies the port driver that the port is no longer selected in a print object. The spooler sends this command to notify the port driver that the output port is no longer connected to a print queue. BIDI_NOTIFY_PORT_SELECTED(21h) allows the port driver to know that the spooler will not be sending print jobs to this printer.
The port driver should not assume that no job can be sent to this port, because an application can still print OD_DIRECT to this port. BIDI_NOTIFY_PORT_RELEASED(22h) can assist the port driver in determining the type of connection necessary for the printer.
BIDI_SET_DEVICE_ID(23h) sets the printer's device ID. The protocol converter calls PrtSet with this command structure to notify the spooler of the device ID of an attached printer.
BIDI_SET_DEVICE_ID(23h) is used when the port driver is unable to determine the device ID during BIDI_Q_PORT(800Bh), and allows the protocol converter to retrieve the device ID.
BIDI_ENABLE_ALERT(24h) enables alerts for the printer. This command is sent as a result of an application calling SplRegister to register for alerts. The alert(s) specified are enabled, in addition to any currently enabled alerts for the printer.
BIDI_DISABLE_ALERT(25h) disables alerts for the printer. This command is sent as a result of an application calling SplUnRegister to unregister for alerts. Only the alert(s) specified are disabled.
BIDI_ADD_VIRTUAL_PORT(26h) adds a virtual printer port. This command is sent to the port driver to notify it that a port for querying purposes only has been added. The port driver does not know about the printer port passed into SplPdSet when BIDI_ADD_VIRTUAL_PORT(26h) is sent.
BIDI_DEL_VIRTUAL_PORT(27h) deletes a virtual printer port. This command is sent to the port driver when an application calls SplDeletePort to remove a virtual port.
BIDI_DEL_PORT(28h) is sent to the protocol converter and the port driver after a spooler port has been removed, even if the port driver is the application removing the port. It is not sent when a virtual port is removed. The protocol converter and port driver can free any instance data stored for the printer port.
Note: Port drivers are normally called to remove a port by the print object, but any application can remove a port by updating the system .INI file.