A sprinkler controller that takes HTTP command for zone and duration.
Dependencies: EthernetNetIf mbed HTTPServer
NTPClient Class Reference
A NTP Client. More...
#include <NTPClient.h>
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.
Definition at line 45 of file NTPClient.cpp.
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
Definition at line 81 of file NTPClient.cpp.
void setOnResult | ( | void(*)(NTPResult) | pMethod ) |
Setups the result callback.
- Parameters:
-
pMethod : callback function
Definition at line 102 of file NTPClient.cpp.
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
Definition at line 64 of file NTPClient.cpp.
NTPResult setTime | ( | const Host & | host ) |
Gets current time (blocking)
Updates the time using the server host Blocks until completion
- Parameters:
-
host : NTP server
Definition at line 58 of file NTPClient.cpp.
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 Fri Jul 15 2022 01:20:29 by 1.7.2