Unix Programming - Reading output for printer

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > January 2004 > Reading output for printer





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Reading output for printer
Peteris Krumins

2004-01-23, 5:33 pm


Hello,

I am interested how to read data from a 3rd party device which
has Parallel port output and outputs data for printer.
(that is, if i connect a printer to it, the printer would print
everything the device outputs).

I have to do the same, just read the data in my program.
I have finished the program, hoping, the data would be easly read
(fopen("/dev/lp0","r"), then just select()ing and waiting fd to
unblock) after loading the appropriate, parallel port
(parport, parport_pc) drivers and lp driver but it is not that
easy..

I have tried connecting the device to computers Parallel port,
both with serial and null cabels but unfortunately i was not able
to get anything read.
(I tried reading /dev/lp0, both when lp driver was in polling and
interrupt driven modes)

Could anyone help me how to get it done? What should be done
to read the data coming from a special device which outputs
data via Parallel port for a printer?
Maybe if i connected
DB25 (to the special device) -> DB9 (serial, to pc) it could be done?

(talking about linux, tho if it could be done under BSDs, i'd also
appriciate your suggestion(s))


Thanks,
P.Krumins
Michael B Allen

2004-01-23, 5:33 pm

On Mon, 22 Dec 2003 15:51:04 -0500, Peteris Krumins wrote:

quote:

> Hello,
>
> I am interested how to read data from a 3rd party device which has
> Parallel port output and outputs data for printer. (that is, if i
> connect a printer to it, the printer would print
> everything the device outputs).
>
> I have to do the same, just read the data in my program.



Get kermit and get it to read the data. Then use lsof, strace, etc to
determine what it's doing and then emulate that. Also kermit has some
automation capability.

Mike
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com