diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 745a8c77..a4a1ca14 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -26,10 +26,10 @@ target_sources(app PRIVATE src/sm_uart_handler.c) target_sources_ifdef(CONFIG_SM_SMS app PRIVATE src/sm_at_sms.c) target_sources_ifdef(CONFIG_SM_PPP app PRIVATE src/sm_ppp.c) target_sources_ifdef(CONFIG_SM_CMUX app PRIVATE src/sm_cmux.c) +target_sources_ifdef(CONFIG_SM_GNSS app PRIVATE src/sm_at_gnss.c) +target_sources_ifdef(CONFIG_SM_NRF_CLOUD app PRIVATE src/sm_at_nrfcloud.c) +target_sources_ifdef(CONFIG_SM_MQTTC app PRIVATE src/sm_at_mqtt.c) -add_subdirectory_ifdef(CONFIG_SM_GNSS src/gnss) -add_subdirectory_ifdef(CONFIG_SM_NRF_CLOUD src/nrfcloud) -add_subdirectory_ifdef(CONFIG_SM_MQTTC src/mqtt_c) add_subdirectory_ifdef(CONFIG_SM_CARRIER src/lwm2m_carrier) zephyr_include_directories(src) diff --git a/app/Kconfig b/app/Kconfig index 727e4051..175cf61c 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -23,6 +23,12 @@ config SM_AT_BUF_SIZE default 4096 help Size of the buffer for incoming AT commands and modem responses. + +config SM_SKIP_READY_MSG + bool "Skip ready message" + help + Skip sending the ready message when the application is powered on. + # # external XTAL for UART # @@ -178,12 +184,21 @@ config SM_NRF_CLOUD bool "nRF Cloud support" default y +config SM_MQTTC + bool "MQTT client support" + default y + select MQTT_LIB + select MQTT_LIB_TLS + config SM_FULL_FOTA bool "Full modem FOTA support" config SM_PPP bool "PPP support" +config SM_CMUX + bool "CMUX support" + if SM_PPP config SM_PPP_FALLBACK_MTU @@ -194,18 +209,7 @@ config SM_PPP_FALLBACK_MTU If no MTU is returned by the modem, this value will be used as a fallback. The MTU will be used for sending and receiving of data on both the PPP and cellular links. -endif - -config SM_CMUX - bool "CMUX support" - -config SM_CMUX_UART_BUFFER_SIZE - int "UART buffer size for CMUX" - depends on SM_CMUX - default 600 - help - Size of the buffer for data received in CMUX mode. - Same buffer size is used for both RX and TX. +endif # SM_PPP if SM_CMUX || SM_PPP @@ -213,20 +217,55 @@ config SM_MODEM_PIPE_TIMEOUT int "Timeout for the CMUX and PPP modem pipe operations in seconds" default 10 -endif +endif # SM_CMUX || SM_PPP -config SM_SKIP_READY_MSG - bool "Skip ready message" +if SM_MQTTC + +config SM_MQTTC_MESSAGE_BUFFER_LEN + int "Size of the buffer for MQTT library" + default 512 help - Skip sending the ready message when the application is powered on. + Specifies maximum message size that can be transmitted/received through + MQTT (excluding MQTT PUBLISH payload). + +endif # SM_MQTTC + +if SM_GNSS + +config SM_GNSS_OUTPUT_NMEA_ON_CMUX_CHANNEL + bool "Output NMEA messages on a dedicated CMUX channel" + depends on SM_CMUX + +config SM_GNSS_OUTPUT_NMEA_SATELLITES + bool "Output NMEA satellite messages (GSV, GSA)" + default y if SM_LOG_LEVEL_DBG + depends on SM_LOG_LEVEL_DBG || SM_GNSS_OUTPUT_NMEA_ON_CMUX_CHANNEL + help + If enabled, NMEA messages that pertain to the satellites will be output + along with the other NMEA messages. Those are output in debug logs, and + can also be output to a dedicated CMUX channel. + +config SM_PGPS_INJECT_FIX_DATA + bool "Inject the data obtained when acquiring a fix" + default y + depends on SM_GNSS + depends on SM_NRF_CLOUD + depends on NRF_CLOUD_PGPS + help + If enabled, when a fix is acquired the current location and time will + be passed to the P-GPS subsystem. + It allows to speed up the time it takes to acquire the next fix when + A-GNSS is disabled or unavailable. + This can be detrimental to short TTFF if the device is expected to move + distances longer than a few dozen kilometers between fix attempts. + In that case this option should be disabled. +endif # SM_GNSS module = SM module-str = serial modem source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config" -rsource "src/mqtt_c/Kconfig" rsource "src/lwm2m_carrier/Kconfig" -rsource "src/gnss/Kconfig" endmenu diff --git a/app/src/gnss/CMakeLists.txt b/app/src/gnss/CMakeLists.txt deleted file mode 100644 index 9b914ada..00000000 --- a/app/src/gnss/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -zephyr_include_directories(.) -target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/sm_at_gnss.c) diff --git a/app/src/gnss/Kconfig b/app/src/gnss/Kconfig deleted file mode 100644 index b6d1ba1a..00000000 --- a/app/src/gnss/Kconfig +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -config SM_GNSS_OUTPUT_NMEA_ON_CMUX_CHANNEL - bool "Output NMEA messages on a dedicated CMUX channel" - depends on SM_CMUX - -config SM_GNSS_OUTPUT_NMEA_SATELLITES - bool "Output NMEA satellite messages (GSV, GSA)" - default y if SM_LOG_LEVEL_DBG - depends on SM_LOG_LEVEL_DBG || SM_GNSS_OUTPUT_NMEA_ON_CMUX_CHANNEL - help - If enabled, NMEA messages that pertain to the satellites will be output - along with the other NMEA messages. Those are output in debug logs, and - can also be output to a dedicated CMUX channel. - -config SM_PGPS_INJECT_FIX_DATA - bool "Inject the data obtained when acquiring a fix" - default y - depends on SM_GNSS - depends on SM_NRF_CLOUD - depends on NRF_CLOUD_PGPS - help - If enabled, when a fix is acquired the current location and time will - be passed to the P-GPS subsystem. - It allows to speed up the time it takes to acquire the next fix when - A-GNSS is disabled or unavailable. - This can be detrimental to short TTFF if the device is expected to move - distances longer than a few dozen kilometers between fix attempts. - In that case this option should be disabled. diff --git a/app/src/mqtt_c/CMakeLists.txt b/app/src/mqtt_c/CMakeLists.txt deleted file mode 100644 index 19f19835..00000000 --- a/app/src/mqtt_c/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2020 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -zephyr_include_directories(.) -target_sources_ifdef(CONFIG_SM_MQTTC app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/sm_at_mqtt.c) diff --git a/app/src/mqtt_c/Kconfig b/app/src/mqtt_c/Kconfig deleted file mode 100644 index 2c3936d1..00000000 --- a/app/src/mqtt_c/Kconfig +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (c) 2020 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -config SM_MQTTC - bool "MQTT client support" - default y - select MQTT_LIB - select MQTT_LIB_TLS - -if SM_MQTTC - -config SM_MQTTC_MESSAGE_BUFFER_LEN - int "Size of the buffer for MQTT library" - default 512 - help - Specifies maximum message size can be transmitted/received through - MQTT (excluding MQTT PUBLISH payload). - -endif # SM_MQTTC diff --git a/app/src/nrfcloud/CMakeLists.txt b/app/src/nrfcloud/CMakeLists.txt deleted file mode 100644 index c6b806fb..00000000 --- a/app/src/nrfcloud/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -zephyr_include_directories(.) -target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/sm_at_nrfcloud.c) diff --git a/app/src/gnss/sm_at_gnss.c b/app/src/sm_at_gnss.c similarity index 100% rename from app/src/gnss/sm_at_gnss.c rename to app/src/sm_at_gnss.c diff --git a/app/src/gnss/sm_at_gnss.h b/app/src/sm_at_gnss.h similarity index 100% rename from app/src/gnss/sm_at_gnss.h rename to app/src/sm_at_gnss.h diff --git a/app/src/mqtt_c/sm_at_mqtt.c b/app/src/sm_at_mqtt.c similarity index 100% rename from app/src/mqtt_c/sm_at_mqtt.c rename to app/src/sm_at_mqtt.c diff --git a/app/src/mqtt_c/sm_at_mqtt.h b/app/src/sm_at_mqtt.h similarity index 100% rename from app/src/mqtt_c/sm_at_mqtt.h rename to app/src/sm_at_mqtt.h diff --git a/app/src/nrfcloud/sm_at_nrfcloud.c b/app/src/sm_at_nrfcloud.c similarity index 100% rename from app/src/nrfcloud/sm_at_nrfcloud.c rename to app/src/sm_at_nrfcloud.c diff --git a/app/src/nrfcloud/sm_at_nrfcloud.h b/app/src/sm_at_nrfcloud.h similarity index 100% rename from app/src/nrfcloud/sm_at_nrfcloud.h rename to app/src/sm_at_nrfcloud.h