gmag11 / EnigmaIOT

Secure sensor and gateway platform based on ESP8266 and ESP32
https://gmag11.github.io/EnigmaIOT
MIT License
240 stars 46 forks source link

move node configuration code to separate classes #45

Open masgari opened 2 years ago

masgari commented 2 years ago

Replacing EnigmaIOTNodeSerialConfigurerClass with current WifiManager makes onboarding simpler, also reduces ~200KB in final firmware size, make it possible to use it with boards with 1MB flash while OTA enabled.

    //nodeConfigurer_t configurer = std::bind(&EnigmaIOTNodeJsonConfigurerClass::configure, &EnigmaIOTNodeJsonConfigurer, std::placeholders::_1);
    nodeConfigurer_t configurer = std::bind(&EnigmaIOTNodeSerialConfigurerClass::configure, &EnigmaIOTNodeSerialConfigurer, std::placeholders::_1);
    //nodeConfigurer_t configurer = std::bind(&EnigmaIOTNodeWifiConfigurerClass::configure, &EnigmaIOTNodeWifiConfigurer, std::placeholders::_1);
    EnigmaIOTNode.begin(&Espnow_hal, NULL, NULL, true, SLEEPY == 1, configurer);  // Start EnigmaIOT communication
gmag11 commented 2 years ago

Hi, I've been offline for a while. This sounds really fine. I'll be happy to merge it. Give me some days to test it. Thanks