File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ void NTPClient::begin() {
73
73
this ->begin (NTP_DEFAULT_LOCAL_PORT);
74
74
}
75
75
76
- void NTPClient::begin (long port) {
76
+ void NTPClient::begin (unsigned int port) {
77
77
this ->_port = port;
78
78
79
79
this ->_udp ->begin (this ->_port );
@@ -181,7 +181,7 @@ void NTPClient::sendNTPPacket() {
181
181
// set all bytes in the buffer to 0
182
182
memset (this ->_packetBuffer , 0 , NTP_PACKET_SIZE);
183
183
// Initialize values needed to form NTP request
184
- // (see URL above for details on the packets) Serial.println(this->_port);
184
+ // (see URL above for details on the packets)
185
185
186
186
this ->_packetBuffer [0 ] = 0b11100011 ; // LI, Version, Mode
187
187
this ->_packetBuffer [1 ] = 0 ; // Stratum, or type of clock
@@ -204,7 +204,7 @@ void NTPClient::sendNTPPacket() {
204
204
this ->_udp ->endPacket ();
205
205
}
206
206
207
- void NTPClient::setRandomPort (long minValue, long maxValue) {
207
+ void NTPClient::setRandomPort (unsigned int minValue, unsigned int maxValue) {
208
208
randomSeed (analogRead (0 ));
209
209
this ->_port = random (minValue, maxValue);
210
210
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class NTPClient {
15
15
16
16
const char * _poolServerName = " pool.ntp.org" ; // Default time server
17
17
IPAddress _poolServerIP;
18
- long _port = NTP_DEFAULT_LOCAL_PORT;
18
+ unsigned int _port = NTP_DEFAULT_LOCAL_PORT;
19
19
long _timeOffset = 0 ;
20
20
21
21
unsigned long _updateInterval = 60000 ; // In ms
@@ -47,7 +47,7 @@ class NTPClient {
47
47
/* *
48
48
* Set random local port
49
49
*/
50
- void setRandomPort (long minValue, long maxValue);
50
+ void setRandomPort (unsigned int minValue, unsigned int maxValue);
51
51
52
52
/* *
53
53
* Starts the underlying UDP client with the default local port
@@ -57,7 +57,7 @@ class NTPClient {
57
57
/* *
58
58
* Starts the underlying UDP client with the specified local port
59
59
*/
60
- void begin (long port);
60
+ void begin (unsigned int port);
61
61
62
62
/* *
63
63
* This should be called in the main loop of your application. By default an update from the NTP Server is only
You can’t perform that action at this time.
0 commit comments