diff options
author | xengineering <me@xengineering.eu> | 2025-05-07 19:03:22 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2025-05-07 19:03:22 +0200 |
commit | a5aafcbd0398ae3893a83827cf66d4352eaee8f0 (patch) | |
tree | 36506463a33aa274dc56f8332269eab096eb73c7 /fw/app/src/settings.h | |
parent | 015972d873627466bd7e40f8d5dbb5951fb0f36a (diff) | |
parent | 184a41809c66868992c90ce9d420b8e4dc46253b (diff) | |
download | iot-contact-a5aafcbd0398ae3893a83827cf66d4352eaee8f0.tar iot-contact-a5aafcbd0398ae3893a83827cf66d4352eaee8f0.tar.zst iot-contact-a5aafcbd0398ae3893a83827cf66d4352eaee8f0.zip |
This adds the HTTP GET /settings.json API. Writing settings is only
supported via the Zephyr shell.
Diffstat (limited to 'fw/app/src/settings.h')
-rw-r--r-- | fw/app/src/settings.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fw/app/src/settings.h b/fw/app/src/settings.h new file mode 100644 index 0000000..8c7b4e3 --- /dev/null +++ b/fw/app/src/settings.h @@ -0,0 +1,33 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * 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' +#define SETTINGS_JSON_MAX_LEN (IPV6_STRLEN_MAX + 50) + + +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 |