Resolve the code generation issue with vector methods being unable to
store the exception info string in the same elf section
(which apparently becomes duplicated, somehow, when building single .cpp)
Error messages look like something like this:
```
vector.tcc:405
error: __c causes a section type conflict with __c
_M_check_len(size_type(1), __EXCSTR("vector::_M_emplace_back_aux"));
vector.tcc:71
note: '__c' was declared here
__throw_length_error(__EXCSTR(__N("vector::reserve")));
```
Common functions moved into namespace domoticz { ... }
Module functions moved into namespace { ... }
Remove templates and favour simple function for nvalue & svalue formatting,
and also use ArduinoJson for the JSON serialization.
Detach lights from the 1st relay, introduce `dczLightIdx`
Use named channel functions instead of counting channels manually.
Try to migrate the old settings.
Introduce stronger type for Idx to avoid entity id vs. domoticz idx confusion in function arguments,
since both are numeric and there's no distinction besides the name itself.
Don't use variable length array and remove `debugSend_P`, directly give the format to `vsnprintf_P`.
Common functions moved into namespace debug { ... }
Module functions moved into namespace { ... }
Provide len argument to most outputs, so it's calculated exactly once.
Early checks for nullptr and zero length.
Fix include order once again, try not to depend on config in header and
only use it in the actual .cpp code.
Still involves strlen for flash strings, but that needs to be addressed by using a custom type like:
```
struct PstrWithLength {
const char* const ptr;
size_t size;
};
```
And define PSTR macro to return:
```
PstrWithLength{&__pstr__[0], sizeof(__pstr__)};`
```
(and, probably, for any `const char (&fixed)[Size]` arrays as well)
Use namespace instead of custom prefix everywhere.
Multiple init() funcs per namespace, instead of one large one for all
of available operators
Continue to apply namespace { ... }
For when scanning is disabled. Remove uniqueness requirement, since
settings may contain multiple SSID with different BSSID values.
wifi::Mac conversion helpers for both xxxxxxxxxx and xx:xx:xx:xx:xx:xx
Shuffle std::vector usage, trying out std::array for static data and
std::unique_ptr where common use-case is reserve / resize + emplace
Also try to workaroud exception string issue with gcc4.8, which should
not be a problem with gcc10.3 coming with Core 3.0.0, but... one solution at a time
Initialize the vector with the values directly, ::reserve(len) instead of ::resize(len) (throught the ctor)
Use assignment when the intent is to replace the target value, not to exchange with something else.
- queue the actual response, as sending immediatly seems to have
inconsistent results with the initial setup page
- allow single string password, just like a normal key
- provide default value for adminPass wsStore variant
- `reload` & `saved` are mutually exclusive
Generate initial connection list with all suitable networks, not only the best ones.
When scanning for a better network, remove results with worse rssi.
Don't remove extra scan results in the delayed scan function,
allow consumer to filter by itself.
Immediatly try to connect when reloading settings and previous attempt
had failed. Because of locking, previously this caused a soft-lock of the
internal loop that required waiting for the long Reconnect timeout to
expire first.
Refactor the module to include namespace { ... } and move build settings into .cpp
Saves ~1.5Kb and also allows gcc to issue unused warnings for declared functions.
As a side-effect of refactoring, (temporarily?) remove softAp leases support.
Current Core moved dhcps support into a C++ code, forcing internal logic
to reference a specific object. Better to wait a bit until that
stabilizes and try again. Plus, it is not currently available in the esp-idf.
Move settings & build flags into local namespace
Fix various functions referring to settings, when i2c is initialized once
Correctly use feature-flags in the .cpp instead of the .h
resolve#2451
Paranoid locking doesn't really matter in the current setup (but, leave some comments about how to solve it when it actually does).
Also copy internal tuple of save+transition+report and give the copy to the callback. Thus, don't assume the consumer is always nice,
and does not declare refs to internal struct variables, making this kind of hard to track.
Refactor internal code so it does not export functions to the built .o
Refactor WebUI:
- remove jquery dependency from the base custom.js and use vanilla JS
- remove jquery + jquery-datatables dependency from the RFM69 module
- replace jquery-datatables handlers with pure-css table + some basic cell filtering
(may be incomplete, but tbh it is not worth additional 50Kb to the .bin size)
- introduce a common way to notify about the app errors, show small text notification
at the top of the page instead of relying on user to find out about errors by using the Web Developer Tools
- replace <span name=...> with <span data-settings-key=...>
- replace <div> templates with <template>, disallowing modification
without an explicit DOM clone
- run `eslint` on html/custom.js and `html-validate` on html/index.html,
and fix issues detected by both tools
Streamline settings group handling in custom.js & index.html
- drop module-specific button-add-... in favour of button-add-settings-group
- only enforce data-settings-max requirement when the property actually exists
- re-create label for=... and input id=... when settings group is
modified, so checkboxes refer to the correct element
- introduce additional data-... properties to generalize settings group additions
- introduce Enumerable object to track some common list elements for
<select>, allow to re-create <option> list when messages come in
different order
Minor fixes that also came with this:
- fix relay code incorrectly parsing the payload, causing no relay names
to be displayed in the SWITCHES panel
- fix scheduler code accidentally combining keys b/c of the way C parses
string literals on separate lines, without any commas in-between
- thermostat should not reference tmpUnit directly in the webui, replace with
module-specific thermostatUnit that is handled on the device itself
- fix index.html initial setup invalid adminPass ids
- fix index.html layout when removing specific schedules
- generic mdns query function so we don't forget about the removeQuery()
- full handle mdns logic in the mqtt module, check for running mdns
instance and periodically poll for _mqtt._tcp service
- autoconnect only when MQTT is enabled *and* there is no server
- use mqtt::settings and mqtt::build namespaces for settings
- some refactoring for topic <-> setting application
- prefer const String& to const char* in topic generation