USB Host

Moderator: ESP_Bob

Unique
Posts: 21
Joined: Tue Jun 08, 2021 5:42 am

Re: USB Host

Postby Unique » Sat Oct 09, 2021 8:14 am

暂时用了以下方式解决:
当数据长度正好为mps大小时,将数据拆分为32+32两包数据发送

Code: Select all

void network_lte_send(const void* src, size_t size)
{
  static const char *TAG = "USB输出";
  switch (LTE_trans_mode_default)
  {
  case LTE_trans_usb:
    if(size == 64)
    {
      uint8_t *src1 = src;
      uint8_t *src2 = src + 32;
      ESP_LOGI(TAG,"处理64字节包");
      usbh_cdc_write_bytes(src1,32);
      usbh_cdc_write_bytes(src2,32);
    }
    else
    {
      usbh_cdc_write_bytes(src,size);
    }
    break;
  case LTE_trans_uart:
    uart_write_bytes(UART_NUM_0,src,size);
  default:

Who is online

Users browsing this forum: No registered users and 42 guests