Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

begin resetting the NTP server #23

Closed
abaskin opened this issue Sep 11, 2021 · 3 comments
Closed

begin resetting the NTP server #23

abaskin opened this issue Sep 11, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@abaskin
Copy link

abaskin commented Sep 11, 2021

The begin method sets the NTP server if it is called without a value. I find this behavior unintuitive and at minimum suggest that the behavior should be documented. To give an example.

NTP.setNtpServerName("asia.pool.ntp.org");
NTP.begin();

In the code above the NTP server is reset to the default by begin even though it was previously set by setNtpServerName. A better approach would be for begin to only set the NTP server value to the default is it has not already been set.

@gmag11
Copy link
Owner

gmag11 commented Oct 4, 2021

Hello. You are right. I'll make that a prior call to NTP.setNtpServerName(...) force begin to use assigned server if begin() is called without arguments. Thank you

@gmag11 gmag11 added the enhancement New feature or request label Oct 4, 2021
@gmag11
Copy link
Owner

gmag11 commented Oct 4, 2021

This should be working as expected after 8be0624, on dev branch. @abaskin Please test it and give some feedback

@abaskin
Copy link
Author

abaskin commented Oct 5, 2021

I changed my code to set the NTP server before calling begin, pointed to the dev branch and it workes perfectly. Thank you.

@gmag11 gmag11 closed this as completed Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants