Update:
Everyone, FYI: here's what I've ended up doing (for now) just to get by:
I'm using a Belkin F5U002 USB to parallel adapter cable and a
Panasonic KX-P1150 dot-matrix printer. With the printer.o module
installed (thanks to Kevin) I can simply plug the cable in (as Yan
suggested) and the printer (or more accurately the CABLE) magically
appears as /dev/usb/lp0. That's the interesting part: whether or not
the printer is plugged in or on-line, the system thinks there's a
printer at /dev/usb/lp0 as long as the cable is plugged in.
>From my C program I'm simply writing my report output to a file
(pr_out.txt) then using the system "cat" command to send it to the
printer:
ret = system("cat pr_out.txt > /dev/usb/lp0");
This works like a charm, except for one little thing; if the printer
is turned off my program hangs (the system call never returns) until
the printer is turned on. After a few seconds a message appears on
the console saying that lp0 is offline. There MUST be a way for me to
obtain this information from within my program but I just don't know
how. I've looked at fork() and wait() and several other system calls
but I can't figure out how to use them.
I can test for the presence of /dev/usb/lp0 before I try to send
anything to the printer but as I said above, that only tells me that
the CABLE is there, not the printer.
If anyone knows how I could get a signal back from this system call
(or some other system call that would work better) I'd very much
appreciate your input. I'm just SO close to getting this thing done.
We'd still like to pursue the option of using an ink jet in the future
(or at least find out if it is even POSSIBLE). I've tried to enlist
T.S. to help me with this whole printer issue and offered to pay them
for their time. They're too busy. They said they'd have a consultant
contact me but that never happened. I'm a bit disappointed with their
support at this point.
Thanks to everyone for your help.
Ed
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|