[cups.development] How are the command filters supposed to return data?

Tim Waugh twaugh at redhat.com
Tue Jul 13 09:05:34 PDT 2010


On Tue, 2010-07-13 at 05:41 -0700, Reinhold Kainhofer wrote:
> However, I could not find any documentation how this response will be handled by CUPS... What do I have to do to properly implement the ReportLevels? In particular, the Ink/Toner tab of system-config-printer says "Marker levels are not reported for this printer."
> However, the ppd file contains:
> *cupsFilter:    "application/vnd.cups-command 100 commandtopjl"
> *cupsCommands: "PrintSelfTestPage ReportLevels"
> 
> If I do a "Refresh", the above communication with the printer happens, but no levels are shown. Apparently, the response by the printer is not properly handled by cups by default (of course, how can it, given that every printer responds in a different format...).
> 
> So, what do I have to do to handle the response properly???

The filter needs to interpret the response from the printer and
communicate the ink levels to CUPS like this:

fprintf (stderr, "ATTR: marker-names=%s,%s,%s\n", names);
fprintf (stderr, "ATTR: marker-colors=%s,%s,%s\n", colors);
fprintf (stderr, "ATTR: marker-levels=%d,%d,%d\n", levels);
etc.

> The commandtops filter strangely does nothing in the ReportLevels target, but has a comment
>  /*
>   * Don't bother sending any additional PostScript commands, since we just
>   * want the backend to have enough time to collect the supply info.
>   */
> 
> This is even more confusing to me, since the backend is only about a transport means, not about a particular protocol...

For network-aware PostScript printers, the ipp/socket/lpd backends using
SNMP to collect marker level information.

See backend/snmp-supplies.c:backendSNMPSupplies() in the source for an
example of how to report marker levels to CUPS.  This is the code used
by the network backends.

Tim.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <https://lists.cups.org/pipermail/cups/attachments/20100713/92bf0edf/attachment.bin>


More information about the cups mailing list