From f1464653b042155a1496d7ef2a3ab51b85d29e0a Mon Sep 17 00:00:00 2001 From: Niels Gras Date: Mon, 3 Jun 2024 14:31:39 +0200 Subject: [PATCH] added comments --- code/arduino/Movement-sensor-code/Connectivity.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {