[求助]模拟打印机时的问题

用论坛的例程模拟打印机,模拟成功,因为没安装驱动,所以提示找不到驱动

我对自己的打印机提取了设备描述符和配置描述符后,在放在程序中,这样子模拟的时候电脑根本无法识别设备

另外那个打印机ID(设备ID)

unsigned char code buffer_id[]= "\x0\x39MFG:HP;CMD:GDI;MDL:HP_LaserJet_5N;CLS:PRINTER;MODE:GDI;";设备ID

这个设备ID是由什么组成的?我要怎要才能在我的打印机上查到或者获取到呢

这个你要看下1284协议,USB PRINT类协议是这样写的: 4.2.1 GET_DEVICE_ID (bRequest = 0) This class-specific request returns a device ID string that is compatible with IEEE 1284. See IEEE 1284 fand formatting information. A printer with multiple configurations, interfaces, or alternate settings may comultiple IEEE 1284 device ID strings. The wValue field is used to specify a zero-based configuration ind high-byte of the wIndex field is used to specify the zero-based interface index. The low-byte of the wInde used to specify the zero-based alternate setting. The device ID string is returned in the following format:


你可以用BUSHOUND软件抓一下PC对你的打印机枚举的过程,应该是可以抓到设备描述符、配置描述符和设备ID的。设备ID是通过{ 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF1, 0x03 }获取


模拟打印机成功了吗?


只有登录才能回复,可以选择微信账号登录