How are the command filters supposed to return data?

Reinhold Kainhofer reinhold at kainhofer.com
Tue Jul 13 05:41:53 PDT 2010


I'm now also looking into supporting the command filters for my Konica-Minolta magicolor MF1690. The printer is connected via the network, using socket://10.0.0.5:9100 as URI. The communication works via a PJL job.

So, I have now started my own commandtopjl script, which sends the appropriate commands to the printer, and the printer responds. For example, the "ReportLevels" command is implemented as:

    else if (strncasecmp(lineptr, "ReportLevels", 12) == 0)
    {
     /*
      * Report ink levels...
      */

      pwrite("\033%-12345X at PJL INFO DSTATUS\015\012", 28);
      pwrite("\033%-12345X", 9);
    }

And the communication is:

-) Sent to printer
.%-12345X at PJL INFO DSTATUS
.%-12345X

-) Printer response (obtained using wireshark):
@PJL INFO DSTATUS
CODE=600100
CONSUMETONERK=15
CONSUMETONERC=12
CONSUMETONERM=20
CONSUMETONERY=20
CONSUMETRSBELT=1
CONSUMEFUSER=0
CONSUMETONERTYPEK=1000
CONSUMETONERTYPEC=0500
CONSUMETONERTYPEM=0500
CONSUMETONERTYPEY=0500
CONSUMETONERINSTALLK=YES
CONSUMETONERINSTALLC=YES
CONSUMETONERINSTALLM=YES
CONSUMETONERINSTALLY=YES
. 


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 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...

Thanks,
Reinhold




More information about the cups-devel mailing list