pololu / libusbp

The Pololu USB Library (also known as libusbp) is a cross-platform C library for accessing USB devices.
Other
104 stars 32 forks source link

port_name : Error #9

Closed yuvarajvelumani closed 2 years ago

yuvarajvelumani commented 2 years ago
DavidEGrayson commented 2 years ago

What operating system are you using? Did you verify using the user interface of your operating system that the printer really does have a serial port? For example, is it visible is the "Ports (COM & LPT)" list of your Device Manager if you are using Windows? What is the full output you get when you run lsport?

yuvarajvelumani commented 2 years ago

I am running from Windows. Mine is an USB Zebra printer for which I had installed the driver and it is detected under 'Universal Serial Bus controllers' (USB Printer Support)

lsport output: ` 0a5f:0081 29J132700409

05c8:0359 5&3920BB0A&0&7

25a7:fa10 5&3920BB0A&0&2

045e:00db 6&28690743&0&2 `

DavidEGrayson commented 2 years ago

It sounds like your printer doesn't have a serial port, so the behavior you are getting from the library is expected. If you think the library should do something other than throw an error maybe you could elaborate on what you are expecting.

yuvarajvelumani commented 2 years ago

So the libaray works only for USB Serial printer like the USB-Serial printer?? not pure USB printers??

DavidEGrayson commented 2 years ago

It works for USB devices that have a serial port interface, regardless of whether they are printers or not. What behavior were you expecting? Could you tell me what string you consider to be the "port name" of your printer and where you got that string from?

yuvarajvelumani commented 2 years ago

My device doesn't detect as USB-Serial bridge or something that shows with COM#. It's a zebra printer which detects as USB Printer Support under USB devices. PrinterQueue class. Any possibility to change/modify the code to work for such devices as I don't see any open source that is compatible for both Windows n Linux.

DavidEGrayson commented 2 years ago

What are you trying to accomplish with this library overall?

yuvarajvelumani commented 2 years ago

I am creating a printer application which is capable of printing labels/receipts. The application runs on Windows machine and also on Raspberry Pi.

The application should be able to support USB printers, USB-Serial Printers and USB-Ethernet printers.

The main connectivity to the application hardware is USB, but the printer interface may be serial/usb/Ethernet.

I felt your library will help me since it has cross platform support.