Fix compilation issues, change ProjectConfig into a shared_ptr with updated definitions

// todo implement the API and missing features
This commit is contained in:
Lorow
2024-11-23 21:00:05 +01:00
parent 60e2e7cc36
commit 6b603f5574
13 changed files with 61 additions and 50 deletions

View File

@@ -1,6 +1,6 @@
#include "RestAPI.hpp"
RestAPI::RestAPI(std::string url)
RestAPI::RestAPI(std::string url, std::shared_ptr<CommandManager> commandManager) : command_manager(commandManager)
{
this->url = url;
// updates

View File

@@ -1,7 +1,11 @@
#pragma once
#ifndef RESTAPI_HPP
#define RESTAPI_HPP
#include <string>
#include <memory>
#include <unordered_map>
#include <mongoose.h>
#include <CommandManager.hpp>
#include "esp_log.h"
@@ -22,6 +26,7 @@ class RestAPI
route_map routes;
struct mg_mgr mgr;
std::shared_ptr<CommandManager> command_manager;
private:
// updates
@@ -50,7 +55,7 @@ private:
public:
// this will also need command manager
RestAPI(std::string url);
RestAPI(std::string url, std::shared_ptr<CommandManager> command_manager);
void begin();
void handle_request(struct mg_connection *connection, int event, void *event_data);
void poll();
@@ -59,4 +64,6 @@ public:
namespace RestAPIHelpers
{
void event_handler(struct mg_connection *connection, int event, void *event_data);
};
};
#endif