mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Cleanup rpc
This commit is contained in:
@@ -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
|
PRIV_REQUIRES driver esp_event nvs_flash esp_netif esp_wifi
|
||||||
INCLUDE_DIRS "include")
|
INCLUDE_DIRS "include")
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by Johnathon Slightham on 2025-05-25.
|
|
||||||
//
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CommunicationRouter {
|
class CommunicationRouter : ICommunicationRouter {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,8 @@
|
|||||||
#ifndef ICOMMUNICATIONROUTER_H
|
#ifndef ICOMMUNICATIONROUTER_H
|
||||||
#define ICOMMUNICATIONROUTER_H
|
#define ICOMMUNICATIONROUTER_H
|
||||||
|
|
||||||
|
class ICommunicationRouter {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif //ICOMMUNICATIONROUTER_H
|
#endif //ICOMMUNICATIONROUTER_H
|
||||||
|
|||||||
12
components/rpc/include/IDiscoveryService.h
Normal file
12
components/rpc/include/IDiscoveryService.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// Created by Johnathon Slightham on 2025-05-26.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef IDISCOVERYSERVICE_H
|
||||||
|
#define IDISCOVERYSERVICE_H
|
||||||
|
|
||||||
|
class IDiscoveryService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //IDISCOVERYSERVICE_H
|
||||||
@@ -5,4 +5,8 @@
|
|||||||
#ifndef IRPCSERVER_H
|
#ifndef IRPCSERVER_H
|
||||||
#define IRPCSERVER_H
|
#define IRPCSERVER_H
|
||||||
|
|
||||||
|
class IRPCServer {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif //IRPCSERVER_H
|
#endif //IRPCSERVER_H
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
class IWifiManager {
|
class IWifiManager {
|
||||||
public:
|
public:
|
||||||
virtual ~IWifiManager() {};
|
virtual ~IWifiManager() {};
|
||||||
virtual int connect();
|
virtual int connect() = 0;
|
||||||
virtual int disconnect();
|
virtual int disconnect() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //IWIFIMANAGER_H
|
#endif //IWIFIMANAGER_H
|
||||||
|
|||||||
@@ -5,4 +5,10 @@
|
|||||||
#ifndef RPCFACTORY_H
|
#ifndef RPCFACTORY_H
|
||||||
#define RPCFACTORY_H
|
#define RPCFACTORY_H
|
||||||
|
|
||||||
|
class RPCFactory {
|
||||||
|
public:
|
||||||
|
static std::shared_ptr<IRPCServer> createRPCServer() {
|
||||||
|
return std::make_shared<TCPServer>();
|
||||||
|
}
|
||||||
|
|
||||||
#endif //RPCFACTORY_H
|
#endif //RPCFACTORY_H
|
||||||
|
|||||||
@@ -5,4 +5,15 @@
|
|||||||
#ifndef TCPSERVER_H
|
#ifndef TCPSERVER_H
|
||||||
#define TCPSERVER_H
|
#define TCPSERVER_H
|
||||||
|
|
||||||
|
#include "IRPCServer.h"
|
||||||
|
|
||||||
|
class TCPServer : IRPCServer {
|
||||||
|
public:
|
||||||
|
TCPServer();
|
||||||
|
~TCPServer();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif //TCPSERVER_H
|
#endif //TCPSERVER_H
|
||||||
|
|||||||
@@ -5,4 +5,8 @@
|
|||||||
#ifndef DISCOVERYSERVICE_H
|
#ifndef DISCOVERYSERVICE_H
|
||||||
#define DISCOVERYSERVICE_H
|
#define DISCOVERYSERVICE_H
|
||||||
|
|
||||||
|
class mDNSDiscoveryService : IDiscoveryService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif //DISCOVERYSERVICE_H
|
#endif //DISCOVERYSERVICE_H
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
|
|
||||||
#include "WifiManager.h"
|
#include "WifiManager.h"
|
||||||
#include "IWifiManager.h"
|
|
||||||
|
|
||||||
extern "C" [[noreturn]] void app_main(void) {
|
extern "C" [[noreturn]] void app_main(void) {
|
||||||
nvs_flash_init();
|
nvs_flash_init();
|
||||||
|
|||||||
Reference in New Issue
Block a user