summaryrefslogtreecommitdiff
path: root/fw/app/src/syslog.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/app/src/syslog.c')
-rw-r--r--fw/app/src/syslog.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fw/app/src/syslog.c b/fw/app/src/syslog.c
index 47b2edb..700547b 100644
--- a/fw/app/src/syslog.c
+++ b/fw/app/src/syslog.c
@@ -7,6 +7,7 @@
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
+#include <string.h>
#include <string.h>
#include <zephyr/init.h>
@@ -33,7 +34,7 @@ LOG_MODULE_REGISTER(syslog);
struct net_mgmt_event_callback l4_cb;
static K_SEM_DEFINE(network_connected, 0, 1);
-static char target_ip[IPV6_STRLEN_MAX] = "2001:db8::2";
+static char target_ip[IPV6_STRLEN_MAX + 1] = "2001:db8::2";
void l4_event_handler(
struct net_mgmt_event_callback *cb,
@@ -145,7 +146,13 @@ int syslog_handle_export(int (*cb)(const char *name, const void *value,
int syslog_handle_get(const char *name, char *val, int val_len_max)
{
- LOG_WRN("Settings get not implemented");
+ const char* next = NULL;
+
+ if (settings_name_steq(name, "target/ip", &next) && !next) {
+ size_t len = strnlen(target_ip, sizeof(target_ip));
+ memcpy(val, target_ip, MIN(len, val_len_max));
+ }
+
return 0;
}