Content originally posted in LPCWare by saraswathi on Tue May 14 11:45:37 MST 2013
Hi Tsuneo,
Thank you for the quick reply.
Now I have configured the firmware for sending and receiving 64 bytes of data. Also, now I am able to receive the valid data and length values at HID_SetReport() callback function. However, the return value of libusb_conrol_transfer() API is -9(PIPE error). I am not able to understand, even though I receive the valid data and length values at device, why I am getting error code at host?
Do you have any idea on this?
I also have one more problem on libusb_control_transfer() API.
The following is the libUSB API I am using for getting the data from device.
libusb_control_transfer(dev_handle, (LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE), HID_GET_REPORT, ((HID_REPORT_TYPE_INPUT<<8)|(CUSTOM_CMD)), INTERFACE_NUMBER, data, sizeof(data), 500)
The following is the libUSB API I am using for sending the data to device.
libusb_control_transfer(dev_handle, (LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE), HID_SET_REPORT, ((HID_REPORT_TYPE_OUTPUT<<8)|(CUSTOM_CMD)), INTERFACE_NUMBER, data, sizeof(data), 500)
I have a situation where I need to send the address to read the flash and receive the read data from the device. In this case I am not able to use the above mentioned commands. Is there any other way in control transfer to do the two way communication?
Or I need to use interrupt endpoints for this type of communication?
Can you please share your opinion on this?
With regards
Saraswathi C