8#include <ArduinoJson.h>
29 const std::string& configPath);
32 const std::string& jsonConfig);
36 const std::string& jsonConfig);
40 const std::string& jsonConfig);
47 static const char* DEFAULT_CONFIG;
52 std::unique_ptr<Action> createActionFromJson(
const ArduinoJson::JsonObject& actionJson,
54 std::unique_ptr<Action> createSendCharActionFromJson(
const ArduinoJson::JsonObject& actionJson,
56 static void actionToJson(
const Action* action, ArduinoJson::JsonObject& out);
57 void populateProfileFromJson(
Profile& profile,
58 ArduinoJson::JsonObject buttons,
Base class for all pedal actions.
Loads pedal configuration from JSON files.
bool replaceProfile(ProfileManager &profileManager, IBleKeyboard *keyboard, uint8_t profileIndex, const std::string &jsonConfig)
Replaces a specific profile with configuration from JSON.
bool mergeConfig(ProfileManager &profileManager, IBleKeyboard *keyboard, const std::string &jsonConfig)
Merges configuration from JSON into existing profiles.
static uint8_t getButtonIndex(const char *buttonName)
Converts button name to button index.
ConfigLoader()
Default constructor: uses production singletons (firmware path)
bool loadFromFile(ProfileManager &profileManager, IBleKeyboard *keyboard, const std::string &configPath)
Loads configuration from a file.
bool loadFromString(ProfileManager &profileManager, IBleKeyboard *keyboard, const std::string &jsonConfig)
Loads configuration from a JSON string.
bool saveToFile(const ProfileManager &profileManager, const std::string &configPath)
Saves configuration to a file.
static const char * getDefaultConfig()
Interface for Bluetooth LE keyboard functionality.
Abstract interface for file system operations.
Interface for logging functionality.
Manages up to MAX_PROFILES profiles with LED feedback.
Represents a single button configuration profile.
ProfileManager * profileManager