Mocking USB input

家住魔仙堡 提交于 2019-12-17 13:29:09

问题


Our product includes some custom hardware, that connects to a PC via USB. We've started looking into automatic testing, but so far I'm unable to find a tool that can record/replay generic USB input.

Does anyone know of such a tool?
(And - it would be best if it's somehow scriptable - testing would have to alternate between GUI interaction and custom hardware manipulation)


回答1:


Hardware solution,

Do you want to generate USB traffic. It's long since I used it, but the CATC protocol analyzer can also generate traffic. http://www.lecroy.com/tm/products/ProtocolAnalyzers/usbtt.asp?menuid=67 And off course, you can write scripts to generate these traffic ...

Software solution,

Write your own application to send packets to the USB bus driver, and also check the usbview (shipped with Windows DDK) source code. You can send data directly to any USB pipe. This is less expensive, but a bit difficult than the hardware solution ...

HTH




回答2:


Mocking usb devices using umockdev

Umockdev is a linux based application which record the behaviour as well as properties of hardware and run the software independent of actual hardware it is running on. Hardware devices can be simulated in virtual environments without disturbing the whole system.It currently supports sysfs, uevents, basic support for /dev devices, and recording/mocking usbdevfs ioctls (for PtP/MTP devices). It helps for creating integration test for hardware related libraries.

source code and examples

umockdev home page




回答3:


There are a couple of test tools on the usb.org tools page, not sure if that's what you need.




回答4:


You can develop a simple program using Usblib. Its easy to use.




回答5:


I don't know if any USB analyzers have option for replay they have for sure option for record. Right now I can think of only LeCroy but there are others companies that make USB analyzers. But they cost similar, LeCroy would be rather top price. Here you should get fair comparison of USB analyzers and their price. www.osronline.com/article.cfm?id=533 (have to register to see article)



来源:https://stackoverflow.com/questions/1384079/mocking-usb-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!