summaryrefslogtreecommitdiff
path: root/fw/app/src/settings.h
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2025-04-16 21:58:20 +0200
committerxengineering <me@xengineering.eu>2025-05-07 18:14:05 +0200
commit993996ab2b9dc7332d06453e2de7315b06ce2458 (patch)
tree1653fd7b8f87b362a1663ecc9c21ba6f126285b1 /fw/app/src/settings.h
parentf4faa103108356bcf53fb7c8829e95f012b21a4a (diff)
downloadiot-contact-993996ab2b9dc7332d06453e2de7315b06ce2458.tar
iot-contact-993996ab2b9dc7332d06453e2de7315b06ce2458.tar.zst
iot-contact-993996ab2b9dc7332d06453e2de7315b06ce2458.zip
fw: app: Encode settings with JSON lib
Diffstat (limited to 'fw/app/src/settings.h')
-rw-r--r--fw/app/src/settings.h21
1 files changed, 21 insertions, 0 deletions
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 <stddef.h>
+#include <zephyr/data/json.h>
+
+#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