Skip to content

Commit bf3fdbb

Browse files
committed
Create random UUIDs
1 parent 1a2a01a commit bf3fdbb

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/EspSigK.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class EspSigK
7272
bool lastPrintDebugSerialHadNewline;
7373

7474
WiFiClient * wiFiClient;
75+
76+
long seedForUuidGeneration;
7577

7678

7779

‎src/EspSigK.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ EspSigK::EspSigK(String hostname, String ssid, String ssidPass, WiFiClient * cli
139139
deltaPaths[i] = "";
140140
deltaValues[i] = "";
141141
}
142+
143+
seedForUuidGeneration = millis();
142144
}
143145

144146
void EspSigK::setWiFiConnectTimeout(uint timeoutMs) {
@@ -896,6 +898,7 @@ String EspSigK::preferencesGetClientId() {
896898

897899
if (clientIdPreferences == "") {
898900
uuid.setRandomMode();
901+
uuid.seed((uint32_t) seedForUuidGeneration, (uint32_t) millis());
899902
uuid.generate();
900903
String newClientId = String(uuid.toCharArray());
901904
printDebugSerialMessage("New clientId: ", false);

0 commit comments

Comments
 (0)