added renderer for char strings, like the boiler's service code text

This commit is contained in:
proddy
2020-09-29 13:30:57 +02:00
parent 92dab0bb00
commit f3dadb3042
2 changed files with 8 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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);