Don't introduce our callback to the type system, continue to bind the
ticker instance as the timer's arg and just use the lambda to pass the
argument to the reset function
```
libraries/Ticker/src/Ticker.h:136:41: warning: cast between incompatible function types from 'void (*)(CustomResetReason)' to 'Ticker::callback_with_arg_t' {aka 'void (*)(void*)'} [-Wcast-function-type]
136 | _attach_ms(milliseconds, false, reinterpret_cast<callback_with_arg_t>(callback), reinterpret_cast<void*>(arg));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Attempt to either parse with newer syntax, or fallback to the floating
point seconds as default. Settings also return a 'result' instead of the
default zero, fallback to build value otherwise (which is still floating point, though)
Update /pulse API endpoint to report the actual pulse timer value that
is active right now, not just the value attached via the setting
Make sure we don't try to strlen some empty space or neighbouring
segments, that may or may not contain nulls
Also tweak the function to warn about large messages, since it is not
(yet) clear whether we actually want those. At least something to log.
Make sure to properly clamp delay times, as the recent issue had shown
it is possible to go below the update limit. SNTP app does not do any
runtime checks, so it's up to us to enforce these limits
Update internal random number generator from raw `secureRandom()` to a custom
'std::random_device'-look-alike, where we could also use it with STL functions
(current implementation is `os_random()` aka `esp_random()`)
Not as clean as other modules, but at least prepare for the further changes.
Implement settings for float duration conversion, and test it out with pulse
and flood window time values.
More safe-guards for an externally-defined pulse time, make sure it is
not either inf or nan and is an actual finite number
Also use EnumerableConfig for the WebUI output, and make sure to use
internal _relays.size() instead of doing a function call
Make sure it could be moved further along, and the values inside of it
can be safely moved as well.
Also fixup commands that were missing ctx in OK / Error.
Use internal duration types, store time in seconds and propogate as
uint32_t when it is necessary. Update tick values as well.
Instead of generic `toInt(), overload between `strtol` and `strtoll`.
Current implementation of `settimeofday` rejects `struct tz` pointer,
make sure it's nullptr.
Sync is a simple enough routine... But, expect an already synced system
before triggering the sntp restart.
For this, keep things as milliseconds (at least for now)
Make sure to use __builtin_strlen in constexpr context
Remove `has*()` functions that are no longer used
Update WebUI callback to use EnumerableConfig
There's no need to move a temporary which is already an rvalue
Clean-up some redundant attributes and function in settings.
Make sure C types are proxied to fixed-sized ones, not the other way around.
Clean-up webprint implementation
- use typed duration for the backlog
- don't duplicate members and types for config, just re-use the struct as-is
- don't go over-the-top with const members, just proxy through a method
(possibly) noticed in the gitter
https://gitter.im/tinkerman-cat/espurna?at=61abba5a76e37917551e4a2f
refactoring causality, as there's no longer an explicit Serial.begin
for RFB_PROVIDER_EFM8BB1 in the hardware setup in the system.cpp
(also, from not including wip serial changes that did serial port setup :/)
Generate resulting .cpp in the $BUILD_DIR, no need for atexit
Register middleware only once, there's no need to manually walk the
project directory since fnmatch.fnmatch(...) supports globs
Provide a SCons Action instead of simple function, so there's a way to
generate things on demand via command line
```
$ pio run -e $env -t .pio/build/$env/espurna_single_source/src/main.cpp
```
- just pass `-include ${cfg}` to the compiler instead of a
temporary custom.h. also do `-DDEVICE=...` and `-DMANUFACTURER=...`
- rework test_build to print using `logging` module
- report leftover configurations, after the failed one exits
- prettify the output and highlight relevant info instead of the whole lines