[Linux-parport] Read Device ID of a parallel device

Nagesh A nagesha71 at gmail.com
Thu Jul 28 05:11:02 EDT 2011


Hi,

I am currently implementing ieee1284 compatibility & nibble mode at device
side.
My device is connected to DB25 of host.

Currently my driver at device side, supports compatibility mode and nibble
mode, and
working fine with data transfers in both directions.

I struck-up where am trying to issue a Device ID request to the host.
Basically, I would like to read the Device ID of my printer (which is of
thermal printer).

I have used the below application code to issue a Device ID request on host
side:

=========================
mode = IEEE1284_MODE_NIBBLE | IEEE1284_DEVICEID;
if (ioctl(dat.fd, PPNEGOT, &mode)) {
    perror("PPNEGOT (1)");
    close(dat.fd);
    return 1;
}

#define MAX_DEVICEID_LEN  1024
len = MAX_DEVICEID_LEN;
ret = read(dat.fd, dat.buf, len);
if (ret < 0) {
    perror("read");
    close(dat.fd);
    return 1;
}

============================
Here the ioctl (PPNEGOT) is failing  by saying "No such device or address".

I am wondering that it is passing when I try to read the data from host in
nibble mode.
I could confirm that nibble mode is working fine, but Device ID request in
nibble mode is throwing the above fault.

Please help me in this regards,

-- 
*regards,*
*-Nagesh A*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-parport/attachments/20110728/222c39ed/attachment.html>


More information about the Linux-parport mailing list