Cleanup RPC component

This commit is contained in:
2025-05-26 14:44:08 -04:00
parent eadd76f570
commit bc6b2a4500
15 changed files with 81 additions and 32 deletions

View File

@@ -7,7 +7,7 @@
class CommunicationRouter {
class CommunicationRouter : ICommunicationRouter {
};

View File

@@ -5,4 +5,8 @@
#ifndef ICOMMUNICATIONROUTER_H
#define ICOMMUNICATIONROUTER_H
class ICommunicationRouter {
}
#endif //ICOMMUNICATIONROUTER_H

View File

@@ -0,0 +1,12 @@
//
// Created by Johnathon Slightham on 2025-05-26.
//
#ifndef IDISCOVERYSERVICE_H
#define IDISCOVERYSERVICE_H
class IDiscoveryService {
}
#endif //IDISCOVERYSERVICE_H

View File

@@ -5,4 +5,8 @@
#ifndef IRPCSERVER_H
#define IRPCSERVER_H
class IRPCServer {
}
#endif //IRPCSERVER_H

View File

@@ -0,0 +1,15 @@
//
// Created by Johnathon Slightham on 2025-05-26.
//
#ifndef IWIFIMANAGER_H
#define IWIFIMANAGER_H
class IWifiManager {
public:
virtual ~IWifiManager() {};
virtual int connect() = 0;
virtual int disconnect() = 0;
};
#endif //IWIFIMANAGER_H

View File

@@ -5,4 +5,10 @@
#ifndef RPCFACTORY_H
#define RPCFACTORY_H
class RPCFactory {
public:
static std::shared_ptr<IRPCServer> createRPCServer() {
return std::make_shared<TCPServer>();
}
#endif //RPCFACTORY_H

View File

@@ -5,4 +5,15 @@
#ifndef TCPSERVER_H
#define TCPSERVER_H
#include "IRPCServer.h"
class TCPServer : IRPCServer {
public:
TCPServer();
~TCPServer();
private:
}
#endif //TCPSERVER_H

View File

@@ -6,13 +6,14 @@
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
class WifiManager {
#include "IWifiManager.h"
class WifiManager final : IWifiManager {
public:
WifiManager() = default;
~WifiManager() = default;
int init();
int connect();
int disconnect();
WifiManager();
~WifiManager() override = default;
int connect() override;
int disconnect() override;
[[noreturn]] void manage();
@@ -28,7 +29,6 @@ private:
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;

View File

@@ -5,4 +5,8 @@
#ifndef DISCOVERYSERVICE_H
#define DISCOVERYSERVICE_H
class mDNSDiscoveryService : IDiscoveryService {
}
#endif //DISCOVERYSERVICE_H