mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-17 13:33:44 +02:00
Fix compilation issues, change ProjectConfig into a shared_ptr with updated definitions
// todo implement the API and missing features
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user