Skip to content

Commit

Permalink
net: lib: nrfcloud: kconfig organization/cleanup
Browse files Browse the repository at this point in the history
Improve Kconfig menu display and navigation.

Signed-off-by: Justin Morton <justin.morton@nordicsemi.no>
  • Loading branch information
jayteemo committed Sep 27, 2024
1 parent 5cc1fde commit d4c25b1
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 101 deletions.
98 changes: 35 additions & 63 deletions subsys/net/lib/nrf_cloud/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,80 +5,34 @@

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"
default 16842753

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
Expand Down Expand Up @@ -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
Expand All @@ -151,21 +107,37 @@ 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
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"
3 changes: 3 additions & 0 deletions subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_alert
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
menu "Alerts"

menuconfig NRF_CLOUD_ALERT
bool "nRF Cloud Alert System"
Expand All @@ -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
54 changes: 29 additions & 25 deletions subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_fota
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
#
# 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
select DOWNLOAD_CLIENT
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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
41 changes: 41 additions & 0 deletions subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
27 changes: 15 additions & 12 deletions subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_log
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_pgps
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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

0 comments on commit d4c25b1

Please sign in to comment.