|
From: | Noam Weissman |
Subject: | Re: [lwip-users] how to set the link up |
Date: | Wed, 5 Jul 2017 16:55:24 +0000 |
Hi,
Yes I have two tasks... One polling the link and another handling the application side DHCP.
You can use one task but in my case as the code is shared between devices I have split it to
two separate tasks. In that case every device may be different. Sometimes the link task is a bit
different (local) because the network part is different... Sometimes it has just a PHY, sometimes it has a switch etc...
My DHCP task calls dhcp_start and wait for an IP. If there is a timeout the task will assign a static default IP. You can do something similar.
BR, Noam. From: lwip-users <lwip-users-bounces+address@hidden> on behalf of massimiliano cialdi <address@hidden>
Sent: Wednesday, July 5, 2017 6:25 PM To: address@hidden Subject: Re: [lwip-users] how to set the link up So you have a task to manage link status an another to manage DHCP?
I have to make possible to change ip address or switch between static and dynamic ip without reboot. I noticed that when the board has a DHCP assigned IP and the link goes down, the board do not change ip or switch in auto ip. So I'm going to setup a task to poll PHY link status (and speed, to switch on/off speed led), and another task to manage ip assignment. These task should be under application layer. I do not know if it's a good idea. best regards Max On 05/07/2017 16:40, Noam Weissman wrote:
Hi Sylvian, THANKS for pointing this out !!!. I am using the code I sent for several years and was not aware of that :-( The base code was taken from ST example !! I could not find netifapi_netif_set_link_up ... did you mean netifapi_netif_set_up ? |
[Prev in Thread] | Current Thread | [Next in Thread] |