C code to use existing printer
I did C code to print strings over one printer. I used "fopen" and "fputs" to write through the parallel port.
FILE * stream = fopen ("/dev/lp0", "w");
fputs (MY_STRING, stream;
Now, I installed a new printer via USB. The printer installed itself and I can see it in my printer list (OS: openSUSE 10.2)
1. Can I use the same functions (see above) that I used to work with my USB printer?
2. If I can use the same functions, how can I know which usb port my printer uses. I did a "lsusb". I can see that my printer is located to Bus 003 Device 002. I read that usb printer are located in /dev/usb. I then used /dev/usb/lp0, but seems not working. Am I ok with that?
3. If I cannot use the same functions, what should I use to be able to send my data via the USB driver?
Thanks in advance.
Last edited by icarus_31; 10-09-2009 at 03:54 PM.