added comments

This commit is contained in:
Niels Gras
2024-06-03 14:31:39 +02:00
parent c084443799
commit f1464653b0

View File

@@ -21,7 +21,7 @@ void Connectivity::connectWiFi(char* ssid, char* pass){
// }
const char* getServerURL = "http://145.92.8.132:443/get-ip";
String ipAddress = "";
String ipAddress = ""; // string that will hold the server's IP address
String Connectivity::fetchIPAddress() {
if (WiFi.status() == WL_CONNECTED) {
@@ -32,6 +32,7 @@ String Connectivity::fetchIPAddress() {
int httpCode = http.GET();
if (httpCode > 0) {
if (httpCode == HTTP_CODE_OK) {
// If successful (code 200), read the response body and store the IP address
ipAddress = http.getString();
}
} else {