diff --git a/NTPClient.cpp b/NTPClient.cpp index ddb76fb..caa30d1 100755 --- a/NTPClient.cpp +++ b/NTPClient.cpp @@ -204,7 +204,7 @@ void NTPClient::sendNTPPacket() { this->_udp->endPacket(); } -void NTPClient::setRandomPort() { +void NTPClient::setRandomPort(long minValue, long maxValue) { randomSeed(analogRead(0)); - this->_port = random(1, 65534); + this->_port = random(minValue, maxValue); } \ No newline at end of file diff --git a/NTPClient.h b/NTPClient.h index 6498e82..226f54a 100755 --- a/NTPClient.h +++ b/NTPClient.h @@ -47,7 +47,7 @@ class NTPClient { /** * Set random local port */ - void setRandomPort(); + void setRandomPort(long minValue, long maxValue); /** * Starts the underlying UDP client with the default local port