[PARPORT] Parallel port programming help


Jason Fritz (J.Fritz@ericsson.com)
Wed, 17 Nov 1999 17:10:59 -0700


A few weeks ago, I wrote a small application to communicate with a simple
device over the parallel port of a PC running Linux. The application
simply opened "/dev/lp1" and wrote bytes to the port when necessary. I
also receive input from the device via some of the pins normally used for
"paper out" and other such indicators (this is using ioctl(fd, LPGETSTATUS,
&status)).

The machine was recently upgraded to Linux 2.2, and the application no
longer works! It blocks forever when writing a byte if any of the control
pins indicate an error (again, "paper out" or other such error).

Can anyone give me any information on how to fix this? I'm hoping that
there's a quick code change. I've been trying to find information on the
Linux parport web pages, but it's difficult to understand. If possible,
I'd like to avoid code that requires me to have administrative access
(since that will be "yet another road block").

I was hoping to use ioctl() to set LPCAREFUL to false, since the lp.h
header file seemed to indicate this might fix the problem. However, the
header file also said that this command is obsolete. It appears that it is
always TRUE now, from what I can tell from the port status.

Thanks in advance for any help,
Jason

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 17 Nov 1999 - 19:18:25 EST