[GH-ISSUE #1169] HTTP_UPDATE_OK naming collision #999

Closed
opened 2026-02-28 01:28:03 +03:00 by kerem · 1 comment
Owner

Originally created by @markg85 on GitHub (Dec 12, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1169

Hardware

WiFimanager Branch/Release:

  • Master
  • Development

Esp8266/Esp32:

  • ESP8266
  • ESP32

I'm adding update functionality to an ESP32 project. For that i'm using the HTTPUpdate.h file that comes with the ESP32 framework.
It, in it's header has this:

enum HTTPUpdateResult {
    HTTP_UPDATE_FAILED,
    HTTP_UPDATE_NO_UPDATES,
    HTTP_UPDATE_OK
};

typedef HTTPUpdateResult t_httpUpdate_return; // backward compatibility

This collides with the strings_en.h file (soft reminder why: C++ enum is without the class in between is global scope):

const char HTTP_UPDATE_OK[] PROGMEM = "<div class='msg P'><strong>Update OK!</strong> Device Rebooting now...</div>";

In my opinion both projects are wrong here.
WiFiManager should probably namespace these things as these names are definitely easy to use by other projects too.
And the ESP folks should have done enum class HTTPUpdateResult. Though adding that now adds a load more compile errors.

The "easiest" fix is to throw a namespace around those string messages. Though that does give a bit of pain in the rest of the WiFiManager source to fix the result of that namespace.

Other then that, i quite like WiFiManager now :) I had my issues with it in the beginning but ever since using the development branch it's - ironically - working super stable!

Cheers,
Mark

Originally created by @markg85 on GitHub (Dec 12, 2020). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1169 #### Hardware **WiFimanager Branch/Release:** - [ ] Master - [x] Development **Esp8266/Esp32:** - [ ] ESP8266 - [x] ESP32 I'm adding update functionality to an ESP32 project. For that i'm using the `HTTPUpdate.h` file that comes with the ESP32 framework. It, in it's header has this: ```cpp enum HTTPUpdateResult { HTTP_UPDATE_FAILED, HTTP_UPDATE_NO_UPDATES, HTTP_UPDATE_OK }; typedef HTTPUpdateResult t_httpUpdate_return; // backward compatibility ``` This collides with the `strings_en.h` file (soft reminder why: C++ enum is without the class in between is global scope): ```cpp const char HTTP_UPDATE_OK[] PROGMEM = "<div class='msg P'><strong>Update OK!</strong> Device Rebooting now...</div>"; ``` In my opinion both projects are wrong here. WiFiManager should probably namespace these things as these names are definitely easy to use by other projects too. And the ESP folks should have done `enum class HTTPUpdateResult`. Though adding that now adds a load more compile errors. The "easiest" fix is to throw a namespace around those string messages. Though that does give a bit of pain in the rest of the WiFiManager source to fix the result of that namespace. Other then that, i quite like WiFiManager now :) I had my issues with it in the beginning but ever since using the development branch it's - ironically - working super stable! Cheers, Mark
kerem closed this issue 2026-02-28 01:28:03 +03:00
Author
Owner

@tablatronix commented on GitHub (Dec 13, 2020):

I thought I had an issue for namespacing, ill make one

<!-- gh-comment-id:743925540 --> @tablatronix commented on GitHub (Dec 13, 2020): I thought I had an issue for namespacing, ill make one
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#999
No description provided.