From 9fce27bb2b6c3160f5b8521e1928c73d3a0ce97b Mon Sep 17 00:00:00 2001 From: Tommi Kangas Date: Mon, 19 Aug 2024 15:49:47 +0300 Subject: [PATCH] samples: cellular: modem_shell: remove CONFIG_MOSH_LINK option Removed obsolete CONFIG_MOSH_LINK Kconfig option, because compilation has not been possible with the option disabled. At the same time cleaned up some other unnecessary flagging. Signed-off-by: Tommi Kangas --- .../releases/release-notes-changelog.rst | 5 ++- samples/cellular/modem_shell/CMakeLists.txt | 2 +- samples/cellular/modem_shell/Kconfig | 11 ------ samples/cellular/modem_shell/README.rst | 5 --- .../modem_shell/overlay-non-offloading.conf | 1 - samples/cellular/modem_shell/overlay-ppp.conf | 1 - samples/cellular/modem_shell/prj.conf | 1 - samples/cellular/modem_shell/src/main.c | 24 ++++--------- samples/cellular/modem_shell/src/shell.c | 34 ++++++------------- 9 files changed, 23 insertions(+), 61 deletions(-) diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 8b093f8fb20a..70ab1743f733 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -270,7 +270,10 @@ Bluetooth Mesh samples Cellular samples ---------------- -|no_changes_yet_note| +* :ref:`modem_shell_application` sample: + + * Removed the ``CONFIG_MOSH_LINK`` Kconfig option. + Link control functionality is now always enabled and cannot be disabled. Cryptography samples -------------------- diff --git a/samples/cellular/modem_shell/CMakeLists.txt b/samples/cellular/modem_shell/CMakeLists.txt index 1ef685d68bf2..b68a52787efe 100644 --- a/samples/cellular/modem_shell/CMakeLists.txt +++ b/samples/cellular/modem_shell/CMakeLists.txt @@ -17,10 +17,10 @@ add_subdirectory(src/print) add_subdirectory(src/utils) add_subdirectory(src/uart) add_subdirectory(src/at) +add_subdirectory(src/link) add_subdirectory_ifdef(CONFIG_MOSH_NRF91_NON_OFFLOADING_DEV src/drivers) add_subdirectory_ifdef(CONFIG_MOSH_WORKER_THREADS src/th) add_subdirectory_ifdef(CONFIG_MOSH_SOCK src/sock) -add_subdirectory_ifdef(CONFIG_MOSH_LINK src/link) add_subdirectory_ifdef(CONFIG_MOSH_PING src/ping) add_subdirectory_ifdef(CONFIG_MOSH_GNSS src/gnss) add_subdirectory_ifdef(CONFIG_MOSH_SMS src/sms) diff --git a/samples/cellular/modem_shell/Kconfig b/samples/cellular/modem_shell/Kconfig index bdfa2f4956af..3da730728ae8 100644 --- a/samples/cellular/modem_shell/Kconfig +++ b/samples/cellular/modem_shell/Kconfig @@ -29,15 +29,6 @@ config MOSH_PING help Ping is a tool for testing the reachability of a host on an IP network. -config MOSH_LINK - bool "Link control" - depends on LTE_LINK_CONTROL - depends on MODEM_INFO - depends on SETTINGS - default y - help - Link control changes and queries the state of the LTE connection. - config MOSH_CURL bool "cURL" default y @@ -184,7 +175,6 @@ config MOSH_AT_CMD_MODE_TERMINATION default 3 if MOSH_AT_CMD_MODE_CR_LF_TERMINATION endif -if MOSH_LINK menu "MoSH link control selections" config MOSH_LINK_SETT_NORMAL_MODE_AT_CMD_STR_LEN @@ -195,7 +185,6 @@ config MOSH_LINK_SETT_NORMAL_MODE_AT_CMD_STR_LEN when going to normal mode. endmenu -endif #MOSH_LINK if MOSH_WORKER_THREADS diff --git a/samples/cellular/modem_shell/README.rst b/samples/cellular/modem_shell/README.rst index 9c529bc053a0..9f8a81cfa149 100644 --- a/samples/cellular/modem_shell/README.rst +++ b/samples/cellular/modem_shell/README.rst @@ -812,11 +812,6 @@ Configuration options Check and configure the following configuration options for the sample: -.. _CONFIG_MOSH_LINK: - -CONFIG_MOSH_LINK - Enable LTE link control feature in modem shell. - .. _CONFIG_MOSH_PING: CONFIG_MOSH_PING diff --git a/samples/cellular/modem_shell/overlay-non-offloading.conf b/samples/cellular/modem_shell/overlay-non-offloading.conf index e22f646beb45..542e7d3485f8 100644 --- a/samples/cellular/modem_shell/overlay-non-offloading.conf +++ b/samples/cellular/modem_shell/overlay-non-offloading.conf @@ -12,7 +12,6 @@ CONFIG_MOSH_WORKER_THREADS=n CONFIG_MOSH_SOCK=n CONFIG_MOSH_PING=n CONFIG_MOSH_CURL=n -CONFIG_MOSH_LINK=y CONFIG_MOSH_GNSS=n CONFIG_MOSH_SMS=n CONFIG_MOSH_LOCATION=n diff --git a/samples/cellular/modem_shell/overlay-ppp.conf b/samples/cellular/modem_shell/overlay-ppp.conf index d8438eab940d..a93e6a051755 100644 --- a/samples/cellular/modem_shell/overlay-ppp.conf +++ b/samples/cellular/modem_shell/overlay-ppp.conf @@ -11,7 +11,6 @@ CONFIG_MOSH_WORKER_THREADS=n CONFIG_MOSH_SOCK=n CONFIG_MOSH_PING=y CONFIG_MOSH_CURL=n -CONFIG_MOSH_LINK=y CONFIG_MOSH_GNSS=n CONFIG_MOSH_SMS=n CONFIG_MOSH_LOCATION=n diff --git a/samples/cellular/modem_shell/prj.conf b/samples/cellular/modem_shell/prj.conf index ace599ba5ce8..fbd6bab1d0fa 100644 --- a/samples/cellular/modem_shell/prj.conf +++ b/samples/cellular/modem_shell/prj.conf @@ -11,7 +11,6 @@ CONFIG_NRF_IPERF3_RESULTS_WAIT_TIME=180 CONFIG_MOSH_SOCK=y CONFIG_MOSH_PING=y CONFIG_MOSH_CURL=y -CONFIG_MOSH_LINK=y CONFIG_MOSH_SMS=y CONFIG_MOSH_GNSS=y CONFIG_MOSH_LOCATION=y diff --git a/samples/cellular/modem_shell/src/main.c b/samples/cellular/modem_shell/src/main.c index d95f23e559c9..cd854c34ced5 100644 --- a/samples/cellular/modem_shell/src/main.c +++ b/samples/cellular/modem_shell/src/main.c @@ -6,17 +6,13 @@ #include #include +#include #include #include -#include -#include - -#include #include #include #include - #include #if defined(CONFIG_SHELL_BACKEND_SERIAL) #include @@ -24,24 +20,24 @@ #include #endif +#include +#include #include #include #include #include - #include - #include + +#include "mosh_defines.h" +#include "mosh_print.h" +#include "link.h" #include "uart_shell.h" #if defined(CONFIG_MOSH_PPP) #include "ppp_ctrl.h" #endif -#if defined(CONFIG_MOSH_LINK) -#include "link.h" -#endif - #if defined(CONFIG_MOSH_GNSS) #include "gnss.h" #endif @@ -52,8 +48,6 @@ #if defined(CONFIG_MOSH_WORKER_THREADS) #include "th_ctrl.h" #endif -#include "mosh_defines.h" -#include "mosh_print.h" #if defined(CONFIG_MOSH_LOCATION) #include "location_shell.h" @@ -312,17 +306,13 @@ int main(void) /* Location library should be initialized before LTE normal mode */ location_ctrl_init(); #endif -#if defined(CONFIG_LTE_LINK_CONTROL) && defined(CONFIG_MOSH_LINK) link_init(); -#endif -#if defined(CONFIG_MODEM_INFO) err = modem_info_init(); if (err) { printk("Modem info could not be initialized: %d\n", err); return 0; } -#endif /* Version information printing uses the Modem information library, so it can not be done * before the library has been initialized. diff --git a/samples/cellular/modem_shell/src/shell.c b/samples/cellular/modem_shell/src/shell.c index 6fbe8ca666a7..73d08ac269b3 100644 --- a/samples/cellular/modem_shell/src/shell.c +++ b/samples/cellular/modem_shell/src/shell.c @@ -12,28 +12,28 @@ #include #include #include + #include #include -#if defined(CONFIG_LWM2M_CARRIER) -#include -#endif +#include "mosh_print.h" +#include "link_shell.h" + #if defined(CONFIG_MOSH_IPERF3) #include #include #endif -#if defined(CONFIG_MOSH_LINK) + +#if defined(CONFIG_MOSH_CURL) +#include +#endif + #if defined(CONFIG_LWM2M_CARRIER) -#include "link.h" #include +#include +#include "link.h" #include "link_settings.h" #endif /* CONFIG_LWM2M_CARRIER */ -#include "link_shell.h" -#endif /* CONFIG_MOSH_LINK */ -#if defined(CONFIG_MOSH_CURL) -#include -#endif -#include "mosh_print.h" extern struct k_poll_signal mosh_signal; @@ -129,28 +129,16 @@ int lwm2m_carrier_event_handler(const lwm2m_carrier_event_t *event) switch (event->type) { case LWM2M_CARRIER_EVENT_LTE_LINK_UP: mosh_print("LwM2M carrier event: request LTE Link up"); -#if defined(CONFIG_LTE_LINK_CONTROL) && defined(CONFIG_MOSH_LINK) link_func_mode_set(LTE_LC_FUNC_MODE_NORMAL, link_sett_is_normal_mode_autoconn_rel14_used()); return 0; -#else - return lte_lc_normal(); -#endif case LWM2M_CARRIER_EVENT_LTE_LINK_DOWN: mosh_print("LwM2M carrier event: request LTE Link down"); -#if defined(CONFIG_LTE_LINK_CONTROL) && defined(CONFIG_MOSH_LINK) link_func_mode_set(LTE_LC_FUNC_MODE_OFFLINE, false); -#else - err = lte_lc_offline(); -#endif break; case LWM2M_CARRIER_EVENT_LTE_POWER_OFF: mosh_print("LwM2M carrier event: request LTE Power off"); -#if defined(CONFIG_LTE_LINK_CONTROL) && defined(CONFIG_MOSH_LINK) link_func_mode_set(LTE_LC_FUNC_MODE_POWER_OFF, false); -#else - err = lte_lc_power_off(); -#endif break; case LWM2M_CARRIER_EVENT_BOOTSTRAPPED: mosh_print("LwM2M carrier event: bootstrapped");