Read Device ID of a parallel device
2011-07-28 09:11:02 GMT
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,
_______________________________________________ Linux-parport mailing list Linux-parport <at> lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-parport
RSS Feed