[PARPORT] simple (dumb?) ppdev question

From: Peter Asemann (sipeasem@immd3.informatik.uni-erlangen.de)
Date: Thu May 22 2003 - 11:44:40 EDT

  • Next message: Tim Waugh: "Re: [PARPORT] simple (dumb?) ppdev question"

    Hi there!

    I've two integers

    int ioret;
    int fd;

    and fd is an open file descriptor to /dev/parport0

    The following does not work but fails with an input/output error - why?
    Other ioctls I do before (PPEXCL, PPCLAIM) return 0, so I suppose they work
    and I've got the parport0 exclusively for me. I can also actually print
    things with write()

    ioret = IEEE1284_MODE_EPP;
            if (ioctl (fd, PPNEGOT,&ioret) == -1) {
                    perror ("ioctl failed");
                    exit (1);
            } else {
                    printf("ioctl suceeded with return value %d\n",ioctl);
            }

    Is it possible that if the device doesn't react on the ioctl, this
    input/output error is returned? I thought that in case the negotiation failed
    it'd return 0, but overwrite the value in ioret with the mode actually
    "negotiated", in this case compatibility mode (following my personal logic).

    Well, maybe it's just that I didn't read the right ressources on the net; I'd
    appreciate any suggestions regarding this.

    Peter Asemann

    -- 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 2b29 : Thu May 22 2003 - 11:48:42 EDT