SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

missile launcher code

Last post 12-28-2006 1:55 PM by timberwolf0122. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-13-2006 6:21 AM

    missile launcher code

    I'm trying to use SharpUSBLib to control a USB missile launcher I bought from thinkgeek (http://www.thinkgeek.com/geektoys/cubegoodies/86b8/)

    I've been looking at java and python versions of a controller program, and it seems I've ran into a wall.

    Is there a good way to tell if my code has actually attached to the USB port my device is on?  I'm using pretty much the example code:

            const int VENDOR_ID = 0x1130;
            const int PRODUCT_ID = 0x0202;

    foreach (Bus bus in Bus.Busses)
                {
                    foreach (Descriptor descriptor in bus.Descriptors)
                    {
                        if (descriptor.VendorId == VENDOR_ID && descriptor.ProductId == PRODUCT_ID)
                        {
                            try
                            {
                                device = descriptor.OpenDevice();
                            }
                            catch (UsbException ex)
                            {
                                Console.WriteLine(ex.Message);
                            }
                            return;
                        }
                    }
                }

     

     

    However when I do the SendControlMessage() function, I don't see any output in HDD USB Monitor (http://www.hhdsoftware.com/) where I do in the program that came with the device.

     Any hints?  If full source is required, let me know, as this is just really for a hobby/learning experience, I don't mind sharing code.
     

  • 12-28-2006 1:55 PM In reply to

    Re: missile launcher code

    I have the same issue, the SendControlMessage does not appear to work at-all or it just re-sends the last command from the windows application, if anyone can help I would appreciated it!

    FYI - Here are the controll codes to make the missile launcher fire as captured by Snoopy

    520 out down 0x00 2506.143 CLASS_INTERFACE 55 53 42 43 00 00 04 00 
    URB Header (length: 80)
    SequenceNumber: 520
    Function: 001b (CLASS_INTERFACE)
    PipeHandle: 00000000

    SetupPacket:
    0000: 22 09 00 02 01 00 00 00
    bmRequestType: 22
      DIR: Host-To-Device
      TYPE: Class
      RECIPIENT: Endpoint
    bRequest: 09 


    TransferBuffer: 0x00000008 (8) length
    0000: 55 53 42 43 00 00 04 00
    520 out up n/a 2506.146 CONTROL_TRANSFER - 0x00000000
    URB Header (length: 80)
    SequenceNumber: 520
    Function: 0008 (CONTROL_TRANSFER)
    PipeHandle: 82d1a670

    SetupPacket:
    0000: 21 09 00 02 01 00 08 00
    bmRequestType: 21
      DIR: Host-To-Device
      TYPE: Class
      RECIPIENT: Interface
    bRequest: 09 


    No TransferBuffer

    521 out down 0x00 2506.146 CLASS_INTERFACE 55 53 42 43 00 40 02 00 
    URB Header (length: 80)
    SequenceNumber: 521
    Function: 001b (CLASS_INTERFACE)
    PipeHandle: 00000000

    SetupPacket:
    0000: 22 09 00 02 01 00 00 00
    bmRequestType: 22
      DIR: Host-To-Device
      TYPE: Class
      RECIPIENT: Endpoint
    bRequest: 09 


    TransferBuffer: 0x00000008 (8) length
    0000: 55 53 42 43 00 40 02 00
    521 out up n/a 2506.150 CONTROL_TRANSFER - 0x00000000
    URB Header (length: 80)
    SequenceNumber: 521
    Function: 0008 (CONTROL_TRANSFER)
    PipeHandle: 82d1a670

    SetupPacket:
    0000: 21 09 00 02 01 00 08 00
    bmRequestType: 21
      DIR: Host-To-Device
      TYPE: Class
      RECIPIENT: Interface
    bRequest: 09 


    No TransferBuffer

    522 out down 0x00 2506.150 CLASS_INTERFACE 00 00 00 00 00 01 08 08 
    URB Header (length: 80)
    SequenceNumber: 522
    Function: 001b (CLASS_INTERFACE)
    PipeHandle: 00000000

    SetupPacket:
    0000: 22 09 00 02 00 00 00 00
    bmRequestType: 22
      DIR: Host-To-Device
      TYPE: Class
      RECIPIENT: Endpoint
    bRequest: 09 


    TransferBuffer: 0x00000040 (64) length
    0000: 00 00 00 00 00 01 08 08 00 00 00 00 00 00 00 00
    0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    522 out up n/a 2506.164 CONTROL_TRANSFER - 0x00000000
    URB Header (length: 80)
    SequenceNumber: 522
    Function: 0008 (CONTROL_TRANSFER)
    PipeHandle: 82d1a670

    SetupPacket:
    0000: 21 09 00 02 00 00 40 00
    bmRequestType: 21
      DIR: Host-To-Device
      TYPE: Class
      RECIPIENT: Interface
    bRequest: 09 


    No TransferBuffer

     

    Filed under:
Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.