Author Topic: decoding my analyzer  (Read 9513 times)

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
decoding my analyzer
« on: January 05, 2019, 10:23:17 am »
Need some help decoding my analyzer.

This is a snap of a control transfer but I need to convert this to software. Where is the Rid and type?
« Last Edit: January 05, 2019, 01:24:50 pm by ulao »

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
Re: decoding my analyzer
« Reply #1 on: January 05, 2019, 12:55:10 pm »
Ok I was missing my setup, still not sure shy this is not working.

In the setup I see it's a control transfer : device to host, class, interface, guessing report ID 0 and a size of 6 request 09 (set report) with report ID 0 and an out (02) . In my software I see that exact same thing but my data (data1) is something like ff,50,6d,b6. And on my analyzer I see the right data I would expect, 0,6,0,0,0,0 guessing again rid,size,d0,d1,d2,d3 - but a bit confused at why only 4 bytes. Unless the first two are data and just a coincidence.

this code shows my confusion. I do get 6 bytes but the data part is nothing like I see in the analyzer.
Code: [Select]
case HID_REQ_SetReport:// (09)
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE) )
{
if (USB_ControlRequest.wValue == 0x0200) //out report ID 0
{
uint8_t  ReportData[USB_ControlRequest.wLength];
test[0]= ReportData[0];//255
test[1]= ReportData[1];//80
test[2]= ReportData[2];//6d
test[3]= ReportData[3];//b6
test[4]= ReportData[4];//2
}
}

« Last Edit: January 05, 2019, 02:17:13 pm by ulao »

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
Re: decoding my analyzer
« Reply #2 on: January 05, 2019, 03:48:31 pm »
was a lufa issue. Needed to add

         Endpoint_ClearSETUP();
         Endpoint_Read_Control_Stream_LE(ReportData, ReportSize);
         Endpoint_ClearIN();