Hi,
I am trying to make a TCP-Server application for the MIMXRT1020-EVK card using Netx.
My application needs to receive a command via TCP and transmit a 6144-byte buffer in response.
Using the function below, the application works correctly if len is up to 4096 bytes, otherwise send_tcp fails.
What am I doing wrong in the code below? Is it necessary to segment the buffer into smaller packets and wait for each one to be transmitted before transmitting the next one?
Does anyone know any higher level way to transmit data via TCP on NetX?
void TCP_Send(void *buf, uint32_t len)
{
UINT ret;
NX_PACKET *send_packet;
nx_packet_allocate(&AppPool,&send_packet,NX_TCP_PACKET,NX_WAIT_FOREVER);
nx_packet_data_append(send_packet,buf,len,&AppPool,NX_WAIT_FOREVER);
ret = nx_tcp_socket_send(&TCPSocket, send_packet, NX_WAIT_FOREVER);
if(ret) nx_packet_release(send_packet);
}