Backchannel usage
Josh Mathis
josh.m at swecoinus.com
Mon May 22 08:56:17 PDT 2006
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
count = cupsBackChannelRead(backbuffer, 2, 5); //read 2 bytes from the
backchannel
fprintf(stderr, "***** Read %i backchannel bytes*****\n", count);
I have a feeling I am not understanding the whole backchannel process.
One thing I can think of - the printer generates its status message and
places it in the parallel output buffer to be read - it does not
proactively write the data back to the PC. Is this the culprit, or does
the parallel backend issue a read?
Thanks,
Josh Mathis
More information about the cups-devel
mailing list