[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Problems with sending UDP packets in FreeRTOS
From: |
Sylvain Rochet |
Subject: |
Re: [lwip-users] Problems with sending UDP packets in FreeRTOS |
Date: |
Thu, 28 Jul 2016 12:16:24 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Hi Mike,
On Thu, Jul 28, 2016 at 10:52:50AM +0100, Mike Fleetwood wrote:
>
> I tried one of Noam's linked examples (included below) - but that showed
> exactly the same problem, stopped sending after about 20 minutes (I couldn't
> tell if it was ERR_USE again, but no reason to think it was any different!).
Well, given how much the snippet below is defective, I assume your whole
software quality is between poor to critically wrong. Given that, the
bug is probably in your low level netif driver.
> void udp_test2(void *arg)
> {
> struct netconn *conn;
> char msg[]="testing" ;
> struct netbuf *buf;
> char * data;
>
> conn = netconn_new( NETCONN_UDP );
Woah, you REALLY HAVE TO check if netconn_new returns a non NULL conn.
> netconn_bind(conn, IP_ADDR_ANY, 1234 ); //local port
You also have to check if netconn_bind actually worked…
> netconn_connect(conn, IP_ADDR_BROADCAST, 1235 );
You also have to check if netconn_connect actually worked…
> for( ;; )
> {
> buf = netbuf_new();
Woah, you REALLY HAVE TO check if netbuf_new returns a non NULL buf.
> data =netbuf_alloc(buf, sizeof(msg));
Woah, you REALLY HAVE TO check if netbuf_alloc returns a non NULL data.
> memcpy (data, msg, sizeof (msg));
You probably wanted to use sizeof(msg)-1 and not sizeof(msg) here, given
you wanted to send a static string.
> netconn_send(conn, buf);
> netbuf_delete(buf); // De-allocate packet buffer
>
> osDelay(4); //some delay!
> }
> }
Dear god.
Sylvain
signature.asc
Description: Digital signature
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, (continued)
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Noam Weissman, 2016/07/27
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Mike Fleetwood, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Noam Weissman, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Mike Fleetwood, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Simon Goldschmidt, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Noam Weissman, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Simon Goldschmidt, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Mike Fleetwood, 2016/07/28
Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Simon Goldschmidt, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Mike Fleetwood, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS,
Sylvain Rochet <=
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Simon Goldschmidt, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Sylvain Rochet, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Mike Fleetwood, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Sylvain Rochet, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, goldsimon, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Sylvain Rochet, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, address@hidden, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Mike Fleetwood, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, goldsimon, 2016/07/28
- Re: [lwip-users] Problems with sending UDP packets in FreeRTOS, Mike Fleetwood, 2016/07/28