Skip to content

Commit

Permalink
samples: cellular: modem_shell: remove CONFIG_MOSH_LINK option
Browse files Browse the repository at this point in the history
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 <tommi.kangas@nordicsemi.no>
  • Loading branch information
tokangas committed Dec 12, 2024
1 parent 13b17af commit 9fce27b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------
Expand Down
2 changes: 1 addition & 1 deletion samples/cellular/modem_shell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions samples/cellular/modem_shell/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
5 changes: 0 additions & 5 deletions samples/cellular/modem_shell/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion samples/cellular/modem_shell/overlay-non-offloading.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion samples/cellular/modem_shell/overlay-ppp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion samples/cellular/modem_shell/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 7 additions & 17 deletions samples/cellular/modem_shell/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,38 @@

#include <stdio.h>
#include <string.h>
#include <sys/types.h>

#include <zephyr/kernel.h>
#include <zephyr/init.h>
#include <helpers/nrfx_reset_reason.h>
#include <nrf_modem.h>

#include <sys/types.h>
#include <zephyr/logging/log_ctrl.h>
#include <zephyr/sys/reboot.h>
#include <zephyr/dfu/mcuboot.h>

#include <zephyr/shell/shell.h>
#if defined(CONFIG_SHELL_BACKEND_SERIAL)
#include <zephyr/shell/shell_uart.h>
#else
#include <zephyr/shell/shell_rtt.h>
#endif

#include <nrf_modem.h>
#include <helpers/nrfx_reset_reason.h>
#include <modem/nrf_modem_lib.h>
#include <modem/nrf_modem_lib_trace.h>
#include <modem/modem_info.h>
#include <modem/lte_lc.h>

#include <net/nrf_cloud_os.h>

#include <dk_buttons_and_leds.h>

#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
Expand All @@ -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"
Expand Down Expand Up @@ -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.
Expand Down
34 changes: 11 additions & 23 deletions samples/cellular/modem_shell/src/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
#include <zephyr/sys/sys_heap.h>
#include <zephyr/linker/linker-defs.h>
#include <zephyr/shell/shell.h>

#include <modem/lte_lc.h>
#include <modem/nrf_modem_lib.h>

#if defined(CONFIG_LWM2M_CARRIER)
#include <lwm2m_carrier.h>
#endif
#include "mosh_print.h"
#include "link_shell.h"

#if defined(CONFIG_MOSH_IPERF3)
#include <zephyr/posix/sys/select.h>
#include <iperf_api.h>
#endif
#if defined(CONFIG_MOSH_LINK)

#if defined(CONFIG_MOSH_CURL)
#include <nrf_curl.h>
#endif

#if defined(CONFIG_LWM2M_CARRIER)
#include "link.h"
#include <modem/pdn.h>
#include <lwm2m_carrier.h>
#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 <nrf_curl.h>
#endif
#include "mosh_print.h"

extern struct k_poll_signal mosh_signal;

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 9fce27b

Please sign in to comment.