Delta Robot example
Dependencies: BufferedSerial Eigen
Fork of TCPSocket_Example by
Diff: ntp.h
- Revision:
- 5:01e1e68309ae
diff -r 778bc352c47f -r 01e1e68309ae ntp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ntp.h Mon Oct 15 18:30:20 2018 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" + +#define NTP_DEFULT_NIST_SERVER_ADDRESS "2.pool.ntp.org" +#define NTP_DEFULT_NIST_SERVER_PORT 123 + +class NTPClient { + public: + NTPClient(NetworkInterface *iface); + void set_server(char* server, int port); + time_t get_timestamp(int timeout = 15000); + + private: + NetworkInterface *iface; + char* nist_server_address; + int nist_server_port; + + uint32_t ntohl(uint32_t num); +}; \ No newline at end of file