Signaling printer status from a filter

Josh Mathis josh.m at swecoinus.com
Mon May 1 07:12:14 PDT 2006


Hello Mike,

Thanks for the information. As I was doing some more reading about these 
new functions in v1.2, I a little about a port monitor. This sounds like 
it would be even more ideal, since it can do periodic polling in the 
background, rather than just during a print job when the other filter is 
active, giving me momentary rather than historic status. Is that 
correct? It seems like an idea similar to the Language Monitor in 
Windows printing. I was unable to find any documentation about the port 
monitor, other than it exists.

Basically, what is the port monitor? Are there any samples available?
How do they interact with the core CUPS system and other 
filters/backends? Any information would help.

Thanks
Josh

Michael Sweet wrote:
> Josh Mathis wrote:
>> With the backchannel support in v1.2, I would like to add 
>> vendor-specific printer status support. I can get my appropriate 
>> status via the backchannel write/read functions, but what do I do with 
>> this info? For example, if my printer returns hex 15 01, then that 
>> means I have a paper jam. How do I cancel my current job and then tell 
>> CUPS that I have a paper jam? I didn't see anything particularly 
>> helpful in the documentation. If it is in the docs, please point me 
>> there, I'm not afraid to read!
> 
> Normally you don't want to cancel a job for this type of error, just
> wait until the condition is cleared and continue.
> 
> If you exit from a filter, the job will be cancelled.  If you exit from
> a backend, you can use the backend exit codes defined in
> <cups/backend.h> to control the disposition of the job.
> 
>> Also, if it turns out that I can signal errors like paper jam, paper 
>> out, etc, can I also send vendor-specific status information, or am I 
>> limited to a few general printer status messages?
> 
> Send STATE: messages to signal new printer-state-reasons keywords,
> and ERROR: messages to provide alternate human-readable text.
> 
> For example, you can use:
> 
>     fputs("STATE: +media-jam-error\n", stderr);
>     fputs("ERROR: Paper jam!\n", stderr);
> 
> to signal a paper jam and provide a human-readable message.
> 
> Once the jam is resolved, use:
> 
>     fputs("STATE: -media-jam-error\n", stderr);
>     fputs("INFO: Resuming print job...\n", stderr);
> 
> to clear the media-jam-error reason and continue with the job.
> 
> RFC 2911 lists the standard keywords supported by IPP, and you can
> use vendor keywords of the form "com.vendor.keyword" for custom
> conditions.  In addition, you can add cupsIPPReason keywords to
> your PPD file to provide human-readable messages for the keywords;
> these are described in the CUPS PPD Extensions help document
> available at "http://localhost:631/help/spec-ppd.html".
> 




More information about the cups mailing list