views:

149

answers:

4

I have a piece of hardware that sends USB data over ethernet (only the data stored in the package will be send). On a remote PC the data is recieved via ethernet. How can I send this data to the USB driver so it translates the data into commands applications can use?

A: 

You need a server listening on whatever port/socket that you are trying to connect to. Twisted Matrix makes decent Python libraries for network communications.

Andrew Sledge
the ethernet communication is not the problem. The problem is: how to understand the usb-data. Normally the driver will translate it and send the request to the application that requested it. with this device the usb driver won't recieve the data. So I have to find a way to either send the recieved data to the driver which will translate it or I have to find a way to translate the data myself. This might be very difficult because the attached device is a MiFare RFID reader which encodes the data.
Wilfred Knigge
A: 

I think this is going to be troublesome.

USB is generally set up to associate a driver with a connected device, based on the device's various ID numbers, as discovered during bus traversal.

Your data comes in over Ethernet, so the platform's USB driver stack won't know anything about the device in question. This means you somehow need to directly talk to the proper driver, and also get it prepared to handle events from a (from its point of view) non-connected device.

I can think of several reasons why even a well-designed USB stack won't handle this happily.

On Linux, you might be able to "cheat" by interpreting the data yourself and sending it on, using the same API:s the actual driver would have used. That won't work for any USB device of course, it requires you know what the device is.

unwind
A: 

It's doable on windows as well, but you need a lot of kernel/usb knowledge to make it work i don't think i will be wrong by estimating this task as few man years (you can reduce this estimation dramatically if you have a limited selection of devices/types of device to support.
You will need to develop a bus driver that will simulate the host controller driver to the native usb host, unfortunately this interface is not public and we did not managed to get MS cooperation on that.
There is additional option to work on hub level, instead on controller level, this interface is available, but i did not managed to find my notes on that.
You can download the evaluation version and investigate the driver stack it might give you a clue where to start.

Ilya
+1  A: 

You're better off getting hardware that does the reciprocal, sends the IP-based USB information to the USB subsystem, rather than try and hack the software driver itself. I can't imagine your hardware vendor doesn't have a device that does this.

Chris Kaminski