From eb3475b49104795e76597bfceb210eea0abb7990 Mon Sep 17 00:00:00 2001 From: Andrew Rankin Date: Sun, 26 Apr 2026 14:51:58 -0400 Subject: [PATCH] Make MO_CONFIG_MAX_VALSTRSIZE override-able via -D MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap the existing 128-byte default in #ifndef so consumers can raise the ceiling via a build flag (`-DMO_CONFIG_MAX_VALSTRSIZE=256` etc.) without patching the header. Default is unchanged. Same shape as the surrounding MO_CONFIG_EXT_PREFIX / MO_CONFIG_TYPECHECK guards. Motivation: the OCPP 1.6 MeterValuesSampledData advertised list overflows 128 chars once the optional measurands (Temperature, SoC, Frequency, Power.Factor) are bound — Configuration::setString silently rejects the write and the CSMS-side default permanently overrides ours. --- src/MicroOcpp/Core/ConfigurationKeyValue.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/MicroOcpp/Core/ConfigurationKeyValue.h b/src/MicroOcpp/Core/ConfigurationKeyValue.h index 3e631c1e..ccf19568 100644 --- a/src/MicroOcpp/Core/ConfigurationKeyValue.h +++ b/src/MicroOcpp/Core/ConfigurationKeyValue.h @@ -8,7 +8,9 @@ #include #include +#ifndef MO_CONFIG_MAX_VALSTRSIZE #define MO_CONFIG_MAX_VALSTRSIZE 128 +#endif #ifndef MO_CONFIG_EXT_PREFIX #define MO_CONFIG_EXT_PREFIX "Cst_"