Kurt Roeckx <[EMAIL PROTECTED]> wrote:

Hi,

> I had a problem in my program where it did
> ieee1284_negotiate(M1284_NIBBLE) but I didn't check the return
> value, and then just called ieee1284_nibble_read().
> ieee1284_nibble_read() returns -1 (as expected), I think errno is
> set to EAGAIN.  But the problem is that the next time I do
> ieee1284_negotiate() and it is succesful, ieee1284_nibble_read()
> still returns -1.
>
> It seems that when calling ieee1284_nibble_read() (using ppdev) it
> always does:
>    set_mode (port, M1284_NIBBLE, 0, 0);
>
> I think the problem is doing the ioctl(PPSETMODE) and that it shouldn't
> be doing that until the negotiation was succesful.

I'm not sure, but this may have to do with this remark from the
ieee1284_negotiate() manpage:

   An IEEE 1284-compliant device will require a successful negotiation
   to a particular mode before it is used for data transfer (but
   simpler devices may not if they only speak one transfer mode).

> You could argue that this isn't exactly a bug in libieee1284,
> but it would be nice that it didn't set the mode until it
> was properly negotiated.

I'd argue that you shouldn't call an I/O method if you haven't
properly negotiated the transfer mode first, indeed :)

The code could check port->current_mode to make sure the negotiation
indeed took place and ended successfully, but then I'm not sure it's a
good idea. I imagine that could become a problem with some devices,
given that "standard compliance" in this area is at best a very
abstract concept...

Anyway, Tim will know way better than I do ;)

JB.

-- 
 Julien BLACHE - Debian & GNU/Linux Developer - <[EMAIL PROTECTED]> 
 
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to