added comments to Connectivity class

This commit is contained in:
Niels
2024-06-06 13:59:38 +02:00
parent 36b0d079b2
commit b2ead915ef
2 changed files with 5 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ void Connectivity::connectWiFi(char* ssid, char* pass){
const char* getServerURL = "http://145.92.8.132:443/get-ip";
String ipAddress = ""; // string that will hold the server's IP address
/** Fetch the IP address of pepper from the server */
const char* Connectivity::fetchIPAddress() {
char* ipAddress = NULL; // Declare ipAddress as a char*
if (WiFi.status() == WL_CONNECTED) {
@@ -48,7 +49,7 @@ const char* Connectivity::fetchIPAddress() {
} else {
Serial.println("WiFi not connected");
}
return ipAddress; // Add this return statement
return ipAddress;
}
/** Send a POST request to a server with provided data */

View File

@@ -14,7 +14,7 @@
#include <ArduinoJson.h>
// declare the class Connectivity with all functions
class Connectivity {
public:
void connectWiFi(char* ssid, char* pass);