Backchannel usage
Michael Sweet
mike at easysw.com
Mon May 22 10:39:46 PDT 2006
Josh Mathis wrote:
> I am trying to add some simple status support into my filter. Before the
> print data of a job is sent, I attempt to send a status request (escape
> command) and then read a two-byte response. However, the function
> always fails (return -1).
>
> To do a basic test, I changed the filter to only send a 3-byte status
> request with printf, just like normal print data, then read the 2-byte
> response with cupsBackChannelRead, then exit the job. However, the read
> always times out and returns -1. I have confirmed that the printer is
> receiving the status request, but it seems that the backend is not
> picking up the response.
>
> Here is what I am doing:
>
> char backbuffer[1024]; //buffer for returned data
> printf("\x1b\x05\x06"); //send status request
Add a fflush(stdout) call here, otherwise your printf output will
not actually get sent to the printer... :)
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
More information about the cups
mailing list