From 993996ab2b9dc7332d06453e2de7315b06ce2458 Mon Sep 17 00:00:00 2001 From: xengineering Date: Wed, 16 Apr 2025 21:58:20 +0200 Subject: fw: app: Encode settings with JSON lib --- fw/app/src/settings.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'fw/app/src/settings.h') diff --git a/fw/app/src/settings.h b/fw/app/src/settings.h index a5cf2ac..290d1ff 100644 --- a/fw/app/src/settings.h +++ b/fw/app/src/settings.h @@ -4,8 +4,29 @@ * obtain one at https://mozilla.org/MPL/2.0/. */ +#ifndef SRC_SETTINGS_H +#define SRC_SETTINGS_H #include +#include + +#define IPV6_STRLEN_MAX 39 // excluding '\0' + + +struct settings_syslog_target { + char ip_array[IPV6_STRLEN_MAX]; + char *ip; /* Zephyr's JSON lib does not work with arrays directly */ +}; + +struct settings_syslog { + struct settings_syslog_target target; +}; + +struct settings { + struct settings_syslog syslog; +}; int settings_to_json(void *buffer, size_t data); + +#endif // !SRC_SETTINGS_H -- cgit v1.2.3-70-g09d2