USB CDC Device Send and Receive data

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB CDC Device Send and Receive data

1,919件の閲覧回数
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 返信

1,464件の閲覧回数
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 件の賞賛
返信