Adding range choice for setRandomPort()
This commit is contained in:
parent
a8bdae7ca4
commit
9e4323bcef
@ -204,7 +204,7 @@ void NTPClient::sendNTPPacket() {
|
|||||||
this->_udp->endPacket();
|
this->_udp->endPacket();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NTPClient::setRandomPort() {
|
void NTPClient::setRandomPort(long minValue, long maxValue) {
|
||||||
randomSeed(analogRead(0));
|
randomSeed(analogRead(0));
|
||||||
this->_port = random(1, 65534);
|
this->_port = random(minValue, maxValue);
|
||||||
}
|
}
|
@ -47,7 +47,7 @@ class NTPClient {
|
|||||||
/**
|
/**
|
||||||
* Set random local port
|
* Set random local port
|
||||||
*/
|
*/
|
||||||
void setRandomPort();
|
void setRandomPort(long minValue, long maxValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the underlying UDP client with the default local port
|
* Starts the underlying UDP client with the default local port
|
||||||
|
Loading…
Reference in New Issue
Block a user