how can i transfer data by usb_control_msg from host to avr,in the host i use
the function usb_control_msg, i want to send 44bytes, can you give me a example.thank you
how can i transfer data by usb_control_msg from host to avr
Here's an example:
Code: Select all
char buffer[44];
/* fill buffer with data here... */
nBytes = usb_control_msg(handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE
| USB_ENDPOINT_OUT, MY_REQUEST_ID, 0, 0, buffer, 44, 5000);
if(nBytes < 0)
fprintf(stderr, "USB error: %s\n", usb_strerror());
How can I collect data that is rcvd from Host
I want to xfer some data to avr from Host. I am able to send but how can I collect the same data at avr side. I mean usb_ctrl_request has only request fileds I want the same data in avr. How do it. help greatly appreciated. Thanks in advance
How can I collect data that is rcvd from Host
Thanks for the immediate response. I am running linux on AVR. all I have to do is get some data from host to target. I am able recieve struct usb_ctrlrequest on target, but i dont know how to collect data that was sent by my usb_control_msg from user space. Can u tell me How to collect data apart reqst type, wvalue, windex. I didnt find any usbFuncwrite in code.. Thanks in advance