如何为不同供应商的打印机编写通用 USB 主机驱动程序?
我想在嵌入式设备上开发一个 USB 主机,它将与来自不同供应商的打印机进行通信。供应商特定打印机的驱动程序将在最终与打印机通信的 PC 上提供,但我的设备正在促进这种通信,并且需要执行打印机的基本握手/设置(即,它需要知道打印机何时连接、什么)是需要打开以进行 CTRL 和 DATA 传输等的套接字 ID)。所有这些打印机都应该符合 IEEE 1284.4 标准,但我发现其中许多打印机都有点安静。
我的一种方法是从每台打印机获取握手的 USB 痕迹,并分别编写不同的代码部分(我知道,这听起来很荒谬!)。有没有通用的方法来做到这一点?是否有提及这些标准信息的可用论坛?例如:EPSON 将“EPSON-CTRL”和“EPSON-DATA”用于其控制和数据服务,需要提供这些服务来获取这些服务的套接字 ID。我很确定惠普、佳能等也会有自己的服务名称。根据标准,这应该在 IANA 中捕获,但我在那里没有看到任何内容。对此的任何帮助将不胜感激。
谢谢和问候, 乌拉斯
I want to develop a USB host on an embedded device that will talk to printers from various vendors. Drivers for the vendor specific printers would be available on PC which is ultimately communicating with printer but my device is facilitating this communication and needs to perform the basic handshaking/setup of the printer (i.e, it needs to know when the printer is connected, what are the socket IDs that needs to be opened for CTRL and DATA transmissions etc). All of these printers are supposed to comply with IEEE 1284.4 standards but I see that many of them vary quiet a bit.
One approach I have is to take the USB traces of handshaking from each of these printers and write various sections of code respectively (I know, that sounds ridiculous!). Is there a generic way to do this? Is there any available forum where these standard informations are mentioned? For eg: EPSON uses 'EPSON-CTRL' and 'EPSON-DATA' for its control and data services which needs to be provided to get the socket ID for these services. I am pretty sure HPs, Canon's etc would have their own service names as well. As per the standards, this was supposed to be captured in IANA but I dont see anything there. Any help on this would be greatly appreciated.
Thanks and regards,
Ullas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,您不能这样做,因为即使 EPSON 和 HP 执行完全相同的操作,它们也会以不同的方式实现其打印机。您的“通用”驱动程序必须明确考虑每种类型的打印机。
话虽这么说,理论上您可以在通用驱动程序套件中实现每种驱动程序类型,并让它确定打印机可用时使用哪个驱动程序。但是,这似乎有点矫枉过正,因为您可以从制造商的网站上在线免费获取驱动程序。
No, you can't do this because EPSON and HP will implement their printers differently even if they do the exact same thing. Your "generic" driver will have to explicitly account for each type of printer.
That being said, you could theoretically implement each driver type in your generic driver suite and have it determine which driver to use when the printer becomes available. But, this seems like a bit of overkill since you can just get the drivers free online at the manufacturer's website.