mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
added renderer for char strings, like the boiler's service code text
This commit is contained in:
@@ -134,6 +134,12 @@ char * Helpers::render_boolean(char * result, bool value) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// render for native char strings
|
||||
char * Helpers::render_value(char * result, const char * value, uint8_t format) {
|
||||
strcpy(result, value);
|
||||
return result;
|
||||
}
|
||||
|
||||
// convert unsigned int (single byte) to text value and returns it
|
||||
// format: 255(0xFF)=boolean, 0=no formatting, otherwise divide by format
|
||||
char * Helpers::render_value(char * result, uint8_t value, uint8_t format) {
|
||||
|
||||
@@ -40,7 +40,8 @@ class Helpers {
|
||||
static char * render_value(char * result, const uint16_t value, const uint8_t format);
|
||||
static char * render_value(char * result, const uint32_t value, const uint8_t format);
|
||||
static char * render_value(char * result, const int16_t value, const uint8_t format);
|
||||
|
||||
static char * render_value(char * result, const char * value, uint8_t format);
|
||||
|
||||
static char * render_boolean(char * result, bool value);
|
||||
|
||||
static char * smallitoa(char * result, const uint8_t value);
|
||||
|
||||
Reference in New Issue
Block a user