From 2fa63adff12ad7152fccb65afd3c07b0f88dae8d Mon Sep 17 00:00:00 2001 From: Tristan Seifert Date: Fri, 13 Dec 2024 15:21:46 -0800 Subject: [PATCH] Function to set syslog hostname --- subsys/logging/log_backend_net.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subsys/logging/log_backend_net.c b/subsys/logging/log_backend_net.c index 7b99a05856f296..588f976e29ddde 100644 --- a/subsys/logging/log_backend_net.c +++ b/subsys/logging/log_backend_net.c @@ -236,3 +236,13 @@ const struct log_backend *log_backend_net_get(void) { return &log_backend_net; } + +int log_backend_net_set_hostname(const char *newHostname) { + if(!newHostname) { + return -EFAULT; + } + + strncpy(dev_hostname, newHostname, sizeof(dev_hostname)); + + return 0; +}