diff --git a/examples/base/main.cpp b/examples/base/main.cpp index 86f9811..3119ec9 100644 --- a/examples/base/main.cpp +++ b/examples/base/main.cpp @@ -1,5 +1,5 @@ #include -#include "Spore.h" +#include "spore/Spore.h" // Create Spore instance with custom labels Spore spore({ diff --git a/examples/neopattern/NeoPatternService.cpp b/examples/neopattern/NeoPatternService.cpp index 0862453..155d36f 100644 --- a/examples/neopattern/NeoPatternService.cpp +++ b/examples/neopattern/NeoPatternService.cpp @@ -1,5 +1,5 @@ #include "NeoPatternService.h" -#include "ApiServer.h" +#include "spore/core/ApiServer.h" NeoPatternService::NeoPatternService(TaskManager& taskMgr, uint16_t numPixels, uint8_t pin, uint8_t type) : taskManager(taskMgr), diff --git a/examples/neopattern/NeoPatternService.h b/examples/neopattern/NeoPatternService.h index 26d0226..0439aa9 100644 --- a/examples/neopattern/NeoPatternService.h +++ b/examples/neopattern/NeoPatternService.h @@ -1,6 +1,6 @@ #pragma once -#include "services/Service.h" -#include "TaskManager.h" +#include "spore/Service.h" +#include "spore/core/TaskManager.h" #include "NeoPattern.cpp" #include #include diff --git a/examples/neopattern/main.cpp b/examples/neopattern/main.cpp index 8d27069..a936aac 100644 --- a/examples/neopattern/main.cpp +++ b/examples/neopattern/main.cpp @@ -1,5 +1,5 @@ #include -#include "Spore.h" +#include "spore/Spore.h" #include "NeoPatternService.h" #ifndef LED_STRIP_PIN diff --git a/examples/neopixel/NeoPixelService.cpp b/examples/neopixel/NeoPixelService.cpp index a66fb1e..7798c03 100644 --- a/examples/neopixel/NeoPixelService.cpp +++ b/examples/neopixel/NeoPixelService.cpp @@ -1,5 +1,5 @@ #include "NeoPixelService.h" -#include "ApiServer.h" +#include "spore/core/ApiServer.h" // Wheel helper: map 0-255 to RGB rainbow static uint32_t colorWheel(Adafruit_NeoPixel& strip, uint8_t pos) { diff --git a/examples/neopixel/NeoPixelService.h b/examples/neopixel/NeoPixelService.h index b0aee58..5653469 100644 --- a/examples/neopixel/NeoPixelService.h +++ b/examples/neopixel/NeoPixelService.h @@ -1,6 +1,6 @@ #pragma once -#include "services/Service.h" -#include "TaskManager.h" +#include "spore/Service.h" +#include "spore/core/TaskManager.h" #include #include #include diff --git a/examples/neopixel/main.cpp b/examples/neopixel/main.cpp index 4ae0f2a..a22650f 100644 --- a/examples/neopixel/main.cpp +++ b/examples/neopixel/main.cpp @@ -1,5 +1,5 @@ #include -#include "Spore.h" +#include "spore/Spore.h" #include "NeoPixelService.h" #ifndef NEOPIXEL_PIN diff --git a/examples/relay/RelayService.cpp b/examples/relay/RelayService.cpp index 9d0200a..ef0eb99 100644 --- a/examples/relay/RelayService.cpp +++ b/examples/relay/RelayService.cpp @@ -1,5 +1,5 @@ #include "RelayService.h" -#include "ApiServer.h" +#include "spore/core/ApiServer.h" RelayService::RelayService(TaskManager& taskMgr, int pin) : taskManager(taskMgr), relayPin(pin), relayOn(false) { diff --git a/examples/relay/RelayService.h b/examples/relay/RelayService.h index 03913b3..9bc2de4 100644 --- a/examples/relay/RelayService.h +++ b/examples/relay/RelayService.h @@ -1,6 +1,6 @@ #pragma once -#include "services/Service.h" -#include "TaskManager.h" +#include "spore/Service.h" +#include "spore/core/TaskManager.h" #include class RelayService : public Service { diff --git a/examples/relay/main.cpp b/examples/relay/main.cpp index 5fe6ef1..3675d4c 100644 --- a/examples/relay/main.cpp +++ b/examples/relay/main.cpp @@ -1,5 +1,5 @@ #include -#include "Spore.h" +#include "spore/Spore.h" #include "RelayService.h" // Choose a default relay pin. For ESP-01 this is GPIO0. Adjust as needed for your board. diff --git a/include/services/Service.h b/include/spore/Service.h similarity index 83% rename from include/services/Service.h rename to include/spore/Service.h index f78d598..735f592 100644 --- a/include/services/Service.h +++ b/include/spore/Service.h @@ -1,5 +1,5 @@ #pragma once -#include "ApiServer.h" +#include "spore/core/ApiServer.h" class Service { public: diff --git a/include/Spore.h b/include/spore/Spore.h similarity index 85% rename from include/Spore.h rename to include/spore/Spore.h index 630012e..dcaf2f1 100644 --- a/include/Spore.h +++ b/include/spore/Spore.h @@ -4,12 +4,12 @@ #include #include #include -#include "NodeContext.h" -#include "NetworkManager.h" -#include "ClusterManager.h" -#include "ApiServer.h" -#include "TaskManager.h" -#include "services/Service.h" +#include "core/NodeContext.h" +#include "core/NetworkManager.h" +#include "core/ClusterManager.h" +#include "core/ApiServer.h" +#include "core/TaskManager.h" +#include "Service.h" class Spore { public: diff --git a/include/ApiServer.h b/include/spore/core/ApiServer.h similarity index 92% rename from include/ApiServer.h rename to include/spore/core/ApiServer.h index 90beb9e..bbea44c 100644 --- a/include/ApiServer.h +++ b/include/spore/core/ApiServer.h @@ -7,10 +7,10 @@ #include #include -#include "NodeContext.h" -#include "NodeInfo.h" -#include "TaskManager.h" -#include "ApiTypes.h" +#include "spore/core/NodeContext.h" +#include "spore/types/NodeInfo.h" +#include "spore/core/TaskManager.h" +#include "spore/types/ApiTypes.h" class Service; // Forward declaration diff --git a/include/ClusterManager.h b/include/spore/core/ClusterManager.h similarity index 87% rename from include/ClusterManager.h rename to include/spore/core/ClusterManager.h index c878a9c..b0decd5 100644 --- a/include/ClusterManager.h +++ b/include/spore/core/ClusterManager.h @@ -1,7 +1,7 @@ #pragma once -#include "NodeContext.h" -#include "NodeInfo.h" -#include "TaskManager.h" +#include "spore/core/NodeContext.h" +#include "spore/types/NodeInfo.h" +#include "spore/core/TaskManager.h" #include #include #include diff --git a/include/NetworkManager.h b/include/spore/core/NetworkManager.h similarity index 97% rename from include/NetworkManager.h rename to include/spore/core/NetworkManager.h index 38a1d4d..96a0cf9 100644 --- a/include/NetworkManager.h +++ b/include/spore/core/NetworkManager.h @@ -1,5 +1,5 @@ #pragma once -#include "NodeContext.h" +#include "spore/core/NodeContext.h" #include #include diff --git a/include/NodeContext.h b/include/spore/core/NodeContext.h similarity index 86% rename from include/NodeContext.h rename to include/spore/core/NodeContext.h index 3feb30c..dd2cb85 100644 --- a/include/NodeContext.h +++ b/include/spore/core/NodeContext.h @@ -2,12 +2,12 @@ #include #include -#include "NodeInfo.h" +#include "spore/types/NodeInfo.h" #include #include #include -#include "Config.h" -#include "ApiTypes.h" +#include "spore/types/Config.h" +#include "spore/types/ApiTypes.h" class NodeContext { public: diff --git a/include/TaskManager.h b/include/spore/core/TaskManager.h similarity index 98% rename from include/TaskManager.h rename to include/spore/core/TaskManager.h index ffe1488..c09d80e 100644 --- a/include/TaskManager.h +++ b/include/spore/core/TaskManager.h @@ -4,7 +4,7 @@ #include #include #include -#include "NodeContext.h" +#include "spore/core/NodeContext.h" #include // Define our own callback type to avoid conflict with TaskScheduler diff --git a/include/Globals.h b/include/spore/internal/Globals.h similarity index 100% rename from include/Globals.h rename to include/spore/internal/Globals.h diff --git a/include/services/ClusterService.h b/include/spore/services/ClusterService.h similarity index 84% rename from include/services/ClusterService.h rename to include/spore/services/ClusterService.h index 41c0145..21b8a9e 100644 --- a/include/services/ClusterService.h +++ b/include/spore/services/ClusterService.h @@ -1,6 +1,6 @@ #pragma once -#include "services/Service.h" -#include "NodeContext.h" +#include "spore/Service.h" +#include "spore/core/NodeContext.h" #include class ClusterService : public Service { diff --git a/include/services/NetworkService.h b/include/spore/services/NetworkService.h similarity index 85% rename from include/services/NetworkService.h rename to include/spore/services/NetworkService.h index fa4aef8..4c8973b 100644 --- a/include/services/NetworkService.h +++ b/include/spore/services/NetworkService.h @@ -1,7 +1,7 @@ #pragma once -#include "services/Service.h" -#include "NetworkManager.h" -#include "NodeContext.h" +#include "spore/Service.h" +#include "spore/core/NetworkManager.h" +#include "spore/core/NodeContext.h" class NetworkService : public Service { public: diff --git a/include/services/NodeService.h b/include/spore/services/NodeService.h similarity index 92% rename from include/services/NodeService.h rename to include/spore/services/NodeService.h index 41b70bd..daae61c 100644 --- a/include/services/NodeService.h +++ b/include/spore/services/NodeService.h @@ -1,6 +1,6 @@ #pragma once -#include "services/Service.h" -#include "NodeContext.h" +#include "spore/Service.h" +#include "spore/core/NodeContext.h" #include #include diff --git a/include/services/TaskService.h b/include/spore/services/TaskService.h similarity index 86% rename from include/services/TaskService.h rename to include/spore/services/TaskService.h index 9e3791c..d5b6edb 100644 --- a/include/services/TaskService.h +++ b/include/spore/services/TaskService.h @@ -1,6 +1,6 @@ #pragma once -#include "services/Service.h" -#include "TaskManager.h" +#include "spore/Service.h" +#include "spore/core/TaskManager.h" #include class TaskService : public Service { diff --git a/include/ApiTypes.h b/include/spore/types/ApiTypes.h similarity index 100% rename from include/ApiTypes.h rename to include/spore/types/ApiTypes.h diff --git a/include/Config.h b/include/spore/types/Config.h similarity index 100% rename from include/Config.h rename to include/spore/types/Config.h diff --git a/include/NodeInfo.h b/include/spore/types/NodeInfo.h similarity index 100% rename from include/NodeInfo.h rename to include/spore/types/NodeInfo.h diff --git a/platformio.ini b/platformio.ini index 5266d1b..a7986a9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -30,9 +30,11 @@ board_build.flash_size = 1M lib_deps = ${common.lib_deps} build_src_filter = + - + - + - + + + + + + + + + + + [env:d1_mini] platform = platformio/espressif8266@^4.2.1 @@ -45,9 +47,11 @@ board_build.flash_size = 4M lib_deps = ${common.lib_deps} build_src_filter = + - + - + - + + + + + + + + + + + [env:esp01_1m_relay] platform = platformio/espressif8266@^4.2.1 @@ -61,9 +65,11 @@ board_build.flash_size = 1M lib_deps = ${common.lib_deps} build_src_filter = + - + - + - + + + + + + + + + + + [env:esp01_1m_neopixel] platform = platformio/espressif8266@^4.2.1 diff --git a/src/Spore.cpp b/src/spore/Spore.cpp similarity index 95% rename from src/Spore.cpp rename to src/spore/Spore.cpp index 635dc35..4b5ead0 100644 --- a/src/Spore.cpp +++ b/src/spore/Spore.cpp @@ -1,8 +1,8 @@ -#include "Spore.h" -#include "services/NodeService.h" -#include "services/NetworkService.h" -#include "services/ClusterService.h" -#include "services/TaskService.h" +#include "spore/Spore.h" +#include "spore/services/NodeService.h" +#include "spore/services/NetworkService.h" +#include "spore/services/ClusterService.h" +#include "spore/services/TaskService.h" #include Spore::Spore() : ctx(), network(ctx), taskManager(ctx), cluster(ctx, taskManager), diff --git a/src/ApiServer.cpp b/src/spore/core/ApiServer.cpp similarity index 98% rename from src/ApiServer.cpp rename to src/spore/core/ApiServer.cpp index e8fa118..2f5c49c 100644 --- a/src/ApiServer.cpp +++ b/src/spore/core/ApiServer.cpp @@ -1,5 +1,5 @@ -#include "ApiServer.h" -#include "services/Service.h" +#include "spore/core/ApiServer.h" +#include "spore/Service.h" #include const char* ApiServer::methodToStr(int method) { diff --git a/src/ClusterManager.cpp b/src/spore/core/ClusterManager.cpp similarity index 99% rename from src/ClusterManager.cpp rename to src/spore/core/ClusterManager.cpp index 8daee5a..c37ad3c 100644 --- a/src/ClusterManager.cpp +++ b/src/spore/core/ClusterManager.cpp @@ -1,5 +1,5 @@ -#include "ClusterManager.h" -#include "Globals.h" +#include "spore/core/ClusterManager.h" +#include "spore/internal/Globals.h" ClusterManager::ClusterManager(NodeContext& ctx, TaskManager& taskMgr) : ctx(ctx), taskManager(taskMgr) { // Register callback for node_discovered event diff --git a/src/NetworkManager.cpp b/src/spore/core/NetworkManager.cpp similarity index 99% rename from src/NetworkManager.cpp rename to src/spore/core/NetworkManager.cpp index c06cb30..8a1f66d 100644 --- a/src/NetworkManager.cpp +++ b/src/spore/core/NetworkManager.cpp @@ -1,4 +1,4 @@ -#include "NetworkManager.h" +#include "spore/core/NetworkManager.h" // SSID and password are now configured via Config class diff --git a/src/NodeContext.cpp b/src/spore/core/NodeContext.cpp similarity index 95% rename from src/NodeContext.cpp rename to src/spore/core/NodeContext.cpp index e5833d3..18b729d 100644 --- a/src/NodeContext.cpp +++ b/src/spore/core/NodeContext.cpp @@ -1,4 +1,4 @@ -#include "NodeContext.h" +#include "spore/core/NodeContext.h" NodeContext::NodeContext() { udp = new WiFiUDP(); diff --git a/src/TaskManager.cpp b/src/spore/core/TaskManager.cpp similarity index 99% rename from src/TaskManager.cpp rename to src/spore/core/TaskManager.cpp index c211fd5..9f5a117 100644 --- a/src/TaskManager.cpp +++ b/src/spore/core/TaskManager.cpp @@ -1,4 +1,4 @@ -#include "TaskManager.h" +#include "spore/core/TaskManager.h" #include TaskManager::TaskManager(NodeContext& ctx) : ctx(ctx) {} diff --git a/src/services/ClusterService.cpp b/src/spore/services/ClusterService.cpp similarity index 95% rename from src/services/ClusterService.cpp rename to src/spore/services/ClusterService.cpp index 7b88d20..12c7f18 100644 --- a/src/services/ClusterService.cpp +++ b/src/spore/services/ClusterService.cpp @@ -1,5 +1,5 @@ -#include "services/ClusterService.h" -#include "ApiServer.h" +#include "spore/services/ClusterService.h" +#include "spore/core/ApiServer.h" ClusterService::ClusterService(NodeContext& ctx) : ctx(ctx) {} diff --git a/src/services/NetworkService.cpp b/src/spore/services/NetworkService.cpp similarity index 99% rename from src/services/NetworkService.cpp rename to src/spore/services/NetworkService.cpp index 237b0a4..1009f4f 100644 --- a/src/services/NetworkService.cpp +++ b/src/spore/services/NetworkService.cpp @@ -1,4 +1,4 @@ -#include "services/NetworkService.h" +#include "spore/services/NetworkService.h" #include NetworkService::NetworkService(NetworkManager& networkManager) diff --git a/src/services/NodeService.cpp b/src/spore/services/NodeService.cpp similarity index 98% rename from src/services/NodeService.cpp rename to src/spore/services/NodeService.cpp index 2894180..1b3f4bf 100644 --- a/src/services/NodeService.cpp +++ b/src/spore/services/NodeService.cpp @@ -1,5 +1,5 @@ -#include "services/NodeService.h" -#include "ApiServer.h" +#include "spore/services/NodeService.h" +#include "spore/core/ApiServer.h" NodeService::NodeService(NodeContext& ctx, ApiServer& apiServer) : ctx(ctx), apiServer(apiServer) {} diff --git a/src/services/TaskService.cpp b/src/spore/services/TaskService.cpp similarity index 98% rename from src/services/TaskService.cpp rename to src/spore/services/TaskService.cpp index 52b616f..c6db68e 100644 --- a/src/services/TaskService.cpp +++ b/src/spore/services/TaskService.cpp @@ -1,5 +1,5 @@ -#include "services/TaskService.h" -#include "ApiServer.h" +#include "spore/services/TaskService.h" +#include "spore/core/ApiServer.h" #include TaskService::TaskService(TaskManager& taskManager) : taskManager(taskManager) {} diff --git a/src/Config.cpp b/src/spore/types/Config.cpp similarity index 95% rename from src/Config.cpp rename to src/spore/types/Config.cpp index 6700557..4467884 100644 --- a/src/Config.cpp +++ b/src/spore/types/Config.cpp @@ -1,4 +1,4 @@ -#include "Config.h" +#include "spore/types/Config.h" Config::Config() { // WiFi Configuration diff --git a/src/NodeInfo.cpp b/src/spore/types/NodeInfo.cpp similarity index 92% rename from src/NodeInfo.cpp rename to src/spore/types/NodeInfo.cpp index ac53755..bd0ac3b 100644 --- a/src/NodeInfo.cpp +++ b/src/spore/types/NodeInfo.cpp @@ -1,5 +1,5 @@ -#include "NodeInfo.h" -#include "Globals.h" +#include "spore/types/NodeInfo.h" +#include "spore/internal/Globals.h" const char* statusToStr(NodeInfo::Status status) { switch (status) {