Skip to content

Commit

Permalink
samples: cellular: mss: Add BLE gw support
Browse files Browse the repository at this point in the history
Refactor the proposed nRF Cloud BLE gateway sample
as an overlay and ble folder that adds on to the
nRF Cloud Multi Service sample.

Jira: IRIS-9993

Signed-off-by: Pete Skeggs <[email protected]>
  • Loading branch information
plskeggs committed Jan 15, 2025
1 parent 370d0e2 commit 30a3525
Show file tree
Hide file tree
Showing 57 changed files with 10,100 additions and 17 deletions.
21 changes: 18 additions & 3 deletions samples/cellular/nrf_cloud_multi_service/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#
# Copyright (c) 2022 Nordic Semiconductor ASA
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

set(BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR})

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(nrf_cloud_multi_service)
zephyr_compile_definitions(PROJECT_NAME=${PROJECT_NAME})
Expand Down Expand Up @@ -45,6 +47,19 @@ if(CONFIG_NRF_MODEM_LIB)
target_sources(app PRIVATE src/at_commands.c)
endif()

# NORDIC SDK APP END

zephyr_include_directories(src)

if (CONFIG_NRF_CLOUD_GATEWAY)
target_sources(app PRIVATE src/ble/ble.c)
target_sources(app PRIVATE src/ble/ble_codec.c)
target_sources(app PRIVATE src/ble/ble_conn_mgr.c)
target_sources(app PRIVATE src/ble/gateway.c)
target_sources_ifdef(CONFIG_SHELL app PRIVATE src/ble/cli.c)
target_sources_ifdef(CONFIG_GATEWAY_BLE_FOTA app PRIVATE src/ble/dfu/peripheral_dfu.c)
target_sources_ifdef(CONFIG_FLASH_TEST, app PRIVATE src/ble/flash/flash_test.c)
zephyr_include_directories(src src/ble src/ble/flash src/ble/dfu)
#add_subdirectory(src/ble/dfu)
add_subdirectory(src/ble/flash)
endif()

# NORDIC SDK APP END
2 changes: 2 additions & 0 deletions samples/cellular/nrf_cloud_multi_service/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

menu "Multi Service Sample Settings"

rsource "Kconfig.ble_gateway"

config APP_VERSION
string "Multi Service Sample version"
default "1.0.0"
Expand Down
139 changes: 139 additions & 0 deletions samples/cellular/nrf_cloud_multi_service/Kconfig.ble_gateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

menu "nRF Cloud BLE Gateway Sample Settings"

if NRF_CLOUD_GATEWAY

config USE_BT_HCI_SETUP
bool "Use BT HCI setup"
default y
select BT_HCI_SETUP
help
Get the setup to run.

config APPLICATION_WORKQUEUE_PRIORITY
int "Application workqueue priority"
default SYSTEM_WORKQUEUE_PRIORITY

config FLASH_TEST
bool "Enable Flash Test module"
default n
select NRFX_SPIM if FLASH_TEST
select NRFX_SPIM3 if FLASH_TEST
select SPI if FLASH_TEST
select SPI_NOR if FLASH_TEST
help
Enable to test Erase, Write, and Read of external flash.

config CLOUD_BUTTON
bool "Enable button sensor"
default y

config CLOUD_BUTTON_INPUT
int "Set button sensor button number"
range 1 4 if BOARD_NRF9160_PCA10090NS
range 1 1 if BOARD_NRF9160_PCA20035NS
default 1

config ENTER_52840_MCUBOOT_VIA_BUTTON
bool "Button enables 52840 MCUboot"
depends on BOARD_APRICITY_GATEWAY_NRF9160 || BOARD_APRICITY_GATEWAY_NRF9160_NS
help
Holding a button during and after startup will place the
nrf52840 into MCUboot mode so the firmware can be updated.

config SHELL_PROMPT_SECURE
string "Displayed prompt name"
default "uart:~# "
help
Displayed prompt name for UART backend once user has logged in.

config SHELL_DEFAULT_PASSWORD
string "Factory-set initial password"
default "nordic"
help
User needs to type this to enter the shell and execute
commands.

config GATEWAY_BLE_FOTA
bool "Enable BLE FOTA support"
default y
help
Enable ability to receive FOTA jobs for specific BLE devices,
then inject data from one or more file downloads to a BLE
device that supports a compatible DFU protocol.

config GATEWAY_DBG_CMDS
bool "Enable debugging commands"
default y
select CPU_LOAD
select CPU_LOAD_CMDS
select KERNEL_SHELL

config GATEWAY_SHELL
bool "Enable shell for administering nRF Cloud gateway"
default y
select SHELL
select SHELL_CMDS
select SHELL_HISTORY
select SHELL_METAKEYS
select SHELL_VT100_COLORS
select SHELL_BACKEND_SERIAL
select SHELL_CMDS_SELECT

config STARTING_LOG_OVERRIDE
bool "Different logging level at boot"
default n
help
All configured logging will occur if disabled. Otherwise,
logging changed to STARTING_LOG_LEVEL until user logs in and
manually enables with 'log enable inf' (or whatever level is
desired).

choice
prompt "Max compiled-in log level to boot with"
default STARTING_LOG_LEVEL_INF
depends on LOG

config STARTING_LOG_LEVEL_OFF
bool "Off"

config STARTING_LOG_LEVEL_ERR
bool "Error"

config STARTING_LOG_LEVEL_WRN
bool "Warning"

config STARTING_LOG_LEVEL_INF
bool "Info"

config STARTING_LOG_LEVEL_DBG
bool "Debug"

endchoice

config STARTING_LOG_LEVEL
int
depends on LOG
default 0 if STARTING_LOG_LEVEL_OFF
default 1 if STARTING_LOG_LEVEL_ERR
default 2 if STARTING_LOG_LEVEL_WRN
default 3 if STARTING_LOG_LEVEL_INF
default 4 if STARTING_LOG_LEVEL_DBG

if NRF_CLOUD_MQTT
module-str = MQTT BLE Gateway
endif
if NRF_CLOUD_COAP
module-str = CoAP BLE Gateway
endif
module = NRFCLOUD_BLE_GATEWAY
source "subsys/logging/Kconfig.template.log_config"

endif

endmenu
2 changes: 1 addition & 1 deletion samples/cellular/nrf_cloud_multi_service/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This sample implements or demonstrates the following features:
* Support for the `nRF Cloud Provisioning Service`_ using the :ref:`lib_nrf_provisioning` library.
For compatibility with auto-onboarding, the device ID uses the 128 bit UUID format rather than the older nrf-<IMEI> format.
* Support for remote execution of modem AT commands using application-specific device messages.
* Periodic cellular, Wi-Fi®, and GNSS location tracking using the :ref:`lib_location` library.
* Periodic cellular, Wi-Fi, and GNSS location tracking using the :ref:`lib_location` library.
* Periodic temperature sensor sampling on your `Nordic Thingy:91`_, or fake temperature measurements on your `nRF9151 DK <Nordic nRF9151 DK_>`_ , `nRF9161 DK <Nordic nRF9161 DK_>`_, or `nRF9160 DK <Nordic nRF9160 DK_>`_.
* Transmission of sensor and GNSS location samples to the nRF Cloud portal as `nRF Cloud device messages <nRF Cloud Device Messages_>`_.
* Construction of valid `nRF Cloud device messages <nRF Cloud Device Messages_>`_.
Expand Down
Loading

0 comments on commit 30a3525

Please sign in to comment.