hid-data comunication problem

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
24c1024
Posts: 2
Joined: Sat Sep 10, 2016 7:07 am

hid-data comunication problem

Post by 24c1024 » Sat Sep 10, 2016 4:35 pm

hi

i use hid-data example with 2 reportid .

how can i get data from pc in avr ?

in usbFunctionSetup

rq->wIndex.bytes[1];

is return report id ?

how can i get hid buffer data ?

thanks

mostafayasin
Posts: 6
Joined: Sun Oct 21, 2018 12:30 am

Re: hid-data comunication problem

Post by mostafayasin » Mon Oct 22, 2018 4:06 pm

I think the first byte it contain the report ID .

ulao
Rank 4
Rank 4
Posts: 480
Joined: Mon Aug 25, 2008 8:45 pm

Re: hid-data comunication problem

Post by ulao » Wed Oct 24, 2018 4:06 pm

yeah,

usbRequest_t *rq = (void *)data;
char rID = rq->wValue.bytes[0];//report ID;

then you can do

if(rq->bRequest == USBRQ_HID_GET_REPORT)//features reports.
and
if (rID == 1)

wait.. This is a 2 year old post? LOL Don't bump those man... ;)

ulao
Rank 4
Rank 4
Posts: 480
Joined: Mon Aug 25, 2008 8:45 pm

Re: hid-data comunication problem

Post by ulao » Tue Dec 04, 2018 6:43 pm

First byte is report ID if there are report IDs in the report. In the case you do not use Report ID's, the first byte is first data.

Post Reply