lwip netconn with ethernet disconnect

classic Classic list List threaded Threaded
3 messages Options
jim
Reply | Threaded
Open this post in threaded view
|

lwip netconn with ethernet disconnect

jim
Hi,

I have the lwip system working and it is awesome!

I am wondering how to recover from cable disconnect in my application.
On cable disconnect, the driver calls tcpip_callback_with_block which
ends up successfully entering netif_set_link_down.

My application is currently waiting on the receive mailbox through
netconn_recv.

What is the expected behavior when the cable is removed? I would have
expected the blocking  netconn_recv to return with an error.

Thanks in advance for any help.
Jim



_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip netconn with ethernet disconnect

Hugh Reynolds
Jim,

In my application each time I call LWIP I check the connection state reported by the PHY.
I have a state machine that handles cable up/down.
If it is down, when it comes back I re-init LWIP and anything that has been hanging on the line.

That works...every time...is there a better way?

Regards

Hugh

-----Original Message-----
From: lwip-users <lwip-users-bounces+hugh=[hidden email]> On Behalf Of jim
Sent: 08 November 2018 01:46
To: [hidden email]
Cc:
Subject: [lwip-users] lwip netconn with ethernet disconnect

Hi,

I have the lwip system working and it is awesome!

I am wondering how to recover from cable disconnect in my application.
On cable disconnect, the driver calls tcpip_callback_with_block which
ends up successfully entering netif_set_link_down.

My application is currently waiting on the receive mailbox through
netconn_recv.

What is the expected behavior when the cable is removed? I would have
expected the blocking  netconn_recv to return with an error.

Thanks in advance for any help.
Jim



_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip netconn with ethernet disconnect

yacobh@dds-security.com
Hello all,

I check also the connection state reported by the PHY but don't re-init
LWIP.

I call netif_set_link_up() or netif_set_link_down() in accordance with:
a) the connection state reported by PHY
b) the state of netif that reported by netif_is_link_up()

Yacob Hassidim

-----Original Message-----
From: lwip-users <lwip-users-bounces+yacobh=[hidden email]> On
Behalf Of Hugh Reynolds
Sent: Thursday, November 8, 2018 11:28 AM
To: 'Mailing list for lwIP users' <[hidden email]>
Cc: [hidden email]
Subject: Re: [lwip-users] lwip netconn with ethernet disconnect

Jim,

In my application each time I call LWIP I check the connection state
reported by the PHY.
I have a state machine that handles cable up/down.
If it is down, when it comes back I re-init LWIP and anything that has been
hanging on the line.

That works...every time...is there a better way?

Regards

Hugh

-----Original Message-----
From: lwip-users <lwip-users-bounces+hugh=[hidden email]> On
Behalf Of jim
Sent: 08 November 2018 01:46
To: [hidden email]
Cc:
Subject: [lwip-users] lwip netconn with ethernet disconnect

Hi,

I have the lwip system working and it is awesome!

I am wondering how to recover from cable disconnect in my application.
On cable disconnect, the driver calls tcpip_callback_with_block which ends
up successfully entering netif_set_link_down.

My application is currently waiting on the receive mailbox through
netconn_recv.

What is the expected behavior when the cable is removed? I would have
expected the blocking  netconn_recv to return with an error.

Thanks in advance for any help.
Jim



_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users