USB Bidi Extender
During printing, writes are blocked by the print job data, so the getStatus method is used to obtain unsolicited status from the device, using only the read channel. But if the device supports a secondary USB interface, then the requestStatus method function is used to obtain status from a printer while the device is printing.
The following diagram provides an overview of the USB Bidi extension architecture, showing the scenario where the getStatus method is used to obtain unsolicited status from the device via the USBPrint interface.
For more information about working with a USB printer, see USB Printing.
USB Bidi extender API reference
USBMon Bidi extension XML schema
The USBMon Bidi Extension file uses the same basic structure as the SNMP Bidi Extension file and the WSDMon Bidi Extension file. The XML schema file is published in the Windows Driver Kit and USBMon Bidi extension files will be automatically schema-validated during the INFGate WHCK test. When you're developing a Bidi extension schema and working with the USB bus, it is important to note the following information:
Values may specify an accessType of either Get, Set, or GetSet. This indicates where the described schema element is supported in the Bidi Get or Set operation types.
Values may specify a queryKey. This should be used to denote the physical operations used to obtain data from your device. The Print driver USB monitor and Bidi sample demonstrates a USB device that supports two different queryKeys. All properties under the same queryKey should be retrievable in one USB read/write operation.
Bidi values are immediately polled if they are requested in a Bidi API call. The refreshInterval value is the initial value that indicates when to poll the device for updates on a particular Bidi schema value. After each poll, the refreshInterval increases until we stop polling. The following formula shows how refreshInterval is incremented:
currentRefreshInterval = refreshInterval * (3 * numPolls);
USBMon and USB Bidi extension file interaction
Windows driver samples on GitHub
USBMon Bidi XML File Sample - this provides a sample of a USBMon Bidi Extension XML file. It uses the standard Bidi schema properties DeviceInfo, Configuration, and Memory and also defines a few custom extensions. For more information, see Print driver USB monitor and Bidi sample.
And for more information about Bidi extension files, see Bidirectional Communication Schema.
Key Name: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print
After the registry key shown in preceding section is created, and the hosting process has been restarted, the script can be debugged as follows:
Set the debugger to script debugging mode.
Select Break All (Ctrl + Alt + Break) to break into the process the next time a script runs.
Run the scenario to reproduce your issue.