I'm using the ppdev driver in a program to communicate with a mp3
player (Nomad I).
The first time I run the program, I don't have any problems sending
or receiving data to/from the device. At each communication with the
device, I open, claim and negociate the port in ECP mode. After some
reads and write, when i'm finished (and there is no data waiting on
the port for me to read it), I release and close the port.
My problem is that it works the first time, but not a second time!
I'm getting from my perror():
PPNEGOT: Input/Output error
If I close my gtk program to run it again, It work the first time
I don't use IRQs and I also don't do anything more than use the
read and write kernel functions.
I would like to know what I'm not doing correctly or if I missed
something in closing the port; Because I assume that when my gtk
program ends, the ppdev driver cleanup something so it works again
at the next program execution...
By the way, do anyone can direct me to some code that does something
similar ? I'm having a hard time finding some ppdev code !
I'm using Kernel 2.4.4 with ppdev and parport as modules, on a RedHat
7.1 distribution. The system is a Toshiba 1750 laptop.
Here is a summary of the steps I'm doing in a menu callback:
open the device
claim PPEXCL (I tried without it, same thing)
send a probe command to the device:
write 3 bytes, read 3 bytes.
(result are what I expected for whatever commands I sent to it)
I'm not using anymore PPRDATA and PPWDATA as I know I don't have
to use them with read() and write().
-- To unsubscribe, send mail to: firstname.lastname@example.org --
-- with the single word "unsubscribe" in the body of the message. --
This archive was generated by hypermail 2b29 : Fri May 18 2001 - 01:47:10 EDT