4 Replies Latest reply on Apr 28, 2016 12:36 AM by axel.lin_1746341

    How to handle insufficient "available_space" in "wiced_packet_create_tcp"?

    avinashckumar.switch

      Hi All,

       

      I am trying to send a rather large packet over TCP in AP mode. The packet varies anywhere between 1400 to 1800 bytes. When I give this length to "wiced_packet_create_tcp", it sometimes returns the "available_space" parameter with a value smaller than my packet size.

       

      What does this mean? Does it mean I have to split up my packet or is it dependent on any other memory?

      Has my application occupied so much memory that the TCP stack is unable to find any more memory?

       

      I am using WICED 3.3.1 with (FreeRTOS + LwIP) on an MXCHIP EMW3162 module with STM32 and BCM43362A2.

       

      Sample Code: (Function from my end responsible for sending packets).

          if ((result = wiced_packet_create_tcp( socket, strlen (response), &tx_packet, (uint8_t**) &tx_data, &available_data_length )) != WICED_SUCCESS )
          {
              MYLOG("TCP packet creation failed, %d", result);
              return WICED_ERROR;
          }
          if (available_data_length >= strlen(response)) {
              MYLOG (" Not enough memory available for sending data ");
              return WICED_ERROR;
          }

      Thanks in advance for the help.

      Best Regards,

      Avinash

       

      Message was edited by: Avinash Kumar The title could have been better framed.