Backchannel usage

Josh Mathis josh.m at swecoinus.com
Mon May 22 11:04:20 PDT 2006


Thanks for the reminder. I added that. Unfortunately, I still get the 
same result. I tried my printer's debug mode where it prints (in hex) 
all the data sent to it and it seems that the printf is getting to the 
printer. A separate command line utility shows that the printer is 
responding to status inquiries correctly, but my backchannel read still 
returns -1.

Thanks again.
-Josh

Michael Sweet wrote:
> 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... :)
> 




More information about the cups mailing list