开发者

Reading info from printer on USB port

In the days of parallel printers one used to be able to send a command on LPT1 and receive back standard info such as life count etc.

Now, with USB devices, have we lost that capability? Or is ther开发者_StackOverflow中文版e still a way to read the info?


I assume your question is Windows centric. On some devices the manufacturer (like Epson and Star for example) provide utilities that let you access the device as a 'legacy serial' interface. It's still USB but the software gives you a virtual serial port you can talk to it with. I've been doing some digging trying to figure out what features are exposed by the low level drivers, but haven't had much luck there as Windows drivers really aren't my forte.

In the windows printers you get to select from a variety of ports. For parallel and serial you can open them as \.\LPT1 or \.\COM1 etc and get bi-directional behaviour that way. But for USB the ports are often USB001, and trying to open \.\USB001 for example doesn't seem to work. Such an approach might work, if you can figure out exactly what name to open. But that name will probably have a big ugly GUID in it if the information you see in winobj is anything to go by...

If you come up with any better answers please let me know!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜