diff --git a/code/arduino/Movement-sensor-code/Connectivity.cpp b/code/arduino/Movement-sensor-code/Connectivity.cpp index bfc3c04..2e9b69d 100644 --- a/code/arduino/Movement-sensor-code/Connectivity.cpp +++ b/code/arduino/Movement-sensor-code/Connectivity.cpp @@ -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 {