Page 1 of 1

Custom class send multiple bytes?

Posted: Sat Feb 04, 2012 10:42 pm
by mrzephy
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

Re: Custom class send multiple bytes?

Posted: Fri Mar 09, 2012 5:00 pm
by mrzephy
Bump in case someone can help me with this, still interested in the answer. Thanks.