Replies: 11 comments 12 replies
-
You mean, you want to compile this code to the executable that can run on your OS? Yes, you need a working Go compiler with working Cgo support, plus you need the libusb, plus your need a working DNS-SD infrastructure (Linux uses avahi) And please note, |
Beta Was this translation helpful? Give feedback.
-
As printer may be connected and disconnected in any time, and (on desktop at least) multiple printers may be connected, some signalling mechanism is required that allows Cgo is only needed to deal wil libusb and avahi libraries. In theory, these layers are isolated in the You may also consider looking to the ippusb_bridge project. It was written by Google for their ChromeOS and was inspired by the Please note, that it took from Google several month to reimplement |
Beta Was this translation helpful? Give feedback.
-
Go has excellent HTTP implementation on its standard library. If you plan to use C++, my advise is to start from choosing HTTP library for C++, |
Beta Was this translation helpful? Give feedback.
-
HTTP proxy consist from the HTTP server, HTTP client and some glue code between them. In the HTTP library, the server part is the first thing to consider. In the The important thing to consider, HTTP library must allow to deal with big attachment in the streaming mode. Go HTTP library simple returns document body as io.Reader, and program may read from there as much as it can handle. Prefetching entire document into the memory may consume a lot of memory, because typical document is the image sent to printer or received from scanner. |
Beta Was this translation helpful? Give feedback.
-
Another important thing, There are no hidden quirks in the I suggest you to use these quirk files "as is", it will allow you in the future to import new quirks from the |
Beta Was this translation helpful? Give feedback.
-
Thank you ,I am reading your code,It's great. |
Beta Was this translation helpful? Give feedback.
-
Yes. In short, DNS-SD (known also ad MDNS, Bonjour etc) is the service that allows somebody to advertise something to the entire local network, and interested parties can find it, using decentralized protocol without dedicated server. And the same mechanism works within the single machine, using Under the hood, it uses DNS messages, distributed using UDP milticasts. BTW, what OS are you porting to? Goolge at ChromeOS uses UNIX-domain socket instead. I have no idea how do they deal if 2 or more printers connected, but we can ask @yetamrra |
Beta Was this translation helpful? Give feedback.
-
If it is a kind of Linux, even simplified, Go must work there with a reasonable effort |
Beta Was this translation helpful? Give feedback.
-
Hi @niuliwan,
Honestly, it sounds a bit strange. Pure Go program can run on a top of bare Linux kernel without any external libs.
Printer needs to provide USB interfaces with Class=7, Subclass=1, Protocol=4. These and only these interfaces do support IPP over USB protocol. Not all USB printers and scanners support this protocol, but newest ones tend to support. So,
Actually, much more: https://github.com/OpenPrinting/ipp-usb#under-the-hood The most important thing:
Because 7/1/4 USB interfaces expect to receive HTTP requests and return HTTP responses. |
Beta Was this translation helpful? Give feedback.
-
Very hard to say, because people mostly come to me with problems, not with success stories. In the long-term perspective - 100%. |
Beta Was this translation helpful? Give feedback.
-
Hi @zdohnal, I've missed the chance to start gathering this table from the very beginning. So currently this is unlikely that we will be able to collect a representative table. From another hand, @tillkamppeter and @michaelrsweet think that all modern device come with IPP-USB support, and all new network devices come with the eSCL support as well. I'm not as optimistic as they are, but supporting IPP-USB and eSCL opens the door to the Apple's users market, so I expect that in the long-term perspective (i.e., in few years) literally all new devices will support these protocols. |
Beta Was this translation helpful? Give feedback.
-
I hava a mini OS running on phones ,what should we do to compile this code to a app? If we need to migrate a compiler for the go language or any other things?
Beta Was this translation helpful? Give feedback.
All reactions