lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Setting NTP server address according to some conditions


From: address@hidden
Subject: Re: [lwip-users] Setting NTP server address according to some conditions
Date: Wed, 17 Jul 2019 20:37:25 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Am 19.04.2019 um 09:33 schrieb address@hidden:
Hi!

I’m using LWIP 2.0.3. In my code I have a static  NTP server address.
But this address can be invalid or valid (depending what the user will
write in it). If DHCP is enabled I want to reach the following behavior:

  * If the NTP server address is delivered via the DHCP, it will be set
    and used (it doesn’t matter what is the static address).
  * If the NTP server address is not delivered via the DHCP and the
    static NTP server address is invalid, the NTP will not be initialized.
  * If the NTP server address is not delivered, but the static NTP
    server address is valid, the NTP will be initialized and will use
    the static address.

To reach this, I need to decide what to do in the call of the function
dhcp_set_ntp_address(). But there is no callback, so I cannot call my
own code. How can I reach this behavior without modifying the original
code of the stack (file sntp.c)?

This is open source development: post a patch that does what you want in
a portable way and we'll see if it can be added.

Regards,
Simon



reply via email to

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