如何模拟USB设备? [英] How to emulate USB devices?

查看:1027
本文介绍了如何模拟USB设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们团队的其余成员将为我的应用程序制作一个简单的非标准USB麦克风,但在完成集成之前,我必须对其进行仿真,以进行集成测试.

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.

  1. 物理环回是否存在任何风险? USB
  2. 有什么方法可以创建逻辑环回? ( MSDN对此有一些看法)
  3. 有通用的USB仿真器软件吗?
  1. Is there any risk in a physical loopback? Yes there is
  2. Will a physical loopback work? Only with a USB bridge
  3. There is any way to create a logical loopback? (MSDN has something about this)
  4. There is any general purpose USB emulator software?

如果有很多可用的选项,我宁愿使用.NET/Matlab/Python解决方案.

In case there is many options available I'd rather work it .NET/Matlab/Python solutions.

推荐答案

概念验证此处

我强烈建议此项目,USB IP .这是通过网络连接USB设备的一种方式.有一个Windows客户端.

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.

这意味着,您将客户端安装在Windows计算机上. 然后,该设备希望与连接到Linux计算机(即服务器)的USB设备通信:

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:

您现在要做的是任一为Linux创建一个虚假的设备驱动程序,该驱动程序看上去已连接到物理USB设备,但实际上只是装作您的USB设备的逻辑.有用于编写适用于Linux的USB驱动程序的教程. 或者,您可以为设备控制管理器创建自己的存根驱动程序(请参见上图).这个存根驱动程序可以在Windows或Linux上运行,没关系.它甚至可以在作为USB客户端的相同 Windows计算机上运行.

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.

问题本身提到的 DSF USB回送设备,与Device Control Manager的存根驱动程序是同一种解决方案,但是完全使Linux脱颖而出.

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.

这篇关于如何模拟USB设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆