Hi
I am able to send packets via lwip_sendto in the main thread that I created.
What I then wanted to do was to use a timer in the main thread, using
sys_timeout function to then do the sendout with the timer expires. When I do
this lwip_sendto just hangs there and I cant receive any packets or send any
subsequent packets.
As mentioned previously, if I move the lwip_sendto to the main loop everything
works fine again. What could be causing this?
Placed below is a simplified version of what I am trying to do.
static void
send_actual_pkt( void * args )
{
uint8_t pkt[576];
// ... populate the pkt
uint16_t len = generate_pkt();
if ( lwip_sendto( s, pkt, len, 0, (struct sockaddr *)&from, sizeof(from)
) != len ) <---- hanging here!!!!
{
uart_printf( "Didnt send correctly %x\n", len );
}
}
while( 1 )
{
if ( (lwip_recvfrom(s, raw_buf, sizeof(raw_buf), 0, (struct
sockaddr*)&from, (socklen_t*)&fromlen)) > 0 )
{
sys_timeout( ms, send_actual_pkt, NULL );
}
}
Thanks in advance.
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users