2 Replies Latest reply on May 8, 2016 10:35 PM by tjskk

    wiced_udp_send transmit stuck problem

    tjskk

      I using STM32F4 to transmit camera capture jpep

      form device to server via wifi udp

       

      I do frame transmit, and packet size is 1460, speed 400 packet / second

      it's often stuck on wiced_udp_send

       

      it's my code

      while(pp->length >0){

      if(pp->length>1460){

      if(cam_send_data((uint8_t *)pbuff, (uint16_t)1460 )!= WICED_SUCCESS){

      WPRINT_MACRO(("socket send data : send data failed\r\n"));

      return WICED_ERROR;

      }

      pbuff=(uint8_t *)(pbuff+1460);

      pp->length=(uint32_t)(pp->length-1460);

      } else {

      if(cam_send_data((uint8_t *)pbuff, (uint16_t)pp->length )!= WICED_SUCCESS){

      WPRINT_MACRO(("socket send data : send final data failed\r\n"));

      return WICED_ERROR;

      }

      pp->length=0;

      break;

      }

      }

       

      and cam_send_data is do

      const wiced_ip_address_t INITIALISER_IPV4_ADDRESS( peer_ip_addr, MAKE_IPV4_ADDRESS(192, 168, 1, 35) );

      memcpy(tx_data, pp, data_length);

      wiced_packet_set_data_end(packet, (uint8_t*)tx_data + data_length);

      if (wiced_udp_send(&udp_socket, &peer_ip_addr, peer_port, packet) != WICED_SUCCESS)

      {

      WPRINT_APP_INFO(("UDP packet send failed\n"));

      wiced_packet_delete(packet);

      return WICED_ERROR;

      }

       

      Any solution can fix this problem?