-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3 tracking issue #87
Comments
I think making the three pieces separate components is the way to go. Im not 100% sure that the interface to the HTTP module is any better than having a solid interface in ConfigManager ie:
Then anyone can hit configManager from HTTP/other (who knows right?) .. maybe Im over simplifying this
I say, first break out the components ... then think about how you turn off/on and what the edge cases are ... You talked me out of the ability to turn off the AP mode once already .. maybe until Thus, always have AP mode for setting the Wifi things, and then everything else is the optional (station mode, HTTP) |
As I got back to my code now, I remember a use case for disabling HTTP in AP mode: I want a device that I doesnt connect to the internet, but I can connect to and serve HTTP ... The current code path we just merged should allow this, jsut wanted to point out the use case of not needed to configure Wifi is a thing. |
Fair enough. It is something we should account for. At the moment I am busy ripping things apparent to see where the interlinking is. I would like to have ConfigManager know as little as possible about the other parts, and largely let each part drive itself but at the same time not make things more complex in a simple use case. I think this is the bulk of the work in this. I will open some branches when I have something to propose. |
Work of the maker - thank you |
So it seems the parameters are a difficult concept to handle in C++ in a generic way. Specifically if we remove Json which is desirable. My thoughts moved to a Currently my idea is to use a very generic parameter like: class parameter {
const char* name;
type_info type;
void* ptr;
size_t size;
} and offload all the functionality into ConfigManager, so it would look like: class ConfigManager {
public:
template <typename T>
void add(const char* name, T* ptr, PM mode);
template <>
void add(const char* name, char* ptr, size_t len, PM mode); // This is a template specialisation for `add` for `char*`
template <typename T>
bool is<T>(const char* name);
template <typename T>
T as(const char* name);
// char* as specialisation
template <typename T>
void set<T>(const char* name);
// char* set specialisation
void begin();
} it would mean we have to be specific about the types we allow, which would not be a bad thing. The only ugly thing would be creating the json document, cause for each param, we would need to try every type we support with Still looking into this more. |
What if |
So there are 2 ways of thinking about this:
What I am exploring above is option 2 to understand its feasibility. I find it an interesting option as Wifi and HTTP feed off of ConfigManager, making it a central player. In option 1 ConfigManager is playing a mostly proxy role in the system (ie the |
This does not feel right to me ...
Yes ... many yes
YES Option 2 sounds more of what I was thinking. I'd treat ConfigManager as, well, only the manager of the configs ... I know, not creative. Setting and Storing ... The |
So at this point this is thwarting me a bit. Partially cause my brain is stuck in a very Go way of solving this problem, and partially due to the distractions in RL. It has occurred to me along the way that the |
I was hoping to snoop :( what is the The settings are already available via the I struggled with how to get all the variables in a way that doesnt upset C++ string typing ;) ... |
I have committed a wip on v3 to show where my brain is on this. I am still very much playing with the struct of this to understand how it could fit together. |
This issue will be used to track to work on
v3
of ConfigManager. The idea will evolve and be discussed here.The ideas around this are from the collaboration between @nrwiersma and @cgmckeever.
General Idea
Split ConfigManager into roughly 3 parts:
When the Wifi and HTTP sections can we turned off or a custom class used to suit the needs of the user, however a "simple" option should remain leading to the use of ConfigManager as it exists today. This can be achieved using Abstract Classes (interfaces) around the Wifi and HTTP sections.
Questions
ssid
andpassword
?The text was updated successfully, but these errors were encountered: