@ Mr. John Smith - I can get you a more complete program tomorrow when I get in, but can you run the below code and send me the contents of bytes1 and bytes2? Something like {0x00, 0x01, 0x04, …} is fine.
byte[] bytes1 = new byte[Descriptors.Configuration.LENGTH];
threeDMouse.SendSetupPacket(0x80, 0x06, (ushort)0x0200, 0, bytes1, 0, bytes1.Length);
var descriptor = new Descriptors.Configuration(bytes1);
byte[] bytes2 = new byte[descriptor.TotalLength];
threeDMouse.SendSetupPacket(0x80, 0x06, (ushort)0x0200, 0, bytes2, 0, bytes2.Length);
@ Mr. John Smith: Maybe this helps a bit, all done in VS2013 with the beta from codeplex and plain NETMF, but maybe it’ll just work for other versions as well. Was done on a cerberus with 4.3.4.0 (but the raw device I use is not recognized by the raptor though)
static void Controller_UnknownDeviceConnected(object sender, Controller.UnknownDeviceConnectedEventArgs unknowndevice)
{
Debug.Print("");
Debug.Print("Unknown Device connected.");
Debug.Print(" ID = " + unknowndevice.Id.ToString("X4"));
Debug.Print(" Port = " + unknowndevice.PortNumber);
Debug.Print(" VID = " + unknowndevice.VendorId.ToString("X4"));
Debug.Print(" PID = " + unknowndevice.ProductId.ToString("X4"));
Debug.Print(" Type = " + (BaseDevice.DeviceType)unknowndevice.Type);
raw = new RawDevice(unknowndevice.Id,
unknowndevice.InterfaceIndex,
unknowndevice.VendorId,
unknowndevice.ProductId,
unknowndevice.PortNumber,
BaseDevice.DeviceType.HID);
raw.Disconnected += raw_Disconnected;
GHI.Usb.Descriptors.Device devdesc = raw.GetDeviceDescriptor();
Debug.Print("Number of configurations . . . " + devdesc.NumberOfConfigurations);
Debug.Print("Max Packet size . . . . . . . " + devdesc.MaximumPacketSize);
Debug.Print("Protocol code . . . . . . . . " + devdesc.ProtocalCode.ToString("X2"));
Debug.Print("Release number . . . . . . . . " + devdesc.ReleaseNumber.ToString("X2"));
Debug.Print("Serial number index . . . . . " + devdesc.SerialNumberIndex.ToString("X2"));
Debug.Print("Subclass code . . . . . . . . " + devdesc.SubclassCode.ToString("X2"));
Debug.Print("USB sepecification number . . " + devdesc.UsbSpecificationNumber.ToString("X2"));
// On this device there is only one configuration descriptor
GHI.Usb.Descriptors.Configuration cfgdesc = raw.GetConfigurationDescriptor(0);
// look for the HID device
for (int i = 0; i < cfgdesc.Interfaces.Length; i++)
{
Debug.Print(" === Interface ===");
Debug.Print(" Class: " + ClassToString(cfgdesc.Interfaces[i].ClassCode));
Debug.Print(" SubClass: " + cfgdesc.Interfaces[i].SubclassCode);
Debug.Print(" Number: " + cfgdesc.Interfaces[i].Number);
Debug.Print(" Protocol: " + cfgdesc.Interfaces[i].ProtocolCode);
Debug.Print(" Type: " + cfgdesc.Interfaces[i].Type);
for (int ep = 0; ep < cfgdesc.Interfaces[i].Endpoints.Length; ep++)
{
Debug.Print(" -- Endpoint --");
Debug.Print(" Attributes: " + cfgdesc.Interfaces[i].Endpoints[ep].Attributes);
Debug.Print(" Address: " + cfgdesc.Interfaces[i].Endpoints[ep].Address);
Debug.Print(" Type: " + cfgdesc.Interfaces[i].Endpoints[ep].Type);
Debug.Print(" Interval: " + cfgdesc.Interfaces[i].Endpoints[ep].Interval);
Debug.Print(" ");
}
Debug.Print(" ");
Debug.Print(" ");
}
Debug.Print("So far, so good ...");
}
The framework throws a first chance exception every time I read from the device and there is no data to read (I’m assuming). It Controller.GetLastError says 2.
@ Jay Jay - Thanks for the links, worked fine for me …
[Port2] : USB Input Device
Is Port User Connectable: yes
Is Port Debug Capable: no
Companion Port Number: 0
Companion Hub Symbolic Link Name:
Protocols Supported:
USB 1.1: yes
USB 2.0: yes
USB 3.0: no
Device Power State: PowerDeviceD3
---===>Device Information<===---
English product name: "Universal Bridge"
ConnectionStatus:
Current Config Value: 0x01 -> Device Bus Speed: Low
Device Address: 0x02
Open Pipes: 1
===>Device Descriptor<===
bLength: 0x12
bDescriptorType: 0x01
bcdUSB: 0x0110
bDeviceClass: 0x00 -> This is an Interface Class Defined Device
bDeviceSubClass: 0x00
bDeviceProtocol: 0x00
bMaxPacketSize0: 0x08 = (8) Bytes
idVendor: 0x0FDE = IDT DATA SYSTEM LIMITED
idProduct: 0xCA01
bcdDevice: 0x0302
iManufacturer: 0x00
iProduct: 0x01
English (United States) "Universal Bridge"
iSerialNumber: 0x00
bNumConfigurations: 0x01
---===>Open Pipes<===---
===>Endpoint Descriptor<===
bLength: 0x07
bDescriptorType: 0x05
bEndpointAddress: 0x81 -> Direction: IN - EndpointID: 1
bmAttributes: 0x03 -> Interrupt Transfer Type
wMaxPacketSize: 0x0008
bInterval: 0x01
---===>Full Configuration Descriptor<===---
===>Configuration Descriptor<===
bLength: 0x09
bDescriptorType: 0x02
wTotalLength: 0x0022 -> Validated
bNumInterfaces: 0x01
bConfigurationValue: 0x01
iConfiguration: 0x00
bmAttributes: 0x80 -> Bus Powered
MaxPower: 0x32 = 100 mA
===>Interface Descriptor<===
bLength: 0x09
bDescriptorType: 0x04
bInterfaceNumber: 0x00
bAlternateSetting: 0x00
bNumEndpoints: 0x01
bInterfaceClass: 0x03 -> HID Interface Class
bInterfaceSubClass: 0x00
bInterfaceProtocol: 0x00
iInterface: 0x00
===>HID Descriptor<===
bLength: 0x09
bDescriptorType: 0x21
bcdHID: 0x0110
bCountryCode: 0x00
bNumDescriptors: 0x01
bDescriptorType: 0x22 (Report Descriptor)
wDescriptorLength: 0x0022
===>Endpoint Descriptor<===
bLength: 0x07
bDescriptorType: 0x05
bEndpointAddress: 0x81 -> Direction: IN - EndpointID: 1
bmAttributes: 0x03 -> Interrupt Transfer Type
wMaxPacketSize: 0x0008
bInterval: 0x01
@ Mr. John Smith - There is a nice USB Sniffer written in C# where you can input some data and monitor what’s going. Try to search for UsbLibrary on the internet or if you are send me a PM with an email address I’ll send you the VS project with documentation.