[cups.general] reading data from raw printer

Johannes Meixner jsmeix at suse.de
Tue Jul 3 02:40:53 PDT 2007


Hello,

On Jun 29 14:56 Moritz von Schweinitz wrote (shortened):
> I'm using cups (with a lot of success) to drive a lot of point-of-sale
> printers (Epson TMU-200) using the raw-text mode. I open the attached
> cash-drawers sending binary commands to the printer.
> I was asked whether i can implement the option that the point-of-sale
> software 'blocks' for as long as the cash-drawer is open.
> These cash-drawers are usually connected to printers, and when sending
> a special command to the printer, the printer sends back a status code
> that indicates whether the cash-drawer is open or closed, and this is
> relatvely easy to implement when talking directly to the serial port.
> But i'd like to do this over cups. Is this possible?
> Something ins the spirit of:
> $open = `echo $send_status_command | cups -P tmu200`
> ?
> 
> How can i read information from a printer?

It is the CUPS backend which talks directly to the printer, see
the CUPS documentation and "man backend" and
http://en.opensuse.org/SDB:CUPS_in_a_Nutshell

Therefore it is the backend which can read information from a printer.

To do special stuff you would have to write your own backend.
E.g. don't use the generic "serial" backend but use your own
special "myserial" backend which does exactly what you like.

But I don't understand how the CUPS backend (which runs usually
under the user "lp") should communicate with the point-of-sale
software (which runs under whatever user) and how the backend
should let the point-of-sale software "block".

As far as I see, all what the backend could do is not to finish
as long as the cash-drawer is open (i.e. after the print data
has been sent to the printer, the backend could query the printer
in a loop until the cash-drawer is closed) and what the point-of-sale
software could do is to query the print job status and "block" as
long as the print job is not finished (i.e. as long as the backend
didn't finish).


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex





More information about the cups mailing list