Custom class send multiple bytes?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
mrzephy
Posts: 5
Joined: Fri Sep 23, 2011 3:32 am

Custom class send multiple bytes?

Post by mrzephy » Sat Feb 04, 2012 10:42 pm

Hey,

How would I go about sending multiple bytes PC->AVR using the custom-class example? I guess the data should probably be in usbMsgPtr, but I don't know how I can find out the length of the buffer?
And what is the purpose of the wValue and wIndex if you use a buffer also? Can I just use those for my data as well (I need more than 4 bytes though)?

This is the code from custom-class that probably has to be changed:

Code: Select all

}else if(rq->bRequest == CUSTOM_RQ_SET_STATUS){
        if(rq->wValue.bytes[0] & 1){    /* set LED */
            LED_PORT_OUTPUT |= _BV(LED_BIT);
        }else{                          /* clear LED */
            LED_PORT_OUTPUT &= ~_BV(LED_BIT);
        }
    }


Thanks

mrzephy
Posts: 5
Joined: Fri Sep 23, 2011 3:32 am

Re: Custom class send multiple bytes?

Post by mrzephy » Fri Mar 09, 2012 5:00 pm

Bump in case someone can help me with this, still interested in the answer. Thanks.

Post Reply