- Restructure include/ and src/ directories with logical grouping - Move core components to spore/core/ (NodeContext, NetworkManager, TaskManager, ClusterManager, ApiServer) - Move services to spore/services/ (NodeService, NetworkService, ClusterService, TaskService) - Move types to spore/types/ (NodeInfo, ApiTypes, Config) - Move internal components to spore/internal/ (Globals) - Update all #include statements to use new namespace paths - Update platformio.ini build filters for all environments - Update all example files to use new include paths - Maintain backward compatibility for public API - Improve code organization, maintainability, and scalability This reorganization follows modern C++ project structure patterns and provides clear separation between public API, internal implementation, and utilities. All examples compile successfully with the new structure.
23 lines
794 B
C++
23 lines
794 B
C++
#pragma once
|
|
#include "spore/Service.h"
|
|
#include "spore/core/NodeContext.h"
|
|
#include <ArduinoJson.h>
|
|
#include <Updater.h>
|
|
|
|
class NodeService : public Service {
|
|
public:
|
|
NodeService(NodeContext& ctx, ApiServer& apiServer);
|
|
void registerEndpoints(ApiServer& api) override;
|
|
const char* getName() const override { return "Node"; }
|
|
|
|
private:
|
|
NodeContext& ctx;
|
|
ApiServer& apiServer;
|
|
|
|
void handleStatusRequest(AsyncWebServerRequest* request);
|
|
void handleUpdateRequest(AsyncWebServerRequest* request);
|
|
void handleUpdateUpload(AsyncWebServerRequest* request, const String& filename, size_t index, uint8_t* data, size_t len, bool final);
|
|
void handleRestartRequest(AsyncWebServerRequest* request);
|
|
void handleEndpointsRequest(AsyncWebServerRequest* request);
|
|
};
|