Sending data from a saved file Through USB port with Delphi

Posted on 2006-05-18
Last Modified: 2008-01-09
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, 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.
Question by:JeffParadis
    LVL 11

    Expert Comment

    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.

    Author Comment

    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?
    LVL 11

    Accepted Solution

    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 the website of Jan Axelson.
    Her (!) book is reference material.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now