• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • Last Modified:

Sending data from a saved file Through USB port with Delphi

I'm looking for a way to record data from an Xbox controller (USB compatible) into a created file extension, then to be able to send it back from the pc onto the USB port to the Xbox so the computer can replay the Xbox controller sequences by itself. I'm using the XBCD 1.07 driver which can be found on www.redcl0ud.com, but I can't seem to figure everything out(I'm trying to modify the Main.pas of the XBCDSU folder of the source code). Is it possible to use "TFileStream" to record data into a file? Also, how can I send data from a saved file through the USB port with a 20 millisecond interval between each byte, since the software also reads the signal at the same interval? Thank you.
  • 2
1 Solution
This is hogwash. USB does not work that way.
This cannot be done without hardware because USB is a serial master-slave bus and not a serial line.
The bus is under hardware control on both sides.
Two masters are not allowed on the bus so you cannot connect your PC to the Xbox. This would kill both USB host controllers.
JeffParadisAuthor Commented:
On the Xbox, the gamepad is responsible for sending the data to the Xbox (Atmel At43USB353-M microcontroller). Knowing that, could it work if I switch between the pc and the controller for signal transmission to the Xbox? The way I see it is that in both cases the Xbox console would be the slave (because it's always on the receiving end).....or am I simply missing a few concepts in USB knowledge?

If you suggest this activity to be done with hardware, how would you proceed? Thanks?
Host controller and slave device communicate in hardware. The bus protocol is complicated and not deterministic enough for playback.
The easiest way would be to attack the Xbox controller on the other side. The microcontroller reads its sensors which is simple digital electronic.
If you grab the signals and play them back the Xbox controller will faithfully report them to the Xbox.

You should search and read this board.
The USB IF forum is the place where all the USB developers meet.

Also read http://www.lvr.com the website of Jan Axelson.
Her (!) book is reference material.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now