We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all
first of all thanks to Tsuneo Chinzei for contributing here that much. Very helpful. THANK YOU !! I am afraid my question finally will end up there top;)
So, here is the common problem, wanting to increase msg sizes. read around here a lot and obeyed all the hints, but still failing.
I am using the Std Keil XP Client, except that I converted it back to VC 6 and added minor overlapped support (works fine for 1 byte msgs)
First I used the simplified report desciptor TC provided , together with one byte msgs -> Still OK
const BYTE HID_ReportDescriptor[] = { HID_UsagePageVendor(0x00), HID_Usage(0x01), HID_Collection(HID_Application), HID_LogicalMin(0), // value range: 0 - 0xFF HID_LogicalMaxS(0xFF), HID_ReportSize(8), // 8 bits HID_ReportCount(1), // one byte HID_Usage(0x01), HID_Input(HID_Data | HID_Variable | HID_Absolute), HID_Usage(0x01), HID_Output(HID_Data | HID_Variable | HID_Absolute), HID_EndCollection, };
I modified the wMaxPacketSize to 0x40 , still OK
Then I set the Report Count to 60 Bytes. Inspection with HID Device Exerciser shows device now with 61 bytes, as expected. (in both directions)
Next step is to modify the VC program to reflect the report changes, so setting both i+o structres to 61 bytes. WriteFile is Ok, but ReadFile always hangs.
Looking ant the many threads here about this particular topic , it would really have been a good idea to provide such a sample? Hello ? KEIL ?!?!? someone reading here ?!?!
Even harder to understand is: How can they ship a broken product like they do with ULINK 2 . Using the inspector shows a completely broken string table, as is in all the samples here too. Again - thanks TC , that can be fixed, but why do they ship such broken stuff ?
Try Jan Axelson's HID example.
Usbhidio_vc6 www.lvr.com/.../usbhidio_vc6.zip
a) Change the VID/PID on the code You can type in VID/PID on the dialog, but changing code is easier than typing in it every time.
usbhidiocDlg.cpp CUsbhidiocDlg::CUsbhidiocDlg(CWnd* pParent /*=NULL*/) : CDialog(CUsbhidiocDlg::IDD, pParent) { ... m_ProductIDString = _T("1299"); m_VendorIDString = _T("0925"); //These are the vendor and product IDs to look for. //Uses Lakeview Research's Vendor ID. int VendorID = 0x0925; int ProductID = 0x1299;
b) For VC6, As Jan said in this Microchip topic, 't check "Use control transfers" for Input and Output reports"
Her example automatically tune the report size, according to the report descriptor on the device. Then, you don't need to worry about the report size on the host app code.
Anyway, why didn't you get this example, when you visit her HID page for "HID Device Exerciser" (HidTest.zip)?
Tsuneo
Hi, Tsuneo
what a surprise to meet you here in the end;) You have no idea how grateful I am. Just think of the string table hints. THANK THANK you very MUCH !
I did indeed looked at Axel's page, (a fine source of inspiration by the way) but unfortunately I don't have access to the neccessary ddk files to get it compiled.
"unfortunately I don't have access to the neccessary ddk files to get it compiled."
For VC6, use this headers and libraries.
Excerpt HID and Setup header/library from Win2k DDK www.intel.com/.../FromDDK.htm (a support page for "USB Design by Example" by John Hyde from Intel Press)
THANX
It turned out that something in the XP prog is wrong - no idea what (up to now). Will try to find that out. BTW the idea to put in the Vendor and Product ID into the source is fine .. BUT .. you then have to add that for the variables too, otherwise they remain at their default value ;)) took me a moment to find out why device detection always failed.
usbhidioc.cpp //These are the vendor and product IDs to look for. //Uses Lakeview Research's Vendor ID. int VendorID = xxxx; int ProductID = xxxx;