This commit is contained in:
2025-05-25 00:49:53 -04:00
parent 22f5b16eba
commit 7ed52f2733
23 changed files with 812 additions and 70 deletions

View File

@@ -0,0 +1,16 @@
//
// Created by Johnathon Slightham on 2025-05-25.
//
#ifndef COMMUNICATIONROUTER_H
#define COMMUNICATIONROUTER_H
class CommunicationRouter {
};
#endif //COMMUNICATIONROUTER_H

View File

@@ -0,0 +1,8 @@
//
// Created by Johnathon Slightham on 2025-05-25.
//
#ifndef DISCOVERYSERVICE_H
#define DISCOVERYSERVICE_H
#endif //DISCOVERYSERVICE_H

View File

@@ -0,0 +1,8 @@
//
// Created by Johnathon Slightham on 2025-05-25.
//
#ifndef ICOMMUNICATIONROUTER_H
#define ICOMMUNICATIONROUTER_H
#endif //ICOMMUNICATIONROUTER_H

View File

@@ -0,0 +1,8 @@
//
// Created by Johnathon Slightham on 2025-05-25.
//
#ifndef IMESSAGINGINTERFACE_H
#define IMESSAGINGINTERFACE_H
#endif //IMESSAGINGINTERFACE_H

View File

@@ -0,0 +1,8 @@
//
// Created by Johnathon Slightham on 2025-05-25.
//
#ifndef IRPCSERVER_H
#define IRPCSERVER_H
#endif //IRPCSERVER_H

View File

@@ -0,0 +1,16 @@
//
// Created by Johnathon Slightham on 2025-05-25.
//
#ifndef MESSAGINGINTERFACE_H
#define MESSAGINGINTERFACE_H
class MessagingInterface {
};
#endif //MESSAGINGINTERFACE_H

View File

@@ -0,0 +1,8 @@
//
// Created by Johnathon Slightham on 2025-05-25.
//
#ifndef RPCFACTORY_H
#define RPCFACTORY_H
#endif //RPCFACTORY_H

View File

@@ -0,0 +1,8 @@
//
// Created by Johnathon Slightham on 2025-05-25.
//
#ifndef TCPSERVER_H
#define TCPSERVER_H
#endif //TCPSERVER_H

View File

@@ -0,0 +1,39 @@
#ifndef NETWORKMANAGER_H
#define NETWORKMANAGER_H
#include "esp_event.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
class WifiManager {
public:
WifiManager() = default;
~WifiManager() = default;
int init();
int connect();
int disconnect();
[[noreturn]] void manage();
enum class wifi_state { connect, connected, disconnected, connecting, disconnect, searching };
private:
void update_state(wifi_state state);
[[noreturn]] static void s_manage(WifiManager *that);
int init_connection();
int handle_connecting();
int handle_disconnect();
int handle_search();
static void wifi_event_handler(void *event_handler_arg, esp_event_base_t event_base, int32_t event_id, void *event_data);
SemaphoreHandle_t m_mutex;
wifi_state m_state;
TaskHandle_t m_task;
unsigned int m_attempts;
};
#endif //NETWORKMANAGER_H