Recent Posts

Pages: [1] 2 3 ... 10
1
USB / Re: linux box not allowing control set's but does get's ok.
« Last post by ulao on August 16, 2018, 08:50:51 am »
WFT?

this worked.
 question[0]=0x12; question[1]=1; question[4]=0x00; r = libusb_control_transfer(devh, CTRL_OUT,HID_SET_REPORT,(HID_REPORT_TYPE_FEATURE<<8)|0x12, 0,question, 8,TIMEOUT);

this does not

 question[0]=1; question[3]=0x00; r = libusb_control_transfer(devh, CTRL_OUT,HID_SET_REPORT,(HID_REPORT_TYPE_FEATURE<<8)|0x12, 0,question, 8,TIMEOUT);

so you have to pass in the report id in the first element as well as the parameter ? That's stupid.

oddly I get  error -7 even though it worked.
2
USB / Re: linux box not allowing control set's but does get's ok.
« Last post by ulao on August 16, 2018, 07:49:33 am »
I created a test sample from a claimed working version online and it would seem there is a bug in the latest lib usb as it too is not working. I already tied a few versions os libusb 1.x


my report id is 18
sending a out control transfer feature report
no error, but does not hit device.

Code: [Select]
static int test_control_transfer(void)
 {
 int r,i;
 char answer[PACKET_CTRL_LEN];
 char question[8];
  question[0]=1;
 question[3]=0xff;
 fprintf(stderr, "----------------\n");

 r = libusb_control_transfer(devh,CTRL_OUT,HID_SET_REPORT,(HID_REPORT_TYPE_FEATURE<<8)|0x12, 0,question, 8,TIMEOUT);
 if (r < 0) {
 fprintf(stderr, "Control Out error %d\n", r);
 return r;
 }

 return 0;
 }
3
USB / Re: linux box not allowing control set's but does get's ok.
« Last post by ulao on August 15, 2018, 10:36:28 am »
nope, we are good with the permissions.  Plus the get operations are working.

I did see this...

watching forceFeedback (it uses a set control transfer ) it works


so I dummied up a clone in my app.



The only difference here is the transfer flags... I see no reference of this in my 1.0 libusb api.  Anyone know what this is?


huh, looking at this I do see I forgot to change the array report size to a 4. I can try that. Another intersting thing here is that any data I send the device says it received it. I can make up a report id with some random size and it thinks it worked.
4
USB / Re: linux box not allowing control set's but does get's ok.
« Last post by bpaddock on August 15, 2018, 07:45:18 am »
Are there any issues with the UDEV rules for the user account?
They can prevent writes while allowing reads.
Does demsg shed any light when it happens?
5
USB / linux box not allowing control set's but does get's ok.
« Last post by ulao on August 14, 2018, 11:33:59 am »
I can use a get control transfer no problem on linux but a set is failing.

This is what wireshark sees when use a set. The data never made it to the device.


attached WS log.
6
USB / Note from Jan
« Last post by Jan Axelson on August 09, 2018, 11:05:39 pm »
I will be mostly offline through Aug 25 but please feel free to continue to post questions (and answers!) and I will respond as I am available.
7
USB / Re: USAGE_MAXIMUM in Report Descriptor
« Last post by Jan Axelson on August 06, 2018, 09:27:28 pm »
Agree!
8
USB / Re: USAGE_MAXIMUM in Report Descriptor
« Last post by Doug D. on August 06, 2018, 07:54:50 pm »
Thanks for explaining that Jan.  That section of the USB specification is sheer torture.  I can't believe how convoluted the design is, and how badly it was written--complete with grammatical errors in the worst possible places.  I'm sure developers have been suffering over it for 17 years now.
9
USB / Re: USAGE_MAXIMUM in Report Descriptor
« Last post by Jan Axelson on August 05, 2018, 03:28:30 pm »
The purpose of Usages is to help the host decide how to use the report data. If the data is vendor-defined and your host application will know how to use it, go ahead and use the same Usage value for all of the data.

If you want to give each byte a unique Usage, you can use the MINIMUM and MAXIMUM items to define them all at once.
10
USB / Re: USAGE_MAXIMUM in Report Descriptor
« Last post by Doug D. on August 04, 2018, 12:08:22 pm »
I have read section 6.2.2 (Report Descriptor) of the HID 1.11 specification as well as Chapter 12 of your book (HID Reports), but I still need help in understanding USAGE.

Does this apply to multiple data fields (e.g. bytes), as well as control fields (e.g. keyboard buttons)?  All 64 of my REPORT_COUNT items will be interpreted by my host application as data bytes, not as controls.  I need a report descriptor for transferring my 64-byte reports into a buffer, where I can unpack them into a known data format of 8-bit and 32-bit data words.

I understand that "Local" items in a report descriptor (e.g. USAGE) modify the subsequent "Main" item in the descriptor (e.g. INPUT), but how many USAGEs do I need?  Can I really have the same USAGE number for all 64 of my REPORT_COUNT fields (bytes)?

If so, why would I need to declare the usage range "USAGE_MINIMUM" to "USAGE_MAXIMUM"?  Couldn't I just declare a single usage number (e.g. "USAGE (Vendor Usage 1)", i.e. 0x09 0x01) for all of my "Main" INPUT and OUTPUT fields?  Or, since this is a vendor-defined application, could I even declare "USAGE (Undefined)", i.e. 0x09 0x00?

If not, then that brings me back to my original question--how can I specify a USAGE_MAXIMUM for my 64 fields with the Descriptor Tool?
Pages: [1] 2 3 ... 10