如何模拟USB设备?
我团队的其他成员将为我的应用程序制作一个简单的非标准 USB 麦克风,但在他们完成之前,我将不得不模拟它,以进行集成测试。
物理环回有任何风险吗?是的物理环回会起作用吗?仅适用于 USB 桥- 有任何方法可以创建逻辑环回? (MSDN 有相关内容)
- 有任何通用 USB 仿真器软件?
如果有很多可用选项,我宁愿使用 .NET/Matlab/Python 解决方案。
The rest of my team will make for my application a simple non-standard USB microphone, but until they finish it I will have to emulate it, for integration testing purposes.
Is there any risk in a physical loopback?Yes there isWill a physical loopback work?Only with a USB bridge- There is any way to create a logical loopback? (MSDN has something about this)
- There is any general purpose USB emulator software?
In case there is many options available I'd rather work it .NET/Matlab/Python solutions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑:概念证明此处
我强烈推荐此项目,USB IP。它是一种通过网络连接 USB 设备的方式。有一个 Windows 客户端。
这意味着,您在 Windows 计算机上安装客户端。
然后,该设备期望与连接到 Linux 计算机(服务器)的 USB 设备进行通信:
您现在要做的就是两者之一 为 Linux 创建一个假设备驱动程序,看起来像是连接到物理 USB 设备,但实际上只是假装是您的 USB 设备的逻辑。有为 Linux 编写 USB 驱动程序的教程。 或者您为设备控制管理器创建自己的存根驱动程序(参见上图)。这个存根驱动程序可以在 Windows 或 Linux 上运行,这并不重要。它甚至可以在作为 USB 客户端的同一台 Windows 计算机上运行。
问题本身提到的 DSF USB Loopback Device 将是与设备控制管理器的存根驱动程序相同类型的解决方案,但完全将 Linux 排除在外。
Edit: Proof of concept here
I strongly recommend this project, USB IP. It is a way of connecting USB devices over the network. There is a Windows client.
What this means is, you install the client on your Windows computer.
This device then expects to talk to a USB device connected to a Linux computer, the server:
What you now do, is either create a fake device driver for Linux, that looks like is connected to a physical USB device, but in reality is just logic pretending to be your USB device. There are tutorials for writing USB drivers for Linux. Or you create your own stub driver for the Device Control Manager (see picture above). This stub driver could run on Windows or Linux, it wouldn't matter. It could even run on the same Windows machine which is the USB client.
The DSF USB Loopback Device mentioned in the question itself, would be the same kind of solution as a stub driver for the Device Control Manager, but taking Linux out of the picture altogether.
您可以使用 QEMU 编写虚拟 USB 设备。
您可以复制现有设备,例如 this QEMU 存储库并根据您的需要进行更改。
编写并编译 USB 设备后,您可以使用 QEMU 命令行界面将其简单地连接到 VM。
You can write virtual USB device using QEMU.
You can duplicate already existing device, like the dev-serial.c found in this QEMU repository and change it for your needs.
After you write and compile your USB device you can simply attach it to your VM using the QEMU command line interface.