diff --git a/applications/serial_lte_modem/Kconfig b/applications/serial_lte_modem/Kconfig index 318eaa984761..93b0e01681cf 100644 --- a/applications/serial_lte_modem/Kconfig +++ b/applications/serial_lte_modem/Kconfig @@ -201,6 +201,12 @@ config SLM_MODEM_PIPE_TIMEOUT endif +config SLM_SKIP_READY_MSG + bool "Skip ready message" + help + Skip sending the ready message when the application is powered on. + + module = SLM module-str = serial modem source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" diff --git a/applications/serial_lte_modem/overlay-cmux.conf b/applications/serial_lte_modem/overlay-cmux.conf index 900d9876b68e..258277b8a728 100644 --- a/applications/serial_lte_modem/overlay-cmux.conf +++ b/applications/serial_lte_modem/overlay-cmux.conf @@ -5,6 +5,7 @@ # CONFIG_SLM_CMUX=y +CONFIG_SLM_SKIP_READY_MSG=y # Zephyr modem subsystem CONFIG_MODEM_MODULES=y diff --git a/applications/serial_lte_modem/src/slm_at_host.c b/applications/serial_lte_modem/src/slm_at_host.c index 3bfff4ba328a..af3de07b50f7 100644 --- a/applications/serial_lte_modem/src/slm_at_host.c +++ b/applications/serial_lte_modem/src/slm_at_host.c @@ -910,9 +910,12 @@ int slm_at_host_init(void) return err; } - err = slm_at_send_str(SLM_SYNC_STR); - if (err) { - return err; + if (!IS_ENABLED(CONFIG_SLM_SKIP_READY_MSG)) { + /* Send Ready string to indicate that AT host is ready */ + err = slm_at_send_str(SLM_SYNC_STR); + if (err) { + return err; + } } /* This is here and not earlier because in case of firmware diff --git a/applications/serial_lte_modem/src/slm_cmux.c b/applications/serial_lte_modem/src/slm_cmux.c index ad605572c4e9..4ea48a3bff20 100644 --- a/applications/serial_lte_modem/src/slm_cmux.c +++ b/applications/serial_lte_modem/src/slm_cmux.c @@ -114,6 +114,10 @@ static void init_dlci(size_t dlci_idx, uint16_t recv_buf_size, static int cmux_write_at_channel(const uint8_t *data, size_t len) { + if (cmux.dlcis[cmux.at_channel].instance.state != MODEM_CMUX_DLCI_STATE_OPEN) { + return 0; + } + int ret = modem_pipe_transmit(cmux.dlcis[cmux.at_channel].pipe, data, len); if (ret != len) {