Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: blinky_max32630fthr
NTPClient.h File Reference
NTP Client header file. More...
Go to the source code of this file.
Data Structures | |
| class | NTPClient |
| NTP Client to update the mbed's RTC using a remote time server. More... | |
Enumerations | |
| enum | NTPResult { NTP_DNS, NTP_PRTCL, NTP_TIMEOUT, NTP_CONN, NTP_OK = 0 } |
NTP client results. More... | |
Functions | |
| NTPClient () | |
| Instantiate the NTP client. | |
| NTPResult | setTime (const char *host, uint16_t port=NTP_DEFAULT_PORT, uint32_t timeout=NTP_DEFAULT_TIMEOUT) |
| Get current time (blocking) Update the time using the server host Blocks until completion. | |
Detailed Description
NTP Client header file.
Definition in file NTPClient.h.
Enumeration Type Documentation
| enum NTPResult |
NTP client results.
- Enumerator:
NTP_DNS Could not resolve name.
NTP_PRTCL Protocol error.
NTP_TIMEOUT Connection timeout.
NTP_CONN Connection error.
NTP_OK Success.
Definition at line 33 of file NTPClient.h.
Function Documentation
| __attribute__::NTPClient | ( | ) |
Instantiate the NTP client.
| NTPResult __attribute__::setTime | ( | const char * | host, |
| uint16_t | port = NTP_DEFAULT_PORT, |
||
| uint32_t | timeout = NTP_DEFAULT_TIMEOUT |
||
| ) |
Get current time (blocking) Update the time using the server host Blocks until completion.
- Parameters:
-
host NTP server IPv4 address or hostname (will be resolved via DNS) port port to use; defaults to 123 timeout waiting timeout in ms (osWaitForever for blocking function, not recommended)
- Returns:
- 0 on success, NTP error code (<0) on failure
Generated on Tue Jul 12 2022 14:21:29 by
1.7.2
