ZLP For Printers Over USB RRS feed

  • Question

  • Hi:

    My understanding of the USB protocol spec is that if at the end of a bulk transfer the last packet was exactly wMaxPacketSize (64 bytes for our full speed implimentation) that an additional zero length packet must be sent:

    Compliant USB 2.0/1.1 drivers must transmit packets of maximum size (wMaxPacketSize) and then either end the transmission by means of a packet of less than maximum size, or delimit the end of the transmission by means of a zero-length packet. The transmission is not complete until the driver sends a packet smaller than wMaxPacketSize. If the transfer size is an exact multiple of the maximum, the driver must send a zero-length delimiting packet to explicitly terminate the transfer

    Delimiting the data transmission with zero-length packets, as required by the USB specification, is the responsibility of the device driver. The system USB stack will not generate these packets automatically.

    My question is for printers - does the USB Port Monitor keep track of the packets and then send a zero length packet in the EndDocPort handler if the last sent packet was exactly the maximum number of bytes?  Or is that something the printer Language Monitor supposed to keep track of?  If the LM is supposed to keep track of it - what happens in the case where bidirectional communication is disabled (i.e. the LM is not called)?  If it is the responsibility of the LM how can the LM tell the PM to send the zero length packet?  I tried calling the PM WritePort with a length of zero in the LM EndDocPort handler but a zero length packet was not sent.  Specifically I tried this is on XP, but the same issue is present on Win7 (haven't tested on Win8).


    Dale Ziebarth HID Global / Fargo

    Wednesday, April 24, 2013 8:05 PM