From d4c25b107582fa83d734ee72242767bbcda20fd9 Mon Sep 17 00:00:00 2001 From: Justin Morton Date: Thu, 26 Sep 2024 13:26:37 -0700 Subject: [PATCH] net: lib: nrfcloud: kconfig organization/cleanup Improve Kconfig menu display and navigation. Signed-off-by: Justin Morton --- subsys/net/lib/nrf_cloud/Kconfig | 98 +++++++------------ .../net/lib/nrf_cloud/Kconfig.nrf_cloud_alert | 3 + .../net/lib/nrf_cloud/Kconfig.nrf_cloud_fota | 54 +++++----- .../lib/nrf_cloud/Kconfig.nrf_cloud_location | 41 ++++++++ .../net/lib/nrf_cloud/Kconfig.nrf_cloud_log | 27 ++--- .../net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps | 2 +- .../nrf_cloud/Kconfig.nrf_cloud_shadow_info | 10 ++ 7 files changed, 134 insertions(+), 101 deletions(-) diff --git a/subsys/net/lib/nrf_cloud/Kconfig b/subsys/net/lib/nrf_cloud/Kconfig index 38aa7a370ca4..f7fb9b087674 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig +++ b/subsys/net/lib/nrf_cloud/Kconfig @@ -5,40 +5,27 @@ menu "nRF Cloud" -rsource "Kconfig.nrf_cloud_client_id" +menu "Transport" rsource "Kconfig.nrf_cloud_mqtt" -rsource "Kconfig.nrf_cloud_fota" - -rsource "Kconfig.nrf_cloud_agnss" - -rsource "Kconfig.nrf_cloud_pgps" - rsource "Kconfig.nrf_cloud_rest" -rsource "Kconfig.nrf_cloud_location" +if NRF_CLOUD_MQTT || NRF_CLOUD_REST -rsource "Kconfig.nrf_cloud_alert" +config NRF_CLOUD_HOST_NAME + string "nRF Cloud server hostname" + default "mqtt.nrfcloud.com" + help + Used for MQTT and JITP performed with REST -rsource "Kconfig.nrf_cloud_log" +endif # NRF_CLOUD_MQTT || NRF_CLOUD_REST rsource "Kconfig.nrf_cloud_coap" -rsource "Kconfig.nrf_cloud_shadow_info" - -config NRF_CLOUD_VERBOSE_DETAILS - bool "Log more info about cloud connection" - default y - help - Log at INF level the stage, protocol, sec tag, host name, and team ID, - in addition to device id. +endmenu # "Transport" -config NRF_CLOUD_GATEWAY - bool "nRF Cloud Gateway" - help - Enables functionality in this device to be compatible with - nRF Cloud LTE gateway support. +menu "Credentials" config NRF_CLOUD_SEC_TAG int "Security tag to use for nRF Cloud connection" @@ -46,39 +33,6 @@ config NRF_CLOUD_SEC_TAG if NRF_CLOUD_MQTT || NRF_CLOUD_REST || NRF_CLOUD_PGPS || MODEM_JWT || NRF_CLOUD_COAP -config NRF_CLOUD_HOST_NAME - string "nRF Cloud server hostname" - default "mqtt.nrfcloud.com" - help - Used for MQTT and JITP performed with REST - -config NRF_CLOUD_DEVICE_STATUS_ENCODE_VOLTAGE - bool "Include the (battery) voltage when encoding device status" - depends on MODEM_INFO - depends on MODEM_INFO_ADD_DEVICE - default y - -choice NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT - prompt "Encoding options for Wi-Fi location requests" - default NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_MAC_RSSI - -config NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_MAC_ONLY - bool "Encode only the MAC address" - help - The MAC address is the only required parameter. - -config NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_MAC_RSSI - bool "Encode the MAC address and the RSSI value" - help - The RSSI value may improve location accuracy. - -config NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_ALL - bool "Encode all available parameters" - help - This option increases the memory required for creating requests. - It also increases the amount of data sent to nRF Cloud. -endchoice - config NRF_CLOUD_PROVISION_CERTIFICATES bool "Install credentials for nRF Cloud connection" select EXPERIMENTAL @@ -135,6 +89,8 @@ config NRF_CLOUD_CREDENTIALS_MGMT_TLS_CRED select TLS_CREDENTIALS endchoice +endif # NRF_CLOUD_MQTT || NRF_CLOUD_REST || NRF_CLOUD_PGPS || MODEM_JWT || NRF_CLOUD_COAP + config NRF_CLOUD_JWT_SOURCE_CUSTOM bool "Custom JWT creation and signing" select EXPERIMENTAL @@ -151,16 +107,32 @@ config NRF_CLOUD_JWT_SOURCE_CUSTOM help JWTs are created and signed by the nRF Cloud library, not the modem. The signing key is obtained from the TLS credentials module. +endmenu # "Credentials" -endif # NRF_CLOUD_MQTT || NRF_CLOUD_REST || NRF_CLOUD_PGPS || MODEM_JWT || NRF_CLOUD_COAP +rsource "Kconfig.nrf_cloud_client_id" + +rsource "Kconfig.nrf_cloud_fota" -if NRF_CLOUD_AGNSS || NRF_CLOUD_PGPS +rsource "Kconfig.nrf_cloud_location" -module = NRF_CLOUD_GPS -module-str = nRF Cloud GPS Assistance -source "subsys/logging/Kconfig.template.log_config" +rsource "Kconfig.nrf_cloud_alert" -endif +rsource "Kconfig.nrf_cloud_log" + +rsource "Kconfig.nrf_cloud_shadow_info" + +config NRF_CLOUD_VERBOSE_DETAILS + bool "Log more info about cloud connection" + default y + help + Log at INF level the stage, protocol, sec tag, host name, and team ID, + in addition to device id. + +config NRF_CLOUD_GATEWAY + bool "nRF Cloud Gateway" + help + Enables functionality in this device to be compatible with + nRF Cloud LTE gateway support. module=NRF_CLOUD module-dep=LOG @@ -168,4 +140,4 @@ module-str=Log level for nRF Cloud module-help=Enables nRF Cloud log messages. source "subsys/logging/Kconfig.template.log_config" -endmenu +endmenu # "nRF Cloud" diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_alert b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_alert index d25ecded13ef..6386aaed689a 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_alert +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_alert @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +menu "Alerts" menuconfig NRF_CLOUD_ALERT bool "nRF Cloud Alert System" @@ -21,3 +22,5 @@ endif # NRF_CLOUD_ALERT module = NRF_CLOUD_ALERT module-str = nRF Cloud Alert source "subsys/logging/Kconfig.template.log_config" + +endmenu diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota index 7b7f69bc9a28..b23436f508e5 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +menu "Firmware Over-the-Air (FOTA) Updates" menuconfig NRF_CLOUD_FOTA - bool "Enable nRF Cloud MQTT FOTA library" + bool "nRF Cloud MQTT FOTA library" select FOTA_DOWNLOAD select FOTA_DOWNLOAD_PROGRESS_EVT select DFU_TARGET @@ -12,6 +13,7 @@ menuconfig NRF_CLOUD_FOTA select REBOOT select CJSON_LIB select SETTINGS + depends on FOTA_USE_NRF_CLOUD_SETTINGS_AREA default y if NRF_CLOUD_MQTT if NRF_CLOUD_FOTA @@ -36,20 +38,26 @@ config NRF_CLOUD_FOTA_BLE_DEVICES endif # NRF_CLOUD_FOTA -config NRF_CLOUD_FOTA_DOWNLOAD_FRAGMENT_SIZE - int "Fragment size for FOTA downloads" - depends on FOTA_DOWNLOAD - range 128 1900 - default 1700 - config FOTA_USE_NRF_CLOUD_SETTINGS_AREA - bool "Use the same settings area as the nRF Cloud FOTA library" + bool "Use the settings area defined by nRF Cloud FOTA library" default y help Using the same settings area as the nRF Cloud FOTA library will allow this sample to perform application-FOTA updates to applications built with CONFIG_NRF_CLOUD_FOTA enabled. +config NRF_CLOUD_FOTA_POLL + bool "FOTA job polling helpers (REST/CoAP)" + depends on !NRF_CLOUD_FOTA + depends on FOTA_DOWNLOAD + select FOTA_DOWNLOAD_EXTERNAL_DL if NRF_CLOUD_COAP_DOWNLOADS + help + When enabled, nRF Cloud FOTA job polling helpers will be built. These + functions make it easy to request, download, and handle modem, boot, + and application FOTA updates when using the REST or CoAP interfaces + to nRF Cloud. +if NRF_CLOUD_FOTA_POLL + config FOTA_SETTINGS_NAME depends on !FOTA_USE_NRF_CLOUD_SETTINGS_AREA string "Settings identifier for the FOTA support library" @@ -77,6 +85,16 @@ config FOTA_DL_TIMEOUT_MIN the download will be cancelled and the job status will be set as failed. +module = NRF_CLOUD_FOTA_POLL +module-str = nRF Cloud FOTA Poll +source "subsys/logging/Kconfig.template.log_config" +endif # NRF_CLOUD_FOTA_POLL + +config NRF_CLOUD_FOTA_DOWNLOAD_FRAGMENT_SIZE + int "Fragment size for FOTA downloads" + depends on FOTA_DOWNLOAD + range 128 1900 + default 1700 if NRF_CLOUD_REST config REST_FOTA_DL_TIMEOUT_MIN @@ -86,7 +104,7 @@ config REST_FOTA_DL_TIMEOUT_MIN endif # NRF_CLOUD_REST menuconfig NRF_CLOUD_FOTA_FULL_MODEM_UPDATE - bool "Enable full modem FOTA updates" + bool "Full modem FOTA updates" select NRF_MODEM_LIB select ZCBOR select DFU_TARGET @@ -156,22 +174,8 @@ config NRF_CLOUD_FOTA_TYPE_SMP_SUPPORTED help This symbol is y when SMP FOTA is supported by the configuration. -config NRF_CLOUD_FOTA_POLL - bool "Enable FOTA job polling helpers" - depends on FOTA_DOWNLOAD - select FOTA_DOWNLOAD_EXTERNAL_DL if NRF_CLOUD_COAP_DOWNLOADS - help - When enabled, nRF Cloud FOTA job polling helpers will be built. These - functions make it easy to request, download, and handle modem, boot, - and application FOTA updates when using the REST or CoAP interfaces - to nRF Cloud. - -if NRF_CLOUD_FOTA_POLL -module = NRF_CLOUD_FOTA_POLL -module-str = nRF Cloud FOTA Poll -source "subsys/logging/Kconfig.template.log_config" -endif # NRF_CLOUD_FOTA_POLL - module = NRF_CLOUD_FOTA module-str = nRF Cloud FOTA source "subsys/logging/Kconfig.template.log_config" + +endmenu diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location index 7f8f36319506..44bc75c8a5fb 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location @@ -3,6 +3,10 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +menu "Location" + +menu "Cellular/Wi-Fi" + config NRF_CLOUD_LOCATION bool "Enable nRF Cloud Location (cellular and/or Wi-Fi) over MQTT" imply FPU @@ -28,3 +32,40 @@ config NRF_CLOUD_LOCATION_PARSE_ANCHORS bool "Parse anchor data in location result" help If enabled, the anchor buffer in the result structure must be properly initialized. + +choice NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT + prompt "Encoding options for Wi-Fi location requests" + default NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_MAC_RSSI + +config NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_MAC_ONLY + bool "Encode only the MAC address" + help + The MAC address is the only required parameter. + +config NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_MAC_RSSI + bool "Encode the MAC address and the RSSI value" + help + The RSSI value may improve location accuracy. + +config NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_ALL + bool "Encode all available parameters" + help + This option increases the memory required for creating requests. + It also increases the amount of data sent to nRF Cloud. +endchoice + +endmenu + +rsource "Kconfig.nrf_cloud_agnss" + +rsource "Kconfig.nrf_cloud_pgps" + +if NRF_CLOUD_AGNSS || NRF_CLOUD_PGPS + +module = NRF_CLOUD_GPS +module-str = nRF Cloud GPS Assistance +source "subsys/logging/Kconfig.template.log_config" + +endif + +endmenu diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_log b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_log index 6c7c2f63d6d2..602942c2c420 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_log +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_log @@ -2,18 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # - -config NRF_CLOUD_LOG_DIRECT - bool "nRF Cloud direct logging" - default y - depends on NRF_CLOUD_MQTT || NRF_CLOUD_REST || NRF_CLOUD_COAP - select CBPRINTF_LIBC_SUBSTS if !NRF_CLOUD_LOG_BACKEND - help - Enable direct log message transfer to the cloud. If - NRF_CLOUD_LOG_BACKEND is enabled, these messages will be - routed there, where buffering will occur. Otherwise, they will - be sent directly to the cloud, with the assumption that a valid - network connection is available. +menu "Logging" menuconfig NRF_CLOUD_LOG_BACKEND bool "nRF Cloud logging system" @@ -49,6 +38,18 @@ source "subsys/logging/Kconfig.template.log_format_config" endif # NRF_CLOUD_LOG_BACKEND +config NRF_CLOUD_LOG_DIRECT + bool "nRF Cloud direct logging" + default y + depends on NRF_CLOUD_MQTT || NRF_CLOUD_REST || NRF_CLOUD_COAP + select CBPRINTF_LIBC_SUBSTS if !NRF_CLOUD_LOG_BACKEND + help + Enable direct log message transfer to the cloud. If + NRF_CLOUD_LOG_BACKEND is enabled, these messages will be + routed there, where buffering will occur. Otherwise, they will + be sent directly to the cloud, with the assumption that a valid + network connection is available. + config NRF_CLOUD_LOG_OUTPUT_LEVEL int "Only log entries less than or equal to this will be sent" range 0 4 @@ -87,3 +88,5 @@ config NRF_CLOUD_LOG_DICTIONARY_LOGGING_ENABLED module = NRF_CLOUD_LOG module-str = nRF Cloud Log source "subsys/logging/Kconfig.template.log_config" + +endmenu diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps index 7dc094416599..7d3d68762fbb 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps @@ -4,7 +4,7 @@ # menuconfig NRF_CLOUD_PGPS - bool "Enable nRF Cloud Predicted GPS (P-GPS)" + bool "nRF Cloud Predicted GPS (P-GPS)" depends on MODEM_INFO depends on MODEM_INFO_ADD_NETWORK depends on DATE_TIME diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info index d62c96e75b76..a75105e3621a 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info @@ -3,6 +3,14 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +menu "Device Shadow" + +config NRF_CLOUD_DEVICE_STATUS_ENCODE_VOLTAGE + bool "Include the (battery) voltage when encoding device status" + depends on MODEM_INFO + depends on MODEM_INFO_ADD_DEVICE + default y + # Select the info sections that will be automatically added to the device's # shadow when connecting to nRF Cloud with MQTT or CoAP. menu "Send shadow info sections on initial connect (MQTT/CoAP)" @@ -114,3 +122,5 @@ config NRF_CLOUD_SEND_SHADOW_INFO This symbol is y when at least one option to send an info section is enabled. endmenu + +endmenu