Reputation: 41
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.
Upvotes: 4
Views: 5712
Reputation: 88
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.
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.
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.
Upvotes: 1
Reputation: 13024
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.
Upvotes: 5