1

Is it possible to emulate steering wheel? I mean say to windows like I'm pressing 30% of left button? Or do I need to write some driver which will communicate with my application? So that windows will think that it is a real device.

If I need driver, then what commands I need to send to windows to do right things, maybe I can send them directly from my application.

I have small experience writing application which communicate with card reader using virtual com port, but there was real device :/

Maybe I can use some real steering wheel driver, install it in windows and then send command to some com port to make windows think that it's real device?

Please help, or at least show direction where I can find some information.

Vladimir Kruglov
  • 196
  • 1
  • 19
  • You can get a USB steering wheel for $30 or $40 online (with gas and brake pedals), then look into USB HID libraries (see [here](http://stackoverflow.com/questions/280199/)) – Dagg Nabbit Nov 23 '13 at 11:38
  • Or for around $5 you can get a USB converter for an old PlayStation controller and just pretend the analog stick is a steering wheel... – Dagg Nabbit Nov 23 '13 at 11:53
  • i don't want use real i want to make my application act like real device do, just for now i don't know how exactly real device work, what type of connection is between game and controller, and which data is passed between them – Vladimir Kruglov Dec 03 '13 at 20:17
  • Hmm, something like [this](http://stackoverflow.com/questions/1913979/how-to-emulate-usb-devices) maybe? – Dagg Nabbit Dec 03 '13 at 21:12

1 Answers1

1

Found a solution on http://vjoystick.sourceforge.net/site/. Now I have written the server and the client on my phone and started testing, but it's working somehow slow. I open socket and send from phone 3-5 bytes, but server reads 3-4 messages. Sample("x-100;x-4;x45;")

TcpClient tcpClient = (TcpClient)client;
NetworkStream clientStream = tcpClient.GetStream();

byte[] message = new byte[1000];
int bytesRead;

while (ThreadsRun) {
    bytesRead = 0;
    try {
        bytesRead = clientStream.Read(message, 0, 1000);
        var stringMsg = "";
        for (int i = 0; i < bytesRead; i++) {
            stringMsg += (char)message[i];
        }
        queue.Enqueue(stringMsg);//conqurentqueue
    } catch {
        break;
    }
    Thread.Sleep(1);
}
tcpClient.Close();

Code is very simple and should be fast, ping from phone is 40ms sending 56 bytes.

What is wrong here or is there another faster way to send small amount of data very frequently?

Lahiru
  • 1,428
  • 13
  • 17
Vladimir Kruglov
  • 196
  • 1
  • 19