寻找虚拟 USB HID 驱动程序

发布于 2024-08-10 19:06:57 字数 356 浏览 4 评论 0原文

我们设计了一种特殊的通信工具,用于在轮椅上控制灯光等。我们使用 Z-wave< /a>.我们有用于通过 PC 控制这些设备的应用程序。

不幸的是,该应用程序需要 USB 记忆棒。我们的设计不允许使用 USB 连接棒。相反,我们使用串行接口模块,通过蓝牙和虚拟端口链接到电脑。我们知道该应用程序使用HID标准windriver。 (不涉及第三方驱动程序)

我们想知道是否可以使用 HID“包装器”驱动程序来模拟 USB 标识符和 PnP,使应用程序认为连接棒已连接,然后将蓝牙虚拟端口数据链接到应用程序。

We designed a special communication tool for use on a wheelchair to control lights etc. We use Z-wave. We have app for control of these devices via PC.

Unfortunately, the app expects a USB stick. Our design does not allow a USB connected stick. Instead we use serial interface module that links to the pc via Bluetooth and a virtual comport. We know that the application uses HID standard windriver. (no third party driver involved)

We were wondering if we could use a HID "wrapper" driver that simulates the USB identifiers and PnP in a way that the application thinks that a stick is connected, and then links the Bluetooth virtual comport data to the app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你又不是我 2024-08-17 19:06:57

是的,我相信这是可能的,可能会很有趣,从来没有想过用 PC 来模拟 HID 设备。你们组中有人有驱动程序开发经验吗?如果没有,请为陡峭的学习曲线做好准备。

问题:“USB 棒”是指包含说明文件的 USB 闪存驱动器,还是某种类型的 HID 设备,如鼠标或操纵杆,如标题所示?

不过,这并不重要,无论哪种情况,都可以编写一个驱动程序来用 PC 来模拟它。对于您的商店/项目来说,将您的技能提升到可以做到这一点是否经济是主要问题。这绝对不是你可以在周末完成的代码。

Yes, I believe it is possible, could be quite interesting, never thought of simulating a HID device with a PC. Does anyone in your group have any driver development experience? If not, prepare for a steep learning curve.

Question: by "USB stick" do you mean a USB flash drive that contains a file with the instructions, or some type of HID device, like a mouse or a joystick, as the title suggests?

It doesn't really matter though, in either case it is certainly possible to write a driver to simulate it with a PC. Whether it is economical for your shop/project to upskill you to the point where you can do that is the main question. This would definitely not be code you can cut out in a weekend.

梦巷 2024-08-17 19:06:57

它非常有趣...我想更多地了解您现有的设备,即“USB 记忆棒实际上是一个无线电收发器”。

它如何连接到PC?是通过 USB 电缆(作为虚拟 COM 端口)吗?或者您是否使用任何 USB-UART (USB-RS232) 适配器,例如以下链接中提到的适配器 (http://www.ftdichip.com/Products/Cables/USBRS232.htm)在您的收发器和 PC 之间。即 USB 串行适配器放置在您的设备和 PC 之间。

  1. 如果您的设备直接连接到 PC 的 USB 端口(作为虚拟 COM 端口),那么我为您提供一种解决方案。我们需要开发一个内核模式 WDM 或 WDF USB HID 迷你驱动程序,以便在安装我们的驱动程序后,您的虚拟 COM 端口设备将被 PC 主机和 PC 应用程序视为 USB HID 设备。在此 HID 迷你驱动程序中,我们可以在 HID 报告描述符中定义自定义顶级 HID 集合,以便您告诉的任何希望设备作为 USB HID 设备的应用程序都可以通过 Windows HID API 调用(例如 HidD_GetFeature)轻松进行通信、HidD_SetFeature、HidD_GetInputReport、HidD_SetOutputReport,甚至 ReadFile 和 WriteFile 函数都可以使用。

  2. 但是,如果您的收发器有 RS232 D9 端口,那么您可能必须插入 USB 串行适配器,正如我之前在 PC 和收发器之间所说的那样。在这种情况下,我们需要开发一个 UMDF USB Hid 微型驱动程序,并在 HID 报告描述符中包含自定义顶级 HID 集合。该驱动程序将完全是一个虚拟驱动程序,并将其自身与实际的虚拟 COM 端口一起附加到设备管理器。 HID 兼容应用程序将与该虚拟驱动程序通信,并将收发器视为 USB HID 设备,尽管它实际上是 COM 端口。 UMDF 驱动程序将负责虚拟 com 端口和 HID 应用程序之间的通信。

如果您有任何疑问或寻求任何进一步的说明,请告诉我。

Its quite interesting... I want to know more about your existing device i.e. "USB stick is in fact a radio-transceiver".

How does it get connected to the PC ? is it through a USB cable (as Virtual COM Port) ? or Are you using any USB-UART (USB-RS232) adapters like the one mentioned in the following link (http://www.ftdichip.com/Products/Cables/USBRS232.htm) between your transceiver and the PC. i.e. the USB-Serial adapter is placed between your device and the PC.

  1. If your device is directly connected to PC's USB port (as a Virtual COM port), then I have one solution for you. We need to develop a Kernel mode WDM or WDF USB HID mini driver so that after installing our driver, your Virtual COM port device will be seen by the PC host and the PC application as USB HID device. In this HID mini driver, we can define a custom top level HID collection in the HID report descriptor, so that what ever the application you have told that expects the device as a USB HID device will easily communicate through Windows HID API calls such as HidD_GetFeature, HidD_SetFeature, HidD_GetInputReport, HidD_SetOutputReport, even ReadFile and WriteFile functions will work.

  2. But if your transceiver has a RS232 D9 port, then you may have to insert a USB-Serial adapter as I said before b/w the PC and your transceiver. In this case, we need to develop a UMDF USB Hid minidriver with a custom top level HID collection in the HID report descriptor. This driver will be totally a virtual driver and attaches itself to the device manager along with the actual Virtual COM port. The HID compliant application will communicate with this virtual driver and see the transceiver as a USB HID device, though it's actually a COM port. The UMDF driver will take care of the communication between the virtual com port and the HID application.

Please let me know if you have any doubts or seek any further clarifications.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文