diff --git a/src/helpers.cpp b/src/helpers.cpp index 1d8080151..1eb195b84 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -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) { diff --git a/src/helpers.h b/src/helpers.h index 521f178be..b84f4f699 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -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);