diff --git a/components/rpc/CMakeLists.txt b/components/rpc/CMakeLists.txt index c749993..7705066 100644 --- a/components/rpc/CMakeLists.txt +++ b/components/rpc/CMakeLists.txt @@ -1,3 +1,3 @@ -idf_component_register(SRCS "rpc.cpp" "TCPServer.cpp" "WifiManager.cpp" +idf_component_register(SRCS "rpc.cpp" "WifiManager.cpp" PRIV_REQUIRES driver esp_event nvs_flash esp_netif esp_wifi INCLUDE_DIRS "include") diff --git a/components/rpc/RPCFactory.cpp b/components/rpc/RPCFactory.cpp deleted file mode 100644 index 129175e..0000000 --- a/components/rpc/RPCFactory.cpp +++ /dev/null @@ -1,3 +0,0 @@ -// -// Created by Johnathon Slightham on 2025-05-25. -// diff --git a/components/rpc/include/CommunicationRouter.h b/components/rpc/include/CommunicationRouter.h index f3b5ab7..381a816 100644 --- a/components/rpc/include/CommunicationRouter.h +++ b/components/rpc/include/CommunicationRouter.h @@ -7,7 +7,7 @@ -class CommunicationRouter { +class CommunicationRouter : ICommunicationRouter { }; diff --git a/components/rpc/include/ICommunicationRouter.h b/components/rpc/include/ICommunicationRouter.h index 32c7057..424d91b 100644 --- a/components/rpc/include/ICommunicationRouter.h +++ b/components/rpc/include/ICommunicationRouter.h @@ -5,4 +5,8 @@ #ifndef ICOMMUNICATIONROUTER_H #define ICOMMUNICATIONROUTER_H +class ICommunicationRouter { + +} + #endif //ICOMMUNICATIONROUTER_H diff --git a/components/rpc/include/IDiscoveryService.h b/components/rpc/include/IDiscoveryService.h new file mode 100644 index 0000000..ea4541e --- /dev/null +++ b/components/rpc/include/IDiscoveryService.h @@ -0,0 +1,12 @@ +// +// Created by Johnathon Slightham on 2025-05-26. +// + +#ifndef IDISCOVERYSERVICE_H +#define IDISCOVERYSERVICE_H + +class IDiscoveryService { + +} + +#endif //IDISCOVERYSERVICE_H diff --git a/components/rpc/include/IRPCServer.h b/components/rpc/include/IRPCServer.h index 11bc17e..6a9db7a 100644 --- a/components/rpc/include/IRPCServer.h +++ b/components/rpc/include/IRPCServer.h @@ -5,4 +5,8 @@ #ifndef IRPCSERVER_H #define IRPCSERVER_H +class IRPCServer { + +} + #endif //IRPCSERVER_H diff --git a/components/rpc/include/IWifiManager.h b/components/rpc/include/IWifiManager.h index a93d814..e86059f 100644 --- a/components/rpc/include/IWifiManager.h +++ b/components/rpc/include/IWifiManager.h @@ -8,8 +8,8 @@ class IWifiManager { public: virtual ~IWifiManager() {}; - virtual int connect(); - virtual int disconnect(); + virtual int connect() = 0; + virtual int disconnect() = 0; }; #endif //IWIFIMANAGER_H diff --git a/components/rpc/include/RPCFactory.h b/components/rpc/include/RPCFactory.h index 848f0ae..803e931 100644 --- a/components/rpc/include/RPCFactory.h +++ b/components/rpc/include/RPCFactory.h @@ -5,4 +5,10 @@ #ifndef RPCFACTORY_H #define RPCFACTORY_H +class RPCFactory { +public: +static std::shared_ptr createRPCServer() { + return std::make_shared(); +} + #endif //RPCFACTORY_H diff --git a/components/rpc/include/TCPServer.h b/components/rpc/include/TCPServer.h index ae62f30..631ff3a 100644 --- a/components/rpc/include/TCPServer.h +++ b/components/rpc/include/TCPServer.h @@ -5,4 +5,15 @@ #ifndef TCPSERVER_H #define TCPSERVER_H +#include "IRPCServer.h" + +class TCPServer : IRPCServer { +public: +TCPServer(); +~TCPServer(); + +private: + +} + #endif //TCPSERVER_H diff --git a/components/rpc/include/DiscoveryService.h b/components/rpc/include/mDNSDiscoveryService.h similarity index 72% rename from components/rpc/include/DiscoveryService.h rename to components/rpc/include/mDNSDiscoveryService.h index 26395b1..63dbcef 100644 --- a/components/rpc/include/DiscoveryService.h +++ b/components/rpc/include/mDNSDiscoveryService.h @@ -5,4 +5,8 @@ #ifndef DISCOVERYSERVICE_H #define DISCOVERYSERVICE_H +class mDNSDiscoveryService : IDiscoveryService { + +} + #endif //DISCOVERYSERVICE_H diff --git a/main/main.cpp b/main/main.cpp index a364186..924fab5 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -8,7 +8,6 @@ #include "nvs_flash.h" #include "WifiManager.h" -#include "IWifiManager.h" extern "C" [[noreturn]] void app_main(void) { nvs_flash_init();