I'm trying to send RESET to USB printer (Samsung SPP-2040) using the
following code:
#include <sys/ioctl.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/lp.h>
#include <linux/usb.h>
int print_d, ioctl_return;
unsigned int status;
// printf ("LPRESET=%d\n",LPRESET);
if ((print_d = open("/dev/usb/lp0",O_RDWR|O_EXCL)) == -1 )
{perror("open lp0 failed "); exit(1);}
if ((ioctl_return = ioctl(print_d, LPRESET)) == -1)
perror("ioctl failed ");
}
but I'm receiving "ioctl failed : Inappropriate ioctl for device"
message.
What's wrong with this code?
Thanks,
Vitaly
|
|
0
|
|
|
|
Reply
|
vitaly_il (1)
|
11/28/2005 7:46:09 AM |
|