define and use ( NTP_CLIENT_PORT )
Dependents: header_main header_main_public header_main_publish header_main_colinas_V0
Fork of NTPClient by
Diff: NTPClient.cpp
- Revision:
- 7:1114d8054150
- Parent:
- 6:1e5f969b85cc
- Child:
- 8:95a72c23f3c6
diff -r 1e5f969b85cc -r 1114d8054150 NTPClient.cpp --- a/NTPClient.cpp Wed Aug 27 21:10:14 2014 +0000 +++ b/NTPClient.cpp Thu Aug 28 12:23:53 2014 +0000 @@ -41,7 +41,7 @@ #include "mbed.h" //time() and set_time() #define NTP_PORT 123 -#define NTP_CLIENT_PORT 0 //Random port +#define NTP_CLIENT_PORT 8138 // specific port #define NTP_TIMESTAMP_DELTA 2208988800ull //Diff btw a UNIX timestamp (Starting Jan, 1st 1970) and a NTP timestamp (Starting Jan, 1st 1900) NTPClient::NTPClient() : m_sock() @@ -61,7 +61,7 @@ //Create & bind socket DBG("Binding socket"); //m_sock.bind(0); // Bind to a random port - m_sock.bind( 8138 ); // Bind to an specific port + m_sock.bind( NTP_CLIENT_PORT ); // Bind to an specific port m_sock.set_blocking( false, timeout ); //Set not blocking