USB CDC Device Send and Receive data

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USB CDC Device Send and Receive data

1,408 次查看
GiulianoLeitede
Contributor II

I'm trying to migrate some code from old FLS USB to KSDK USB stack and I'm facing some troubles to find basic functions like _send and _recv when working with CDC class. The "USB Stack Device RM" on session 3.6.2.6 and 3.6.2.7 saws about "usb_device_cdc_acm_send" and "usb_device_cdc_acm_recv" respectively but I couldn't find those functions anywhere. Also the CDC_VCOM example doesn't make use of them to send and receive data to and from host, instead it writes or reads a buffer and makes use of "USB_DeviceSendRequest" function. Where can I find those _send and _recv functions pointed by documentation?

 

Thanks

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

953 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Giuliano Vitor

Seams that USB documentation for SDK 2.0 is not updated. usb_device_cdc_acm_send and usb_device_cdc_acm_recv were used for SDK 1.3, in SDK 2.0 you can find this functions like USB_DeviceCdcAcmRecv and USB_DeviceCdcAcmSend. For example in the cdc_vcom example you can find in the kUSB_DeviceCdcEventSendResponse and kUSB_DeviceCdcEventRecvResponse events something like:

case kUSB_DeviceCdcEventSendResponse:     
{
...
USB_DeviceCdcAcmRecv(handle,
                     USB_CDC_VCOM_BULK_OUT_ENDPOINT,
                     s_currRecvBuf,
                     g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);‍‍‍‍‍
...
break;
}

case kUSB_DeviceCdcEventRecvResponse:
{
     if ((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions))
     {
          s_recvSize = epCbParam->length;
          if (!s_recvSize)
          {
          /* Schedule buffer for next receive event */
          USB_DeviceCdcAcmRecv(handle,
                               USB_CDC_VCOM_BULK_OUT_ENDPOINT,
                               s_currRecvBuf,
                               g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);
...
break;
}

inside USB_DeviceCdcAcmRecv and USB_DeviceCdcAcmSend they used this USB_DeviceRecvRequest and USB_DeviceSendRequest that you mentioned

Hope this information help you

Best Regards

Jorge Alcala

0 项奖励
回复