diff options
Diffstat (limited to 'fw/app')
-rw-r--r-- | fw/app/Kconfig | 4 | ||||
-rw-r--r-- | fw/app/src/syslog.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/fw/app/Kconfig b/fw/app/Kconfig index 5393e05..3481340 100644 --- a/fw/app/Kconfig +++ b/fw/app/Kconfig @@ -2,4 +2,8 @@ config IOT_CONTACT_REMOTE_UPDATE bool "Enable the remote update system" default n +config IOT_CONTACT_NETWORK_HACK + bool "Reboots after a fixed timeout if network connection cannot be established" + default n + source "Kconfig.zephyr" diff --git a/fw/app/src/syslog.c b/fw/app/src/syslog.c index edc2839..e19a196 100644 --- a/fw/app/src/syslog.c +++ b/fw/app/src/syslog.c @@ -14,7 +14,10 @@ #include <zephyr/logging/log_ctrl.h> #include <zephyr/logging/log_core.h> #include <zephyr/net/conn_mgr_connectivity.h> + +#ifdef CONFIG_IOT_CONTACT_NETWORK_HACK #include <zephyr/sys/reboot.h> +#endif // CONFIG_IOT_CONTACT_NETWORK_HACK LOG_MODULE_REGISTER(syslog); @@ -58,12 +61,17 @@ int init_syslog(void) LOG_DBG("Initializing syslog logging backend"); LOG_INF("Waiting for network ..."); + +#ifdef CONFIG_IOT_CONTACT_NETWORK_HACK int ret = k_sem_take(&network_connected, NETWORK_BUG_DELAY); if (ret == -EAGAIN) { LOG_ERR("Could not connect to network - rebooting system"); log_flush(); sys_reboot(SYS_REBOOT_COLD); } +#else + k_sem_take(&network_connected, K_FOREVER); +#endif // CONFIG_IOT_CONTACT_NETWORK_HACK LOG_INF("Enabling syslog backend"); const struct log_backend *backend = log_backend_net_get(); |