lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] LWIP RAW API tcpip_callback()


From: Werner Motz
Subject: Re: [lwip-users] LWIP RAW API tcpip_callback()
Date: Wed, 17 May 2017 08:36:54 +0200

> In my freertos task (outside lwip) I do following:
>
> [..]
>
>              tcpip_callback_with_block(WTF, tcp_active_pcbs, 0);

Why on earth would you pass 'tcp_active_pcbs'? Wherever you got that
from: tell them this is wrong and they should stop spreading such horrible
code examples!

---> passing tcp_active_pcbs is not necessary because as u already
mentioned, I could call it everywhere. I just tried to give a parameter to
the callback function.

Starting with 2.0.0, you can even link this only when including
"lwip/priv/tcp_priv.h". And guess what, 'priv' means 'private'. Not
'public'! You should smell there's something wrong when an application needs
to include the private headers of the stack!

---> Obviously it is not good / right to call macros and functions from
there. Could you mention another way where to get the active pcbs from
outside the lwip thread?
>
> Unfortunatelly I run into Assert function in 
> tcpip_callback_with_block(.)
>
> LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
>

This indicates you have not called lwip_init(). I wonder who told you how to
start with lwIP? Did you see there are actually files in the 'doc' folder?

---> You are wrong! Lwip_init() has been called before. If you would have
read my message you would know that I am able to establish a connection and
receive data via recv callback.


Really (and not meant in an offensive way!), I'm with Dirk thinking you need
someone teaching you lessons on embedded programming. Or you need to pay
someone programming your devices if this is about devices you want to
sell...

---> Serious? You did not even answer to one of my questions. I didn't ask
for a master solution. I politely asked for the proper way to send data from
outside the lwip_thread.
That my code is obviously bad I do already know. I am not a C developer.
Never learned it. I apologize myself for asking u noob questions and going
to cancel my address from the mail list.
Thank you for your help.


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]