added comments
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user