Ports and Interfaces > USB

linux box not allowing control set's but does get's ok.

(1/3) > >>

ulao:
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.

bpaddock:
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?

ulao:
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.




Looking at this I do see I forgot to change the array report size to a 4. I did try 8 but get the same results.  Another interesting 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.

ulao:
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: ---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;
 }
--- End code ---

ulao:
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. Using wirewhark I don't see an error at all. The packet even completes in a timely manner. Yet the libusb code is waiting for some sort of reply that never occurs.

Jan, maybe when you return and have time can you update a feature control out transfer sample using the latest libusb?

Navigation

[0] Message Index

[#] Next page

Go to full version