mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +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;
|
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
|
// convert unsigned int (single byte) to text value and returns it
|
||||||
// format: 255(0xFF)=boolean, 0=no formatting, otherwise divide by format
|
// format: 255(0xFF)=boolean, 0=no formatting, otherwise divide by format
|
||||||
char * Helpers::render_value(char * result, uint8_t value, uint8_t format) {
|
char * Helpers::render_value(char * result, uint8_t value, uint8_t format) {
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class Helpers {
|
|||||||
static char * render_value(char * result, const uint16_t value, const uint8_t format);
|
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 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 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 * render_boolean(char * result, bool value);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user