I have a need to write an client-server application where a tiny server rests on a USB gadget and communicates with a client application on the host.
I've not done this sort of thing before but I have done webapps and usually, they're all developed and debugged on the local machine using the lo
loopback network interface. This has perhaps influenced my way of thinking and I'm looking for a way to simulate a USB host and gadget on my machine so that I can build both ends of the application completely on my PC before I dive into the actual gadget and get the thing going.
Is this the right way to go about it? I realise that the USB protocol is asymmetrical and found some references to this over here but it seems to most natural way to go about it.
If it is the right way, how do I start off with something like this and are there any potential problems that others are aware of which I might stumble over?
Update
References which I found from Googling earlier. There are Linux Kernel modules (part of my Ubuntu Install too) which seem to be able to simulate the host and gadget sides (viz. dummy_hcd and gadgetfs respectively). My idea is to simply have something like
Host application (client) on PC <-> device file 0 <-> Loopback device <-> device file 1 <-> Gadget application (server) also on PC (will be moved to gadget).