Hi Isaac,
Thanks for your reply.
Now my demo can read and write by using _usb_host_send_data()/ _usb_host_recv_data() api.
but sometimes the data which recerived from device may be confused.
I make the changes on the CDC host demo like below
static const USB_HOST_DRIVER_INFO DriverInfoTable[] = {
{
{0x00,0x00}, /* Vendor ID per USB-IF */
{0x00,0x00}, /* Product ID per manufacturer */
0xFF,//USB_CLASS_COMMUNICATION, /* Class code */
0x00,//USB_SUBCLASS_COM_ABSTRACT, /* Sub-Class code */
0x00,//0xFF, /* Protocol */
0, /* Reserved */
usb_host_cdc_acm_event /* Application call back function */
},
#ifdef USBCLASS_INC_CDC
{
usb_class_cdc_acm_init,
sizeof(USB_ACM_CLASS_INTF_STRUCT),
0xFF,//USB_CLASS_COMMUNICATION,
0x00,//USB_SUBCLASS_COM_ABSTRACT,
0x00,//USB_PROTOCOL_COM_NOSPEC,
0xFF, 0xFF, 0xFE
},
and dev_inst_ptr->state can be set to DEVSTATE_ENUM_OK
case DEVSTATE_SET_INTF: /* Select interface done */
dev_inst_ptr->state = DEVSTATE_ENUM_OK;
usb_hostdev_attach_detach(dev_inst_ptr, USB_INTF_EVENT);
break;
default:
dev_inst_ptr->state = DEVSTATE_ENUM_OK;
case DEVSTATE_ENUM_OK: /* enumeration complete */
if ((dev_inst_ptr->control_callback != NULL))
then i use _usb_host_send_data()/ _usb_host_recv_data() to read and write the corresponding pipe,and it work.
I am busy for other things recently,i will check why sometimes the data which recerived from device are confused when i am free.
Thanks and B.R.
Kun