I have to simulate a USB Device for automation and testing purposes (in Linux). Original driver/application for this device uses “libusb” to communicate with it.
I don’t have much experience in Linux and Simulation, after some searching I have understood that I need to write a kernel level driver and an application in user-space to simulate that device. Is this right? If Yes, How can this be done?
Thanks in Advance.
USB virtualization (AKA a virtual USB) is when a physical USB device can be accessed and managed by another remote computer. This remote computer, and the computer physically connected to the USB, share the same network.
You can use external USB hard drives with your virtual machine, much like any other USB device.
USB Device Tree Viewer or UsbTreeView is based upon the Microsoft "USBView" sample application found in the Windows Driver Development Kits. This utility quickly displays all the USB hubs and ports, beginning with connections status, device information, and pertinent connection information.
Finally implemented it by modifying "libusb", modified it to send and receive usb transfers from message queue instead of usbfs. Programmed my simulator to create libsub type transfers and send/receive them using message queues as well.
Simulator now interprets the incoming transfers and sends it to a command parser, which sends request/message to automation system using sockets in a specific format. Automation system sends it's instruction by sending to command parser using socket. This socket invokes method specific to each request in simulator, Now simulator forms an appropriate transfer structure and passes to device plugin (via libusb) through message queue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With