I have inherited some sming based firmware but am having trouble getting it to compile on current sming.
The original problem is here:
otaUpdater->addItem(bootconf.roms[rom_slot], romurl);
if (rom_slot == 0) {
otaUpdater->addItem(RBOOT_SPIFFS_0, spiffsurl);
} else {
otaUpdater->addItem(RBOOT_SPIFFS_1, spiffsurl);
}
otaUpdater->setCallback(otaUpdateDelegate(&ApplicationOTA::rBootCallback, this));
beforeOTA();
otaUpdater->start();
and it seems that 'otaUpdateDelegate' isn't defined in the current Sming framework anymore. However, when I change this to 'OtaUpdateDelegate' (with a capital o, as it is defined), I get the following error:
otaUpdater->addItem(bootconf.roms[rom_slot], romurl);
if (rom_slot == 0) {
otaUpdater->addItem(RBOOT_SPIFFS_0, spiffsurl);
} else {
otaUpdater->addItem(RBOOT_SPIFFS_1, spiffsurl);
}
otaUpdater->setCallback(otaUpdateDelegate(&ApplicationOTA::rBootCallback, this));
beforeOTA();
otaUpdater->start();
it seems that 'OtaUpdateDelegate', for some reason, is typed 'void'. Also, it would seem that the parameters are somehow wrong, since it requires a bool as the second parameter and 'this' is an object reference.
This is my first encounter with Delegates in the c++ world. I understand what their general idea is, but here I am thoroughly confused.
Can someone enlighten me?
kind regards
pj