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.
Dependencies: NTPClient_NetServices mbed
NTPClient Class Reference
A NTP Client. More...
#include <NTPClient.h>
Inherits NetService.
Public Member Functions | |
| NTPClient () | |
| Instantiates the NTP client. | |
| NTPResult | setTime (const Host &host) |
| Gets current time (blocking) | |
| NTPResult | setTime (const Host &host, void(*pMethod)(NTPResult)) |
| Gets current time (non-blocking) | |
| template<class T > | |
| NTPResult | setTime (const Host &host, T *pItem, void(T::*pMethod)(NTPResult)) |
| Gets current time (non-blocking) | |
| void | doSetTime (const Host &host) |
| Gets current time (non-blocking) | |
| void | setOnResult (void(*pMethod)(NTPResult)) |
| Setups the result callback. | |
Detailed Description
A NTP Client.
The NTP client is a simple UDP client that will update the mbed's RTC
Definition at line 51 of file NTPClient.h.
Constructor & Destructor Documentation
| NTPClient | ( | ) |
Instantiates the NTP client.
Member Function Documentation
| void doSetTime | ( | const Host & | host ) |
Gets current time (non-blocking)
Updates the time using the server host The function returns immediately and calls the previously set callback on completion or error
- Parameters:
-
host : NTP server
| void setOnResult | ( | void(*)(NTPResult) | pMethod ) |
Setups the result callback.
- Parameters:
-
pMethod : callback function
| NTPResult setTime | ( | const Host & | host ) |
Gets current time (blocking)
Updates the time using the server host Blocks until completion
- Parameters:
-
host : NTP server
Gets current time (non-blocking)
Updates the time using the server host The function returns immediately and calls the callback on completion or error
- Parameters:
-
host : NTP server pMethod : callback function
Gets current time (non-blocking)
Updates the time
- Parameters:
-
host : NTP server pItem : instance of class on which to execute the callback method pMethod : callback method The function returns immediately and calls the callback on completion or error
Definition at line 88 of file NTPClient.h.
Generated on Tue Jul 12 2022 22:07:19 by
1.7.2