summaryrefslogtreecommitdiff
path: root/fw/app/src/settings.h
blob: 8c7b4e36ee7af4a16cf8ae0e98e2b0caf5f18593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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