diff --git a/Kconfig.nrf b/Kconfig.nrf index 600517a3cc63..335cad1bd51f 100644 --- a/Kconfig.nrf +++ b/Kconfig.nrf @@ -1,5 +1,5 @@ # -# Copyright (c) 2018 Nordic Semiconductor +# Copyright (c) 2018-2023 Nordic Semiconductor # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # @@ -28,6 +28,12 @@ endif # BUILD_WITH_TFM menu "Nordic nRF Connect" +# Hides child parent configuration options +config HIDE_CHILD_PARENT_CONFIG + bool + default y if "$(HIDE_CHILD_PARENT_CONFIG)" = "True" + default n + # Override boot banner config BOOT_BANNER_STRING default "Booting nRF Connect SDK" diff --git a/applications/asset_tracker_v2/Kconfig b/applications/asset_tracker_v2/Kconfig index 9747b30638e5..8ad3c988dff7 100644 --- a/applications/asset_tracker_v2/Kconfig +++ b/applications/asset_tracker_v2/Kconfig @@ -21,7 +21,9 @@ config ASSET_TRACKER_V2_APP_VERSION_MAX_LEN config ASSET_TRACKER_V2_LTO bool "Enable link time optimization" - default y if SIZE_OPTIMIZATIONS + default y if (SIZE_OPTIMIZATIONS && !NATIVE_LIBRARY) + # not for NATIVE_LIBRARY as otherwise the native simulator build will produce a warning when + # mixing lto and non lto code causing twister runs to fail help Compile the Asset Tracker application code with link time optimization enabled. This option is only applied for the application code and not the libraries and external modules diff --git a/applications/asset_tracker_v2/boards/native_posix.conf b/applications/asset_tracker_v2/boards/native_sim.conf similarity index 97% rename from applications/asset_tracker_v2/boards/native_posix.conf rename to applications/asset_tracker_v2/boards/native_sim.conf index 3cbbdbf47aea..9bd7854b5d2c 100644 --- a/applications/asset_tracker_v2/boards/native_posix.conf +++ b/applications/asset_tracker_v2/boards/native_sim.conf @@ -57,7 +57,7 @@ CONFIG_SENSOR_MODULE=n CONFIG_MODEM_MODULE=n CONFIG_UI_MODULE=n -# Running the application in native_posix emulator requires functionality +# Running the application in native_sim emulator requires functionality # that is present in the debug module CONFIG_DEBUG_MODULE=y diff --git a/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst b/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst index 086c761484e8..297de51ce980 100644 --- a/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst +++ b/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst @@ -104,16 +104,9 @@ The application provides predefined configuration files for typical use cases. Following are the available configuration files: -* :file:`prj.conf` - Configuration file common for ``nrf9161dk_nrf9161_ns``, ``thingy91_nrf9160_ns``, and ``nrf9160dk_nrf9160_ns`` build targets. -* :file:`prj_qemu_x86.conf` - Configuration file common for ``qemu_x86`` build target. -* :file:`prj_native_posix.conf` - Configuration file common for ``native_posix`` build target. -* :file:`boards/nrf9161dk_nrf9161_ns.conf` - Configuration file specific for nRF9161 DK. - This file is automatically merged with the :file:`prj.conf` file when you build for the ``nrf9161dk_nrf9161_ns`` build target. -* :file:`boards/thingy91_nrf9160_ns.conf` - Configuration file specific for Thingy:91. - This file is automatically merged with the :file:`prj.conf` file when you build for the ``thingy91_nrf9160_ns`` build target. -* :file:`boards/nrf9160dk_nrf9160_ns.conf` - Configuration file specific for nRF9160 DK. - This file is automatically merged with the :file:`prj.conf` file when you build for the ``nrf9160dk_nrf9160_ns`` build target. -* :file:`boards//led_state_def.h` - Header file that describes the LED behavior of the CAF LEDs module. +* :file:`prj.conf` - Configuration file for all build targets. +* :file:`boards/.conf` - Configuration overlay file specific for . + This file is automatically merged with the :file:`prj.conf` file when you build for that target. Overlay configurations files that enable specific features: @@ -134,6 +127,8 @@ Custom DTC overlay file for enabling a specific feature: Multiple overlay files can be included to enable multiple features at the same time. +Header file that describes the LED behavior of the CAF LEDs module: file:`include//led_state_def.h`. + .. note:: Generally, Kconfig overlays have an ``overlay-`` prefix and a :file:`.conf` extension. diff --git a/applications/asset_tracker_v2/doc/unit_test.rst b/applications/asset_tracker_v2/doc/unit_test.rst index 4759cca245c7..1af401e9927b 100644 --- a/applications/asset_tracker_v2/doc/unit_test.rst +++ b/applications/asset_tracker_v2/doc/unit_test.rst @@ -30,11 +30,11 @@ Running unit tests using West Enter the following west commands to execute the tests on different board targets: -* :ref:`zephyr:native_posix` board target: +* :ref:`zephyr:native_sim` board target: .. code-block:: console - west build -b native_posix -t run + west build -b native_sim -t run * ``qemu_cortex_m3`` board target: @@ -47,7 +47,7 @@ Running unit tests using Twister Enter the following twister commands to execute the tests on different board targets: -* On both :ref:`zephyr:native_posix` and ``qemu_cortex_m3`` board targets: +* On both :ref:`zephyr:native_sim` and ``qemu_cortex_m3`` board targets: .. code-block:: console diff --git a/applications/asset_tracker_v2/sample.yaml b/applications/asset_tracker_v2/sample.yaml index 2de8b8fd1ecb..06fafd4377e3 100644 --- a/applications/asset_tracker_v2/sample.yaml +++ b/applications/asset_tracker_v2/sample.yaml @@ -4,11 +4,11 @@ tests: applications.asset_tracker_v2.nrf_cloud: build_only: true build_on_all: true - platform_allow: nrf9160dk_nrf9160_ns nrf9161dk_nrf9161_ns thingy91_nrf9160_ns native_posix + platform_allow: nrf9160dk_nrf9160_ns nrf9161dk_nrf9161_ns thingy91_nrf9160_ns native_sim integration_platforms: - nrf9160dk_nrf9160_ns - thingy91_nrf9160_ns - - native_posix + - native_sim tags: ci_build applications.asset_tracker_v2.nrf_cloud.sysbuild: build_only: true @@ -60,11 +60,11 @@ tests: applications.asset_tracker_v2.aws: build_only: true build_on_all: true - platform_allow: nrf9160dk_nrf9160_ns nrf9161dk_nrf9161_ns thingy91_nrf9160_ns native_posix + platform_allow: nrf9160dk_nrf9160_ns nrf9161dk_nrf9161_ns thingy91_nrf9160_ns native_sim integration_platforms: - nrf9160dk_nrf9160_ns - thingy91_nrf9160_ns - - native_posix + - native_sim extra_configs: - CONFIG_AWS_IOT_BROKER_HOST_NAME="example-hostname.aws.com" extra_args: EXTRA_CONF_FILE="overlay-aws.conf" @@ -134,11 +134,11 @@ tests: applications.asset_tracker_v2.azure: build_only: true build_on_all: true - platform_allow: nrf9160dk_nrf9160_ns nrf9161dk_nrf9161_ns thingy91_nrf9160_ns native_posix + platform_allow: nrf9160dk_nrf9160_ns nrf9161dk_nrf9161_ns thingy91_nrf9160_ns native_sim integration_platforms: - nrf9160dk_nrf9160_ns - thingy91_nrf9160_ns - - native_posix + - native_sim extra_configs: - CONFIG_AZURE_IOT_HUB_DPS_HOSTNAME="global.azure-devices-provisioning.net" - CONFIG_AZURE_IOT_HUB_DPS_ID_SCOPE="IDSCOPE" @@ -160,11 +160,11 @@ tests: applications.asset_tracker_v2.debug: build_only: true build_on_all: true - platform_allow: nrf9160dk_nrf9160_ns nrf9161dk_nrf9161_ns thingy91_nrf9160_ns native_posix + platform_allow: nrf9160dk_nrf9160_ns nrf9161dk_nrf9161_ns thingy91_nrf9160_ns native_sim integration_platforms: - nrf9160dk_nrf9160_ns - thingy91_nrf9160_ns - - native_posix + - native_sim extra_args: EXTRA_CONF_FILE=overlay-debug.conf tags: ci_build applications.asset_tracker_v2.debug.sysbuild: diff --git a/applications/asset_tracker_v2/tests/debug_module/boards/native_posix.conf b/applications/asset_tracker_v2/tests/debug_module/boards/native_posix.conf deleted file mode 100644 index cfc8da14917c..000000000000 --- a/applications/asset_tracker_v2/tests/debug_module/boards/native_posix.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_EXTERNAL_LIBC=y diff --git a/applications/asset_tracker_v2/tests/debug_module/testcase.yaml b/applications/asset_tracker_v2/tests/debug_module/testcase.yaml index a293e481be02..ae39a538c666 100644 --- a/applications/asset_tracker_v2/tests/debug_module/testcase.yaml +++ b/applications/asset_tracker_v2/tests/debug_module/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.debug_module_test.tester: - platform_allow: native_posix qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns integration_platforms: - - native_posix + - native_sim - qemu_cortex_m3 - nrf9160dk_nrf9160_ns tags: debug_module diff --git a/applications/asset_tracker_v2/tests/json_common/boards/native_posix.conf b/applications/asset_tracker_v2/tests/json_common/boards/native_posix.conf deleted file mode 100644 index 0e2805d57260..000000000000 --- a/applications/asset_tracker_v2/tests/json_common/boards/native_posix.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_EXTERNAL_LIBC=y diff --git a/applications/asset_tracker_v2/tests/json_common/testcase.yaml b/applications/asset_tracker_v2/tests/json_common/testcase.yaml index 55084e38d7d4..16cb05468e59 100644 --- a/applications/asset_tracker_v2/tests/json_common/testcase.yaml +++ b/applications/asset_tracker_v2/tests/json_common/testcase.yaml @@ -1,18 +1,18 @@ tests: applications.asset_tracker_v2.cloud.cloud_codec.json_common.aws: - platform_allow: nrf9160dk_nrf9160 native_posix qemu_cortex_m3 + platform_allow: nrf9160dk_nrf9160 native_sim qemu_cortex_m3 integration_platforms: - nrf9160dk_nrf9160 - - native_posix + - native_sim - qemu_cortex_m3 tags: json_common_test-aws extra_configs: - CONFIG_CLOUD_CODEC_AWS_IOT=y applications.asset_tracker_v2.cloud.cloud_codec.json_common.azure: - platform_allow: nrf9160dk_nrf9160 native_posix qemu_cortex_m3 + platform_allow: nrf9160dk_nrf9160 native_sim qemu_cortex_m3 integration_platforms: - nrf9160dk_nrf9160 - - native_posix + - native_sim - qemu_cortex_m3 tags: json_common_test-azure extra_configs: diff --git a/applications/asset_tracker_v2/tests/location_module/boards/native_posix.conf b/applications/asset_tracker_v2/tests/location_module/boards/native_posix.conf deleted file mode 100644 index ec5ba7c4c07a..000000000000 --- a/applications/asset_tracker_v2/tests/location_module/boards/native_posix.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_EXTERNAL_LIBC=y diff --git a/applications/asset_tracker_v2/tests/location_module/testcase.yaml b/applications/asset_tracker_v2/tests/location_module/testcase.yaml index a97a2393c23f..1addf5483608 100644 --- a/applications/asset_tracker_v2/tests/location_module/testcase.yaml +++ b/applications/asset_tracker_v2/tests/location_module/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.location_module_test.tester: - platform_allow: native_posix qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns integration_platforms: - - native_posix + - native_sim - qemu_cortex_m3 - nrf9160dk_nrf9160_ns tags: location_module diff --git a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/boards/native_posix.conf b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/boards/native_posix.conf deleted file mode 100644 index cfc8da14917c..000000000000 --- a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/boards/native_posix.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_EXTERNAL_LIBC=y diff --git a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/testcase.yaml b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/testcase.yaml index deefa13aecbc..dc71aa93ecd8 100644 --- a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/testcase.yaml +++ b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.lwm2m_codec: - platform_allow: native_posix qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns integration_platforms: - - native_posix + - native_sim - qemu_cortex_m3 - nrf9160dk_nrf9160_ns tags: lwm2m_codec diff --git a/applications/asset_tracker_v2/tests/lwm2m_integration/boards/native_posix.conf b/applications/asset_tracker_v2/tests/lwm2m_integration/boards/native_posix.conf deleted file mode 100644 index cfc8da14917c..000000000000 --- a/applications/asset_tracker_v2/tests/lwm2m_integration/boards/native_posix.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_EXTERNAL_LIBC=y diff --git a/applications/asset_tracker_v2/tests/lwm2m_integration/testcase.yaml b/applications/asset_tracker_v2/tests/lwm2m_integration/testcase.yaml index 6c1019e9af3d..c39991ae5106 100644 --- a/applications/asset_tracker_v2/tests/lwm2m_integration/testcase.yaml +++ b/applications/asset_tracker_v2/tests/lwm2m_integration/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.lwm2m_integration: - platform_allow: native_posix qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns integration_platforms: - - native_posix + - native_sim - qemu_cortex_m3 - nrf9160dk_nrf9160_ns tags: lwm2m_integration diff --git a/applications/asset_tracker_v2/tests/nrf_cloud_codec/boards/native_posix.conf b/applications/asset_tracker_v2/tests/nrf_cloud_codec/boards/native_posix.conf deleted file mode 100644 index cfc8da14917c..000000000000 --- a/applications/asset_tracker_v2/tests/nrf_cloud_codec/boards/native_posix.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_EXTERNAL_LIBC=y diff --git a/applications/asset_tracker_v2/tests/nrf_cloud_codec/testcase.yaml b/applications/asset_tracker_v2/tests/nrf_cloud_codec/testcase.yaml index b22955d89fec..35aca809dee7 100644 --- a/applications/asset_tracker_v2/tests/nrf_cloud_codec/testcase.yaml +++ b/applications/asset_tracker_v2/tests/nrf_cloud_codec/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.nrf_cloud_codec_test: - platform_allow: native_posix qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns integration_platforms: - - native_posix + - native_sim - qemu_cortex_m3 - nrf9160dk_nrf9160_ns tags: nrf_cloud_codec diff --git a/applications/asset_tracker_v2/tests/nrf_cloud_codec_mocked_cjson/boards/native_posix.conf b/applications/asset_tracker_v2/tests/nrf_cloud_codec_mocked_cjson/boards/native_posix.conf deleted file mode 100644 index cfc8da14917c..000000000000 --- a/applications/asset_tracker_v2/tests/nrf_cloud_codec_mocked_cjson/boards/native_posix.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_EXTERNAL_LIBC=y diff --git a/applications/asset_tracker_v2/tests/nrf_cloud_codec_mocked_cjson/testcase.yaml b/applications/asset_tracker_v2/tests/nrf_cloud_codec_mocked_cjson/testcase.yaml index e3584510f7f7..40cf2545a660 100644 --- a/applications/asset_tracker_v2/tests/nrf_cloud_codec_mocked_cjson/testcase.yaml +++ b/applications/asset_tracker_v2/tests/nrf_cloud_codec_mocked_cjson/testcase.yaml @@ -1,7 +1,7 @@ tests: asset_tracker_v2.nrf_cloud_codec_mocked_cjson_test: - platform_allow: native_posix qemu_cortex_m3 + platform_allow: native_sim qemu_cortex_m3 integration_platforms: - - native_posix + - native_sim - qemu_cortex_m3 tags: nrf_cloud_codec_mocked_cJSON diff --git a/applications/asset_tracker_v2/tests/ui_module/boards/native_posix.conf b/applications/asset_tracker_v2/tests/ui_module/boards/native_posix.conf deleted file mode 100644 index cfc8da14917c..000000000000 --- a/applications/asset_tracker_v2/tests/ui_module/boards/native_posix.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -CONFIG_EXTERNAL_LIBC=y diff --git a/applications/asset_tracker_v2/tests/ui_module/testcase.yaml b/applications/asset_tracker_v2/tests/ui_module/testcase.yaml index 6c5e682d1460..882916082d1a 100644 --- a/applications/asset_tracker_v2/tests/ui_module/testcase.yaml +++ b/applications/asset_tracker_v2/tests/ui_module/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.ui_module_test.tester: - platform_allow: native_posix qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns integration_platforms: - - native_posix + - native_sim - qemu_cortex_m3 - nrf9160dk_nrf9160_ns tags: ui_module diff --git a/applications/connectivity_bridge/app.overlay b/applications/connectivity_bridge/app.overlay index de1aa5d0beba..54b74070fc9d 100644 --- a/applications/connectivity_bridge/app.overlay +++ b/applications/connectivity_bridge/app.overlay @@ -24,6 +24,13 @@ }; / { + ramdisk0 { + compatible = "zephyr,ram-disk"; + disk-name = "RAM"; + sector-size = <512>; + sector-count = <128>; + }; + chosen { zephyr,console = &rtt0; zephyr,shell-uart = &rtt0; diff --git a/applications/connectivity_bridge/prj.conf b/applications/connectivity_bridge/prj.conf index 0c3793953482..806372a63e93 100644 --- a/applications/connectivity_bridge/prj.conf +++ b/applications/connectivity_bridge/prj.conf @@ -29,7 +29,6 @@ CONFIG_USB_CDC_ACM_RINGBUF_SIZE=16384 # Disk and file system CONFIG_DISK_ACCESS=y CONFIG_DISK_DRIVER_RAM=y -CONFIG_DISK_RAM_VOLUME_SIZE=64 CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_FS_FATFS_LFN=y diff --git a/applications/connectivity_bridge/src/events/ble_ctrl_event.h b/applications/connectivity_bridge/src/events/ble_ctrl_event.h index 75e9c0523be9..6f8023f80d7d 100644 --- a/applications/connectivity_bridge/src/events/ble_ctrl_event.h +++ b/applications/connectivity_bridge/src/events/ble_ctrl_event.h @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/applications/connectivity_bridge/src/events/ble_data_event.h b/applications/connectivity_bridge/src/events/ble_data_event.h index 7419936c9cab..0e415c74afb7 100644 --- a/applications/connectivity_bridge/src/events/ble_data_event.h +++ b/applications/connectivity_bridge/src/events/ble_data_event.h @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/applications/connectivity_bridge/src/events/cdc_data_event.h b/applications/connectivity_bridge/src/events/cdc_data_event.h index 9181f2c10e8b..d033d2129cf2 100644 --- a/applications/connectivity_bridge/src/events/cdc_data_event.h +++ b/applications/connectivity_bridge/src/events/cdc_data_event.h @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/applications/connectivity_bridge/src/events/fs_event.h b/applications/connectivity_bridge/src/events/fs_event.h index 2b5765fa0a6c..68de042c1bc7 100644 --- a/applications/connectivity_bridge/src/events/fs_event.h +++ b/applications/connectivity_bridge/src/events/fs_event.h @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/applications/connectivity_bridge/src/events/module_state_event.h b/applications/connectivity_bridge/src/events/module_state_event.h index c64225cb1bf9..fefd3b183683 100644 --- a/applications/connectivity_bridge/src/events/module_state_event.h +++ b/applications/connectivity_bridge/src/events/module_state_event.h @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/applications/connectivity_bridge/src/events/peer_conn_event.h b/applications/connectivity_bridge/src/events/peer_conn_event.h index 24e70750abe8..61c427582b5b 100644 --- a/applications/connectivity_bridge/src/events/peer_conn_event.h +++ b/applications/connectivity_bridge/src/events/peer_conn_event.h @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/applications/connectivity_bridge/src/events/uart_data_event.h b/applications/connectivity_bridge/src/events/uart_data_event.h index c40d56fbb25c..c8240235839a 100644 --- a/applications/connectivity_bridge/src/events/uart_data_event.h +++ b/applications/connectivity_bridge/src/events/uart_data_event.h @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/applications/machine_learning/CMakeLists.txt b/applications/machine_learning/CMakeLists.txt index 5c5df1e48e7d..2f2330a03521 100644 --- a/applications/machine_learning/CMakeLists.txt +++ b/applications/machine_learning/CMakeLists.txt @@ -39,6 +39,6 @@ add_subdirectory(src/events) add_subdirectory(src/modules) add_subdirectory(src/util) -if(CONFIG_BT_RPMSG) - assert_exists(hci_rpmsg_CONF_FILE) +if(CONFIG_BT_HCI_IPC) + assert_exists(hci_ipc_CONF_FILE) endif() diff --git a/applications/machine_learning/README.rst b/applications/machine_learning/README.rst index afce0b91b34e..78c95711c159 100644 --- a/applications/machine_learning/README.rst +++ b/applications/machine_learning/README.rst @@ -312,7 +312,7 @@ The Thingy:53 and nRF53 Development Kit use multi-image build with the following You can define the application-specific configuration for the mentioned child images in the board-specific directory in the :file:`applications/machine_learning/configuration/` directory. The Kconfig configuration file should be located in subdirectory :file:`child_image/child_image_name` and its name should match the application Kconfig file name, that is contain the build type if necessary -For example, the :file:`applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf` file defines configuration of Bluetooth HCI RPMsg for ``debug`` build type on ``thingy53_nrf5340_cpuapp`` board, while the :file:`applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj_release.conf` file defines configuration of Bluetooth HCI RPMsg for ``release`` build type. +For example, the :file:`applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj.conf` file defines configuration of Bluetooth HCI RPMsg for ``debug`` build type on ``thingy53_nrf5340_cpuapp`` board, while the :file:`applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf` file defines configuration of Bluetooth HCI RPMsg for ``release`` build type. See :ref:`ug_multi_image` for detailed information about multi-image builds and child image configuration. .. _nrf_machine_learning_app_requirements_build_types: diff --git a/applications/machine_learning/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf b/applications/machine_learning/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_ipc/prj.conf similarity index 100% rename from applications/machine_learning/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf rename to applications/machine_learning/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_ipc/prj.conf diff --git a/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf b/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj.conf similarity index 100% rename from applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf rename to applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj.conf diff --git a/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj_release.conf b/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf similarity index 100% rename from applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj_release.conf rename to applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf diff --git a/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj_rtt.conf b/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_rtt.conf similarity index 100% rename from applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj_rtt.conf rename to applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_rtt.conf diff --git a/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_rpmsg/prj.conf b/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_ipc/prj.conf similarity index 100% rename from applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_rpmsg/prj.conf rename to applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_ipc/prj.conf diff --git a/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_rpmsg/prj_release.conf b/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_ipc/prj_release.conf similarity index 100% rename from applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_rpmsg/prj_release.conf rename to applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_ipc/prj_release.conf diff --git a/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_rpmsg/prj_rtt.conf b/applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_ipc/prj_rtt.conf similarity index 100% rename from applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_rpmsg/prj_rtt.conf rename to applications/machine_learning/configuration/thingy53_nrf5340_cpuapp_ns/child_image/hci_ipc/prj_rtt.conf diff --git a/applications/matter_bridge/CMakeLists.txt b/applications/matter_bridge/CMakeLists.txt index a0f4c4315da3..3d54988e737e 100644 --- a/applications/matter_bridge/CMakeLists.txt +++ b/applications/matter_bridge/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.20.0) # Set Kconfig root files that will be processed as a first Kconfig for used child images. set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") -set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") +set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") # For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. if(CONF_FILE) diff --git a/applications/matter_bridge/child_image/hci_ipc/prj.conf b/applications/matter_bridge/child_image/hci_ipc/prj.conf new file mode 100644 index 000000000000..4df8ed0ec19d --- /dev/null +++ b/applications/matter_bridge/child_image/hci_ipc/prj.conf @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n + +CONFIG_BT_MAX_CONN=10 +CONFIG_BT_CENTRAL=y diff --git a/applications/matter_bridge/child_image/hci_ipc/prj_release.conf b/applications/matter_bridge/child_image/hci_ipc/prj_release.conf new file mode 100644 index 000000000000..df6cc8273165 --- /dev/null +++ b/applications/matter_bridge/child_image/hci_ipc/prj_release.conf @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=y + +CONFIG_BT_MAX_CONN=10 +CONFIG_BT_CENTRAL=y diff --git a/applications/matter_bridge/child_image/hci_rpmsg/prj.conf b/applications/matter_bridge/child_image/hci_rpmsg/prj.conf deleted file mode 100644 index 851576c89611..000000000000 --- a/applications/matter_bridge/child_image/hci_rpmsg/prj.conf +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n - -CONFIG_BT_MAX_CONN=10 -CONFIG_BT_CENTRAL=y diff --git a/applications/matter_bridge/child_image/hci_rpmsg/prj_release.conf b/applications/matter_bridge/child_image/hci_rpmsg/prj_release.conf deleted file mode 100644 index 2f4223d79340..000000000000 --- a/applications/matter_bridge/child_image/hci_rpmsg/prj_release.conf +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=y - -CONFIG_BT_MAX_CONN=10 -CONFIG_BT_CENTRAL=y diff --git a/applications/matter_bridge/doc/matter_bridge_description.rst b/applications/matter_bridge/doc/matter_bridge_description.rst index af9a269a11a8..1035313ed1f7 100644 --- a/applications/matter_bridge/doc/matter_bridge_description.rst +++ b/applications/matter_bridge/doc/matter_bridge_description.rst @@ -349,7 +349,7 @@ Build the target using the following command in the project directory to enable .. parsed-literal:: :class: highlight - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_BRIDGED_DEVICE_BT=y -DOVERLAY_CONFIG="overlay-bt_max_connections_app.conf" -Dhci_rpmsg_OVERLAY_CONFIG="*absoule_path*/overlay-bt_max_connections_net.conf" + west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_BRIDGED_DEVICE_BT=y -DOVERLAY_CONFIG="overlay-bt_max_connections_app.conf" -Dhci_ipc_OVERLAY_CONFIG="*absoule_path*/overlay-bt_max_connections_net.conf" Replace *absolute_path* with the absolute path to the Matter bridge application on your local disk. diff --git a/applications/matter_bridge/sysbuild/hci_rpmsg/prj.conf b/applications/matter_bridge/sysbuild/hci_ipc/prj.conf similarity index 100% rename from applications/matter_bridge/sysbuild/hci_rpmsg/prj.conf rename to applications/matter_bridge/sysbuild/hci_ipc/prj.conf diff --git a/applications/matter_weather_station/CMakeLists.txt b/applications/matter_weather_station/CMakeLists.txt index c8e9b1549ce3..9c1501a23b6b 100644 --- a/applications/matter_weather_station/CMakeLists.txt +++ b/applications/matter_weather_station/CMakeLists.txt @@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.20.0) set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configuration/\${BOARD}") set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") -set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") +set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") if("${OVERLAY_CONFIG}" STREQUAL "overlay-factory_data.conf") set(PM_STATIC_YML_FILE ${APPLICATION_CONFIG_DIR}/pm_static_factory_data.yml) diff --git a/applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf b/applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj.conf similarity index 100% rename from applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf rename to applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj.conf diff --git a/applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj_release.conf b/applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf similarity index 100% rename from applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/child_image/hci_rpmsg/prj_release.conf rename to applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf diff --git a/applications/nrf5340_audio/README.rst b/applications/nrf5340_audio/README.rst index 54de96fa86a8..1fc48bb75d5b 100644 --- a/applications/nrf5340_audio/README.rst +++ b/applications/nrf5340_audio/README.rst @@ -66,7 +66,7 @@ Only one of the following :file:`.conf` files is included when building: When building using the command line, you must explicitly specify if :file:`prj_release.conf` is going to be included instead of :file:`prj.conf`. See :ref:`nrf53_audio_app_building` for details. -In addition, the application features the :file:`child_image` directory with an experimental :file:`hci_rpmsg.conf`. +In addition, the application features the :file:`child_image` directory with an experimental :file:`hci_ipc.conf`. This file is a work-in-progress implementation of the SoftDevice Controller that has not been thoroughly tested and should not be used. The application is only tested using :ref:`lib_bt_ll_acs_nrf53_readme`. diff --git a/applications/nrf5340_audio/child_image/hci_rpmsg.conf b/applications/nrf5340_audio/child_image/hci_ipc.conf similarity index 100% rename from applications/nrf5340_audio/child_image/hci_rpmsg.conf rename to applications/nrf5340_audio/child_image/hci_ipc.conf diff --git a/applications/nrf5340_audio/doc/firmware_architecture.rst b/applications/nrf5340_audio/doc/firmware_architecture.rst index 49716e915a32..ba010dc2e82e 100644 --- a/applications/nrf5340_audio/doc/firmware_architecture.rst +++ b/applications/nrf5340_audio/doc/firmware_architecture.rst @@ -263,7 +263,7 @@ Synchronization module flow The received audio data in the I2S-based firmware devices follows the following path: 1. The LE Audio Controller Subsystem for nRF53 running on the network core receives the compressed audio data. -#. The controller subsystem sends the audio data to the Zephyr Bluetooth LE host similarly to the :ref:`zephyr:bluetooth-hci-rpmsg-sample` sample. +#. The controller subsystem sends the audio data to the Zephyr Bluetooth LE host similarly to the :ref:`zephyr:bluetooth-hci-ipc-sample` sample. #. The host sends the data to the stream control module. #. The data is sent to a FIFO buffer. #. The data is sent from the FIFO buffer to the :file:`audio_datapath.c` synchronization module. diff --git a/applications/nrf5340_audio/src/audio/Kconfig.defaults b/applications/nrf5340_audio/src/audio/Kconfig.defaults index 460779f556ab..58a6c6a68a08 100644 --- a/applications/nrf5340_audio/src/audio/Kconfig.defaults +++ b/applications/nrf5340_audio/src/audio/Kconfig.defaults @@ -16,10 +16,6 @@ config NRFX_DPPI config CMSIS_DSP default y -# Required for calculating test tones -config CMSIS_DSP_FASTMATH - default y - # HEADSET if AUDIO_DEV = 1 diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c index bd90e2e8d389..59d074565543 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c @@ -129,7 +129,7 @@ static void le_audio_event_publish(enum le_audio_evt_type event) static void print_codec(const struct audio_codec_info *codec) { - if (codec->id == BT_AUDIO_CODEC_LC3_ID) { + if (codec->id == BT_HCI_CODING_FORMAT_LC3) { LOG_INF("Codec config for LC3:"); LOG_INF("\tFrequency: %d Hz", codec->frequency); LOG_INF("\tFrame Duration: %d us", codec->frame_duration_us); @@ -146,15 +146,15 @@ static void print_codec(const struct audio_codec_info *codec) static void get_codec_info(const struct bt_audio_codec_cfg *codec, struct audio_codec_info *codec_info) { - if (codec->id == BT_AUDIO_CODEC_LC3_ID) { + if (codec->id == BT_HCI_CODING_FORMAT_LC3) { /* LC3 uses the generic LTV format - other codecs might do as well */ LOG_DBG("Retrieve the codec configuration for LC3"); codec_info->id = codec->id; codec_info->cid = codec->cid; codec_info->vid = codec->vid; codec_info->frequency = bt_audio_codec_cfg_get_freq(codec); - codec_info->frame_duration_us = bt_audio_codec_cfg_get_frame_duration_us(codec); - bt_audio_codec_cfg_get_chan_allocation_val(codec, &codec_info->chan_allocation); + codec_info->frame_duration_us = bt_audio_codec_cfg_get_frame_dur(codec); + bt_audio_codec_cfg_get_chan_allocation(codec, &codec_info->chan_allocation); codec_info->octets_per_sdu = bt_audio_codec_cfg_get_octets_per_frame(codec); codec_info->bitrate = (codec_info->octets_per_sdu * 8 * 1000000) / codec_info->frame_duration_us; diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig.defaults b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig.defaults index 1310a1640dca..d908b8ae3473 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig.defaults +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig.defaults @@ -97,13 +97,6 @@ config BT_PAC_SNK_NOTIFIABLE # For fixing compatibility issue with Android 14 default y -config BT_PACS_SNK_CONTEXT - default 0x0007 if STREAM_BIDIRECTIONAL - default 0x0005 - -config BT_PACS_SRC_CONTEXT - default 0x0007 if STREAM_BIDIRECTIONAL - config BT_CSIP_SET_MEMBER default y diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.c index da01f616abdc..78b75275e4b9 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.c @@ -558,7 +558,7 @@ static void pac_record_cb(struct bt_conn *conn, enum bt_audio_dir dir, return; } - if (codec->id != BT_AUDIO_CODEC_LC3_ID) { + if (codec->id != BT_HCI_CODING_FORMAT_LC3) { LOG_DBG("Only the LC3 codec is supported"); return; } diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.c index 43df156680be..ce0276d4f3c3 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.c @@ -185,7 +185,7 @@ static struct bt_audio_source { static void print_codec(const struct bt_audio_codec_cfg *codec, enum bt_audio_dir dir) { - if (codec->id == BT_AUDIO_CODEC_LC3_ID) { + if (codec->id == BT_HCI_CODING_FORMAT_LC3) { /* LC3 uses the generic LTV format - other codecs might do as well */ enum bt_audio_location chan_allocation; @@ -198,14 +198,14 @@ static void print_codec(const struct bt_audio_codec_cfg *codec, enum bt_audio_di } LOG_INF("\tFrequency: %d Hz", bt_audio_codec_cfg_get_freq(codec)); - LOG_INF("\tFrame Duration: %d us", bt_audio_codec_cfg_get_frame_duration_us(codec)); - if (bt_audio_codec_cfg_get_chan_allocation_val(codec, &chan_allocation) == 0) { + LOG_INF("\tFrame Duration: %d us", bt_audio_codec_cfg_get_frame_dur(codec)); + if (bt_audio_codec_cfg_get_chan_allocation(codec, &chan_allocation) == 0) { LOG_INF("\tChannel allocation: 0x%x", chan_allocation); } uint32_t octets_per_sdu = bt_audio_codec_cfg_get_octets_per_frame(codec); uint32_t bitrate = octets_per_sdu * 8 * - (1000000 / bt_audio_codec_cfg_get_frame_duration_us(codec)); + (1000000 / bt_audio_codec_cfg_get_frame_dur(codec)); LOG_INF("\tOctets per frame: %d (%d bps)", octets_per_sdu, bitrate); LOG_INF("\tFrames per SDU: %d", @@ -467,7 +467,7 @@ int unicast_server_config_get(uint32_t *bitrate, uint32_t *sampling_rate_hz, if (bitrate != NULL) { /* Get the configuration for the sink stream */ - int frames_per_sec = 1000000 / bt_audio_codec_cfg_get_frame_duration_us( + int frames_per_sec = 1000000 / bt_audio_codec_cfg_get_frame_dur( audio_streams[0].codec_cfg); int bits_per_frame = bt_audio_codec_cfg_get_octets_per_frame(audio_streams[0].codec_cfg) * 8; diff --git a/applications/nrf5340_audio/tools/buildprog/buildprog.py b/applications/nrf5340_audio/tools/buildprog/buildprog.py index 1b5bf0163930..07bb1056988f 100644 --- a/applications/nrf5340_audio/tools/buildprog/buildprog.py +++ b/applications/nrf5340_audio/tools/buildprog/buildprog.py @@ -202,7 +202,7 @@ def __populate_hex_paths(dev, options, child_image): if options.controller != Controller.acs_nrf53: dev.hex_path_app = dest_folder / "zephyr/zephyr.hex" - dev.hex_path_net = dest_folder / "hci_rpmsg/zephyr/zephyr.hex" + dev.hex_path_net = dest_folder / "hci_ipc/zephyr/zephyr.hex" return if dev.core_app_programmed == SelectFlags.TBD: diff --git a/applications/nrf_desktop/CMakeLists.txt b/applications/nrf_desktop/CMakeLists.txt index 8fca1ee76972..61ef21d82dbf 100644 --- a/applications/nrf_desktop/CMakeLists.txt +++ b/applications/nrf_desktop/CMakeLists.txt @@ -50,8 +50,8 @@ if(NOT SYSBUILD AND NOT CONFIG_NCS_IS_VARIANT_IMAGE) if(CONFIG_SECURE_BOOT) assert_exists(b0_CONF_FILE) endif() - if(CONFIG_BT_RPMSG) - assert_exists(hci_rpmsg_CONF_FILE) + if(CONFIG_BT_HCI_IPC) + assert_exists(hci_ipc_CONF_FILE) endif() endif() diff --git a/applications/nrf_desktop/README.rst b/applications/nrf_desktop/README.rst index 75a384465053..b566b4d58217 100644 --- a/applications/nrf_desktop/README.rst +++ b/applications/nrf_desktop/README.rst @@ -873,12 +873,12 @@ For example, you can build the application for ``nrf52840dk_nrf52840`` with ``nr For the multi-core build, you need to pass the ``SHIELD`` parameter to images built on both application and network core. The network core controls the FEM, but the application core needs to forward the needed pins to the network core. -Use ``hci_rpmsg_`` as the *childImageName* parameter, because in the nRF Desktop application, network core runs using ``hci_rpmsg_``. +Use ``hci_ipc_`` as the *childImageName* parameter, because in the nRF Desktop application, network core runs using ``hci_ipc_``. The command for ``nrf5340dk_nrf5340_cpuapp`` with ``nrf21540ek`` shield would look as follows: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf21540ek_fwd -Dhci_rpmsg_SHIELD=nrf21540ek -DCONFIG_CAF_BLE_USE_LLPM=n + west build -b nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf21540ek_fwd -Dhci_ipc_SHIELD=nrf21540ek -DCONFIG_CAF_BLE_USE_LLPM=n For detailed information about building an application using the nRF21540 EK, see the :ref:`ug_radio_fem_nrf21540ek_programming` section in the Working with RF Front-end modules documentation. diff --git a/applications/nrf_desktop/configuration/common/hid_keymap.h b/applications/nrf_desktop/configuration/common/hid_keymap.h index dfcdd06402e9..210c1051e2a0 100644 --- a/applications/nrf_desktop/configuration/common/hid_keymap.h +++ b/applications/nrf_desktop/configuration/common/hid_keymap.h @@ -8,7 +8,7 @@ #define _HID_KEYMAP_H_ #include -#include +#include #include #include "hid_report_desc.h" diff --git a/applications/nrf_desktop/configuration/common/hid_report_desc.h b/applications/nrf_desktop/configuration/common/hid_report_desc.h index ae5181df32ea..5daa46547172 100644 --- a/applications/nrf_desktop/configuration/common/hid_report_desc.h +++ b/applications/nrf_desktop/configuration/common/hid_report_desc.h @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include "hid_report_mouse.h" diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_mcuboot_qspi.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_mcuboot_qspi.conf index 3d7776f69ef9..4b493b0b189c 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_mcuboot_qspi.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_mcuboot_qspi.conf @@ -30,7 +30,6 @@ CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 CONFIG_BOOT_MAX_IMG_SECTORS=2048 # Logger -CONFIG_USE_SEGGER_RTT=y CONFIG_LOG=y CONFIG_LOG_MAX_LEVEL=2 CONFIG_LOG_PRINTK=y @@ -38,6 +37,14 @@ CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_LOG_BACKEND_SHOW_COLOR=n CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n +# Use only UART for logs +CONFIG_LOG_BACKEND_RTT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_LOG_BACKEND_UART=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y + # Decrease memory usage CONFIG_TIMESLICING=n CONFIG_CBPRINTF_NANO=y diff --git a/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf b/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_ipc/prj.conf similarity index 100% rename from applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_rpmsg/prj.conf rename to applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_ipc/prj.conf diff --git a/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_rpmsg/prj_release.conf b/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf similarity index 100% rename from applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_rpmsg/prj_release.conf rename to applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf diff --git a/applications/nrf_desktop/sample.yaml b/applications/nrf_desktop/sample.yaml index d807911bd2cb..8e95a7c782cf 100644 --- a/applications/nrf_desktop/sample.yaml +++ b/applications/nrf_desktop/sample.yaml @@ -112,7 +112,7 @@ tests: - nrf5340dk_nrf5340_cpuapp tags: bluetooth ci_build extra_args: SHIELD=nrf21540ek_fwd - hci_rpmsg_SHIELD=nrf21540ek + hci_ipc_SHIELD=nrf21540ek extra_configs: - CONFIG_CAF_BLE_USE_LLPM=n applications.nrf_desktop.zrelease: diff --git a/applications/nrf_desktop/src/events/usb_event.h b/applications/nrf_desktop/src/events/usb_event.h index 1d58948b6853..d89ca6722963 100644 --- a/applications/nrf_desktop/src/events/usb_event.h +++ b/applications/nrf_desktop/src/events/usb_event.h @@ -11,7 +11,7 @@ #ifndef _USB_EVENT_H_ #define _USB_EVENT_H_ -#include +#include #include #include diff --git a/applications/nrf_desktop/src/hw_interface/selector_hw.c b/applications/nrf_desktop/src/hw_interface/selector_hw.c index 59468a11270f..4a9c04b1931e 100644 --- a/applications/nrf_desktop/src/hw_interface/selector_hw.c +++ b/applications/nrf_desktop/src/hw_interface/selector_hw.c @@ -147,6 +147,7 @@ static void selector_isr(const struct device *dev, struct gpio_callback *cb, { struct selector *sel; size_t port; + uint8_t *ptr; for (port = 0; port < ARRAY_SIZE(gpio_dev); port++) { if (dev == gpio_dev[port]) { @@ -155,7 +156,8 @@ static void selector_isr(const struct device *dev, struct gpio_callback *cb, } __ASSERT_NO_MSG(port != ARRAY_SIZE(gpio_dev)); - sel = CONTAINER_OF((uint8_t *)cb - port * sizeof(sel->gpio_cb[0]), + ptr = (uint8_t *)cb - port * sizeof(sel->gpio_cb[0]); + sel = CONTAINER_OF((struct gpio_callback (*)[])ptr, struct selector, gpio_cb); disable_interrupts_nolock(sel); @@ -175,7 +177,7 @@ static int read_state_and_enable_interrupts(struct selector *selector) static void selector_work_fn(struct k_work *w) { - struct selector *selector = CONTAINER_OF(w, struct selector, work); + struct selector *selector = CONTAINER_OF(w, struct selector, work.work); int err = read_state_and_enable_interrupts(selector); diff --git a/applications/nrf_desktop/src/modules/hid_forward.c b/applications/nrf_desktop/src/modules/hid_forward.c index 5b795ad745f4..b30625362d4c 100644 --- a/applications/nrf_desktop/src/modules/hid_forward.c +++ b/applications/nrf_desktop/src/modules/hid_forward.c @@ -664,7 +664,7 @@ static void read_rsp_fn(struct k_work *work) { struct hids_peripheral *per = CONTAINER_OF(work, struct hids_peripheral, - read_rsp); + read_rsp.work); struct bt_hogp_rep_info *config_rep = bt_hogp_rep_find(&per->hogp, BT_HIDS_REPORT_TYPE_FEATURE, diff --git a/applications/nrf_desktop/src/modules/watchdog.c b/applications/nrf_desktop/src/modules/watchdog.c index ad676a7425f5..b256f88cf0ea 100644 --- a/applications/nrf_desktop/src/modules/watchdog.c +++ b/applications/nrf_desktop/src/modules/watchdog.c @@ -29,7 +29,7 @@ static struct wdt_data_storage wdt_data = { static void watchdog_feed_worker(struct k_work *work_desc) { struct wdt_data_storage *data = - CONTAINER_OF(work_desc, struct wdt_data_storage, work); + CONTAINER_OF(work_desc, struct wdt_data_storage, work.work); int err = wdt_feed(data->wdt, data->wdt_channel_id); diff --git a/applications/nrf_desktop/src/util/config_channel_transport.c b/applications/nrf_desktop/src/util/config_channel_transport.c index 06cd4674554f..b0c288e0d655 100644 --- a/applications/nrf_desktop/src/util/config_channel_transport.c +++ b/applications/nrf_desktop/src/util/config_channel_transport.c @@ -158,7 +158,7 @@ static void timeout_fn(struct k_work *work) { struct config_channel_transport *transport = CONTAINER_OF(work, struct config_channel_transport, - timeout); + timeout.work); __ASSERT_NO_MSG(transport->state == CONFIG_CHANNEL_TRANSPORT_WAIT_RSP); diff --git a/applications/nrf_desktop/sysbuild/hci_rpmsg/prj.conf b/applications/nrf_desktop/sysbuild/hci_ipc/prj.conf similarity index 100% rename from applications/nrf_desktop/sysbuild/hci_rpmsg/prj.conf rename to applications/nrf_desktop/sysbuild/hci_ipc/prj.conf diff --git a/applications/serial_lte_modem/src/gnss/slm_at_gnss.c b/applications/serial_lte_modem/src/gnss/slm_at_gnss.c index 136db26c418d..f6901e67a0ef 100644 --- a/applications/serial_lte_modem/src/gnss/slm_at_gnss.c +++ b/applications/serial_lte_modem/src/gnss/slm_at_gnss.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -34,11 +35,8 @@ LOG_MODULE_REGISTER(slm_gnss, CONFIG_SLM_LOG_LEVEL); #define LOCATION_REPORT_MS 5000 -#define SEC_PER_MIN (60UL) -#define MIN_PER_HOUR (60UL) #define SEC_PER_HOUR (MIN_PER_HOUR * SEC_PER_MIN) -#define HOURS_PER_DAY (24UL) -#define SEC_PER_DAY (HOURS_PER_DAY * SEC_PER_HOUR) +#define SEC_PER_DAY (HOUR_PER_DAY * SEC_PER_HOUR) /* (6.1.1980 UTC - 1.1.1970 UTC) */ #define GPS_TO_UNIX_UTC_OFFSET_SECONDS (315964800UL) /* UTC/GPS time offset as of 1st of January 2017. */ diff --git a/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c b/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c index 1fedb40e4f36..a7be7f40d2e6 100644 --- a/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c +++ b/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "slm_util.h" #include "slm_at_host.h" #include "slm_native_tls.h" diff --git a/boards/arm/nrf7002dk_nrf5340/Kconfig b/boards/arm/nrf7002dk_nrf5340/Kconfig index 9e08f334e8aa..8130dc0f436f 100644 --- a/boards/arm/nrf7002dk_nrf5340/Kconfig +++ b/boards/arm/nrf7002dk_nrf5340/Kconfig @@ -27,11 +27,11 @@ config BOARD_ENABLE_DCDC_HV default y choice BT_HCI_BUS_TYPE - default BT_RPMSG if BT + default BT_HCI_IPC if BT endchoice config HEAP_MEM_POOL_SIZE - default 4096 if BT_RPMSG + default 4096 if BT_HCI_IPC config BT_HCI_VS default y if BT @@ -59,7 +59,7 @@ config DOMAIN_CPUNET_BOARD help The board which will be used for CPUNET domain when creating a multi image application where one or more images should be located on - another board. For example hci_rpmsg on the nRF5340_cpunet for + another board. For example hci_ipc on the nRF5340_cpunet for Bluetooth applications. endif # BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS diff --git a/boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common.dts b/boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common.dts index 96f0870d89a3..8ed4476a906d 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common.dts +++ b/boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common.dts @@ -13,7 +13,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci-rpmsg-ipc = &ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; }; diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.dts b/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.dts index 5c8947b0c920..af63d6859dd5 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.dts +++ b/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.dts @@ -18,7 +18,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci-rpmsg-ipc = &ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,sram = &sram1; zephyr,flash = &flash1; diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig b/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig index 9d8237ff2cc8..64504951ed6f 100644 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig +++ b/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig @@ -25,11 +25,11 @@ config BOARD_ENABLE_DCDC_HV default y choice BT_HCI_BUS_TYPE - default BT_RPMSG if BT + default BT_HCI_IPC if BT endchoice config HEAP_MEM_POOL_SIZE - default 4096 if BT_RPMSG + default 4096 if BT_HCI_IPC config BT_HCI_VS default y if BT @@ -57,7 +57,7 @@ config DOMAIN_CPUNET_BOARD help The board which will be used for CPUNET domain when creating a multi image application where one or more images should be located on - another board. For example hci_rpmsg on the nRF5340_cpunet for + another board. For example hci_ipc on the nRF5340_cpunet for Bluetooth applications. endif # BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common.dts b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common.dts index 1816030f65f0..461a9995c04f 100644 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common.dts +++ b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common.dts @@ -13,7 +13,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci-rpmsg-ipc = &ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,ieee802154 = &ieee802154; }; diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.dts b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.dts index ac05b0446511..1b688cedf789 100644 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.dts +++ b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.dts @@ -18,7 +18,7 @@ zephyr,uart-mcumgr = &uart0; zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci-rpmsg-ipc = &ipc0; + zephyr,bt-hci-ipc = &ipc0; nordic,802154-spinel-ipc = &ipc0; zephyr,sram = &sram1; zephyr,flash = &flash1; diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 44435f826c16..8b48070eb621 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -206,7 +206,7 @@ add_custom_target( COMMENT "Generating Devicetree bindings documentation..." ) -add_docset(zephyr DODGY) +add_docset(zephyr) add_dependencies(zephyr zephyr-devicetree) add_dependencies(zephyr-all zephyr-devicetree) diff --git a/doc/nrf/conf.py b/doc/nrf/conf.py index 10ccdfd47b7d..f3aaee7d886f 100644 --- a/doc/nrf/conf.py +++ b/doc/nrf/conf.py @@ -48,6 +48,7 @@ "zephyr.external_content", "zephyr.doxyrunner", "zephyr.link-roles", + "zephyr.domain", "sphinx_tabs.tabs", "software_maturity_table", "sphinx_togglebutton", diff --git a/doc/nrf/config_and_build/multi_image.rst b/doc/nrf/config_and_build/multi_image.rst index a58bbe826134..48ae1d4b861e 100644 --- a/doc/nrf/config_and_build/multi_image.rst +++ b/doc/nrf/config_and_build/multi_image.rst @@ -121,8 +121,8 @@ See the following example: .. code-block:: cmake add_child_image( - NAME hci_rpmsg - SOURCE_DIR ${ZEPHYR_BASE}/samples/bluetooth/hci_rpmsg + NAME hci_ipc + SOURCE_DIR ${ZEPHYR_BASE}/samples/bluetooth/hci_ipc DOMAIN CPUNET ) diff --git a/doc/nrf/device_guides/wifi_coex.rst b/doc/nrf/device_guides/wifi_coex.rst index 3e22dfb68fa6..50308e66c38b 100644 --- a/doc/nrf/device_guides/wifi_coex.rst +++ b/doc/nrf/device_guides/wifi_coex.rst @@ -157,7 +157,7 @@ To enable Wi-Fi coexistence on the nRF70 Series device, complete the following s * ``multiprotocol_rpmsg`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. * ``802154_rpmsg`` for applications having support for 802.15.4, but not for Bluetooth. - * ``hci_rpmsg`` for application having support for Bluetooth, but not for 802.15.4. + * ``hci_ipc`` for application having support for Bluetooth, but not for 802.15.4. #. Enable the following Kconfig options: @@ -235,7 +235,7 @@ To enable the generic three-wire coexistence, do the following: * ``multiprotocol_rpmsg`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. * ``802154_rpmsg`` for applications having support for 802.15.4, but not for Bluetooth. - * ``hci_rpmsg`` for application having support for Bluetooth, but not for 802.15.4. + * ``hci_ipc`` for application having support for Bluetooth, but not for 802.15.4. #. Enable the following Kconfig options: diff --git a/doc/nrf/device_guides/working_with_fem.rst b/doc/nrf/device_guides/working_with_fem.rst index 2d73339cbba8..929ddddf2ed9 100644 --- a/doc/nrf/device_guides/working_with_fem.rst +++ b/doc/nrf/device_guides/working_with_fem.rst @@ -304,7 +304,7 @@ To use nRF21540 in GPIO mode, complete the following steps: * ``multiprotocol_rpmsg`` for multiprotocol applications having support for both 802.15.4 and Bluetooth. * ``802154_rpmsg`` for applications having support for 802.15.4, but not for Bluetooth. - * ``hci_rpmsg`` for application having support for Bluetooth, but not for 802.15.4. + * ``hci_ipc`` for application having support for Bluetooth, but not for 802.15.4. .. note:: This step is not needed when testing with :ref:`direct_test_mode` and :ref:`radio_test` on the nRF53 Series devices. @@ -635,7 +635,7 @@ The *childImageName_* parameter can take the following values: * ``multiprotocol_rpmsg_`` for multiprotocol applications with support for 802.15.4 and Bluetooth * ``802154_rpmsg_`` for applications with support for 802.15.4, but without support for Bluetooth -* ``hci_rpmsg_`` for application with support for Bluetooth, but without support for 802.15.4 +* ``hci_ipc_`` for application with support for Bluetooth, but without support for 802.15.4 References ^^^^^^^^^^ diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/developing.rst b/doc/nrf/device_guides/working_with_nrf/nrf52/developing.rst index 0e21198bb0d0..37b0433f053c 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf52/developing.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf52/developing.rst @@ -78,7 +78,7 @@ Here is an example of how you can build for the :ref:`peripheral_lbs` sample: west build -b *build_target* -- -DCONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y When you connect to the device after the build has completed and the firmware has been programmed to it, the SMP Service is enabled with the ``UUID 8D53DC1D-1DB7-4CD3-868B-8A527460AA84``. -If you want to add SMP Service to advertising data, refer to the :ref:`zephyr:smp_svr_sample`. +If you want to add SMP Service to advertising data, refer to the :zephyr:code-sample:`smp-svr`. .. fota_upgrades_over_ble_additional_information_end @@ -180,11 +180,11 @@ To perform a FOTA update, complete the following steps: FOTA update sample ================== -The :ref:`zephyr:smp_svr_sample` demonstrates how to set up your project to support FOTA updates. +The :zephyr:code-sample:`smp-svr` demonstrates how to set up your project to support FOTA updates. The sample documentation is from the Zephyr project and is incompatible with the :ref:`ug_multi_image`. When working in the |NCS| environment, ignore the part of the sample documentation that describes the building and programming steps. -In |NCS|, you can build and program the :ref:`zephyr:smp_svr_sample` as any other sample using the following commands: +In |NCS|, you can build and program the :zephyr:code-sample:`smp-svr` as any other sample using the following commands: .. parsed-literal:: :class: highlight diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340.rst b/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340.rst index 435a5f96a7e8..446be6f34654 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340.rst @@ -161,7 +161,7 @@ Bluetooth Low Energy * - Network core - Application core - * - :ref:`zephyr:bluetooth-hci-rpmsg-sample` + * - :ref:`zephyr:bluetooth-hci-ipc-sample` - | :ref:`Bluetooth Low Energy samples ` | :ref:`Bluetooth samples in Zephyr ` * - :ref:`ble_rpc_host` (supported for development) @@ -177,7 +177,7 @@ Split Controller and Host When splitting the Bluetooth LE Controller and the Host, run the Bluetooth LE Controller on the network core and the host part of the Bluetooth LE stack and the application logic on the application core. -For the network core, the |NCS| provides the :ref:`zephyr:bluetooth-hci-rpmsg-sample` sample. +For the network core, the |NCS| provides the :ref:`zephyr:bluetooth-hci-ipc-sample` sample. This Zephyr sample is designed specifically to enable the Bluetooth LE Controller functionality on a remote MCU using the `RPMsg Messaging Protocol`_ as a transport for Bluetooth HCI. The sample implements the RPMsg transport using the `OpenAMP`_ library to communicate with a Bluetooth Host stack that runs on a separate core (in this case, the nRF5340 application core). @@ -257,7 +257,7 @@ When using Thread or Zigbee in parallel with Bluetooth LE, run the low-level rad Bluetooth LE and IEEE 802.15.4 multiprotocol architecture in multicore SoC For the network core, the |NCS| provides the :ref:`multiprotocol-rpmsg-sample` sample. -It is a combination of the :ref:`zephyr:bluetooth-hci-rpmsg-sample` sample (for Bluetooth LE) and the :ref:`zephyr:nrf-ieee802154-rpmsg-sample` sample (for IEEE 802.15.4). +It is a combination of the :ref:`zephyr:bluetooth-hci-ipc-sample` sample (for Bluetooth LE) and the :ref:`zephyr:nrf-ieee802154-rpmsg-sample` sample (for IEEE 802.15.4). This means that it enables both the Bluetooth LE Controller and the nRF IEEE 802.15.4 radio driver and simultaneously exposes the functionality of both stacks to the application core using the `RPMsg Messaging Protocol`_. Separate RPMsg endpoints are used to obtain independent inter-core connections for each stack. @@ -341,7 +341,7 @@ For other samples, the images are built separately. The :term:`build configuration` depends on the following Kconfig options that must be set in the configuration of the parent image: -* :kconfig:option:`CONFIG_BT_RPMSG` - set to ``y`` in all Bluetooth LE samples for the application core +* :kconfig:option:`CONFIG_BT_HCI_IPC` - set to ``y`` in all Bluetooth LE samples for the application core * :kconfig:option:`CONFIG_NRF_802154_SER_HOST` - set to ``y`` in all Thread, Zigbee, and Matter samples for the application core * :kconfig:option:`CONFIG_NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE` - set to ``y`` in all network core samples that require the :ref:`nrf5340_empty_app_core` sample @@ -353,13 +353,13 @@ The combination of these options determines which (if any) sample is included in * - Enabled options - Child image sample for the network core - Child image sample for the application core - * - :kconfig:option:`CONFIG_BT_RPMSG` - - :ref:`zephyr:bluetooth-hci-rpmsg-sample` + * - :kconfig:option:`CONFIG_BT_HCI_IPC` + - :ref:`zephyr:bluetooth-hci-ipc-sample` - --- * - :kconfig:option:`CONFIG_NRF_802154_SER_HOST` - :ref:`zephyr:nrf-ieee802154-rpmsg-sample` - --- - * - :kconfig:option:`CONFIG_BT_RPMSG` and :kconfig:option:`CONFIG_NRF_802154_SER_HOST` + * - :kconfig:option:`CONFIG_BT_HCI_IPC` and :kconfig:option:`CONFIG_NRF_802154_SER_HOST` - :ref:`multiprotocol-rpmsg-sample` - --- * - :kconfig:option:`CONFIG_NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE` @@ -370,13 +370,13 @@ Configuration of the child image ================================ When a network sample is built automatically as a child image in a multi-image build, you can define the relevant Kconfig options (if required) in a :file:`.conf` file. -Name the file :file:`network_sample*\ .conf`, where *network_sample* is the name of the child image (for example, :file:`hci_rpmsg.conf`). +Name the file :file:`network_sample*\ .conf`, where *network_sample* is the name of the child image (for example, :file:`hci_ipc.conf`). Place the file in a :file:`child_image` subfolder of the application sample directory. See :ref:`ug_multi_image_variables` for more information. This way of defining the Kconfig options allows to align the configurations of both images. -For example, see the :ref:`ble_throughput` child image configuration in :file:`nrf/samples/bluetooth/throughput/child_image/hci_rpmsg.conf`. +For example, see the :ref:`ble_throughput` child image configuration in :file:`nrf/samples/bluetooth/throughput/child_image/hci_ipc.conf`. .. _ug_nrf5340_building: diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/gs.rst b/doc/nrf/device_guides/working_with_nrf/nrf70/gs.rst index 692fe5766f4d..534bd6112546 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf70/gs.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf70/gs.rst @@ -250,8 +250,8 @@ Testing the LEDs and buttons in the nRF7002 DK The following samples allow you to test if the buttons (or switches) and LEDs on the development kit are working properly with |NCS|: -* :ref:`blinky-sample` -* :ref:`button-sample` +* :zephyr:code-sample:`blinky` +* :zephyr:code-sample:`button` Build and flash the samples to make sure |NCS| is running correctly on your development kit. For the button and LED definitions, see the :file:`boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common.dts` file. diff --git a/doc/nrf/includes/hci_rpmsg_overlay.txt b/doc/nrf/includes/hci_ipc_overlay.txt similarity index 100% rename from doc/nrf/includes/hci_rpmsg_overlay.txt rename to doc/nrf/includes/hci_ipc_overlay.txt diff --git a/doc/nrf/includes/sample_board_rows.txt b/doc/nrf/includes/sample_board_rows.txt index 1eee8e3da461..e8b267c30e35 100644 --- a/doc/nrf/includes/sample_board_rows.txt +++ b/doc/nrf/includes/sample_board_rows.txt @@ -169,6 +169,11 @@ .. nrf7002dk_nrf7001_nrf5340_cpunet | :ref:`nRF7002 DK (emulating nRF7001) ` | PCA10143 | :ref:`nrf7002dk_nrf7001_nrf5340 ` | ``nrf7002dk_nrf7001_nrf5340_cpunet`` | + .. native_posix | Native Posix | | native_posix | ``native_posix`` | + +.. native_sim + +| Native Simulator | | native_sim | ``native_sim`` | diff --git a/doc/nrf/libraries/bluetooth_services/services/dfu_smp.rst b/doc/nrf/libraries/bluetooth_services/services/dfu_smp.rst index 39eb747cc670..80ad7d66dccb 100644 --- a/doc/nrf/libraries/bluetooth_services/services/dfu_smp.rst +++ b/doc/nrf/libraries/bluetooth_services/services/dfu_smp.rst @@ -11,7 +11,7 @@ This module implements a Simple Management Protocol (SMP) Service Client that ca SMP is a basic transfer encoding for use with the `mcumgr`_ management protocol. See `SMP over Bluetooth`_ for the service specification. -The SMP Client module can be used to interact with Zephyr's :ref:`zephyr:smp_svr_sample`. +The SMP Client module can be used to interact with Zephyr's :zephyr:code-sample:`smp-svr`. The SMP Client implements only the service. It does not provide any functionality to process or interpret SMP commands and responses. @@ -49,12 +49,12 @@ Usage MTU negotiation =============== -The current DFU SMP Server implementation in the :ref:`zephyr:smp_svr_sample` requires the whole command to be sent in one transfer. +The current DFU SMP Server implementation in the :zephyr:code-sample:`smp-svr` requires the whole command to be sent in one transfer. For most operations, this requires a bigger MTU size than the default one. This requires MTU negotiation in the MTU exchange process (see :c:func:`bt_gatt_exchange_mtu`). Writing long characteristic values is not supported. -This is a limitation of the :ref:`zephyr:smp_svr_sample`, not of the SMP Client. +This is a limitation of the :zephyr:code-sample:`smp-svr`, not of the SMP Client. Sending a command ================= diff --git a/doc/nrf/libraries/networking/coap_utils.rst b/doc/nrf/libraries/networking/coap_utils.rst index 86d85e7b7158..15afbb8cc78e 100644 --- a/doc/nrf/libraries/networking/coap_utils.rst +++ b/doc/nrf/libraries/networking/coap_utils.rst @@ -26,7 +26,7 @@ Currently, the library only supports the User Datagram Protocol (UDP) protocol. Configuration ************* -To enable the CoAP utils library, set the :kconfig:option:`CONFIG_COAP_UTILS` Kconfig option. +To enable the CoAP utils library, set the :kconfig:option:`CONFIG_COAP` and :kconfig:option:`CONFIG_COAP_UTILS` Kconfig options. API documentation ***************** diff --git a/doc/nrf/protocols/matter/getting_started/hw_requirements.rst b/doc/nrf/protocols/matter/getting_started/hw_requirements.rst index 3ddf0e32f988..f517c7c17165 100644 --- a/doc/nrf/protocols/matter/getting_started/hw_requirements.rst +++ b/doc/nrf/protocols/matter/getting_started/hw_requirements.rst @@ -488,7 +488,7 @@ For more information about configuration of memory layouts in Matter, see :ref:` | | | +---------------------+------------------+-------------------+ | | | | provision | 33.375kB (0x8580)| 640B (0x280) | +---------------------------------------------------------+---------------------+-------------------+---------------------+------------------+-------------------+ - | Network application (app) | 34kB (0x8800) | 222kB (0x37800) | hci_rpmsg | 34kB (0x8800) | 222kB (0x37800) | + | Network application (app) | 34kB (0x8800) | 222kB (0x37800) | hci_ipc | 34kB (0x8800) | 222kB (0x37800) | +---------------------------------------------------------+---------------------+-------------------+---------------------+------------------+-------------------+ Network core SRAM flash (size: 0x10000 = 64kB) diff --git a/doc/nrf/protocols/matter/getting_started/kconfig.rst b/doc/nrf/protocols/matter/getting_started/kconfig.rst index 52ad4574d5b2..bf4507dfcc0c 100644 --- a/doc/nrf/protocols/matter/getting_started/kconfig.rst +++ b/doc/nrf/protocols/matter/getting_started/kconfig.rst @@ -18,7 +18,7 @@ The Kconfig options for Matter applications in the |NCS| are stored in the follo * :file:`prj.conf` files, which are specific to the application. * :file:`Kconfig.defaults` file, which is available in the :file:`module/lib/matter/config/nrfconnect/chip-module` directory and is used to populate :file:`prj.conf` with Kconfig option settings common to all samples. -The Matter samples use the same structure for other software images, such as MCUboot, Multiprotocol RPMsg or HCI RPMsg, which have default options defined in the corresponding :file:`Kconfig.mcuboot.defaults`, :file:`Kconfig.multiprotocol_rpmsg.defaults` and :file:`Kconfig.hci_rpmsg.defaults` files. +The Matter samples use the same structure for other software images, such as MCUboot, Multiprotocol RPMsg or HCI RPMsg, which have default options defined in the corresponding :file:`Kconfig.mcuboot.defaults`, :file:`Kconfig.multiprotocol_rpmsg.defaults` and :file:`Kconfig.hci_ipc.defaults` files. For an example configuration, see the :ref:`Matter Template sample's ` :file:`prj.conf` files in the sample root directory. diff --git a/doc/nrf/protocols/matter/getting_started/transmission_power.rst b/doc/nrf/protocols/matter/getting_started/transmission_power.rst index d2d00cc57098..4f13b10a271c 100644 --- a/doc/nrf/protocols/matter/getting_started/transmission_power.rst +++ b/doc/nrf/protocols/matter/getting_started/transmission_power.rst @@ -146,7 +146,7 @@ You can do this by either editing the :file:`prj.conf` file or building the samp For example: * If you want to build for Thread devices for the ``nrf5340dk_nrf5340_cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, add ``-Dmultiprotocol_rpmsg_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y`` as the CMake argument. - * If you want to build for Wi-Fi® devices for the ``nrf7002dk_nrf5340_cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, add ``-Dhci_rpmsg_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y`` as the CMake argument. + * If you want to build for Wi-Fi® devices for the ``nrf7002dk_nrf5340_cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, add ``-Dhci_ipc_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y`` as the CMake argument. See `nRF Connect for VS Code extension pack `_ documentation for more information. @@ -167,7 +167,7 @@ You can do this by either editing the :file:`prj.conf` file or building the samp .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -Dhci_rpmsg_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y + west build -b nrf7002dk_nrf5340_cpuapp -- -Dhci_ipc_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y .. diff --git a/doc/nrf/releases_and_maturity/known_issues.rst b/doc/nrf/releases_and_maturity/known_issues.rst index 19d6cdff2f6f..4a925fc4dd1c 100644 --- a/doc/nrf/releases_and_maturity/known_issues.rst +++ b/doc/nrf/releases_and_maturity/known_issues.rst @@ -213,7 +213,7 @@ Only secure applications can use Bluetooth® LE .. rst-class:: v1-2-1 v1-2-0 v1-1-0 :kconfig:option:`CONFIG_BT_SMP` alignment requirement - When running the :ref:`bluetooth_central_dfu_smp` sample, the :kconfig:option:`CONFIG_BT_SMP` configuration must be aligned between this sample and the Zephyr counterpart (:ref:`zephyr:smp_svr_sample`). + When running the :ref:`bluetooth_central_dfu_smp` sample, the :kconfig:option:`CONFIG_BT_SMP` configuration must be aligned between this sample and the Zephyr counterpart (:zephyr:code-sample:`smp-svr`). However, security is not enabled by default in the Zephyr sample. @@ -1796,8 +1796,8 @@ NCSDK-21709: :ref:`peripheral_uart` sample does not work on nRF52810 and nRF5281 .. rst-class:: v2-3-0 v2-2-0 -NCSDK-18112: :ref:`bluetooth_central_dfu_smp` sample cannot do discovery on the :ref:`smp_svr_sample` - The :ref:`bluetooth_central_dfu_smp` sample cannot perform the GATT discovery on a DK with the :ref:`smp_svr_sample`. +NCSDK-18112: :ref:`bluetooth_central_dfu_smp` sample cannot do discovery on the :zephyr:code-sample:`smp-svr` + The :ref:`bluetooth_central_dfu_smp` sample cannot perform the GATT discovery on a DK with the :zephyr:code-sample:`smp-svr`. **Workaround:** Enable the legacy LLCP mechanism (:kconfig:option:`CONFIG_BT_LL_SW_LLCP_LEGACY`). @@ -4109,22 +4109,22 @@ The time returned by clock_gettime() API becomes incorrect after one week of upt .. rst-class:: v1-4-2 v1-4-1 v1-4-0 NCSDK-6330: USB Mass Storage Sample Application fails MSC Tests from USB3CV test tool - :ref:`zephyr:usb_mass` fails the USB3CV compliance Command Set Test from the MSC Tests suite. + :zephyr:code-sample:`usb-mass` fails the USB3CV compliance Command Set Test from the MSC Tests suite. .. rst-class:: v1-4-2 v1-4-1 v1-4-0 NCSDK-6328: USB CDC ACM Composite Sample Application fails Chapter 9 Tests from USB3CV test tool - :ref:`zephyr:usb_cdc-acm_composite` fails the USB3CV compliance TD 9.1: Device Descriptor Test from the Chapter 9 Test suite. + :zephyr:code-sample:`usb-cdc-acm-composite` fails the USB3CV compliance TD 9.1: Device Descriptor Test from the Chapter 9 Test suite. .. rst-class:: v1-4-2 v1-4-1 v1-4-0 NCSDK-6331: WebUSB sample application fails Chapter 9 Tests from USB3CV test tool - :ref:`zephyr:webusb-sample` fails the USB3CV compliance TD 9.21: LPM L1 Suspend Resume Test from the Chapter 9 Test suite. + :zephyr:code-sample:`webusb` fails the USB3CV compliance TD 9.21: LPM L1 Suspend Resume Test from the Chapter 9 Test suite. .. rst-class:: v1-3-2 v1-3-1 v1-3-0 FOTA does not work - FOTA with the :ref:`zephyr:smp_svr_sample` does not work. + FOTA with the :zephyr:code-sample:`smp-svr` does not work. **Affected platforms:** nRF5340 @@ -4137,18 +4137,18 @@ NCSIDB-108: Thread context switch might lead to a kernel fault .. rst-class:: v1-0-0 Counter Alarm sample does not work - The :ref:`zephyr:alarm_sample` does not work. + The :zephyr:code-sample:`alarm` does not work. A fix can be found in `Pull Request #16736 `_. .. rst-class:: v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 USB Mass Storage Sample Application compilation issues - :ref:`zephyr:usb_mass` does not compile. + :zephyr:code-sample:`usb-mass` does not compile. .. rst-class:: v1-7-1 v1-7-0 v1-4-2 v1-4-1 v1-4-0 NCSDK-6832: SMP Server sample fails upon initialization - The :ref:`zephyr:smp_svr_sample` will fail upon initialization when using the :file:`bt-overlay.conf` Kconfig overlay file. + The :zephyr:code-sample:`smp-svr` will fail upon initialization when using the :file:`bt-overlay.conf` Kconfig overlay file. This happens because of a stack overflow. **Workaround:** Set :kconfig:option:`CONFIG_MAIN_STACK_SIZE` to ``2048``. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.0.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.0.0.rst index 63b4b990a929..d3ae859ec431 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.0.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.0.0.rst @@ -312,8 +312,8 @@ DFU Zephyr ====== -* The :ref:`zephyr:alarm_sample` does not work. A fix can be found in `Pull Request #16736 `_. -* :ref:`zephyr:usb_mass` does not compile. +* The :zephyr:code-sample:`alarm` does not work. A fix can be found in `Pull Request #16736 `_. +* :zephyr:code-sample:`usb-mass` does not compile. nrfxlib ======= diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.1.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.1.0.rst index 87605fdf8753..a72b0887b754 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.1.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.1.0.rst @@ -522,7 +522,7 @@ Bluetooth Low Energy If a directed high duty cycle advertiser times out, the application might have to wait a short time before starting a new connectable advertiser. Otherwise, starting the advertiser will fail. * Bluetooth Low Energy peripheral samples are unstable in some conditions (when pairing and bonding are performed and then disconnections/re-connections happen). -* When running the :ref:`bluetooth_central_dfu_smp` sample, the :kconfig:option:`CONFIG_BT_SMP` configuration must be aligned between this sample and the Zephyr counterpart (:ref:`zephyr:smp_svr_sample`). +* When running the :ref:`bluetooth_central_dfu_smp` sample, the :kconfig:option:`CONFIG_BT_SMP` configuration must be aligned between this sample and the Zephyr counterpart (:zephyr:code-sample:`smp-svr`). However, security is not enabled by default in the Zephyr sample. * The central samples (:ref:`central_uart`, :ref:`bluetooth_central_hids`) do not support any pairing methods with MITM protection. * On some operating systems, the nrf_desktop application is unable to reconnect to a host. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.2.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.2.0.rst index 745bcd89489d..3c888e51427c 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.2.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.2.0.rst @@ -555,7 +555,7 @@ Bluetooth Low Energy NFC requires this API to work correctly. * When the :ref:`peripheral_hids_mouse` sample is used with the Zephyr Bluetooth LE Controller, directed advertising does not time out and the regular advertising cannot be started. * The :ref:`bluetooth_central_hids` sample cannot connect to a peripheral that uses directed advertising. -* When running the :ref:`bluetooth_central_dfu_smp` sample, the :kconfig:option:`CONFIG_BT_SMP` configuration must be aligned between this sample and the Zephyr counterpart (:ref:`zephyr:smp_svr_sample`). +* When running the :ref:`bluetooth_central_dfu_smp` sample, the :kconfig:option:`CONFIG_BT_SMP` configuration must be aligned between this sample and the Zephyr counterpart (:zephyr:code-sample:`smp-svr`). However, security is not enabled by default in the Zephyr sample. * The central samples (:ref:`central_uart`, :ref:`bluetooth_central_hids`) do not support any pairing methods with MITM protection. * On some operating systems, the nrf_desktop application is unable to reconnect to a host. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.3.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.3.0.rst index 11f5b17ca244..76592298c2dd 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.3.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.3.0.rst @@ -168,7 +168,7 @@ nRF5340 SoC ----------- * Added :ref:`nrf5340_empty_app_core` for samples running purely on the nRF5340 network core. -* When building a Bluetooth sample for nRF5340, the :ref:`zephyr:bluetooth-hci-rpmsg-sample` sample is now automatically built as child image. +* When building a Bluetooth sample for nRF5340, the :ref:`zephyr:bluetooth-hci-ipc-sample` sample is now automatically built as child image. Multiprotocol Service Layer (MPSL) ----------------------------------- @@ -476,7 +476,7 @@ nRF5 nRF5340 ------- -* FOTA with the :ref:`zephyr:smp_svr_sample` does not work. +* FOTA with the :zephyr:code-sample:`smp-svr` does not work. nRF52820 -------- @@ -588,7 +588,7 @@ Bluetooth Low Energy NFC requires this API to work correctly. (fixed) * When the :ref:`peripheral_hids_mouse` sample is used with the Zephyr Bluetooth LE Controller, directed advertising does not time out and the regular advertising cannot be started. (fixed) * The :ref:`bluetooth_central_hids` sample cannot connect to a peripheral that uses directed advertising. (fixed) -* When running the :ref:`bluetooth_central_dfu_smp` sample, the :kconfig:option:`CONFIG_BT_SMP` configuration must be aligned between this sample and the Zephyr counterpart (:ref:`zephyr:smp_svr_sample`). +* When running the :ref:`bluetooth_central_dfu_smp` sample, the :kconfig:option:`CONFIG_BT_SMP` configuration must be aligned between this sample and the Zephyr counterpart (:zephyr:code-sample:`smp-svr`). However, security is not enabled by default in the Zephyr sample. (fixed) * On some operating systems, the nrf_desktop application is unable to reconnect to a host. (fixed) diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.4.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.4.0.rst index 7f637b0bd7ec..f415d7c7d625 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.4.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.4.0.rst @@ -196,7 +196,7 @@ nRF5340 SoC * :ref:`nrf_rpc_entropy_nrf53` sample - This sample demonstrates how to use the entropy driver in a dual core device such as nRF5340 PDK. * :ref:`nrfxlib:nrf_rpc` - This standalone library enables inter-processor communication on Nordic Semiconductor devices. -* Zephyr's :ref:`zephyr:smp_svr_sample` now works on nRF5340 PDK. +* Zephyr's :zephyr:code-sample:`smp-svr` now works on nRF5340 PDK. Bluetooth Low Energy -------------------- @@ -482,7 +482,7 @@ Build system * Added the ``ncs_add_partition_manager_config`` function that allows out-of-tree users to specify partition manager configuration files. * Added a warning if no static partition manager configuration is provided when one image (or more) is not built from source in a multi-image build. -* Enabled choosing a build strategy for Zephyr's :ref:`zephyr:bluetooth-hci-rpmsg-sample` sample when it is built as a child image. +* Enabled choosing a build strategy for Zephyr's :ref:`zephyr:bluetooth-hci-ipc-sample` sample when it is built as a child image. See :ref:`ug_multi_image` for details. * Improved multi-core builds by disassociating domain names from board names. * Bugfixes: diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst index d729df0a174d..5584d29c2f36 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst @@ -153,7 +153,7 @@ nRF5340 SoC * :ref:`esb_readme` subsystem - Added support for nRF5340 (CPUNET) in the ESB subsystem. * Secure Partition Manager (SPM) subsystem - Added support for nRF5340 peripherals in non-secure applications. - * :ref:`ble_samples` - Added configuration overlays for child image to the required Bluetooth LE samples so that no Kconfig updates in the :ref:`zephyr:bluetooth-hci-rpmsg-sample` sample are needed by default. + * :ref:`ble_samples` - Added configuration overlays for child image to the required Bluetooth LE samples so that no Kconfig updates in the :ref:`zephyr:bluetooth-hci-ipc-sample` sample are needed by default. * :ref:`nrf5340_empty_app_core` sample - Disabled the kernel memory pool option :kconfig:option:`CONFIG_KERNEL_MEM_POOL` to reduce the memory footprint. * ``bl_boot`` library - Disabled clock interrupts before booting the application. This change fixes an issue where the :ref:`bootloader` sample would not be able to boot a Zephyr application on the nRF5340 SoC. @@ -734,7 +734,7 @@ The following list summarizes the most important changes inherited from upstream * Added multiple minor TCP2 bugfixes and improvements. * Added support for RX packet queueing in TCP2. * Added network management events for DHCPv4. - * Added periodic throughput printout to the :ref:`zephyr:sockets-echo-server-sample` sample. + * Added periodic throughput printout to the :zephyr:code-sample:`sockets-echo-server` sample. * Added an experimental option to set preemptive priority for networking threads (:kconfig:option:`CONFIG_NET_TC_THREAD_PREEMPTIVE`). * Added a Kconfig option that enables a hostname update on link address change (:kconfig:option:`CONFIG_NET_HOSTNAME_UNIQUE_UPDATE`). * Added multiple fixes to the DHCP implementation. @@ -867,12 +867,12 @@ The following list summarizes the most important changes inherited from upstream * Samples: * Added :ref:`zephyr:nrf-ieee802154-rpmsg-sample`. - * Added :ref:`zephyr:cloud-tagoio-http-post-sample`. + * Added :zephyr:code-sample:`tagoio-http-post`. * Added Civetweb WebSocket Server sample. - * :ref:`zephyr:led_ws2812_sample`: Updated to force SPIM on nRF52 DK. - * :ref:`zephyr:cfb_custom_fonts`: Added support for ssd1306fb. - * :ref:`zephyr:gsm-modem-sample`: Added suspend/resume shell commands. - * :ref:`zephyr:updatehub_fota_sample`: Added support for Bluetooth LE IPSP, 802.15.4, modem, and Wi-Fi. + * :zephyr:code-sample:`led-ws2812`: Updated to force SPIM on nRF52 DK. + * :zephyr:code-sample:`cfb-custom-fonts`: Added support for ssd1306fb. + * :zephyr:code-sample:`gsm-modem`: Added suspend/resume shell commands. + * :zephyr:code-sample:`updatehub-fota`: Added support for Bluetooth LE IPSP, 802.15.4, modem, and Wi-Fi. * Logging: diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.0.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.0.0.rst index ffa82f00ca76..b713630fa4e5 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.0.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.0.0.rst @@ -540,7 +540,7 @@ Other samples * Improved the calculation of the total payload size for the radio duty cycle. * Fast ramp-up is enabled for all radio modes. * The duty cycle for modulated transmission is limited to 1-90%. - * Improved the DFU throughput in the :ref:`smp_svr_sample` for the Bluetooth transport by optimizing Bluetooth MTU configuration and by leveraging the MCUmgr packet reassembly feature. + * Improved the DFU throughput in the :zephyr:code-sample:`smp-svr` for the Bluetooth transport by optimizing Bluetooth MTU configuration and by leveraging the MCUmgr packet reassembly feature. Drivers ======= diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 5038c24e1bf4..d9aeacc8c55a 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -228,14 +228,16 @@ nRF Desktop * The :ref:`nrf_desktop_bootloader` and :ref:`nrf_desktop_bootloader_background_dfu` sections in the nRF Desktop documentation to explicitly mention the supported DFU configurations. * The documentation describing the :ref:`nrf_desktop_memory_layout` configuration to simplify the process of getting started with the application. * Changed the term *flash memory* to *non-volatile memory* for generalization purposes. - * The :ref:`nrf_desktop_usb_state` to use the :c:func:`usb_hid_set_proto_code` function to set the HID Boot Interface protocol code. - The ``CONFIG_USB_HID_PROTOCOL_CODE`` Kconfig option is deprecated and a dedicated API needs to be used instead. * The :ref:`nrf_desktop_watchdog` to use ``watchdog0`` DTS alias instead of ``wdt`` DTS node label. Using the alias makes the configuration of the module more flexible. * Introduced information about priority, pipeline depth and maximum number of HID reports to :c:struct:`hid_report_subscriber_event`. * The :ref:`nrf_desktop_hid_state` uses :c:struct:`hid_report_subscriber_event` to handle HID data subscribers connection and disconnection. The :c:struct:`ble_peer_event` and ``usb_hid_event`` are no longer used for this purpose. * The ``usb_hid_event`` is removed. + * The :ref:`nrf_desktop_usb_state` to use the :c:func:`usb_hid_set_proto_code` function to set the HID Boot Interface protocol code. + The ``CONFIG_USB_HID_BOOT_PROTOCOL`` Kconfig option was removed and dedicated API needs to be used instead. + * Disabled MCUboot's logs over RTT (:kconfig:option:`CONFIG_LOG_BACKEND_RTT` and :kconfig:option:`CONFIG_USE_SEGGER_RTT`) on ``nrf52840dk_nrf52840`` in :file:`prj_mcuboot_qspi.conf` configuration to reduce MCUboot memory footprint and avoid flash overflows. + Explicitly enabled the UART log backend (:kconfig:option:`CONFIG_LOG_BACKEND_UART`) together with its dependencies in the configuration file to ensure log visibility. Thingy:53: Matter weather station --------------------------------- @@ -751,21 +753,21 @@ Zephyr .. NOTE TO MAINTAINERS: All the Zephyr commits in the below git commands must be handled specially after each upmerge and each nRF Connect SDK release. -The Zephyr fork in |NCS| (``sdk-zephyr``) contains all commits from the upstream Zephyr repository up to and including ``a768a05e6205e415564226543cee67559d15b736``, with some |NCS| specific additions. +The Zephyr fork in |NCS| (``sdk-zephyr``) contains all commits from the upstream Zephyr repository up to and including ``23cf38934c0f68861e403b22bc3dd0ce6efbfa39``, with some |NCS| specific additions. For the list of upstream Zephyr commits (not including cherry-picked commits) incorporated into nRF Connect SDK since the most recent release, run the following command from the :file:`ncs/zephyr` repository (after running ``west update``): .. code-block:: none - git log --oneline a768a05e62 ^4bbd91a908 + git log --oneline 23cf38934c ^a768a05e62 For the list of |NCS| specific commits, including commits cherry-picked from upstream, run: .. code-block:: none - git log --oneline manifest-rev ^a768a05e62 + git log --oneline manifest-rev ^23cf38934c -The current |NCS| main branch is based on revision ``a768a05e62`` of Zephyr. +The current |NCS| main branch is based on revision ``23cf38934c`` of Zephyr. .. note:: For possible breaking changes and changes between the latest Zephyr release and the current Zephyr version, refer to the :ref:`Zephyr release notes `. diff --git a/doc/nrf/samples/wifi_zephyr.rst b/doc/nrf/samples/wifi_zephyr.rst index 16d91a883127..8781cd97c468 100644 --- a/doc/nrf/samples/wifi_zephyr.rst +++ b/doc/nrf/samples/wifi_zephyr.rst @@ -10,22 +10,22 @@ Wi-Fi: Zephyr networking samples In addition to |NCS| samples, it is possible to run selected networking samples with Wi-Fi®, provided and maintained as part of the upstream Zephyr project. The following list specifies samples that are currently supported with the Wi-Fi driver: -* :ref:`dhcpv4-client-sample` -* :ref:`dns-resolve-sample` -* :ref:`ipv4-autoconf-sample` -* :ref:`mdns-responder-sample` -* :ref:`mqtt-publisher-sample` -* :ref:`mqtt-sn-publisher-sample` -* :ref:`coap-client-sample` -* :ref:`coap-server-sample` -* :ref:`sockets-echo-sample` -* :ref:`async-sockets-echo-sample` -* :ref:`sockets-echo-client-sample` -* :ref:`sockets-echo-server-sample` -* :ref:`sockets-http-get` -* :ref:`sntp-client-sample` -* :ref:`syslog-net-sample` -* :ref:`telnet-console-sample` +* :zephyr:code-sample:`dhcpv4-client` +* :zephyr:code-sample:`dns-resolve` +* :zephyr:code-sample:`ipv4-autoconf` +* :zephyr:code-sample:`mdns-responder` +* :zephyr:code-sample:`mqtt-publisher` +* :zephyr:code-sample:`mqtt-sn-publisher` +* :zephyr:code-sample:`coap-client` +* :zephyr:code-sample:`coap-server` +* :zephyr:code-sample:`sockets-echo` +* :zephyr:code-sample:`async-sockets-echo` +* :zephyr:code-sample:`sockets-echo-client` +* :zephyr:code-sample:`sockets-echo-server` +* :zephyr:code-sample:`sockets-http-get` +* :zephyr:code-sample:`sntp-client` +* :zephyr:code-sample:`syslog-net` +* :zephyr:code-sample:`telnet-console` Configuration ************* diff --git a/doc/nrf/test_and_optimize/optimizing/memory.rst b/doc/nrf/test_and_optimize/optimizing/memory.rst index 0f920b34724a..2841ade2f4d2 100644 --- a/doc/nrf/test_and_optimize/optimizing/memory.rst +++ b/doc/nrf/test_and_optimize/optimizing/memory.rst @@ -19,7 +19,7 @@ Complete the following actions to optimize your application: * Use the `Memory report`_ feature in the |nRFVSC| to check the size and percentage of memory that each symbol uses on your device for RAM, ROM, and partitions (when applicable). * Follow the guides for :ref:`optimizing Zephyr `. - Also see the implementation of the :ref:`zephyr:minimal_sample` sample. + Also see the implementation of the :zephyr:code-sample:`minimal` sample. * Analyze stack usage in each thread of your application by using the :ref:`zephyr:thread_analyzer`. Reduce the stack sizes where possible. * Limit or disable debugging features, such as logging or asserts. diff --git a/doc/nrf/test_and_optimize/optimizing/power_general.rst b/doc/nrf/test_and_optimize/optimizing/power_general.rst index 20daba6af525..52d63bebeb8e 100644 --- a/doc/nrf/test_and_optimize/optimizing/power_general.rst +++ b/doc/nrf/test_and_optimize/optimizing/power_general.rst @@ -42,7 +42,7 @@ Disable serial logging Current measurements on devices that have the |NCS| samples or applications programmed with the default configuration, might show elevated current values, when compared to the expected current values from Nordic ultra-low power SoCs. It is because most of the samples and applications in the |NCS| are configured to perform logging over serial port (associated with UART(E) peripheral) by default. -As an example, the image below shows the power measurement output on Power Profiler Kit II for an nRF9160 DK with the :ref:`zephyr:blinky-sample` sample compiled for the ``nrf9160dk_nrf9160_ns`` build target without modifications in the sample configuration. +As an example, the image below shows the power measurement output on Power Profiler Kit II for an nRF9160 DK with the :zephyr:code-sample:`blinky` sample compiled for the ``nrf9160dk_nrf9160_ns`` build target without modifications in the sample configuration. .. figure:: images/app_power_opt_blinky_serial_on.png :width: 100 % diff --git a/doc/requirements.txt b/doc/requirements.txt index f1ed2162d4a2..e488415c87c2 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -11,13 +11,14 @@ breathe # | X | | | | | X m2r2 # | | | | | X | | | | PyYAML # | X | | | | | | | X | pykwalify # | | | | | | | | X | +pytest # | | | | | | | | X | recommonmark # | | | X | X | | | | | sphinx~=6.2 # | X | X | X | X | X | X | X | X | sphinx-copybutton # | X | | | | | | | X | sphinx-ncs-theme<1.1 # | X | | | | | | | | sphinx-notfound-page # | X | | | | | | | X | sphinx-tabs>=3.4 # | X | | | | | | | X | -sphinx-togglebutton # | X | | | | | | | | +sphinx-togglebutton # | X | | | | | | | X | sphinx_markdown_tables # | | | X | | | | | | sphinxcontrib-mscgen # | X | | | | | X | | | sphinxcontrib-plantuml # | | | | | | | X | | diff --git a/drivers/net/eth_rtt.c b/drivers/net/eth_rtt.c index 3aebb371f57f..fb308b9fa243 100644 --- a/drivers/net/eth_rtt.c +++ b/drivers/net/eth_rtt.c @@ -48,7 +48,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include -#include +#include #include /** RTT channel name used to identify Ethernet transfer channel. */ diff --git a/drivers/sensor/paw3212/paw3212.c b/drivers/sensor/paw3212/paw3212.c index 55adb58d4215..f9c8121502e1 100644 --- a/drivers/sensor/paw3212/paw3212.c +++ b/drivers/sensor/paw3212/paw3212.c @@ -548,7 +548,7 @@ static void trigger_handler(struct k_work *work) sensor_trigger_handler_t handler; int err = 0; struct paw3212_data *data = CONTAINER_OF(work, struct paw3212_data, - trigger_handler_work); + trigger_handler_work); const struct device *dev = data->dev; const struct paw3212_config *config = dev->config; @@ -643,7 +643,7 @@ static int paw3212_async_init_configure(const struct device *dev) static void paw3212_async_init(struct k_work *work) { struct paw3212_data *data = CONTAINER_OF(work, struct paw3212_data, - init_work); + init_work.work); const struct device *dev = data->dev; LOG_DBG("PAW3212 async init step %d", data->async_init_step); diff --git a/drivers/sensor/pmw3360/pmw3360.c b/drivers/sensor/pmw3360/pmw3360.c index 4df5bf3883a0..88cfb0ffecdf 100644 --- a/drivers/sensor/pmw3360/pmw3360.c +++ b/drivers/sensor/pmw3360/pmw3360.c @@ -767,7 +767,7 @@ static int pmw3360_async_init_configure(const struct device *dev) static void pmw3360_async_init(struct k_work *work) { struct pmw3360_data *data = CONTAINER_OF(work, struct pmw3360_data, - init_work); + init_work.work); const struct device *dev = data->dev; LOG_DBG("PMW3360 async init step %d", data->async_init_step); diff --git a/drivers/serial/uart_ipc.c b/drivers/serial/uart_ipc.c index da198e6e5cfc..7c28da0ec5bc 100644 --- a/drivers/serial/uart_ipc.c +++ b/drivers/serial/uart_ipc.c @@ -49,7 +49,7 @@ static void ipc_send_work_handler(struct k_work *work) uint8_t *data; struct uart_ipc_data *dev_data; - dev_data = CONTAINER_OF(work, struct uart_ipc_data, ipc_send_work); + dev_data = CONTAINER_OF(work, struct uart_ipc_data, ipc_send_work.work); data_size = ring_buf_get_claim(dev_data->tx_ringbuf, &data, ring_buf_size_get(dev_data->tx_ringbuf)); diff --git a/drivers/wifi/nrf700x/rpu_fw_patches.ld b/drivers/wifi/nrf700x/rpu_fw_patches.ld index 83fc06a28432..e2a6fdd50c69 100644 --- a/drivers/wifi/nrf700x/rpu_fw_patches.ld +++ b/drivers/wifi/nrf700x/rpu_fw_patches.ld @@ -48,4 +48,4 @@ MEMORY #endif /* CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP || CONFIG_BOARD_NRF52840DK_NRF52840 */ -#include +#include diff --git a/drivers/wifi/nrf700x/src/fmac_main.c b/drivers/wifi/nrf700x/src/fmac_main.c index 332b6a842e2c..91adc580fa9d 100644 --- a/drivers/wifi/nrf700x/src/fmac_main.c +++ b/drivers/wifi/nrf700x/src/fmac_main.c @@ -188,7 +188,7 @@ void nrf_wifi_scan_timeout_work(struct k_work *work) struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; - vif_ctx_zep = CONTAINER_OF(work, struct nrf_wifi_vif_ctx_zep, scan_timeout_work); + vif_ctx_zep = CONTAINER_OF(work, struct nrf_wifi_vif_ctx_zep, scan_timeout_work.work); if (!vif_ctx_zep->scan_in_progress) { LOG_INF("%s: Scan not in progress", __func__); diff --git a/drivers/wifi/nrf700x/src/timer.c b/drivers/wifi/nrf700x/src/timer.c index cfcb124ef518..9f1070463342 100644 --- a/drivers/wifi/nrf700x/src/timer.c +++ b/drivers/wifi/nrf700x/src/timer.c @@ -22,7 +22,7 @@ static void timer_expiry_function(struct k_work *work) { struct timer_list *timer; - timer = (struct timer_list *)CONTAINER_OF(work, struct timer_list, work); + timer = (struct timer_list *)CONTAINER_OF(work, struct timer_list, work.work); timer->function(timer->data); } diff --git a/dts/bindings/serial/nordic,nrf-ipc-uart.yaml b/dts/bindings/serial/nordic,nrf-ipc-uart.yaml index 377e8c3e1be6..edd6a715b15c 100644 --- a/dts/bindings/serial/nordic,nrf-ipc-uart.yaml +++ b/dts/bindings/serial/nordic,nrf-ipc-uart.yaml @@ -4,7 +4,7 @@ description: | This is binding for the UART over IPC. -include: uart-controller.yaml +include: [uart-controller.yaml, pinctrl-device.yaml] compatible: "nordic,nrf-ipc-uart" diff --git a/include/bluetooth/conn_ctx.h b/include/bluetooth/conn_ctx.h index f99a2029c83f..15ffb4fbf688 100644 --- a/include/bluetooth/conn_ctx.h +++ b/include/bluetooth/conn_ctx.h @@ -71,7 +71,7 @@ struct bt_conn_ctx_lib { */ static inline size_t bt_conn_ctx_block_size_get(struct bt_conn_ctx_lib *ctx_lib) { - return ctx_lib->mem_slab->block_size; + return ctx_lib->mem_slab->info.block_size; } /** diff --git a/include/bluetooth/mesh/gen_battery_cli.h b/include/bluetooth/mesh/gen_battery_cli.h index 12f1bbe88daf..d9ea2cd7c2ba 100644 --- a/include/bluetooth/mesh/gen_battery_cli.h +++ b/include/bluetooth/mesh/gen_battery_cli.h @@ -74,7 +74,7 @@ struct bt_mesh_battery_cli { uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_BATTERY_OP_GET, BT_MESH_BATTERY_MSG_LEN_GET)]; /** Composition data model entry pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; }; /** @brief Get the status of the bound srv. diff --git a/include/bluetooth/mesh/gen_battery_srv.h b/include/bluetooth/mesh/gen_battery_srv.h index 6e988dfd194d..199b1a87f901 100644 --- a/include/bluetooth/mesh/gen_battery_srv.h +++ b/include/bluetooth/mesh/gen_battery_srv.h @@ -53,7 +53,7 @@ struct bt_mesh_battery_srv; */ struct bt_mesh_battery_srv { /** Pointer to the model entry in the composition data. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publication parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_dtt_cli.h b/include/bluetooth/mesh/gen_dtt_cli.h index 74ea35ea30ae..aceeece856c0 100644 --- a/include/bluetooth/mesh/gen_dtt_cli.h +++ b/include/bluetooth/mesh/gen_dtt_cli.h @@ -76,7 +76,7 @@ struct bt_mesh_dtt_cli { uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_DTT_OP_SET, BT_MESH_DTT_MSG_LEN_SET)]; /** Composition data model entry pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; }; /** @brief Get the Default Transition Time of the server. diff --git a/include/bluetooth/mesh/gen_dtt_srv.h b/include/bluetooth/mesh/gen_dtt_srv.h index 863bc3dedf32..b4c0bd7a7981 100644 --- a/include/bluetooth/mesh/gen_dtt_srv.h +++ b/include/bluetooth/mesh/gen_dtt_srv.h @@ -72,7 +72,7 @@ struct bt_mesh_dtt_srv { uint32_t old_transition_time, uint32_t new_transition_time); /** Composition data Model entry pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Model publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ @@ -128,7 +128,7 @@ struct bt_mesh_dtt_srv *bt_mesh_dtt_srv_get(const struct bt_mesh_elem *elem); * @return Whether the transition was set. */ static inline bool -bt_mesh_dtt_srv_transition_get(struct bt_mesh_model *model, +bt_mesh_dtt_srv_transition_get(const struct bt_mesh_model *model, struct bt_mesh_model_transition *transition) { struct bt_mesh_dtt_srv *srv; diff --git a/include/bluetooth/mesh/gen_loc_cli.h b/include/bluetooth/mesh/gen_loc_cli.h index 3c48b9455d63..ca4b7ba3e54b 100644 --- a/include/bluetooth/mesh/gen_loc_cli.h +++ b/include/bluetooth/mesh/gen_loc_cli.h @@ -91,7 +91,7 @@ struct bt_mesh_loc_cli { uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LOC_OP_GLOBAL_SET, BT_MESH_LOC_MSG_LEN_GLOBAL_SET)]; /** Composition data model entry pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; }; /** @brief Get the global location of the bound srv. diff --git a/include/bluetooth/mesh/gen_loc_srv.h b/include/bluetooth/mesh/gen_loc_srv.h index 0c1df15a2d52..6d39711c08e3 100644 --- a/include/bluetooth/mesh/gen_loc_srv.h +++ b/include/bluetooth/mesh/gen_loc_srv.h @@ -119,7 +119,7 @@ struct bt_mesh_loc_srv_handlers { */ struct bt_mesh_loc_srv { /** Pointer to the model instance. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters for this model instance. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_lvl_cli.h b/include/bluetooth/mesh/gen_lvl_cli.h index ed14d859d7b5..f00dc8586742 100644 --- a/include/bluetooth/mesh/gen_lvl_cli.h +++ b/include/bluetooth/mesh/gen_lvl_cli.h @@ -53,7 +53,7 @@ struct bt_mesh_lvl_cli; */ struct bt_mesh_lvl_cli { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_lvl_srv.h b/include/bluetooth/mesh/gen_lvl_srv.h index 27f3c17414aa..a64f285e1074 100644 --- a/include/bluetooth/mesh/gen_lvl_srv.h +++ b/include/bluetooth/mesh/gen_lvl_srv.h @@ -144,7 +144,7 @@ struct bt_mesh_lvl_srv { /** Application handler functions. */ const struct bt_mesh_lvl_srv_handlers *const handlers; /** Pointer to the mesh model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Model publication parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_onoff_cli.h b/include/bluetooth/mesh/gen_onoff_cli.h index 338ff8f9938b..c8dc95897937 100644 --- a/include/bluetooth/mesh/gen_onoff_cli.h +++ b/include/bluetooth/mesh/gen_onoff_cli.h @@ -74,7 +74,7 @@ struct bt_mesh_onoff_cli { uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_ONOFF_OP_SET, BT_MESH_ONOFF_MSG_MAXLEN_SET)]; /** Access model pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; }; /** @brief Get the status of the bound srv. diff --git a/include/bluetooth/mesh/gen_onoff_srv.h b/include/bluetooth/mesh/gen_onoff_srv.h index b00511cf7b74..3ea202d3f3ed 100644 --- a/include/bluetooth/mesh/gen_onoff_srv.h +++ b/include/bluetooth/mesh/gen_onoff_srv.h @@ -95,7 +95,7 @@ struct bt_mesh_onoff_srv { /** Handler function structure. */ const struct bt_mesh_onoff_srv_handlers *handlers; /** Access model pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_plvl_cli.h b/include/bluetooth/mesh/gen_plvl_cli.h index 446b9af8b710..b8dbb33dd6b3 100644 --- a/include/bluetooth/mesh/gen_plvl_cli.h +++ b/include/bluetooth/mesh/gen_plvl_cli.h @@ -96,7 +96,7 @@ struct bt_mesh_plvl_cli_handlers { */ struct bt_mesh_plvl_cli { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_plvl_srv.h b/include/bluetooth/mesh/gen_plvl_srv.h index 3af9dd777ac2..969886220009 100644 --- a/include/bluetooth/mesh/gen_plvl_srv.h +++ b/include/bluetooth/mesh/gen_plvl_srv.h @@ -147,9 +147,9 @@ struct bt_mesh_plvl_srv { /** Generic Power OnOff server instance. */ struct bt_mesh_ponoff_srv ponoff; /** Pointer to the model entry in the composition data. */ - struct bt_mesh_model *plvl_model; + const struct bt_mesh_model *plvl_model; /** Pointer to the model entry of the Setup Server. */ - struct bt_mesh_model *plvl_setup_model; + const struct bt_mesh_model *plvl_setup_model; /** Model publication parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_ponoff_cli.h b/include/bluetooth/mesh/gen_ponoff_cli.h index f1515202da4b..33bcea72e738 100644 --- a/include/bluetooth/mesh/gen_ponoff_cli.h +++ b/include/bluetooth/mesh/gen_ponoff_cli.h @@ -53,7 +53,7 @@ struct bt_mesh_ponoff_cli; */ struct bt_mesh_ponoff_cli { /** Model entry pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_ponoff_srv.h b/include/bluetooth/mesh/gen_ponoff_srv.h index 7c4093a8fc8a..a12f4564e44a 100644 --- a/include/bluetooth/mesh/gen_ponoff_srv.h +++ b/include/bluetooth/mesh/gen_ponoff_srv.h @@ -77,9 +77,9 @@ struct bt_mesh_ponoff_srv { /** Generic Default Transition Time server instance. */ struct bt_mesh_dtt_srv dtt; /** Pointer to the model entry in the composition data. */ - struct bt_mesh_model *ponoff_model; + const struct bt_mesh_model *ponoff_model; /** Pointer to the model entry of the Setup Server. */ - struct bt_mesh_model *ponoff_setup_model; + const struct bt_mesh_model *ponoff_setup_model; /** Model publication parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_prop_cli.h b/include/bluetooth/mesh/gen_prop_cli.h index 620d0f1d1692..9423eb515547 100644 --- a/include/bluetooth/mesh/gen_prop_cli.h +++ b/include/bluetooth/mesh/gen_prop_cli.h @@ -62,7 +62,7 @@ struct bt_mesh_prop_list { */ struct bt_mesh_prop_cli { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/gen_prop_srv.h b/include/bluetooth/mesh/gen_prop_srv.h index 4cb15c8512fa..da83b06ac25f 100644 --- a/include/bluetooth/mesh/gen_prop_srv.h +++ b/include/bluetooth/mesh/gen_prop_srv.h @@ -151,7 +151,7 @@ enum bt_mesh_prop_srv_state { */ struct bt_mesh_prop_srv { /** Pointer to the mesh model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Model publication parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/light_ctl_cli.h b/include/bluetooth/mesh/light_ctl_cli.h index 8fa9e697bbf2..750e04fb6f8a 100644 --- a/include/bluetooth/mesh/light_ctl_cli.h +++ b/include/bluetooth/mesh/light_ctl_cli.h @@ -96,7 +96,7 @@ struct bt_mesh_light_ctl_cli_handlers { */ struct bt_mesh_light_ctl_cli { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/light_ctl_srv.h b/include/bluetooth/mesh/light_ctl_srv.h index d035d7897ff6..4f46c17f13f5 100644 --- a/include/bluetooth/mesh/light_ctl_srv.h +++ b/include/bluetooth/mesh/light_ctl_srv.h @@ -68,7 +68,7 @@ struct bt_mesh_light_ctl_srv { /** Lightness Server instance. */ struct bt_mesh_lightness_srv lightness_srv; /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/light_ctrl_cli.h b/include/bluetooth/mesh/light_ctrl_cli.h index 3d10a2223d40..45ffeb998476 100644 --- a/include/bluetooth/mesh/light_ctrl_cli.h +++ b/include/bluetooth/mesh/light_ctrl_cli.h @@ -131,7 +131,7 @@ struct bt_mesh_light_ctrl_cli_handlers { */ struct bt_mesh_light_ctrl_cli { /** Composition data model entry pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publication parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/light_ctrl_srv.h b/include/bluetooth/mesh/light_ctrl_srv.h index 5c7732c8f68d..11201e1e68db 100644 --- a/include/bluetooth/mesh/light_ctrl_srv.h +++ b/include/bluetooth/mesh/light_ctrl_srv.h @@ -201,9 +201,9 @@ struct bt_mesh_light_ctrl_srv { /** Transaction ID tracking context */ struct bt_mesh_tid_ctx tid; /** Composition data server model instance */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Composition data setup server model instance */ - struct bt_mesh_model *setup_srv; + const struct bt_mesh_model *setup_srv; }; /** @brief Turn the light on. diff --git a/include/bluetooth/mesh/light_hsl_cli.h b/include/bluetooth/mesh/light_hsl_cli.h index e84f14a64c6b..b4e12639a12d 100644 --- a/include/bluetooth/mesh/light_hsl_cli.h +++ b/include/bluetooth/mesh/light_hsl_cli.h @@ -111,7 +111,7 @@ struct bt_mesh_light_hsl_cli { const struct bt_mesh_light_hsl_cli_handlers *handlers; /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /** Publication buffer */ diff --git a/include/bluetooth/mesh/light_hsl_srv.h b/include/bluetooth/mesh/light_hsl_srv.h index 6e4b09e42a2d..c151f883a1f7 100644 --- a/include/bluetooth/mesh/light_hsl_srv.h +++ b/include/bluetooth/mesh/light_hsl_srv.h @@ -71,7 +71,7 @@ struct bt_mesh_light_hsl_srv { struct bt_mesh_lightness_srv *lightness; /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /** Publish message buffer */ diff --git a/include/bluetooth/mesh/light_hue_srv.h b/include/bluetooth/mesh/light_hue_srv.h index dff3dab23ea8..cfb58e197d00 100644 --- a/include/bluetooth/mesh/light_hue_srv.h +++ b/include/bluetooth/mesh/light_hue_srv.h @@ -161,7 +161,7 @@ struct bt_mesh_light_hue_srv { const struct bt_mesh_light_hue_srv_handlers *handlers; /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Pointer to the corresponding HSL server, if it has one. * Is set automatically by the HSL server. */ diff --git a/include/bluetooth/mesh/light_sat_srv.h b/include/bluetooth/mesh/light_sat_srv.h index f42e261d4cb8..7f9b4e3ed1dc 100644 --- a/include/bluetooth/mesh/light_sat_srv.h +++ b/include/bluetooth/mesh/light_sat_srv.h @@ -131,7 +131,7 @@ struct bt_mesh_light_sat_srv { const struct bt_mesh_light_sat_srv_handlers *handlers; /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Pointer to the corresponding HSL server, if it has one. * Is set automatically by the HSL server. */ diff --git a/include/bluetooth/mesh/light_temp_srv.h b/include/bluetooth/mesh/light_temp_srv.h index 18689d7dde5c..1a6554dea004 100644 --- a/include/bluetooth/mesh/light_temp_srv.h +++ b/include/bluetooth/mesh/light_temp_srv.h @@ -127,7 +127,7 @@ struct bt_mesh_light_temp_srv { /** Light Level Server instance. */ struct bt_mesh_lvl_srv lvl; /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Pointer to the corresponding CTL server, if it has one. * Is set automatically by the CTL server. */ diff --git a/include/bluetooth/mesh/light_xyl_cli.h b/include/bluetooth/mesh/light_xyl_cli.h index a3f88d2e4d4d..7dfc467a6611 100644 --- a/include/bluetooth/mesh/light_xyl_cli.h +++ b/include/bluetooth/mesh/light_xyl_cli.h @@ -84,7 +84,7 @@ struct bt_mesh_light_xyl_cli_handlers { /** Light xyL Client instance. */ struct bt_mesh_light_xyl_cli { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication message */ diff --git a/include/bluetooth/mesh/light_xyl_srv.h b/include/bluetooth/mesh/light_xyl_srv.h index 59e214bbb9a1..cc5098fa0977 100644 --- a/include/bluetooth/mesh/light_xyl_srv.h +++ b/include/bluetooth/mesh/light_xyl_srv.h @@ -151,7 +151,7 @@ struct bt_mesh_light_xyl_srv_handlers { */ struct bt_mesh_light_xyl_srv { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Pointer to Lightness Server instance. */ struct bt_mesh_lightness_srv *lightness_srv; /** Publish parameters. */ diff --git a/include/bluetooth/mesh/lightness_cli.h b/include/bluetooth/mesh/lightness_cli.h index 3d0f7de90ed6..2209f7a57b0b 100644 --- a/include/bluetooth/mesh/lightness_cli.h +++ b/include/bluetooth/mesh/lightness_cli.h @@ -98,7 +98,7 @@ struct bt_mesh_lightness_cli_handlers { */ struct bt_mesh_lightness_cli { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/lightness_srv.h b/include/bluetooth/mesh/lightness_srv.h index 6f65af62d38c..79c19c671a36 100644 --- a/include/bluetooth/mesh/lightness_srv.h +++ b/include/bluetooth/mesh/lightness_srv.h @@ -158,9 +158,9 @@ struct bt_mesh_lightness_srv { /** Internal flag state. */ atomic_t flags; /** Pointer to the model entry in the composition data. */ - struct bt_mesh_model *lightness_model; + const struct bt_mesh_model *lightness_model; /** Pointer to the Setup Server model entry in the composition data. */ - struct bt_mesh_model *lightness_setup_model; + const struct bt_mesh_model *lightness_setup_model; /** Model publication parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/scene_cli.h b/include/bluetooth/mesh/scene_cli.h index bc6332ebce34..7fee840b346d 100644 --- a/include/bluetooth/mesh/scene_cli.h +++ b/include/bluetooth/mesh/scene_cli.h @@ -70,7 +70,7 @@ struct bt_mesh_scene_cli { const struct bt_mesh_scene_register *reg); /* Composition data entry pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /* Model publication parameters. */ struct bt_mesh_model_pub pub; /* Publication message */ diff --git a/include/bluetooth/mesh/scene_srv.h b/include/bluetooth/mesh/scene_srv.h index 33f6c0b3bcea..5886474baab6 100644 --- a/include/bluetooth/mesh/scene_srv.h +++ b/include/bluetooth/mesh/scene_srv.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #ifdef __cplusplus @@ -97,9 +97,9 @@ struct bt_mesh_scene_srv { /** TID context. */ struct bt_mesh_tid_ctx tid; /** Composition data model pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Composition data setup model pointer. */ - struct bt_mesh_model *setup_mod; + const struct bt_mesh_model *setup_mod; /** Publication state. */ struct bt_mesh_model_pub pub; /** Publication message. */ @@ -134,7 +134,7 @@ struct bt_mesh_scene_entry { * @return The number of bytes written to @c data or a negative value * on failure. */ - ssize_t (*store)(struct bt_mesh_model *model, uint8_t data[]); + ssize_t (*store)(const struct bt_mesh_model *model, uint8_t data[]); /** @brief Recall a scene based on the given scene data. * @@ -150,7 +150,7 @@ struct bt_mesh_scene_entry { * @param[in] len Scene data length. * @param[in] transition Transition parameters. */ - void (*recall)(struct bt_mesh_model *model, const uint8_t data[], + void (*recall)(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition); /** @brief Recall a scene is completed @@ -166,7 +166,7 @@ struct bt_mesh_scene_entry { * * @param[in] model Model to restore the scene of. */ - void (*recall_complete)(struct bt_mesh_model *model); + void (*recall_complete)(const struct bt_mesh_model *model); }; /** @brief Notify the Scene Server that a Scene entry has changed. @@ -177,7 +177,7 @@ struct bt_mesh_scene_entry { * * @param[in] mod Model that invalidated the scene. */ -void bt_mesh_scene_invalidate(struct bt_mesh_model *mod); +void bt_mesh_scene_invalidate(const struct bt_mesh_model *mod); /** @brief Set the current Scene. * diff --git a/include/bluetooth/mesh/scheduler_cli.h b/include/bluetooth/mesh/scheduler_cli.h index c674479b4a48..42681a5b74cf 100644 --- a/include/bluetooth/mesh/scheduler_cli.h +++ b/include/bluetooth/mesh/scheduler_cli.h @@ -62,7 +62,7 @@ struct bt_mesh_scheduler_cli { const struct bt_mesh_schedule_entry *action); /* Composition data entry pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /* Model publication parameters. */ struct bt_mesh_model_pub pub; /* Publication message */ diff --git a/include/bluetooth/mesh/scheduler_srv.h b/include/bluetooth/mesh/scheduler_srv.h index d10ddcecaf57..dd38b904bd02 100644 --- a/include/bluetooth/mesh/scheduler_srv.h +++ b/include/bluetooth/mesh/scheduler_srv.h @@ -86,7 +86,7 @@ struct bt_mesh_scheduler_srv { sch_reg[BT_MESH_SCHEDULER_ACTION_ENTRY_COUNT]; }; /** Composition data model pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publication state. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/sensor_cli.h b/include/bluetooth/mesh/sensor_cli.h index 11cf1af24edb..7fba5ece7f84 100644 --- a/include/bluetooth/mesh/sensor_cli.h +++ b/include/bluetooth/mesh/sensor_cli.h @@ -54,7 +54,7 @@ struct bt_mesh_sensor_cli_handlers; */ struct bt_mesh_sensor_cli { /** Composition data model instance. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Model publication parameters. */ struct bt_mesh_model_pub pub; /* Publication buffer */ diff --git a/include/bluetooth/mesh/sensor_srv.h b/include/bluetooth/mesh/sensor_srv.h index b61c8f9c2ffb..3e118c9d6c24 100644 --- a/include/bluetooth/mesh/sensor_srv.h +++ b/include/bluetooth/mesh/sensor_srv.h @@ -91,7 +91,7 @@ struct bt_mesh_sensor_srv { BT_MESH_SENSOR_OP_CADENCE_STATUS, BT_MESH_SENSOR_MSG_MAXLEN_CADENCE_STATUS))]; /** Composition data model pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; }; #if !defined(CONFIG_BT_MESH_SENSOR_USE_LEGACY_SENSOR_VALUE) || defined(__DOXYGEN__) diff --git a/include/bluetooth/mesh/time_cli.h b/include/bluetooth/mesh/time_cli.h index eda03b1ae2d3..d894f9c558d5 100644 --- a/include/bluetooth/mesh/time_cli.h +++ b/include/bluetooth/mesh/time_cli.h @@ -124,7 +124,7 @@ struct bt_mesh_time_cli_handlers { */ struct bt_mesh_time_cli { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /** Acknowledged message tracking. */ diff --git a/include/bluetooth/mesh/time_srv.h b/include/bluetooth/mesh/time_srv.h index f1d628d1b581..079209fe0e0f 100644 --- a/include/bluetooth/mesh/time_srv.h +++ b/include/bluetooth/mesh/time_srv.h @@ -96,7 +96,7 @@ struct bt_mesh_time_srv_data { */ struct bt_mesh_time_srv { /** Model entry. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /** Setup model publish parameters */ @@ -302,7 +302,7 @@ extern const struct bt_mesh_model_op _bt_mesh_time_srv_op[]; extern const struct bt_mesh_model_op _bt_mesh_time_setup_srv_op[]; extern const struct bt_mesh_model_cb _bt_mesh_time_srv_cb; extern const struct bt_mesh_model_cb _bt_mesh_time_setup_srv_cb; -int _bt_mesh_time_srv_update_handler(struct bt_mesh_model *model); +int _bt_mesh_time_srv_update_handler(const struct bt_mesh_model *model); /** @endcond */ #ifdef __cplusplus diff --git a/include/bluetooth/mesh/vnd/dm_cli.h b/include/bluetooth/mesh/vnd/dm_cli.h index ece8eb402ced..fe736416b8e2 100644 --- a/include/bluetooth/mesh/vnd/dm_cli.h +++ b/include/bluetooth/mesh/vnd/dm_cli.h @@ -95,7 +95,7 @@ struct bt_mesh_dm_cli { /** Transaction ID. */ uint8_t tid; /** Access model pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Response context for tracking acknowledged messages. */ struct bt_mesh_msg_ack_ctx ack_ctx; /** Publish parameters. */ diff --git a/include/bluetooth/mesh/vnd/dm_srv.h b/include/bluetooth/mesh/vnd/dm_srv.h index ee607f233545..8a5185bcc11e 100644 --- a/include/bluetooth/mesh/vnd/dm_srv.h +++ b/include/bluetooth/mesh/vnd/dm_srv.h @@ -29,7 +29,7 @@ struct bt_mesh_dm_srv { /** Transaction ID tracker. */ struct bt_mesh_tid_ctx prev_transaction; /** Access model pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Flag indicating measurement in progress */ bool is_busy; /** Default configuration */ diff --git a/include/bluetooth/mesh/vnd/silvair_enocean_srv.h b/include/bluetooth/mesh/vnd/silvair_enocean_srv.h index 2eccb7dec94e..c4beb42fb51e 100644 --- a/include/bluetooth/mesh/vnd/silvair_enocean_srv.h +++ b/include/bluetooth/mesh/vnd/silvair_enocean_srv.h @@ -88,7 +88,7 @@ struct bt_mesh_silvair_enocean_srv { BT_MESH_SILVAIR_ENOCEAN_PROXY_OP, BT_MESH_SILVAIR_ENOCEAN_PROXY_MSG_MAXLEN)]; /** Access model pointer. */ - struct bt_mesh_model *mod; + const struct bt_mesh_model *mod; /** Entry in global list of Enocean Proxy models. */ sys_snode_t entry; }; diff --git a/include/modem/at_cmd_custom.h b/include/modem/at_cmd_custom.h index 844ce8a82c93..ad00d99dec1f 100644 --- a/include/modem/at_cmd_custom.h +++ b/include/modem/at_cmd_custom.h @@ -26,7 +26,7 @@ extern "C" { #include #include #include -#include +#include #include /** diff --git a/include/modem/at_monitor.h b/include/modem/at_monitor.h index 8e20b9a641d6..b298e23d1aaf 100644 --- a/include/modem/at_monitor.h +++ b/include/modem/at_monitor.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/modem/modem_slm.h b/include/modem/modem_slm.h index e32373cdffa2..36c995aefa06 100644 --- a/include/modem/modem_slm.h +++ b/include/modem/modem_slm.h @@ -26,7 +26,7 @@ extern "C" { #include #include #include -#include +#include /** Max size of AT command response is 2100 bytes. */ #define SLM_AT_CMD_RESPONSE_MAX_LEN 2100 diff --git a/include/net/nrf_cloud_defs.h b/include/net/nrf_cloud_defs.h index fe9b9a88e740..ece9821b23d7 100644 --- a/include/net/nrf_cloud_defs.h +++ b/include/net/nrf_cloud_defs.h @@ -7,7 +7,7 @@ #ifndef NRF_CLOUD_DEFS_H__ #define NRF_CLOUD_DEFS_H__ -#include +#include /** @defgroup nrf_cloud_defs nRF Cloud common defines * @{ diff --git a/lib/at_cmd_custom/at_cmd_custom.c b/lib/at_cmd_custom/at_cmd_custom.c index 56ca6baf67d7..2468dd1caa7e 100644 --- a/lib/at_cmd_custom/at_cmd_custom.c +++ b/lib/at_cmd_custom/at_cmd_custom.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/lib/at_monitor/at_monitor.c b/lib/at_monitor/at_monitor.c index e9f82e2aa687..fe16ecfe8337 100644 --- a/lib/at_monitor/at_monitor.c +++ b/lib/at_monitor/at_monitor.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include LOG_MODULE_REGISTER(at_monitor, CONFIG_AT_MONITOR_LOG_LEVEL); diff --git a/lib/bin/lwm2m_carrier/os/lwm2m_os.c b/lib/bin/lwm2m_carrier/os/lwm2m_os.c index 3e726c22652a..a30c1ecf0891 100644 --- a/lib/bin/lwm2m_carrier/os/lwm2m_os.c +++ b/lib/bin/lwm2m_carrier/os/lwm2m_os.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/lib/nrf_modem_lib/CMakeLists.txt b/lib/nrf_modem_lib/CMakeLists.txt index 44ae358348fa..75ef7d26c6d0 100644 --- a/lib/nrf_modem_lib/CMakeLists.txt +++ b/lib/nrf_modem_lib/CMakeLists.txt @@ -9,6 +9,7 @@ zephyr_library_sources(nrf_modem_lib.c) zephyr_library_sources(nrf_modem_os.c) zephyr_library_sources_ifdef(CONFIG_NRF_MODEM_LIB_MEM_DIAG diag.c) zephyr_library_sources_ifdef(CONFIG_NET_SOCKETS nrf91_sockets.c) +zephyr_library_include_directories_ifdef(CONFIG_NET_SOCKETS ${ZEPHYR_BASE}/subsys/net/lib/sockets) add_subdirectory_ifdef(CONFIG_NRF_MODEM_LIB_NET_IF lte_net_if) diff --git a/lib/nrf_modem_lib/nrf_modem_lib.c b/lib/nrf_modem_lib/nrf_modem_lib.c index e4aaac40ab6d..db3f0d735044 100644 --- a/lib/nrf_modem_lib/nrf_modem_lib.c +++ b/lib/nrf_modem_lib/nrf_modem_lib.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/modules/trusted-firmware-m/tfm_boards/common/assert.c b/modules/trusted-firmware-m/tfm_boards/common/assert.c index c0a3edb4e7ec..5cf37054a664 100644 --- a/modules/trusted-firmware-m/tfm_boards/common/assert.c +++ b/modules/trusted-firmware-m/tfm_boards/common/assert.c @@ -7,18 +7,18 @@ #include #include "autoconf.h" #include "region_defs.h" -#include +#include "utilities.h" #define IS_ALIGNED_POW2(value, align) (((value) & ((align) - 1)) == 0) /* Making sure the borders between secure and non-secure regions are aligned with the SPU regions */ #if !(IS_ALIGNED_POW2(PM_TFM_NONSECURE_ADDRESS, CONFIG_NRF_SPU_FLASH_REGION_SIZE)) #pragma message "\n\n!!!Partition alignment error!!!"\ - "\nThe non-secure start address in pm_static.yml"\ - " or generated partition.yml is: " STRINGIFY(PM_TFM_NONSECURE_ADDRESS)\ - "\nwhich is not aligned with the SPU region size."\ - "\nRefer to the documentation section 'TF-M partition alignment requirements'"\ - "\nfor more information.\n\n" + "\nThe non-secure start address in pm_static.yml"\ + " or generated partition.yml is: " M2S(PM_TFM_NONSECURE_ADDRESS)\ + "\nwhich is not aligned with the SPU region size."\ + "\nRefer to the documentation section 'TF-M partition alignment requirements'"\ + "\nfor more information.\n\n" #error "TF-M non-secure start address is not aligned on SPU region size" #endif diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 58982fd68c80..dd135de19e3b 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -80,9 +80,9 @@ if (CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE OR CONFIG_NCS_SAMPLE_EMPTY_NET_CORE_CHI set(CHILD_IMAGE_NAME "multiprotocol_rpmsg") set(CHILD_IMAGE_PATH "${ZEPHYR_NRF_MODULE_DIR}/samples/nrf5340/multiprotocol_rpmsg") - elseif (CONFIG_NCS_SAMPLE_HCI_RPMSG_CHILD_IMAGE) - set(CHILD_IMAGE_NAME "hci_rpmsg") - set(CHILD_IMAGE_PATH "${ZEPHYR_BASE}/samples/bluetooth/hci_rpmsg") + elseif (CONFIG_NCS_SAMPLE_HCI_IPC_CHILD_IMAGE) + set(CHILD_IMAGE_NAME "hci_ipc") + set(CHILD_IMAGE_PATH "${ZEPHYR_BASE}/samples/bluetooth/hci_ipc") elseif (CONFIG_NCS_SAMPLE_802154_RPMSG_CHILD_IMAGE) set(CHILD_IMAGE_NAME "802154_rpmsg") @@ -105,7 +105,7 @@ if (CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE OR CONFIG_NCS_SAMPLE_EMPTY_NET_CORE_CHI if (CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP) # By passing this value we don't require the user to pass any overlay files to the # network core child image. Bluetooth buffer sizes are aligned automatically. - if (CONFIG_NCS_SAMPLE_HCI_RPMSG_CHILD_IMAGE OR CONFIG_NCS_SAMPLE_MULTIPROTOCOL_RPMSG_CHILD_IMAGE) + if (CONFIG_NCS_SAMPLE_HCI_IPC_CHILD_IMAGE OR CONFIG_NCS_SAMPLE_MULTIPROTOCOL_RPMSG_CHILD_IMAGE) add_overlay_config( ${CHILD_IMAGE_NAME} ${CMAKE_CURRENT_LIST_DIR}/common/mcumgr_bt_ota_dfu/rpmsg_child_image_overlay.conf @@ -141,7 +141,7 @@ if (CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE OR CONFIG_NCS_SAMPLE_EMPTY_NET_CORE_CHI # on the network core required by the Bluetooth Mesh. add_overlay_config( ${CHILD_IMAGE_NAME} - "${ZEPHYR_NRF_MODULE_DIR}/subsys/bluetooth/mesh/hci_rpmsg_child_image_overlay.conf" + "${ZEPHYR_NRF_MODULE_DIR}/subsys/bluetooth/mesh/hci_ipc_child_image_overlay.conf" ) endif() diff --git a/samples/Kconfig b/samples/Kconfig index f030b64f3b65..0a82ff1ecc32 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -33,9 +33,9 @@ config NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE config NCS_INCLUDE_RPMSG_CHILD_IMAGE bool "Include RPMsg sample on netcore" - depends on SOC_NRF5340_CPUAPP && (BT_RPMSG || NRF_802154_SER_HOST || BT_RPC || NRF700X_RADIO_TEST_COMBO) + depends on SOC_NRF5340_CPUAPP && (BT_HCI_IPC || NRF_802154_SER_HOST || BT_RPC || NRF700X_RADIO_TEST_COMBO) select PARTITION_MANAGER_ENABLED - default y if BT_RPMSG || NRF_802154_SER_HOST || BT_RPC || NRF700X_RADIO_TEST_COMBO + default y if BT_HCI_IPC || NRF_802154_SER_HOST || BT_RPC || NRF700X_RADIO_TEST_COMBO help Enabling this setting will include a network stack to run on the network core and communicate over RPMsg with the application core. @@ -73,21 +73,21 @@ if NCS_INCLUDE_RPMSG_CHILD_IMAGE config NCS_SAMPLE_MULTIPROTOCOL_RPMSG_CHILD_IMAGE bool - depends on BT_RPMSG && NRF_802154_SER_HOST && !BT_RPC && !NRF700X_RADIO_TEST_COMBO + depends on BT_HCI_IPC && NRF_802154_SER_HOST && !BT_RPC && !NRF700X_RADIO_TEST_COMBO default y help multiprotocol_rpmsg sample as a child image (network core). -config NCS_SAMPLE_HCI_RPMSG_CHILD_IMAGE +config NCS_SAMPLE_HCI_IPC_CHILD_IMAGE bool - depends on BT_RPMSG && !NRF_802154_SER_HOST && !BT_RPC && !NRF700X_RADIO_TEST_COMBO + depends on BT_HCI_IPC && !NRF_802154_SER_HOST && !BT_RPC && !NRF700X_RADIO_TEST_COMBO default y help - hci_rpmsg sample as a child image (network core). + hci_ipc sample as a child image (network core). config NCS_SAMPLE_802154_RPMSG_CHILD_IMAGE bool - depends on NRF_802154_SER_HOST && !BT_RPMSG && !BT_RPC && !NRF700X_RADIO_TEST_COMBO + depends on NRF_802154_SER_HOST && !BT_HCI_IPC && !BT_RPC && !NRF700X_RADIO_TEST_COMBO default y help 802154_rpmsg sample as a child image (network core). diff --git a/samples/bluetooth/central_hr_coded/README.rst b/samples/bluetooth/central_hr_coded/README.rst index d3e94a57c06b..9d5697d109cf 100644 --- a/samples/bluetooth/central_hr_coded/README.rst +++ b/samples/bluetooth/central_hr_coded/README.rst @@ -17,7 +17,7 @@ The sample supports the following development kits: .. table-from-sample-yaml:: -.. include:: /includes/hci_rpmsg_overlay.txt +.. include:: /includes/hci_ipc_overlay.txt The sample also requires a device running a Heart Rate Server with LE Coded PHY support to connect to. For example, another development kit running the :ref:`peripheral_hr_coded` sample. diff --git a/samples/bluetooth/central_hr_coded/child_image/hci_rpmsg.conf b/samples/bluetooth/central_hr_coded/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/central_hr_coded/child_image/hci_rpmsg.conf rename to samples/bluetooth/central_hr_coded/child_image/hci_ipc.conf diff --git a/samples/bluetooth/central_hr_coded/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/central_hr_coded/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/central_hr_coded/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/central_hr_coded/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/central_smp_client/README.rst b/samples/bluetooth/central_smp_client/README.rst index f8c6aaf59285..541d306e8b99 100644 --- a/samples/bluetooth/central_smp_client/README.rst +++ b/samples/bluetooth/central_smp_client/README.rst @@ -23,7 +23,7 @@ The sample supports the following development kits: .. include:: /includes/tfm.txt -The sample also requires a device running `mcumgr`_ with transport protocol over Bluetooth® Low Energy, for example, another development kit running the :ref:`smp_svr_sample`. +The sample also requires a device running `mcumgr`_ with transport protocol over Bluetooth® Low Energy, for example, another development kit running the :zephyr:code-sample:`smp-svr`. .. note:: This sample does not program the device using DFU. @@ -64,9 +64,9 @@ Testing #. |connect_terminal| #. Reset the kit. #. Observe that the text "Starting Bluetooth Central SMP Client example" is printed on the COM listener running on the computer and the device starts scanning for Peripherals with SMP. -#. Program the :ref:`smp_svr_sample` to another development kit. +#. Program the :zephyr:code-sample:`smp-svr` to another development kit. See the documentation for that sample only in the section "Building the sample application". - When you have built the :ref:`smp_svr_sample`, call the following command to program it to the development kit:: + When you have built the :zephyr:code-sample:`smp-svr`, call the following command to program it to the development kit:: west flash diff --git a/samples/bluetooth/central_uart/src/main.c b/samples/bluetooth/central_uart/src/main.c index 277797d610f1..756b8d13602c 100644 --- a/samples/bluetooth/central_uart/src/main.c +++ b/samples/bluetooth/central_uart/src/main.c @@ -138,13 +138,13 @@ static void uart_cb(const struct device *dev, struct uart_event *evt, void *user if (aborted_buf) { buf = CONTAINER_OF(aborted_buf, struct uart_data_t, - data); + data[0]); aborted_buf = NULL; aborted_len = 0; } else { buf = CONTAINER_OF(evt->data.tx.buf, struct uart_data_t, - data); + data[0]); } k_free(buf); @@ -162,7 +162,7 @@ static void uart_cb(const struct device *dev, struct uart_event *evt, void *user case UART_RX_RDY: LOG_DBG("UART_RX_RDY"); - buf = CONTAINER_OF(evt->data.rx.buf, struct uart_data_t, data); + buf = CONTAINER_OF(evt->data.rx.buf, struct uart_data_t, data[0]); buf->len += evt->data.rx.len; if (disable_req) { @@ -210,7 +210,7 @@ static void uart_cb(const struct device *dev, struct uart_event *evt, void *user case UART_RX_BUF_RELEASED: LOG_DBG("UART_RX_BUF_RELEASED"); buf = CONTAINER_OF(evt->data.rx_buf.buf, struct uart_data_t, - data); + data[0]); if (buf->len > 0) { k_fifo_put(&fifo_uart_rx_data, buf); @@ -228,7 +228,7 @@ static void uart_cb(const struct device *dev, struct uart_event *evt, void *user aborted_len += evt->data.tx.len; buf = CONTAINER_OF(aborted_buf, struct uart_data_t, - data); + data[0]); uart_tx(uart, &buf->data[aborted_len], buf->len - aborted_len, SYS_FOREVER_MS); diff --git a/samples/bluetooth/direction_finding_central/README.rst b/samples/bluetooth/direction_finding_central/README.rst index 5309fc83435c..dc34f2346e68 100644 --- a/samples/bluetooth/direction_finding_central/README.rst +++ b/samples/bluetooth/direction_finding_central/README.rst @@ -77,7 +77,7 @@ To build this sample with AoD mode only, set ``OVERLAY_CONFIG`` to the :file:`ov See :ref:`cmake_options` for instructions on how to add this option. For more information about using configuration overlay files, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. -To build this sample for :ref:`nRF5340 DK `, with AoD mode only, add content of :file:`overlay-aod.conf` file to :file:`child_image/hci_rpmsg.conf` file. +To build this sample for :ref:`nRF5340 DK `, with AoD mode only, add content of :file:`overlay-aod.conf` file to :file:`child_image/hci_ipc.conf` file. .. bt_dir_finding_central_aod_end diff --git a/samples/bluetooth/direction_finding_central/child_image/hci_rpmsg.conf b/samples/bluetooth/direction_finding_central/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/direction_finding_central/child_image/hci_rpmsg.conf rename to samples/bluetooth/direction_finding_central/child_image/hci_ipc.conf diff --git a/samples/bluetooth/direction_finding_central/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direction_finding_central/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/direction_finding_central/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/direction_finding_central/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/direction_finding_central/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direction_finding_central/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/direction_finding_central/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/direction_finding_central/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/direction_finding_central/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/direction_finding_central/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/direction_finding_central/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/direction_finding_central/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/direction_finding_connectionless_rx/child_image/hci_rpmsg.conf b/samples/bluetooth/direction_finding_connectionless_rx/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/direction_finding_connectionless_rx/child_image/hci_rpmsg.conf rename to samples/bluetooth/direction_finding_connectionless_rx/child_image/hci_ipc.conf diff --git a/samples/bluetooth/direction_finding_connectionless_rx/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direction_finding_connectionless_rx/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/direction_finding_connectionless_rx/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/direction_finding_connectionless_rx/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direction_finding_connectionless_rx/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/direction_finding_connectionless_rx/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/direction_finding_connectionless_rx/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/direction_finding_connectionless_rx/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/direction_finding_connectionless_rx/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/direction_finding_connectionless_rx/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/direction_finding_connectionless_tx/README.rst b/samples/bluetooth/direction_finding_connectionless_tx/README.rst index 6028df865dd2..4a892c766f00 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/README.rst +++ b/samples/bluetooth/direction_finding_connectionless_tx/README.rst @@ -53,7 +53,7 @@ To build this sample with AoA mode only, set ``OVERLAY_CONFIG`` to the :file:`ov See :ref:`cmake_options` for instructions on how to add this option. For more information about using configuration overlay files, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. -To build this sample for :ref:`nRF5340 DK `, with AoA mode only, add content of :file:`overlay-aoa.conf` file to :file:`child_image/hci_rpmsg.conf` file. +To build this sample for :ref:`nRF5340 DK `, with AoA mode only, add content of :file:`overlay-aoa.conf` file to :file:`child_image/hci_ipc.conf` file. .. bt_dir_finding_tx_aoa_mode_end diff --git a/samples/bluetooth/direction_finding_connectionless_tx/child_image/hci_rpmsg.conf b/samples/bluetooth/direction_finding_connectionless_tx/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/direction_finding_connectionless_tx/child_image/hci_rpmsg.conf rename to samples/bluetooth/direction_finding_connectionless_tx/child_image/hci_ipc.conf diff --git a/samples/bluetooth/direction_finding_connectionless_tx/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direction_finding_connectionless_tx/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/direction_finding_connectionless_tx/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/direction_finding_connectionless_tx/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direction_finding_connectionless_tx/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/direction_finding_connectionless_tx/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/direction_finding_connectionless_tx/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/direction_finding_connectionless_tx/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/direction_finding_connectionless_tx/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/direction_finding_connectionless_tx/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/direction_finding_peripheral/child_image/hci_rpmsg.conf b/samples/bluetooth/direction_finding_peripheral/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/direction_finding_peripheral/child_image/hci_rpmsg.conf rename to samples/bluetooth/direction_finding_peripheral/child_image/hci_ipc.conf diff --git a/samples/bluetooth/direction_finding_peripheral/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direction_finding_peripheral/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/direction_finding_peripheral/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/direction_finding_peripheral/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/direction_finding_peripheral/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direction_finding_peripheral/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/direction_finding_peripheral/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/direction_finding_peripheral/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/direction_finding_peripheral/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/direction_finding_peripheral/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/direction_finding_peripheral/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/direction_finding_peripheral/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/fast_pair/input_device/README.rst b/samples/bluetooth/fast_pair/input_device/README.rst index 5bb557c6c501..d0cfaaa97933 100644 --- a/samples/bluetooth/fast_pair/input_device/README.rst +++ b/samples/bluetooth/fast_pair/input_device/README.rst @@ -26,7 +26,7 @@ The sample supports the following development kits: .. include:: /includes/tfm.txt -.. include:: /includes/hci_rpmsg_overlay.txt +.. include:: /includes/hci_ipc_overlay.txt Overview ******** diff --git a/samples/bluetooth/fast_pair/input_device/child_image/hci_rpmsg.conf b/samples/bluetooth/fast_pair/input_device/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/fast_pair/input_device/child_image/hci_rpmsg.conf rename to samples/bluetooth/fast_pair/input_device/child_image/hci_ipc.conf diff --git a/samples/bluetooth/fast_pair/input_device/src/bt_adv_helper.c b/samples/bluetooth/fast_pair/input_device/src/bt_adv_helper.c index 48d992675a0a..20f16a5d516b 100644 --- a/samples/bluetooth/fast_pair/input_device/src/bt_adv_helper.c +++ b/samples/bluetooth/fast_pair/input_device/src/bt_adv_helper.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2022 Nordic Semiconductor ASA + * Copyright (c) 2022-2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include +#include #include #include @@ -16,8 +17,6 @@ LOG_MODULE_DECLARE(fp_sample, LOG_LEVEL_INF); #include "bt_adv_helper.h" -#define SEC_PER_MIN 60U - /* According to Fast Pair specification RPA rotation must be synchronized with generating new salt * for Acount Key Filter advertising data. The RPA rotation must occur at least every 15 minutes * while the device is actively advertising in Fast Pair not discoverable mode. The value of this diff --git a/samples/bluetooth/fast_pair/input_device/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/fast_pair/input_device/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/fast_pair/input_device/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/fast_pair/input_device/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/model_handler.c b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/model_handler.c index 8166ac85daa7..f6e88dd9472e 100644 --- a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/model_handler.c +++ b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/model_handler.c @@ -124,13 +124,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/chat/include/chat_cli.h b/samples/bluetooth/mesh/chat/include/chat_cli.h index 125d21aef507..0a5b7df527e2 100644 --- a/samples/bluetooth/mesh/chat/include/chat_cli.h +++ b/samples/bluetooth/mesh/chat/include/chat_cli.h @@ -141,7 +141,7 @@ struct bt_mesh_chat_cli_handlers { */ struct bt_mesh_chat_cli { /** Access model pointer. */ - struct bt_mesh_model *model; + const struct bt_mesh_model *model; /** Publish parameters. */ struct bt_mesh_model_pub pub; /** Publication message. */ diff --git a/samples/bluetooth/mesh/chat/src/chat_cli.c b/samples/bluetooth/mesh/chat/src/chat_cli.c index 0f477dfa8bc4..04b2fbf3a8f0 100644 --- a/samples/bluetooth/mesh/chat/src/chat_cli.c +++ b/samples/bluetooth/mesh/chat/src/chat_cli.c @@ -34,10 +34,10 @@ static const uint8_t *extract_msg(struct net_buf_simple *buf) return net_buf_simple_pull_mem(buf, buf->len); } -static int handle_message(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_message(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; const uint8_t *msg; msg = extract_msg(buf); @@ -60,11 +60,10 @@ static void send_message_reply(struct bt_mesh_chat_cli *chat, (void)bt_mesh_model_send(chat->model, ctx, &msg, NULL, NULL); } -static int handle_private_message(struct bt_mesh_model *model, - struct bt_mesh_msg_ctx *ctx, +static int handle_private_message(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; const uint8_t *msg; msg = extract_msg(buf); @@ -78,10 +77,10 @@ static int handle_private_message(struct bt_mesh_model *model, } /* .. include_endpoint_chat_cli_rst_1 */ -static int handle_message_reply(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_message_reply(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; if (chat->handlers->message_reply) { chat->handlers->message_reply(chat, ctx); @@ -90,10 +89,10 @@ static int handle_message_reply(struct bt_mesh_model *model, struct bt_mesh_msg_ return 0; } -static int handle_presence(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_presence(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; enum bt_mesh_chat_cli_presence presence; presence = net_buf_simple_pull_u8(buf); @@ -105,17 +104,17 @@ static int handle_presence(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_presence_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_presence_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_CHAT_CLI_OP_PRESENCE, BT_MESH_CHAT_CLI_MSG_LEN_PRESENCE); encode_presence(&msg, chat->presence); - (void) bt_mesh_model_send(chat->model, ctx, &msg, NULL, NULL); + (void)bt_mesh_model_send(chat->model, ctx, &msg, NULL, NULL); return 0; } @@ -151,9 +150,9 @@ const struct bt_mesh_model_op _bt_mesh_chat_cli_op[] = { }; /* .. include_endpoint_chat_cli_rst_2 */ -static int bt_mesh_chat_cli_update_handler(struct bt_mesh_model *model) +static int bt_mesh_chat_cli_update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; /* Continue publishing current presence. */ encode_presence(model->pub->msg, chat->presence); @@ -163,13 +162,13 @@ static int bt_mesh_chat_cli_update_handler(struct bt_mesh_model *model) /* .. include_startingpoint_chat_cli_rst_3 */ #ifdef CONFIG_BT_SETTINGS -static int bt_mesh_chat_cli_settings_set(struct bt_mesh_model *model, +static int bt_mesh_chat_cli_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; if (name) { return -ENOENT; @@ -191,9 +190,9 @@ static int bt_mesh_chat_cli_settings_set(struct bt_mesh_model *model, /* .. include_endpoint_chat_cli_rst_3 */ /* .. include_startingpoint_chat_cli_rst_4 */ -static int bt_mesh_chat_cli_init(struct bt_mesh_model *model) +static int bt_mesh_chat_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; chat->model = model; @@ -207,9 +206,9 @@ static int bt_mesh_chat_cli_init(struct bt_mesh_model *model) /* .. include_endpoint_chat_cli_rst_4 */ /* .. include_startingpoint_chat_cli_rst_5 */ -static int bt_mesh_chat_cli_start(struct bt_mesh_model *model) +static int bt_mesh_chat_cli_start(const struct bt_mesh_model *model) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; if (chat->handlers->start) { chat->handlers->start(chat); @@ -220,9 +219,9 @@ static int bt_mesh_chat_cli_start(struct bt_mesh_model *model) /* .. include_endpoint_chat_cli_rst_5 */ /* .. include_startingpoint_chat_cli_rst_6 */ -static void bt_mesh_chat_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_chat_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_chat_cli *chat = model->user_data; + struct bt_mesh_chat_cli *chat = model->rt->user_data; chat->presence = BT_MESH_CHAT_CLI_PRESENCE_AVAILABLE; diff --git a/samples/bluetooth/mesh/chat/src/model_handler.c b/samples/bluetooth/mesh/chat/src/model_handler.c index 78ff88024c34..7ca3214ee01d 100644 --- a/samples/bluetooth/mesh/chat/src/model_handler.c +++ b/samples/bluetooth/mesh/chat/src/model_handler.c @@ -48,13 +48,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; @@ -93,9 +93,9 @@ static const uint8_t *presence_string[] = { /** * Returns true if the specified address is an address of the local element. */ -static bool address_is_local(struct bt_mesh_model *mod, uint16_t addr) +static bool address_is_local(const struct bt_mesh_model *mod, uint16_t addr) { - return bt_mesh_model_elem(mod)->addr == addr; + return bt_mesh_model_elem(mod)->rt->addr == addr; } /** @@ -241,7 +241,7 @@ static void print_client_status(void) } else { shell_print(chat_shell, "The mesh node is provisioned. The client address is 0x%04x.", - bt_mesh_model_elem(chat.model)->addr); + bt_mesh_model_elem(chat.model)->rt->addr); } shell_print(chat_shell, "Current presence: %s", diff --git a/samples/bluetooth/mesh/dfu/distributor/src/main.c b/samples/bluetooth/mesh/dfu/distributor/src/main.c index 7f68f86940ad..ef18cd737354 100644 --- a/samples/bluetooth/mesh/dfu/distributor/src/main.c +++ b/samples/bluetooth/mesh/dfu/distributor/src/main.c @@ -53,13 +53,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/dfu/target/src/main.c b/samples/bluetooth/mesh/dfu/target/src/main.c index a56eda5fdb53..07617235e1b3 100644 --- a/samples/bluetooth/mesh/dfu/target/src/main.c +++ b/samples/bluetooth/mesh/dfu/target/src/main.c @@ -49,13 +49,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/light/child_image/hci_rpmsg.conf b/samples/bluetooth/mesh/light/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/mesh/light/child_image/hci_rpmsg.conf rename to samples/bluetooth/mesh/light/child_image/hci_ipc.conf diff --git a/samples/bluetooth/mesh/light/src/model_handler.c b/samples/bluetooth/mesh/light/src/model_handler.c index 2a2bff007965..761f0bb441df 100644 --- a/samples/bluetooth/mesh/light/src/model_handler.c +++ b/samples/bluetooth/mesh/light/src/model_handler.c @@ -155,13 +155,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/light/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/mesh/light/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/mesh/light/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/mesh/light/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/mesh/light_ctrl/child_image/hci_rpmsg.conf b/samples/bluetooth/mesh/light_ctrl/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/mesh/light_ctrl/child_image/hci_rpmsg.conf rename to samples/bluetooth/mesh/light_ctrl/child_image/hci_ipc.conf diff --git a/samples/bluetooth/mesh/light_ctrl/src/main.c b/samples/bluetooth/mesh/light_ctrl/src/main.c index c8c052a92d89..fd98ce698d46 100644 --- a/samples/bluetooth/mesh/light_ctrl/src/main.c +++ b/samples/bluetooth/mesh/light_ctrl/src/main.c @@ -21,7 +21,7 @@ #include #endif -#define EMDS_DEV_IRQ 24 +#define EMDS_DEV_IRQ 26 #define EMDS_DEV_PRIO 0 #define EMDS_ISR_ARG 0 #define EMDS_IRQ_FLAGS 0 diff --git a/samples/bluetooth/mesh/light_ctrl/src/model_handler.c b/samples/bluetooth/mesh/light_ctrl/src/model_handler.c index 8ea72f263cbd..2094ca3419e4 100644 --- a/samples/bluetooth/mesh/light_ctrl/src/model_handler.c +++ b/samples/bluetooth/mesh/light_ctrl/src/model_handler.c @@ -84,13 +84,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; @@ -127,7 +127,7 @@ static void periodic_led_work(struct k_work *work) { uint16_t clamped_lvl; struct lightness_ctx *l_ctx = - CONTAINER_OF(work, struct lightness_ctx, per_work); + CONTAINER_OF(work, struct lightness_ctx, per_work.work); l_ctx->rem_time -= l_ctx->time_per; if ((l_ctx->rem_time <= l_ctx->time_per) || diff --git a/samples/bluetooth/mesh/light_ctrl/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/mesh/light_ctrl/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/mesh/light_ctrl/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/mesh/light_ctrl/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/mesh/light_dimmer/child_image/hci_rpmsg.conf b/samples/bluetooth/mesh/light_dimmer/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/mesh/light_dimmer/child_image/hci_rpmsg.conf rename to samples/bluetooth/mesh/light_dimmer/child_image/hci_ipc.conf diff --git a/samples/bluetooth/mesh/light_dimmer/src/model_handler.c b/samples/bluetooth/mesh/light_dimmer/src/model_handler.c index 571a7cc4c6bc..ba2decb590c5 100644 --- a/samples/bluetooth/mesh/light_dimmer/src/model_handler.c +++ b/samples/bluetooth/mesh/light_dimmer/src/model_handler.c @@ -265,13 +265,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/light_dimmer/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/mesh/light_dimmer/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/mesh/light_dimmer/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/mesh/light_dimmer/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/mesh/light_switch/child_image/hci_rpmsg.conf b/samples/bluetooth/mesh/light_switch/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/mesh/light_switch/child_image/hci_rpmsg.conf rename to samples/bluetooth/mesh/light_switch/child_image/hci_ipc.conf diff --git a/samples/bluetooth/mesh/light_switch/src/model_handler.c b/samples/bluetooth/mesh/light_switch/src/model_handler.c index 3d70a61da50c..828f77cbf5e6 100644 --- a/samples/bluetooth/mesh/light_switch/src/model_handler.c +++ b/samples/bluetooth/mesh/light_switch/src/model_handler.c @@ -142,13 +142,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/light_switch/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/mesh/light_switch/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/mesh/light_switch/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/mesh/light_switch/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/mesh/sensor_client/src/model_handler.c b/samples/bluetooth/mesh/sensor_client/src/model_handler.c index 1e4390e77238..3edfe45a425c 100644 --- a/samples/bluetooth/mesh/sensor_client/src/model_handler.c +++ b/samples/bluetooth/mesh/sensor_client/src/model_handler.c @@ -232,13 +232,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/sensor_server/child_image/hci_rpmsg.conf b/samples/bluetooth/mesh/sensor_server/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/mesh/sensor_server/child_image/hci_rpmsg.conf rename to samples/bluetooth/mesh/sensor_server/child_image/hci_ipc.conf diff --git a/samples/bluetooth/mesh/sensor_server/src/model_handler.c b/samples/bluetooth/mesh/sensor_server/src/model_handler.c index 43365c8b04f4..3ef43e2787d4 100644 --- a/samples/bluetooth/mesh/sensor_server/src/model_handler.c +++ b/samples/bluetooth/mesh/sensor_server/src/model_handler.c @@ -702,13 +702,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/sensor_server/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/mesh/sensor_server/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/mesh/sensor_server/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/mesh/sensor_server/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/mesh/silvair_enocean/child_image/hci_rpmsg.conf b/samples/bluetooth/mesh/silvair_enocean/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/mesh/silvair_enocean/child_image/hci_rpmsg.conf rename to samples/bluetooth/mesh/silvair_enocean/child_image/hci_ipc.conf diff --git a/samples/bluetooth/mesh/silvair_enocean/src/model_handler.c b/samples/bluetooth/mesh/silvair_enocean/src/model_handler.c index 191b5964793b..5b21425f9ba4 100644 --- a/samples/bluetooth/mesh/silvair_enocean/src/model_handler.c +++ b/samples/bluetooth/mesh/silvair_enocean/src/model_handler.c @@ -87,13 +87,13 @@ static void attention_blink(struct k_work *work) } } -static void attention_on(struct bt_mesh_model *mod) +static void attention_on(const struct bt_mesh_model *mod) { attention = true; k_work_reschedule(&attention_blink_work, K_NO_WAIT); } -static void attention_off(struct bt_mesh_model *mod) +static void attention_off(const struct bt_mesh_model *mod) { /* Will stop rescheduling blink timer */ attention = false; diff --git a/samples/bluetooth/mesh/silvair_enocean/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/mesh/silvair_enocean/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/mesh/silvair_enocean/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/mesh/silvair_enocean/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/multiple_adv_sets/child_image/hci_rpmsg.conf b/samples/bluetooth/multiple_adv_sets/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/multiple_adv_sets/child_image/hci_rpmsg.conf rename to samples/bluetooth/multiple_adv_sets/child_image/hci_ipc.conf diff --git a/samples/bluetooth/multiple_adv_sets/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/multiple_adv_sets/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/multiple_adv_sets/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/multiple_adv_sets/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/nrf_dm/README.rst b/samples/bluetooth/nrf_dm/README.rst index 8e0b3461a058..68dd7042d40b 100644 --- a/samples/bluetooth/nrf_dm/README.rst +++ b/samples/bluetooth/nrf_dm/README.rst @@ -252,7 +252,7 @@ In addition, it uses the following Zephyr libraries: * :file:`include/sys/printk.h` * :file:`include/sys/byteorder.h` -* :file:`include/random/rand32.h` +* :file:`include/random/random.h` * :ref:`zephyr:bluetooth_api`: * :file:`include/bluetooth/bluetooth.h` diff --git a/samples/bluetooth/nrf_dm/child_image/hci_rpmsg.conf b/samples/bluetooth/nrf_dm/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/nrf_dm/child_image/hci_rpmsg.conf rename to samples/bluetooth/nrf_dm/child_image/hci_ipc.conf diff --git a/samples/bluetooth/nrf_dm/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/nrf_dm/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/nrf_dm/child_image/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/nrf_dm/child_image/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/nrf_dm/src/peer.c b/samples/bluetooth/nrf_dm/src/peer.c index d0d65cb2a91b..5388ef11c6c1 100644 --- a/samples/bluetooth/nrf_dm/src/peer.c +++ b/samples/bluetooth/nrf_dm/src/peer.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include diff --git a/samples/bluetooth/nrf_dm/src/service.c b/samples/bluetooth/nrf_dm/src/service.c index 48e96ee5dc90..66052110acc9 100644 --- a/samples/bluetooth/nrf_dm/src/service.c +++ b/samples/bluetooth/nrf_dm/src/service.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include "service.h" diff --git a/samples/bluetooth/nrf_dm/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/nrf_dm/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay similarity index 100% rename from samples/bluetooth/nrf_dm/sysbuild/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay rename to samples/bluetooth/nrf_dm/sysbuild/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay diff --git a/samples/bluetooth/nrf_dm/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/nrf_dm/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/nrf_dm/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/nrf_dm/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/peripheral_hids_keyboard/README.rst b/samples/bluetooth/peripheral_hids_keyboard/README.rst index de0e5c25bf0b..a6c83c237cf0 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/README.rst +++ b/samples/bluetooth/peripheral_hids_keyboard/README.rst @@ -20,7 +20,7 @@ The sample supports the following development kits: .. include:: /includes/tfm.txt -.. include:: /includes/hci_rpmsg_overlay.txt +.. include:: /includes/hci_ipc_overlay.txt If the NFC_OOB_PAIRING feature is enabled, the sample requires a smartphone or a tablet with Android v8.0.0 or newer. diff --git a/samples/bluetooth/peripheral_hids_keyboard/child_image/hci_rpmsg.conf b/samples/bluetooth/peripheral_hids_keyboard/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/peripheral_hids_keyboard/child_image/hci_rpmsg.conf rename to samples/bluetooth/peripheral_hids_keyboard/child_image/hci_ipc.conf diff --git a/samples/bluetooth/peripheral_hids_keyboard/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/peripheral_hids_keyboard/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/peripheral_hids_keyboard/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/peripheral_hids_keyboard/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/peripheral_hids_mouse/README.rst b/samples/bluetooth/peripheral_hids_mouse/README.rst index 4eb48b65d690..2b91e134eb46 100644 --- a/samples/bluetooth/peripheral_hids_mouse/README.rst +++ b/samples/bluetooth/peripheral_hids_mouse/README.rst @@ -19,7 +19,7 @@ The sample supports the following development kits: .. include:: /includes/tfm.txt -.. include:: /includes/hci_rpmsg_overlay.txt +.. include:: /includes/hci_ipc_overlay.txt Overview ******** diff --git a/samples/bluetooth/peripheral_hids_mouse/child_image/hci_rpmsg.conf b/samples/bluetooth/peripheral_hids_mouse/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/peripheral_hids_mouse/child_image/hci_rpmsg.conf rename to samples/bluetooth/peripheral_hids_mouse/child_image/hci_ipc.conf diff --git a/samples/bluetooth/peripheral_hr_coded/README.rst b/samples/bluetooth/peripheral_hr_coded/README.rst index 61f9307a77af..340d09d680cb 100644 --- a/samples/bluetooth/peripheral_hr_coded/README.rst +++ b/samples/bluetooth/peripheral_hr_coded/README.rst @@ -17,7 +17,7 @@ The sample supports the following development kits: .. table-from-sample-yaml:: -.. include:: /includes/hci_rpmsg_overlay.txt +.. include:: /includes/hci_ipc_overlay.txt The sample also requires a device running a Heart Rate Server with LE Coded PHY support to connect to. For example, another development kit running the :ref:`bluetooth_central_hr_coded` sample. diff --git a/samples/bluetooth/peripheral_hr_coded/child_image/hci_rpmsg.conf b/samples/bluetooth/peripheral_hr_coded/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/peripheral_hr_coded/child_image/hci_rpmsg.conf rename to samples/bluetooth/peripheral_hr_coded/child_image/hci_ipc.conf diff --git a/samples/bluetooth/peripheral_hr_coded/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/peripheral_hr_coded/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/peripheral_hr_coded/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/peripheral_hr_coded/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/peripheral_mds/README.rst b/samples/bluetooth/peripheral_mds/README.rst index 7418e843129f..f4a2f18e185d 100644 --- a/samples/bluetooth/peripheral_mds/README.rst +++ b/samples/bluetooth/peripheral_mds/README.rst @@ -21,7 +21,7 @@ The sample supports the following development kits: .. include:: /includes/tfm.txt -.. include:: /includes/hci_rpmsg_overlay.txt +.. include:: /includes/hci_ipc_overlay.txt Overview ******** diff --git a/samples/bluetooth/peripheral_mds/child_image/hci_rpmsg.conf b/samples/bluetooth/peripheral_mds/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/peripheral_mds/child_image/hci_rpmsg.conf rename to samples/bluetooth/peripheral_mds/child_image/hci_ipc.conf diff --git a/samples/bluetooth/peripheral_mds/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/peripheral_mds/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/peripheral_mds/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/peripheral_mds/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/peripheral_power_profiling/README.rst b/samples/bluetooth/peripheral_power_profiling/README.rst index 7d76a7e1d867..aafed8a91dbf 100644 --- a/samples/bluetooth/peripheral_power_profiling/README.rst +++ b/samples/bluetooth/peripheral_power_profiling/README.rst @@ -18,7 +18,7 @@ The sample supports the following development kits: .. table-from-sample-yaml:: -.. include:: /includes/hci_rpmsg_overlay.txt +.. include:: /includes/hci_ipc_overlay.txt Optionally, you can use the `Power Profiler Kit II (PPK2)`_ for power profiling and optimizing your configuration. You can use also your proprietary solution for measuring the power consumption. diff --git a/samples/bluetooth/peripheral_power_profiling/child_image/hci_rpmsg.conf b/samples/bluetooth/peripheral_power_profiling/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/peripheral_power_profiling/child_image/hci_rpmsg.conf rename to samples/bluetooth/peripheral_power_profiling/child_image/hci_ipc.conf diff --git a/samples/bluetooth/peripheral_power_profiling/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/peripheral_power_profiling/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/peripheral_power_profiling/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/peripheral_power_profiling/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/peripheral_rscs/README.rst b/samples/bluetooth/peripheral_rscs/README.rst index 671750634702..2b9153bb1744 100644 --- a/samples/bluetooth/peripheral_rscs/README.rst +++ b/samples/bluetooth/peripheral_rscs/README.rst @@ -85,7 +85,7 @@ In addition, it uses the following Zephyr libraries: * :file:`include/zephyr/types.h` * :file:`lib/libc/minimal/include/errno.h` * :file:`include/sys/printk.h` -* :file:`include/random/rand32.h` +* :file:`include/random/random.h` * :ref:`zephyr:bluetooth_api`: * :file:`include/bluetooth/bluetooth.h` diff --git a/samples/bluetooth/peripheral_rscs/src/main.c b/samples/bluetooth/peripheral_rscs/src/main.c index bb0cbb55d2bf..a993648e7d16 100644 --- a/samples/bluetooth/peripheral_rscs/src/main.c +++ b/samples/bluetooth/peripheral_rscs/src/main.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/samples/bluetooth/peripheral_status/child_image/hci_rpmsg/boards/thingy53_nrf5340_cpunet.conf b/samples/bluetooth/peripheral_status/child_image/hci_ipc/boards/thingy53_nrf5340_cpunet.conf similarity index 100% rename from samples/bluetooth/peripheral_status/child_image/hci_rpmsg/boards/thingy53_nrf5340_cpunet.conf rename to samples/bluetooth/peripheral_status/child_image/hci_ipc/boards/thingy53_nrf5340_cpunet.conf diff --git a/samples/bluetooth/peripheral_status/sysbuild/hci_rpmsg/boards/thingy53_nrf5340_cpunet.conf b/samples/bluetooth/peripheral_status/sysbuild/hci_ipc/boards/thingy53_nrf5340_cpunet.conf similarity index 100% rename from samples/bluetooth/peripheral_status/sysbuild/hci_rpmsg/boards/thingy53_nrf5340_cpunet.conf rename to samples/bluetooth/peripheral_status/sysbuild/hci_ipc/boards/thingy53_nrf5340_cpunet.conf diff --git a/samples/bluetooth/peripheral_status/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/peripheral_status/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/peripheral_status/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/peripheral_status/sysbuild/hci_ipc/prj.conf diff --git a/samples/bluetooth/peripheral_uart/src/main.c b/samples/bluetooth/peripheral_uart/src/main.c index de80922cf725..7526fd65ddfd 100644 --- a/samples/bluetooth/peripheral_uart/src/main.c +++ b/samples/bluetooth/peripheral_uart/src/main.c @@ -105,12 +105,12 @@ static void uart_cb(const struct device *dev, struct uart_event *evt, void *user if (aborted_buf) { buf = CONTAINER_OF(aborted_buf, struct uart_data_t, - data); + data[0]); aborted_buf = NULL; aborted_len = 0; } else { buf = CONTAINER_OF(evt->data.tx.buf, struct uart_data_t, - data); + data[0]); } k_free(buf); @@ -128,7 +128,7 @@ static void uart_cb(const struct device *dev, struct uart_event *evt, void *user case UART_RX_RDY: LOG_DBG("UART_RX_RDY"); - buf = CONTAINER_OF(evt->data.rx.buf, struct uart_data_t, data); + buf = CONTAINER_OF(evt->data.rx.buf, struct uart_data_t, data[0]); buf->len += evt->data.rx.len; if (disable_req) { @@ -176,7 +176,7 @@ static void uart_cb(const struct device *dev, struct uart_event *evt, void *user case UART_RX_BUF_RELEASED: LOG_DBG("UART_RX_BUF_RELEASED"); buf = CONTAINER_OF(evt->data.rx_buf.buf, struct uart_data_t, - data); + data[0]); if (buf->len > 0) { k_fifo_put(&fifo_uart_rx_data, buf); @@ -193,7 +193,7 @@ static void uart_cb(const struct device *dev, struct uart_event *evt, void *user } aborted_len += evt->data.tx.len; - buf = CONTAINER_OF(aborted_buf, struct uart_data_t, + buf = CONTAINER_OF((void *)aborted_buf, struct uart_data_t, data); uart_tx(uart, &buf->data[aborted_len], diff --git a/samples/bluetooth/throughput/README.rst b/samples/bluetooth/throughput/README.rst index e247234b8d59..77d9c2a3cb3f 100644 --- a/samples/bluetooth/throughput/README.rst +++ b/samples/bluetooth/throughput/README.rst @@ -21,7 +21,7 @@ The sample supports the following development kits: You can use any two of the development kits listed above and mix different development kits. -.. include:: /includes/hci_rpmsg_overlay.txt +.. include:: /includes/hci_ipc_overlay.txt The sample also requires a connection to a computer with a serial terminal |ANSI| for each of the development kits. diff --git a/samples/bluetooth/throughput/child_image/hci_rpmsg.conf b/samples/bluetooth/throughput/child_image/hci_ipc.conf similarity index 100% rename from samples/bluetooth/throughput/child_image/hci_rpmsg.conf rename to samples/bluetooth/throughput/child_image/hci_ipc.conf diff --git a/samples/bluetooth/throughput/sysbuild/hci_rpmsg/prj.conf b/samples/bluetooth/throughput/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/bluetooth/throughput/sysbuild/hci_rpmsg/prj.conf rename to samples/bluetooth/throughput/sysbuild/hci_ipc/prj.conf diff --git a/samples/cellular/gnss/src/assistance_minimal.c b/samples/cellular/gnss/src/assistance_minimal.c index 3baa3c519329..1ab9390646e7 100644 --- a/samples/cellular/gnss/src/assistance_minimal.c +++ b/samples/cellular/gnss/src/assistance_minimal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Nordic Semiconductor ASA + * Copyright (c) 2021-2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -24,11 +25,8 @@ LOG_MODULE_DECLARE(gnss_sample, CONFIG_GNSS_SAMPLE_LOG_LEVEL); #define GPS_TO_UNIX_UTC_OFFSET_SECONDS (315964800UL) /* UTC/GPS time offset as of 1st of January 2017. */ #define GPS_TO_UTC_LEAP_SECONDS (18UL) -#define SEC_PER_MIN (60UL) -#define MIN_PER_HOUR (60UL) #define SEC_PER_HOUR (MIN_PER_HOUR * SEC_PER_MIN) -#define HOURS_PER_DAY (24UL) -#define SEC_PER_DAY (HOURS_PER_DAY * SEC_PER_HOUR) +#define SEC_PER_DAY (HOUR_PER_DAY * SEC_PER_HOUR) #define DAYS_PER_WEEK (7UL) #define PLMN_STR_MAX_LEN 8 /* MCC + MNC + quotes */ diff --git a/samples/cellular/modem_shell/prj.conf b/samples/cellular/modem_shell/prj.conf index ebed58ddd778..bfddf0ab66db 100644 --- a/samples/cellular/modem_shell/prj.conf +++ b/samples/cellular/modem_shell/prj.conf @@ -34,6 +34,8 @@ CONFIG_SHELL_CMD_BUFF_SIZE=3584 CONFIG_SHELL_STACK_SIZE=9216 # Shell RX buffer needs to be increased to avoid problems with test automation CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=512 +# Use interrupt driven shell UART, otherwise we won't be able to suspend the UART +CONFIG_SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN=y # LTE shell is unnecessary with Modem Shell CONFIG_LTE_SHELL=n # Enable use of vsnprintfcb() for extending mosh_print() format diff --git a/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c b/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c index b814c3ff5a7e..969bddb37000 100644 --- a/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c +++ b/samples/cellular/modem_shell/src/drivers/nrf91_non_offloaded_dev.c @@ -11,7 +11,7 @@ #include -#include +#include #include #include #include diff --git a/samples/cellular/modem_shell/src/link/link.c b/samples/cellular/modem_shell/src/link/link.c index 3ee8e0c0864a..c5e5bc2478fc 100644 --- a/samples/cellular/modem_shell/src/link/link.c +++ b/samples/cellular/modem_shell/src/link/link.c @@ -95,7 +95,8 @@ static struct ncellmeas_data ncellmeas_param_data = { static void link_ncellmeas_worker(struct k_work *work_item) { - struct ncellmeas_data *data = CONTAINER_OF(work_item, struct ncellmeas_data, work); + struct k_work_delayable *delayable_work = k_work_delayable_from_work(work_item); + struct ncellmeas_data *data = CONTAINER_OF(delayable_work, struct ncellmeas_data, work); if (data->mode == LINK_NCELLMEAS_MODE_CONTINUOUS) { link_ncellmeas_start(true, diff --git a/samples/cellular/modem_shell/src/sock/sock.c b/samples/cellular/modem_shell/src/sock/sock.c index 7a52ba98eef1..67a9c25cd542 100644 --- a/samples/cellular/modem_shell/src/sock/sock.c +++ b/samples/cellular/modem_shell/src/sock/sock.c @@ -752,8 +752,9 @@ static int sock_send( static void data_send_work_handler(struct k_work *item) { + struct k_work_delayable *delayable_work = k_work_delayable_from_work(item); struct data_transfer_info *data_send_info_ptr = - CONTAINER_OF(item, struct data_transfer_info, work); + CONTAINER_OF(delayable_work, struct data_transfer_info, work); struct sock_info *socket_info = data_send_info_ptr->parent; int ret; diff --git a/samples/cellular/modem_shell/src/startup_cmd/startup_cmd_ctrl.c b/samples/cellular/modem_shell/src/startup_cmd/startup_cmd_ctrl.c index a6592146de09..b8cc92c01b89 100644 --- a/samples/cellular/modem_shell/src/startup_cmd/startup_cmd_ctrl.c +++ b/samples/cellular/modem_shell/src/startup_cmd/startup_cmd_ctrl.c @@ -28,8 +28,9 @@ static void startup_cmd_worker(struct k_work *work_item) { char *shell_cmd_str; int len = 0; + struct k_work_delayable *delayable_work = k_work_delayable_from_work(work_item); struct startup_cmd_worker_data *data_ptr = - CONTAINER_OF(work_item, struct startup_cmd_worker_data, work); + CONTAINER_OF(delayable_work, struct startup_cmd_worker_data, work); shell_cmd_str = startup_cmd_settings_get(data_ptr->running_mem_slot); diff --git a/samples/cellular/modem_trace_backend/Kconfig.trace_print_stats b/samples/cellular/modem_trace_backend/Kconfig.trace_print_stats index 3a570fa636a8..2d2c7ccf3caf 100644 --- a/samples/cellular/modem_trace_backend/Kconfig.trace_print_stats +++ b/samples/cellular/modem_trace_backend/Kconfig.trace_print_stats @@ -13,8 +13,7 @@ config NRF_MODEM_LIB_TRACE_BACKEND_CUSTOM bool "Count modem traces and print to terminal" depends on CPU_LOAD depends on FPU - imply NEWLIB_LIBC_FLOAT_PRINTF if NEWLIB_LIBC - imply PICOLIBC_IO_FLOAT if PICOLIBC + depends on NEWLIB_LIBC_FLOAT_PRINTF || PICOLIBC_IO_FLOAT help Print modem trace data statistics and cpu utilization. diff --git a/samples/cellular/nrf_cloud_multi_service/src/temperature.c b/samples/cellular/nrf_cloud_multi_service/src/temperature.c index f882eb8dfa48..381c7f36c913 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/temperature.c +++ b/samples/cellular/nrf_cloud_multi_service/src/temperature.c @@ -13,7 +13,7 @@ #else /* CONFIG_TEMP_DATA_USE_SENSOR */ -#include +#include #endif /* CONFIG_TEMP_DATA_USE_SENSOR */ diff --git a/samples/cellular/nrf_cloud_rest_device_message/src/main.c b/samples/cellular/nrf_cloud_rest_device_message/src/main.c index c94edf6c6e63..6fcbab719cf3 100644 --- a/samples/cellular/nrf_cloud_rest_device_message/src/main.c +++ b/samples/cellular/nrf_cloud_rest_device_message/src/main.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/samples/common/mcumgr_bt_ota_dfu/Kconfig b/samples/common/mcumgr_bt_ota_dfu/Kconfig index 3136ada4df10..4f6094e9e05b 100644 --- a/samples/common/mcumgr_bt_ota_dfu/Kconfig +++ b/samples/common/mcumgr_bt_ota_dfu/Kconfig @@ -106,7 +106,7 @@ endif # NCS_SAMPLE_MCUMGR_BT_OTA_DFU config NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP bool "MCUmgr OTA DFU speedup" - depends on BT_CTLR || (NCS_SAMPLE_HCI_RPMSG_CHILD_IMAGE || NCS_SAMPLE_MULTIPROTOCOL_RPMSG_CHILD_IMAGE) + depends on BT_CTLR || (NCS_SAMPLE_HCI_IPC_CHILD_IMAGE || NCS_SAMPLE_MULTIPROTOCOL_RPMSG_CHILD_IMAGE) help Enable this option to speed up the OTA DFU transfer over Bluetooth. This option extends the Bluetooth buffers to extend Bluetooth MTU diff --git a/samples/matter/light_bulb/CMakeLists.txt b/samples/matter/light_bulb/CMakeLists.txt index 87641ff1ee30..2df5dec5c919 100644 --- a/samples/matter/light_bulb/CMakeLists.txt +++ b/samples/matter/light_bulb/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.20.0) # Set Kconfig root files that will be processed as a first Kconfig for used child images. set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") -set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") +set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") # For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. if(CONF_FILE) diff --git a/samples/matter/light_bulb/child_image/hci_ipc/prj.conf b/samples/matter/light_bulb/child_image/hci_ipc/prj.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/light_bulb/child_image/hci_ipc/prj.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_bulb/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/light_bulb/child_image/hci_ipc/prj_no_dfu.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/light_bulb/child_image/hci_ipc/prj_no_dfu.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_bulb/child_image/hci_ipc/prj_release.conf b/samples/matter/light_bulb/child_image/hci_ipc/prj_release.conf new file mode 100644 index 000000000000..4f63d1c059a8 --- /dev/null +++ b/samples/matter/light_bulb/child_image/hci_ipc/prj_release.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/samples/matter/light_bulb/child_image/hci_rpmsg/prj.conf b/samples/matter/light_bulb/child_image/hci_rpmsg/prj.conf deleted file mode 100644 index 2783f8173696..000000000000 --- a/samples/matter/light_bulb/child_image/hci_rpmsg/prj.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_bulb/child_image/hci_rpmsg/prj_no_dfu.conf b/samples/matter/light_bulb/child_image/hci_rpmsg/prj_no_dfu.conf deleted file mode 100644 index 2783f8173696..000000000000 --- a/samples/matter/light_bulb/child_image/hci_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_bulb/child_image/hci_rpmsg/prj_release.conf b/samples/matter/light_bulb/child_image/hci_rpmsg/prj_release.conf deleted file mode 100644 index 4bc1b3129cef..000000000000 --- a/samples/matter/light_bulb/child_image/hci_rpmsg/prj_release.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/samples/matter/light_bulb/sysbuild/hci_rpmsg/prj.conf b/samples/matter/light_bulb/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/matter/light_bulb/sysbuild/hci_rpmsg/prj.conf rename to samples/matter/light_bulb/sysbuild/hci_ipc/prj.conf diff --git a/samples/matter/light_switch/CMakeLists.txt b/samples/matter/light_switch/CMakeLists.txt index 381c3477c12f..b5f3237837e5 100644 --- a/samples/matter/light_switch/CMakeLists.txt +++ b/samples/matter/light_switch/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.20.0) # Set Kconfig root files that will be processed as a first Kconfig for used child images. set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") -set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") +set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") # For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. if(CONF_FILE) diff --git a/samples/matter/light_switch/child_image/hci_ipc/prj.conf b/samples/matter/light_switch/child_image/hci_ipc/prj.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/light_switch/child_image/hci_ipc/prj.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_switch/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/light_switch/child_image/hci_ipc/prj_no_dfu.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/light_switch/child_image/hci_ipc/prj_no_dfu.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_switch/child_image/hci_ipc/prj_release.conf b/samples/matter/light_switch/child_image/hci_ipc/prj_release.conf new file mode 100644 index 000000000000..4f63d1c059a8 --- /dev/null +++ b/samples/matter/light_switch/child_image/hci_ipc/prj_release.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/samples/matter/light_switch/child_image/hci_rpmsg/prj.conf b/samples/matter/light_switch/child_image/hci_rpmsg/prj.conf deleted file mode 100644 index 2783f8173696..000000000000 --- a/samples/matter/light_switch/child_image/hci_rpmsg/prj.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_switch/child_image/hci_rpmsg/prj_no_dfu.conf b/samples/matter/light_switch/child_image/hci_rpmsg/prj_no_dfu.conf deleted file mode 100644 index 2783f8173696..000000000000 --- a/samples/matter/light_switch/child_image/hci_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_switch/child_image/hci_rpmsg/prj_release.conf b/samples/matter/light_switch/child_image/hci_rpmsg/prj_release.conf deleted file mode 100644 index 4bc1b3129cef..000000000000 --- a/samples/matter/light_switch/child_image/hci_rpmsg/prj_release.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/samples/matter/light_switch/sysbuild/hci_rpmsg/prj.conf b/samples/matter/light_switch/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/matter/light_switch/sysbuild/hci_rpmsg/prj.conf rename to samples/matter/light_switch/sysbuild/hci_ipc/prj.conf diff --git a/samples/matter/lock/CMakeLists.txt b/samples/matter/lock/CMakeLists.txt index c4ab2a29d10c..65feeec05291 100644 --- a/samples/matter/lock/CMakeLists.txt +++ b/samples/matter/lock/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.20.0) # Set Kconfig root files that will be processed as a first Kconfig for used child images. set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") -set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") +set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") # For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. if(CONF_FILE) diff --git a/samples/matter/lock/child_image/hci_ipc/prj.conf b/samples/matter/lock/child_image/hci_ipc/prj.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/lock/child_image/hci_ipc/prj.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/lock/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/lock/child_image/hci_ipc/prj_no_dfu.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/lock/child_image/hci_ipc/prj_no_dfu.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/lock/child_image/hci_ipc/prj_release.conf b/samples/matter/lock/child_image/hci_ipc/prj_release.conf new file mode 100644 index 000000000000..4f63d1c059a8 --- /dev/null +++ b/samples/matter/lock/child_image/hci_ipc/prj_release.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/samples/matter/lock/child_image/hci_ipc/prj_thread_wifi_switched.conf b/samples/matter/lock/child_image/hci_ipc/prj_thread_wifi_switched.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/lock/child_image/hci_ipc/prj_thread_wifi_switched.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/lock/child_image/hci_rpmsg/prj.conf b/samples/matter/lock/child_image/hci_rpmsg/prj.conf deleted file mode 100644 index 2783f8173696..000000000000 --- a/samples/matter/lock/child_image/hci_rpmsg/prj.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/lock/child_image/hci_rpmsg/prj_no_dfu.conf b/samples/matter/lock/child_image/hci_rpmsg/prj_no_dfu.conf deleted file mode 100644 index 2783f8173696..000000000000 --- a/samples/matter/lock/child_image/hci_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/lock/child_image/hci_rpmsg/prj_release.conf b/samples/matter/lock/child_image/hci_rpmsg/prj_release.conf deleted file mode 100644 index 4bc1b3129cef..000000000000 --- a/samples/matter/lock/child_image/hci_rpmsg/prj_release.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/samples/matter/lock/sysbuild/hci_rpmsg/prj.conf b/samples/matter/lock/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/matter/lock/sysbuild/hci_rpmsg/prj.conf rename to samples/matter/lock/sysbuild/hci_ipc/prj.conf diff --git a/samples/matter/template/CMakeLists.txt b/samples/matter/template/CMakeLists.txt index 2baaf3325da6..53c356a32c06 100644 --- a/samples/matter/template/CMakeLists.txt +++ b/samples/matter/template/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.20.0) # Set Kconfig root files that will be processed as a first Kconfig for used child images. set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") -set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") +set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") # For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. if(CONF_FILE) diff --git a/samples/matter/template/child_image/hci_ipc/prj.conf b/samples/matter/template/child_image/hci_ipc/prj.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/template/child_image/hci_ipc/prj.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/template/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/template/child_image/hci_ipc/prj_no_dfu.conf new file mode 100644 index 000000000000..d3deb11a1040 --- /dev/null +++ b/samples/matter/template/child_image/hci_ipc/prj_no_dfu.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/template/child_image/hci_ipc/prj_release.conf b/samples/matter/template/child_image/hci_ipc/prj_release.conf new file mode 100644 index 000000000000..4f63d1c059a8 --- /dev/null +++ b/samples/matter/template/child_image/hci_ipc/prj_release.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/samples/matter/template/child_image/hci_rpmsg/prj.conf b/samples/matter/template/child_image/hci_rpmsg/prj.conf deleted file mode 100644 index 2783f8173696..000000000000 --- a/samples/matter/template/child_image/hci_rpmsg/prj.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/template/child_image/hci_rpmsg/prj_no_dfu.conf b/samples/matter/template/child_image/hci_rpmsg/prj_no_dfu.conf deleted file mode 100644 index 2783f8173696..000000000000 --- a/samples/matter/template/child_image/hci_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/template/child_image/hci_rpmsg/prj_release.conf b/samples/matter/template/child_image/hci_rpmsg/prj_release.conf deleted file mode 100644 index 4bc1b3129cef..000000000000 --- a/samples/matter/template/child_image/hci_rpmsg/prj_release.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=y diff --git a/samples/matter/template/sysbuild/hci_rpmsg/prj.conf b/samples/matter/template/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/matter/template/sysbuild/hci_rpmsg/prj.conf rename to samples/matter/template/sysbuild/hci_ipc/prj.conf diff --git a/samples/matter/thermostat/CMakeLists.txt b/samples/matter/thermostat/CMakeLists.txt index 9686ac3f36f0..c14be05c4a5c 100644 --- a/samples/matter/thermostat/CMakeLists.txt +++ b/samples/matter/thermostat/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.20.0) # Set Kconfig root files that will be processed as a first Kconfig for used child images. set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") -set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") +set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") # For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. if(CONF_FILE) diff --git a/samples/matter/thermostat/child_image/hci_ipc/prj.conf b/samples/matter/thermostat/child_image/hci_ipc/prj.conf new file mode 100644 index 000000000000..f01d35078743 --- /dev/null +++ b/samples/matter/thermostat/child_image/hci_ipc/prj.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n diff --git a/samples/matter/thermostat/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/thermostat/child_image/hci_ipc/prj_no_dfu.conf new file mode 100644 index 000000000000..f01d35078743 --- /dev/null +++ b/samples/matter/thermostat/child_image/hci_ipc/prj_no_dfu.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n diff --git a/samples/matter/thermostat/child_image/hci_ipc/prj_release.conf b/samples/matter/thermostat/child_image/hci_ipc/prj_release.conf new file mode 100644 index 000000000000..f01d35078743 --- /dev/null +++ b/samples/matter/thermostat/child_image/hci_ipc/prj_release.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This target uses Kconfig.hci_ipc.defaults to set options common for all +# samples using hci_ipc. This file should contain only options specific for this sample +# hci_ipc configuration or overrides of default values. + +# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding +# in board files. + +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n diff --git a/samples/matter/thermostat/child_image/hci_rpmsg/prj.conf b/samples/matter/thermostat/child_image/hci_rpmsg/prj.conf deleted file mode 100644 index acd9d1cd8c54..000000000000 --- a/samples/matter/thermostat/child_image/hci_rpmsg/prj.conf +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n diff --git a/samples/matter/thermostat/child_image/hci_rpmsg/prj_no_dfu.conf b/samples/matter/thermostat/child_image/hci_rpmsg/prj_no_dfu.conf deleted file mode 100644 index acd9d1cd8c54..000000000000 --- a/samples/matter/thermostat/child_image/hci_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n diff --git a/samples/matter/thermostat/child_image/hci_rpmsg/prj_release.conf b/samples/matter/thermostat/child_image/hci_rpmsg/prj_release.conf deleted file mode 100644 index acd9d1cd8c54..000000000000 --- a/samples/matter/thermostat/child_image/hci_rpmsg/prj_release.conf +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_rpmsg.defaults to set options common for all -# samples using hci_rpmsg. This file should contain only options specific for this sample -# hci_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n diff --git a/samples/matter/thermostat/sysbuild/hci_rpmsg/prj.conf b/samples/matter/thermostat/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/matter/thermostat/sysbuild/hci_rpmsg/prj.conf rename to samples/matter/thermostat/sysbuild/hci_ipc/prj.conf diff --git a/samples/matter/window_covering/sysbuild/hci_rpmsg/prj.conf b/samples/matter/window_covering/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/matter/window_covering/sysbuild/hci_rpmsg/prj.conf rename to samples/matter/window_covering/sysbuild/hci_ipc/prj.conf diff --git a/samples/net/coap_client/src/main.c b/samples/net/coap_client/src/main.c index 8a2a4522b817..1233d5061026 100644 --- a/samples/net/coap_client/src/main.c +++ b/samples/net/coap_client/src/main.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include LOG_MODULE_REGISTER(coap_client_sample, CONFIG_COAP_CLIENT_SAMPLE_LOG_LEVEL); diff --git a/samples/net/mqtt/doc/description.rst b/samples/net/mqtt/doc/description.rst index ab7fced11ac1..c84691bb1289 100644 --- a/samples/net/mqtt/doc/description.rst +++ b/samples/net/mqtt/doc/description.rst @@ -262,7 +262,7 @@ Emulation ========= The sample can be run in :ref:`Native Posix ` that simplifies development and testing and removes the need for hardware. -Before you can build and run Native Posix, you need to perform the steps included in this link: :ref:`networking_with_native_posix`. +Before you can build and run Native Posix, you need to perform the steps included in this link: :ref:`networking_with_native_sim`. When the aforementioned steps are completed, you can build and run the sample by using the following commands: diff --git a/samples/net/mqtt/src/modules/transport/client_id/client_id.c b/samples/net/mqtt/src/modules/transport/client_id/client_id.c index 680acb5b716c..61c7c0eb8540 100644 --- a/samples/net/mqtt/src/modules/transport/client_id/client_id.c +++ b/samples/net/mqtt/src/modules/transport/client_id/client_id.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include #include #include #include diff --git a/samples/nrf5340/empty_app_core/README.rst b/samples/nrf5340/empty_app_core/README.rst index 9d6ebb93d545..a1fd28b87ff2 100644 --- a/samples/nrf5340/empty_app_core/README.rst +++ b/samples/nrf5340/empty_app_core/README.rst @@ -47,7 +47,7 @@ Testing To test the sample, complete the following steps: 1. Program the sample to the application core. -#. Program Zephyr's :ref:`zephyr:blinky-sample` sample to the network core. +#. Program Zephyr's :zephyr:code-sample:`blinky` sample to the network core. #. Observe the LEDs on the kit. Dependencies diff --git a/samples/nrf5340/multiprotocol_rpmsg/README.rst b/samples/nrf5340/multiprotocol_rpmsg/README.rst index 9005f8e078cf..dc5dd1f07020 100644 --- a/samples/nrf5340/multiprotocol_rpmsg/README.rst +++ b/samples/nrf5340/multiprotocol_rpmsg/README.rst @@ -25,7 +25,7 @@ The sample is compatible with the HCI RPMsg driver provided by the |NCS| Bluetoo See the following configuration options for more information: -* :kconfig:option:`CONFIG_BT_RPMSG` +* :kconfig:option:`CONFIG_BT_HCI_IPC` * :kconfig:option:`CONFIG_NRF_802154_SER_HOST` You might need to adjust the Kconfig configuration of this sample to make it compatible with the peer application. @@ -44,13 +44,13 @@ Building and running You must program this sample to the nRF5340 network core. The recommended way of building the sample is to use the multi-image feature of the build system. -In this way, the sample is built automatically as a child image when both :kconfig:option:`CONFIG_BT_RPMSG` and :kconfig:option:`CONFIG_NRF_802154_SER_HOST` are enabled. +In this way, the sample is built automatically as a child image when both :kconfig:option:`CONFIG_BT_HCI_IPC` and :kconfig:option:`CONFIG_NRF_802154_SER_HOST` are enabled. However, you can also build the sample as a stand-alone image. See :ref:`configure_application` for information about how to configure the sample. -For example, you can include the Multiprotocol RPMsg sample in a multi-image build by building the :ref:`sockets-echo-server-sample` sample for the nRF5340 application core and adding the following configuration files to your build as CMake options: +For example, you can include the Multiprotocol RPMsg sample in a multi-image build by building the :zephyr:code-sample:`sockets-echo-server` sample for the nRF5340 application core and adding the following configuration files to your build as CMake options: * :file:`overlay-802154.conf` * :file:`overlay-bt.conf` @@ -69,9 +69,9 @@ Testing ******* The testing methods for this sample depend on how it was built and programmed to the device. -For example, if you built the sample in a multi-image build containing also the :ref:`sockets-echo-server-sample` sample, you can test it as follows: +For example, if you built the sample in a multi-image build containing also the :zephyr:code-sample:`sockets-echo-server` sample, you can test it as follows: -1. Run the IEEE 802.15.4 variant of the :ref:`sockets-echo-client-sample` on a second development kit that supports IEEE 802.15.4. +1. Run the IEEE 802.15.4 variant of the :zephyr:code-sample:`sockets-echo-client` on a second development kit that supports IEEE 802.15.4. #. |connect_terminal| As the nRF5340 DK has multiple UART instances, you must identify the correct port. #. Observe that IPv6 packets are exchanged between the echo client and server over the IEEE 802.15.4 interface. diff --git a/samples/nrf5340/netboot/README.rst b/samples/nrf5340/netboot/README.rst index d315ef1a69d9..34edacd8ba8a 100644 --- a/samples/nrf5340/netboot/README.rst +++ b/samples/nrf5340/netboot/README.rst @@ -84,7 +84,7 @@ Then follow the instructions in :ref:`ug_nrf5340_building` to build and program .. note:: To try out the network core bootloader sample, use the :ref:`peripheral_uart` sample as the basis for the multi-image build. - This sample automatically includes the network core sample :ref:`bluetooth-hci-rpmsg-sample` when built for the nRF5340 DK. + This sample automatically includes the network core sample :ref:`bluetooth-hci-ipc-sample` when built for the nRF5340 DK. Then apply the options mentioned to include the network core bootloader sample with MCUboot. Testing diff --git a/samples/openthread/cli/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/openthread/cli/boards/nrf5340dk_nrf5340_cpuapp.conf index bb2ff81cc9fd..0e264879cc7c 100644 --- a/samples/openthread/cli/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/openthread/cli/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -6,5 +6,5 @@ # Default PRNG entropy for nRF53 Series devices is CSPRNG CC312 # which for that purpose is too slow yet -# Use Xoroshiro128+ as PRNG -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y +# Use Xoshiro128++ as PRNG +CONFIG_XOSHIRO_RANDOM_GENERATOR=y diff --git a/samples/openthread/coap_client/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/openthread/coap_client/boards/nrf5340dk_nrf5340_cpuapp.conf index bb2ff81cc9fd..0e264879cc7c 100644 --- a/samples/openthread/coap_client/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/openthread/coap_client/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -6,5 +6,5 @@ # Default PRNG entropy for nRF53 Series devices is CSPRNG CC312 # which for that purpose is too slow yet -# Use Xoroshiro128+ as PRNG -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y +# Use Xoshiro128++ as PRNG +CONFIG_XOSHIRO_RANDOM_GENERATOR=y diff --git a/samples/openthread/coap_client/prj.conf b/samples/openthread/coap_client/prj.conf index 214dc4a8421a..918a5a4eaf27 100644 --- a/samples/openthread/coap_client/prj.conf +++ b/samples/openthread/coap_client/prj.conf @@ -8,6 +8,7 @@ CONFIG_DK_LIBRARY=y # Enable CoAP utils and CoAP protocol +CONFIG_COAP=y CONFIG_COAP_UTILS=y # Generic networking options diff --git a/samples/openthread/coap_server/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/openthread/coap_server/boards/nrf5340dk_nrf5340_cpuapp.conf index bb2ff81cc9fd..0e264879cc7c 100644 --- a/samples/openthread/coap_server/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/openthread/coap_server/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -6,5 +6,5 @@ # Default PRNG entropy for nRF53 Series devices is CSPRNG CC312 # which for that purpose is too slow yet -# Use Xoroshiro128+ as PRNG -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y +# Use Xoshiro128++ as PRNG +CONFIG_XOSHIRO_RANDOM_GENERATOR=y diff --git a/samples/openthread/coprocessor/README.rst b/samples/openthread/coprocessor/README.rst index 1c9db4cd2f4a..101345fbd2e6 100644 --- a/samples/openthread/coprocessor/README.rst +++ b/samples/openthread/coprocessor/README.rst @@ -10,7 +10,7 @@ Thread: Co-processor The :ref:`Thread ` Co-processor sample demonstrates how to implement OpenThread's :ref:`thread_architectures_designs_cp` inside the Zephyr environment. The sample uses the :ref:`thread_architectures_designs_cp_rcp` architecture. -The sample is based on Zephyr's :ref:`zephyr:coprocessor-sample` sample. +The sample is based on Zephyr's :zephyr:code-sample:`coprocessor` sample. However, it customizes Zephyr's sample to fulfill the |NCS| requirements (for example, by increasing the stack size dedicated for the user application), and also extends it with features such as: * Increased Mbed TLS heap size. diff --git a/samples/peripheral/802154_phy_test/prj.conf b/samples/peripheral/802154_phy_test/prj.conf index 8be91e122d4f..df6e49c139aa 100644 --- a/samples/peripheral/802154_phy_test/prj.conf +++ b/samples/peripheral/802154_phy_test/prj.conf @@ -16,8 +16,8 @@ CONFIG_NRFX_POWER=y # Enable RNG CONFIG_NRFX_RNG=y -# Use XOROSHIRO PRNG -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y +# Use XOSHIRO PRNG +CONFIG_XOSHIRO_RANDOM_GENERATOR=y # Enable Timer CONFIG_NRFX_TIMER2=y diff --git a/samples/peripheral/802154_phy_test/src/periph_proc.c b/samples/peripheral/802154_phy_test/src/periph_proc.c index 6ab118ceba8e..233d7cbe7015 100644 --- a/samples/peripheral/802154_phy_test/src/periph_proc.c +++ b/samples/peripheral/802154_phy_test/src/periph_proc.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include "periph_proc.h" diff --git a/samples/peripheral/radio_test/src/radio_test.c b/samples/peripheral/radio_test/src/radio_test.c index d3dfe76affae..7dbb491618a3 100644 --- a/samples/peripheral/radio_test/src/radio_test.c +++ b/samples/peripheral/radio_test/src/radio_test.c @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include diff --git a/samples/tfm/tfm_psa_template/README.rst b/samples/tfm/tfm_psa_template/README.rst index c952e078487d..1764a10a1248 100644 --- a/samples/tfm/tfm_psa_template/README.rst +++ b/samples/tfm/tfm_psa_template/README.rst @@ -147,7 +147,7 @@ Update the ``prj.conf`` file to set the private signing key for NSIB: See :ref:`ug_fw_update_keys` for more information on how to generate and use keys for a project. The bootloader and the application can be updated using the :file:`mcumgr` command-line tool. -See :ref:`smp_svr_sample` for installation and usage instructions. +See :zephyr:code-sample:`smp-svr` for installation and usage instructions. Application and TF-M firmware update ==================================== diff --git a/samples/wifi/provisioning/child_image/hci_rpmsg.conf b/samples/wifi/provisioning/child_image/hci_ipc.conf similarity index 100% rename from samples/wifi/provisioning/child_image/hci_rpmsg.conf rename to samples/wifi/provisioning/child_image/hci_ipc.conf diff --git a/samples/wifi/provisioning/sysbuild/hci_rpmsg/prj.conf b/samples/wifi/provisioning/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/wifi/provisioning/sysbuild/hci_rpmsg/prj.conf rename to samples/wifi/provisioning/sysbuild/hci_ipc/prj.conf diff --git a/samples/wifi/sr_coex/README.rst b/samples/wifi/sr_coex/README.rst index 897e8267c47e..4aa0f4bd4bb5 100644 --- a/samples/wifi/sr_coex/README.rst +++ b/samples/wifi/sr_coex/README.rst @@ -199,7 +199,7 @@ The following are examples of the CLI commands: .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_MPSL_CX=n -Dhci_rpmsg_CONFIG_MPSL_CX=n + west build -p -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_MPSL_CX=n -Dhci_ipc_CONFIG_MPSL_CX=n Use this command for Wi-Fi throughput only, Bluetooth LE throughput only, or concurrent Wi-Fi and Bluetooth LE throughput with coexistence disabled tests. @@ -207,7 +207,7 @@ Use this command for Wi-Fi throughput only, Bluetooth LE throughput only, or con .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_MPSL_CX=y -Dhci_rpmsg_CONFIG_MPSL_CX=y + west build -p -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_MPSL_CX=y -Dhci_ipc_CONFIG_MPSL_CX=y Use this command for concurrent Wi-Fi and Bluetooth LE throughput with coexistence enabled test. @@ -231,13 +231,13 @@ Add the following SHIELD options for the nRF7002 EK and nRF7001 EK. .. code-block:: console - -DSHIELD=nrf7002ek -Dhci_rpmsg_SHIELD=nrf7002ek_coex + -DSHIELD=nrf7002ek -Dhci_ipc_SHIELD=nrf7002ek_coex * For nRF7001 EK: .. code-block:: console - -DSHIELD=nrf7002ek_nrf7001 -Dhci_rpmsg_SHIELD=nrf7002ek_nrf7001_coex + -DSHIELD=nrf7002ek_nrf7001 -Dhci_ipc_SHIELD=nrf7002ek_nrf7001_coex The generated HEX file to be used is :file:`sr_coex/build/zephyr/merged_domains.hex`. diff --git a/samples/wifi/sr_coex/child_image/hci_rpmsg.conf b/samples/wifi/sr_coex/child_image/hci_ipc.conf similarity index 100% rename from samples/wifi/sr_coex/child_image/hci_rpmsg.conf rename to samples/wifi/sr_coex/child_image/hci_ipc.conf diff --git a/samples/wifi/sr_coex/sample.yaml b/samples/wifi/sr_coex/sample.yaml index 6720afd1d948..f9453ac66631 100644 --- a/samples/wifi/sr_coex/sample.yaml +++ b/samples/wifi/sr_coex/sample.yaml @@ -7,7 +7,7 @@ tests: build_only: true integration_platforms: - nrf7002dk_nrf5340_cpuapp - extra_args: CONFIG_MPSL_CX=y hci_rpmsg_CONFIG_MPSL_CX=y + extra_args: CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y platform_allow: nrf7002dk_nrf5340_cpuapp tags: ci_build @@ -15,7 +15,7 @@ tests: build_only: true integration_platforms: - nrf7002dk_nrf5340_cpuapp - extra_args: CONFIG_MPSL_CX=y hci_rpmsg_CONFIG_MPSL_CX=y + extra_args: CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=n platform_allow: nrf7002dk_nrf5340_cpuapp tags: ci_build @@ -23,7 +23,7 @@ tests: build_only: true integration_platforms: - nrf7002dk_nrf7001_nrf5340_cpuapp - extra_args: CONFIG_MPSL_CX=y hci_rpmsg_CONFIG_MPSL_CX=y + extra_args: CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp tags: ci_build @@ -32,8 +32,8 @@ tests: build_only: true integration_platforms: - nrf5340dk_nrf5340_cpuapp - extra_args: SHIELD=nrf7002ek hci_rpmsg_SHIELD=nrf7002ek_coex - CONFIG_MPSL_CX=y hci_rpmsg_CONFIG_MPSL_CX=y + extra_args: SHIELD=nrf7002ek hci_ipc_SHIELD=nrf7002ek_coex + CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y platform_allow: nrf5340dk_nrf5340_cpuapp tags: ci_build @@ -41,14 +41,14 @@ tests: build_only: true integration_platforms: - nrf5340dk_nrf5340_cpuapp - extra_args: SHIELD=nrf7002ek_nrf7001 hci_rpmsg_SHIELD=nrf7002ek_nrf7001_coex - CONFIG_MPSL_CX=y hci_rpmsg_CONFIG_MPSL_CX=y + extra_args: SHIELD=nrf7002ek_nrf7001 hci_ipc_SHIELD=nrf7002ek_nrf7001_coex + CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y platform_allow: nrf5340dk_nrf5340_cpuapp sample.nrf7002_eb.thingy53.sr_coex: build_only: true - extra_args: SHIELD=nrf7002eb hci_rpmsg_SHIELD=nrf7002eb_coex - CONFIG_MPSL_CX=y hci_rpmsg_CONFIG_MPSL_CX=y + extra_args: SHIELD=nrf7002eb hci_ipc_SHIELD=nrf7002eb_coex + CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y integration_platforms: - thingy53_nrf5340_cpuapp diff --git a/samples/wifi/sr_coex/sysbuild/hci_rpmsg/prj.conf b/samples/wifi/sr_coex/sysbuild/hci_ipc/prj.conf similarity index 100% rename from samples/wifi/sr_coex/sysbuild/hci_rpmsg/prj.conf rename to samples/wifi/sr_coex/sysbuild/hci_ipc/prj.conf diff --git a/samples/zigbee/ncp/README.rst b/samples/zigbee/ncp/README.rst index 39df2cb19397..371019c83e82 100644 --- a/samples/zigbee/ncp/README.rst +++ b/samples/zigbee/ncp/README.rst @@ -201,7 +201,7 @@ See :ref:`mcuboot_ncs` for more information about this and other automatically g After every reset, the sample first boots to MCUboot and then, after a couple of seconds, the NCP sample is booted. When booted to MCUboot, you can upload the new image with the `dfu-util tool`_. -See the Testing section of the :ref:`USB DFU sample documentation ` for the list of required dfu-util commands. +See the Testing section of the :zephyr:code-sample:`usb-dfu` for the list of required dfu-util commands. To learn more about configuring bootloader for an application in |NCS|, see the :ref:`ug_bootloader` page. diff --git a/scripts/ci/license_allow_list.yaml b/scripts/ci/license_allow_list.yaml index 75e0f896937f..a0a420f4df73 100644 --- a/scripts/ci/license_allow_list.yaml +++ b/scripts/ci/license_allow_list.yaml @@ -43,6 +43,7 @@ Apache-2.0: | ^nrf/ext/ /src/zap-generated/ ^nrf/tests/bluetooth/tester/src/main.c$ + ^nrf/tests/bluetooth/tester/src/bttester.c$ ^nrf/subsys/nrf_security/src/legacy ^nrf/modules/trusted-firmware-m/fault.c curl: "^nrf/ext/" diff --git a/scripts/quarantine_zephyr.yaml b/scripts/quarantine_zephyr.yaml index c6d904383bb5..0855bc55693a 100644 --- a/scripts/quarantine_zephyr.yaml +++ b/scripts/quarantine_zephyr.yaml @@ -68,6 +68,10 @@ - scenarios: - sample.display.lvgl.gui + - sample.modules.lvgl.accelerometer_chart + - sample.modules.lvgl.demo_music + - sample.modules.lvgl.demo_benchmark + - sample.modules.lvgl.demo_stress platforms: - native_posix comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24924" @@ -118,9 +122,3 @@ - nrf5340dk_nrf5340_cpuapp_ns - nrf9160dk_nrf9160_ns comment: "Won't be fixed - https://nordicsemi.atlassian.net/browse/NCSDK-22771" - -- scenarios: - - zephyr_get.sysbuild - platforms: - - native_posix - comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24930" diff --git a/scripts/requirements-fixed.txt b/scripts/requirements-fixed.txt index c645312e0233..9cbe7719d096 100644 --- a/scripts/requirements-fixed.txt +++ b/scripts/requirements-fixed.txt @@ -24,7 +24,7 @@ click==8.0.3 # via -r bootloader/mcuboot/scripts/requirements.txt, cmsis-pack-manager==0.5.2 # via pyocd colorama==0.4.6 # via -r zephyr/scripts/requirements-build-test.txt, pyocd, west coverage==7.3.1 # via -r zephyr/scripts/requirements-build-test.txt -cryptography==41.0.4 # via -r bootloader/mcuboot/scripts/requirements.txt, -r nrf/scripts/requirements-build.txt, imgtool, pyjwt +cryptography==41.0.6 # via -r bootloader/mcuboot/scripts/requirements.txt, -r nrf/scripts/requirements-build.txt, imgtool, pyjwt deprecated==1.2.14 # via pygithub dill==0.3.7 # via pylint docopt==0.6.2 # via pykwalify @@ -122,7 +122,7 @@ typed-ast==1.5.5 # via -r nrf/scripts/requirements-ci.txt typing-extensions==4.8.0 # via astroid, mypy, pylint, pyocd, python-can, qrcode urllib3==2.0.7 # via requests wcwidth==0.2.6 # via prettytable -west==1.1.0 # via -r nrf/scripts/requirements-base.txt, -r zephyr/scripts/requirements-base.txt +west==1.2.0 # via -r nrf/scripts/requirements-base.txt, -r zephyr/scripts/requirements-base.txt wget==3.2 # via -r nrf/scripts/requirements-ci.txt wrapt==1.15.0 # via astroid, deprecated, python-can yamllint==1.32.0 # via -r zephyr/scripts/requirements-compliance.txt diff --git a/scripts/tools-versions-darwin.yml b/scripts/tools-versions-darwin.yml index 46f3bd7b28d4..481da4fc4dd5 100644 --- a/scripts/tools-versions-darwin.yml +++ b/scripts/tools-versions-darwin.yml @@ -11,12 +11,12 @@ gperf: dtc: version: 1.6.1 west: - version: 1.0.0 + version: 1.2.0 nanopb: version: 0.4.6 zephyr-sdk: - version: 0.16.1 - architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.1 + version: 0.16.4 + architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.4 - aarch64-zephyr-elf - x86_64-zephyr-elf - arm-zephyr-eabi diff --git a/scripts/tools-versions-linux.yml b/scripts/tools-versions-linux.yml index d29fb159c5c7..57f995ba9ce4 100644 --- a/scripts/tools-versions-linux.yml +++ b/scripts/tools-versions-linux.yml @@ -1,24 +1,24 @@ python: - version: 3.8.2 + version: 3.8.18 git: version: 2.37.3 cmake: - version: 3.20.5 + version: 3.20.6 ninja: - version: 1.9.0.post1 + version: 1.10.2 gperf: version: 3.1 dtc: - version: 1.4.7-3ubuntu2 + version: 1.5.1-1 west: - version: 1.0.0 + version: 1.2.0 gn: version: e55664a01f6ee92762210d0c01b13552f8117e11 nanopb: version: 0.4.6 zephyr-sdk: - version: 0.16.1 - architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.1 + version: 0.16.4 + architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.4 - aarch64-zephyr-elf - x86_64-zephyr-elf - arm-zephyr-eabi diff --git a/scripts/tools-versions-win10.yml b/scripts/tools-versions-win10.yml index c4569ad6031d..351177ee14fb 100644 --- a/scripts/tools-versions-win10.yml +++ b/scripts/tools-versions-win10.yml @@ -1,22 +1,22 @@ python: - version: 3.8.2 + version: 3.8.10 git: version: 2.37.3.windows.1 cmake: - version: 3.20.5 + version: 3.20.6 ninja: - version: 1.9.0 + version: 1.10.2 gperf: version: 3.1 dtc: version: 1.4.7-1 west: - version: 1.0.0 + version: 1.2.0 nanopb: version: 0.4.6 zephyr-sdk: - version: 0.16.1 - architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.1 + version: 0.16.4 + architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.4 - aarch64-zephyr-elf - x86_64-zephyr-elf - arm-zephyr-eabi diff --git a/subsys/bluetooth/gatt_dm.c b/subsys/bluetooth/gatt_dm.c index e9833121f7e2..b336f2588215 100644 --- a/subsys/bluetooth/gatt_dm.c +++ b/subsys/bluetooth/gatt_dm.c @@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(bt_gatt_dm, CONFIG_BT_GATT_DM_LOG_LEVEL); /* Available sizes: 128, 512, 2048... */ -#define CHUNK_DATA_SIZE (128 - sizeof(struct k_mem_block_id) \ +#define CHUNK_DATA_SIZE (128 - sizeof(struct k_heap *) \ - sizeof(struct data_chunk_item *)) #define DATA_ALIGN 4U diff --git a/subsys/bluetooth/mesh/gen_battery_cli.c b/subsys/bluetooth/mesh/gen_battery_cli.c index cbf56d496b80..09f15a2656dc 100644 --- a/subsys/bluetooth/mesh/gen_battery_cli.c +++ b/subsys/bluetooth/mesh/gen_battery_cli.c @@ -43,10 +43,10 @@ int bt_mesh_gen_bat_decode_status(struct net_buf_simple *buf, return 0; } -static int handle_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_battery_cli *cli = model->user_data; + struct bt_mesh_battery_cli *cli = model->rt->user_data; struct bt_mesh_battery_status status; struct bt_mesh_battery_status *rsp; int err; @@ -78,9 +78,9 @@ const struct bt_mesh_model_op _bt_mesh_battery_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_battery_cli_init(struct bt_mesh_model *model) +static int bt_mesh_battery_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_battery_cli *cli = model->user_data; + struct bt_mesh_battery_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -91,9 +91,9 @@ static int bt_mesh_battery_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_battery_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_battery_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_battery_cli *cli = model->user_data; + struct bt_mesh_battery_cli *cli = model->rt->user_data; net_buf_simple_reset(model->pub->msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/gen_battery_srv.c b/subsys/bluetooth/mesh/gen_battery_srv.c index 666a7db61ecb..1d8566ce3310 100644 --- a/subsys/bluetooth/mesh/gen_battery_srv.c +++ b/subsys/bluetooth/mesh/gen_battery_srv.c @@ -46,7 +46,7 @@ void bt_mesh_gen_bat_encode_status(struct net_buf_simple *buf, net_buf_simple_add_u8(buf, flags); } -static void rsp_status(struct bt_mesh_model *model, +static void rsp_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, const struct bt_mesh_battery_status *status) { @@ -58,10 +58,10 @@ static void rsp_status(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, + struct net_buf_simple *buf) { - struct bt_mesh_battery_srv *srv = model->user_data; + struct bt_mesh_battery_srv *srv = model->rt->user_data; struct bt_mesh_battery_status status = BATTERY_STATUS_DEFAULT; srv->get(srv, ctx, &status); @@ -80,9 +80,9 @@ const struct bt_mesh_model_op _bt_mesh_battery_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_battery_srv *srv = model->user_data; + struct bt_mesh_battery_srv *srv = model->rt->user_data; struct bt_mesh_battery_status status = BATTERY_STATUS_DEFAULT; srv->get(srv, NULL, &status); @@ -93,9 +93,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_battery_srv_init(struct bt_mesh_model *model) +static int bt_mesh_battery_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_battery_srv *srv = model->user_data; + struct bt_mesh_battery_srv *srv = model->rt->user_data; srv->model = model; srv->pub.msg = &srv->pub_buf; @@ -106,7 +106,7 @@ static int bt_mesh_battery_srv_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_battery_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_battery_srv_reset(const struct bt_mesh_model *model) { net_buf_simple_reset(model->pub->msg); } diff --git a/subsys/bluetooth/mesh/gen_dtt_cli.c b/subsys/bluetooth/mesh/gen_dtt_cli.c index 0ed0c5144b86..68a2a0d2ac63 100644 --- a/subsys/bluetooth/mesh/gen_dtt_cli.c +++ b/subsys/bluetooth/mesh/gen_dtt_cli.c @@ -7,10 +7,10 @@ #include #include "model_utils.h" -static int handle_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_dtt_cli *cli = model->user_data; + struct bt_mesh_dtt_cli *cli = model->rt->user_data; int32_t transition_time = model_transition_decode(net_buf_simple_pull_u8(buf)); int *rsp; @@ -37,9 +37,9 @@ const struct bt_mesh_model_op _bt_mesh_dtt_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_dtt_init(struct bt_mesh_model *model) +static int bt_mesh_dtt_init(const struct bt_mesh_model *model) { - struct bt_mesh_dtt_cli *cli = model->user_data; + struct bt_mesh_dtt_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -50,9 +50,9 @@ static int bt_mesh_dtt_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_dtt_reset(struct bt_mesh_model *model) +static void bt_mesh_dtt_reset(const struct bt_mesh_model *model) { - struct bt_mesh_dtt_cli *cli = model->user_data; + struct bt_mesh_dtt_cli *cli = model->rt->user_data; net_buf_simple_reset(model->pub->msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/gen_dtt_srv.c b/subsys/bluetooth/mesh/gen_dtt_srv.c index d39b69458f8b..aebef312b0cc 100644 --- a/subsys/bluetooth/mesh/gen_dtt_srv.c +++ b/subsys/bluetooth/mesh/gen_dtt_srv.c @@ -25,20 +25,20 @@ static void rsp_status(struct bt_mesh_dtt_srv *srv, (void)bt_mesh_model_send(srv->model, rx_ctx, &msg, NULL, NULL); } -static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_dtt_srv *srv = model->user_data; + struct bt_mesh_dtt_srv *srv = model->rt->user_data; rsp_status(srv, ctx); return 0; } -static int set_dtt(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf, bool ack) +static int set_dtt(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, + struct net_buf_simple *buf, bool ack) { - struct bt_mesh_dtt_srv *srv = model->user_data; + struct bt_mesh_dtt_srv *srv = model->rt->user_data; uint32_t old_time = srv->transition_time; uint32_t new_time = model_transition_decode(net_buf_simple_pull_u8(buf)); @@ -68,13 +68,13 @@ static int set_dtt(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_dtt(model, ctx, buf, true); } -static int handle_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_dtt(model, ctx, buf, false); @@ -99,17 +99,17 @@ const struct bt_mesh_model_op _bt_mesh_dtt_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_dtt_srv *srv = model->user_data; + struct bt_mesh_dtt_srv *srv = model->rt->user_data; encode_status(srv->model->pub->msg, srv->transition_time); return 0; } -static int bt_mesh_dtt_srv_init(struct bt_mesh_model *model) +static int bt_mesh_dtt_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_dtt_srv *srv = model->user_data; + struct bt_mesh_dtt_srv *srv = model->rt->user_data; srv->model = model; srv->pub.msg = &srv->pub_buf; @@ -120,9 +120,9 @@ static int bt_mesh_dtt_srv_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_dtt_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_dtt_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_dtt_srv *srv = model->user_data; + struct bt_mesh_dtt_srv *srv = model->rt->user_data; srv->transition_time = 0; @@ -134,12 +134,12 @@ static void bt_mesh_dtt_srv_reset(struct bt_mesh_model *model) } #ifdef CONFIG_BT_MESH_DTT_SRV_PERSISTENT -static int bt_mesh_dtt_srv_settings_set(struct bt_mesh_model *model, +static int bt_mesh_dtt_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_dtt_srv *srv = model->user_data; + struct bt_mesh_dtt_srv *srv = model->rt->user_data; if (name) { return -ENOENT; @@ -195,15 +195,15 @@ struct bt_mesh_dtt_srv *bt_mesh_dtt_srv_get(const struct bt_mesh_elem *elem) const struct bt_mesh_comp *comp = bt_mesh_comp_get(); uint16_t index; - index = elem->addr - comp->elem[0].addr; + index = elem->rt->addr - comp->elem[0].rt->addr; for (int i = index; i >= 0; --i) { - struct bt_mesh_elem *element = &comp->elem[i]; + const struct bt_mesh_elem *element = &comp->elem[i]; - struct bt_mesh_model *model = + const struct bt_mesh_model *model = bt_mesh_model_find(element, BT_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV); if (model) { - return (struct bt_mesh_dtt_srv *)(model->user_data); + return (struct bt_mesh_dtt_srv *)(model->rt->user_data); } }; diff --git a/subsys/bluetooth/mesh/gen_loc_cli.c b/subsys/bluetooth/mesh/gen_loc_cli.c index eb788cc4dc9b..e4e7e0efb889 100644 --- a/subsys/bluetooth/mesh/gen_loc_cli.c +++ b/subsys/bluetooth/mesh/gen_loc_cli.c @@ -8,10 +8,10 @@ #include "model_utils.h" #include "gen_loc_internal.h" -static int handle_global_loc(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_global_loc(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_loc_cli *cli = model->user_data; + struct bt_mesh_loc_cli *cli = model->rt->user_data; struct bt_mesh_loc_global loc; struct bt_mesh_loc_global *rsp; @@ -30,10 +30,10 @@ static int handle_global_loc(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int handle_local_loc(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_local_loc(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_loc_cli *cli = model->user_data; + struct bt_mesh_loc_cli *cli = model->rt->user_data; struct bt_mesh_loc_local loc; struct bt_mesh_loc_local *rsp; @@ -66,9 +66,9 @@ const struct bt_mesh_model_op _bt_mesh_loc_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_loc_init(struct bt_mesh_model *model) +static int bt_mesh_loc_init(const struct bt_mesh_model *model) { - struct bt_mesh_loc_cli *cli = model->user_data; + struct bt_mesh_loc_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -79,9 +79,9 @@ static int bt_mesh_loc_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_loc_reset(struct bt_mesh_model *model) +static void bt_mesh_loc_reset(const struct bt_mesh_model *model) { - struct bt_mesh_loc_cli *cli = model->user_data; + struct bt_mesh_loc_cli *cli = model->rt->user_data; net_buf_simple_reset(model->pub->msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/gen_loc_srv.c b/subsys/bluetooth/mesh/gen_loc_srv.c index efc1f0f4f442..7da6aa95f1ae 100644 --- a/subsys/bluetooth/mesh/gen_loc_srv.c +++ b/subsys/bluetooth/mesh/gen_loc_srv.c @@ -26,7 +26,7 @@ /* Global location */ -static void rsp_global(struct bt_mesh_model *model, +static void rsp_global(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, const struct bt_mesh_loc_global *loc) { @@ -39,10 +39,10 @@ static void rsp_global(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int handle_global_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_global_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_loc_srv *srv = model->user_data; + struct bt_mesh_loc_srv *srv = model->rt->user_data; struct bt_mesh_loc_global global = LOC_GLOBAL_DEFAULT; srv->handlers->global_get(srv, ctx, &global); @@ -52,10 +52,10 @@ static int handle_global_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int global_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int global_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_loc_srv *srv = model->user_data; + struct bt_mesh_loc_srv *srv = model->rt->user_data; struct bt_mesh_loc_global global; bt_mesh_loc_global_decode(buf, &global); @@ -72,14 +72,14 @@ static int global_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_global_set(struct bt_mesh_model *model, +static int handle_global_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return global_set(model, ctx, buf, true); } -static int handle_global_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_global_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return global_set(model, ctx, buf, false); @@ -87,7 +87,7 @@ static int handle_global_set_unack(struct bt_mesh_model *model, struct bt_mesh_m /* Local location */ -static void rsp_local(struct bt_mesh_model *model, +static void rsp_local(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, const struct bt_mesh_loc_local *loc) { @@ -100,11 +100,11 @@ static void rsp_local(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int handle_local_get(struct bt_mesh_model *model, +static int handle_local_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_loc_srv *srv = model->user_data; + struct bt_mesh_loc_srv *srv = model->rt->user_data; struct bt_mesh_loc_local local = LOC_LOCAL_DEFAULT; srv->handlers->local_get(srv, ctx, &local); @@ -114,10 +114,10 @@ static int handle_local_get(struct bt_mesh_model *model, return 0; } -static int local_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int local_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_loc_srv *srv = model->user_data; + struct bt_mesh_loc_srv *srv = model->rt->user_data; struct bt_mesh_loc_local local; bt_mesh_loc_local_decode(buf, &local); @@ -134,14 +134,14 @@ static int local_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_local_set(struct bt_mesh_model *model, +static int handle_local_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return local_set(model, ctx, buf, true); } -static int handle_local_set_unack(struct bt_mesh_model *model, +static int handle_local_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -207,9 +207,9 @@ static void local_update_handler(struct bt_mesh_loc_srv *srv) bt_mesh_loc_local_encode(srv->pub.msg, &loc); } -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_loc_srv *srv = model->user_data; + struct bt_mesh_loc_srv *srv = model->rt->user_data; if (!srv->pub_state.is_local_available && !srv->pub_state.is_global_available) { return -EINVAL; @@ -232,9 +232,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_loc_srv_init(struct bt_mesh_model *model) +static int bt_mesh_loc_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_loc_srv *srv = model->user_data; + struct bt_mesh_loc_srv *srv = model->rt->user_data; memset(&srv->pub_state, 0, sizeof(srv->pub_state)); srv->model = model; @@ -246,9 +246,9 @@ static int bt_mesh_loc_srv_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_loc_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_loc_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_loc_srv *srv = model->user_data; + struct bt_mesh_loc_srv *srv = model->rt->user_data; memset(&srv->pub_state, 0, sizeof(srv->pub_state)); net_buf_simple_reset(model->pub->msg); @@ -259,9 +259,9 @@ const struct bt_mesh_model_cb _bt_mesh_loc_srv_cb = { .reset = bt_mesh_loc_srv_reset, }; -static int bt_mesh_loc_setup_srv_init(struct bt_mesh_model *model) +static int bt_mesh_loc_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_loc_srv *srv = model->user_data; + struct bt_mesh_loc_srv *srv = model->rt->user_data; #if defined(CONFIG_BT_MESH_COMP_PAGE_1) int err = bt_mesh_model_correspond(model, srv->model); diff --git a/subsys/bluetooth/mesh/gen_lvl_cli.c b/subsys/bluetooth/mesh/gen_lvl_cli.c index 9fc72a140286..d420b15b6407 100644 --- a/subsys/bluetooth/mesh/gen_lvl_cli.c +++ b/subsys/bluetooth/mesh/gen_lvl_cli.c @@ -7,7 +7,7 @@ #include #include "model_utils.h" -static int handle_status(struct bt_mesh_model *model, +static int handle_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -16,7 +16,7 @@ static int handle_status(struct bt_mesh_model *model, return -EMSGSIZE; } - struct bt_mesh_lvl_cli *cli = model->user_data; + struct bt_mesh_lvl_cli *cli = model->rt->user_data; struct bt_mesh_lvl_status status; struct bt_mesh_lvl_status *rsp; @@ -52,9 +52,9 @@ const struct bt_mesh_model_op _bt_mesh_lvl_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_lvl_init(struct bt_mesh_model *model) +static int bt_mesh_lvl_init(const struct bt_mesh_model *model) { - struct bt_mesh_lvl_cli *cli = model->user_data; + struct bt_mesh_lvl_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -66,9 +66,9 @@ static int bt_mesh_lvl_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_lvl_reset(struct bt_mesh_model *model) +static void bt_mesh_lvl_reset(const struct bt_mesh_model *model) { - struct bt_mesh_lvl_cli *cli = model->user_data; + struct bt_mesh_lvl_cli *cli = model->rt->user_data; net_buf_simple_reset(model->pub->msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/gen_lvl_srv.c b/subsys/bluetooth/mesh/gen_lvl_srv.c index c6278841b32b..f42bc28fdd14 100644 --- a/subsys/bluetooth/mesh/gen_lvl_srv.c +++ b/subsys/bluetooth/mesh/gen_lvl_srv.c @@ -26,7 +26,7 @@ static void encode_status(const struct bt_mesh_lvl_status *status, model_transition_encode(status->remaining_time)); } -static void rsp_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static void rsp_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lvl_status *status) { BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_LVL_OP_STATUS, @@ -36,10 +36,10 @@ static void rsp_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, bt_mesh_model_send(model, ctx, &rsp, NULL, 0); } -static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; struct bt_mesh_lvl_status status = { 0 }; srv->handlers->get(srv, ctx, &status); @@ -49,15 +49,15 @@ static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf, bool ack) +static int set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, + struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_LVL_MSG_MINLEN_SET && buf->len != BT_MESH_LVL_MSG_MAXLEN_SET) { return -EMSGSIZE; } - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_lvl_status status = { 0 }; struct bt_mesh_lvl_set set; @@ -82,15 +82,15 @@ static int set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int delta_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf, bool ack) +static int delta_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, + struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_LVL_MSG_MINLEN_DELTA_SET && buf->len != BT_MESH_LVL_MSG_MAXLEN_DELTA_SET) { return -EMSGSIZE; } - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; struct bt_mesh_lvl_status status = { 0 }; struct bt_mesh_lvl_delta_set delta_set; struct bt_mesh_model_transition transition; @@ -115,15 +115,15 @@ static int delta_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int move_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf, bool ack) +static int move_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, + struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_LVL_MSG_MINLEN_MOVE_SET && buf->len != BT_MESH_LVL_MSG_MAXLEN_MOVE_SET) { return -EMSGSIZE; } - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; struct bt_mesh_lvl_status status = { 0 }; struct bt_mesh_model_transition transition; struct bt_mesh_lvl_move_set move_set; @@ -159,37 +159,37 @@ static int move_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, /* Message handlers */ -static int handle_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set(model, ctx, buf, true); } -static int handle_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set(model, ctx, buf, false); } -static int handle_delta_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_delta_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return delta_set(model, ctx, buf, true); } -static int handle_delta_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_delta_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return delta_set(model, ctx, buf, false); } -static int handle_move_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_move_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return move_set(model, ctx, buf, true); } -static int handle_move_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_move_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return move_set(model, ctx, buf, false); @@ -234,9 +234,9 @@ const struct bt_mesh_model_op _bt_mesh_lvl_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; struct bt_mesh_lvl_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -246,11 +246,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 2; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; struct bt_mesh_lvl_status status = { 0 }; struct bt_mesh_lvl_set set = { .lvl = sys_get_le16(data), @@ -261,9 +261,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], srv->handlers->set(srv, NULL, &set, &status); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; struct bt_mesh_lvl_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -279,9 +279,9 @@ BT_MESH_SCENE_ENTRY_SIG(lvl) = { .recall_complete = scene_recall_complete, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; struct bt_mesh_lvl_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -290,9 +290,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_lvl_srv_init(struct bt_mesh_model *model) +static int bt_mesh_lvl_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_lvl_srv *srv = model->user_data; + struct bt_mesh_lvl_srv *srv = model->rt->user_data; srv->model = model; srv->pub.msg = &srv->pub_buf; @@ -303,7 +303,7 @@ static int bt_mesh_lvl_srv_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_lvl_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_lvl_srv_reset(const struct bt_mesh_model *model) { net_buf_simple_reset(model->pub->msg); } diff --git a/subsys/bluetooth/mesh/gen_onoff_cli.c b/subsys/bluetooth/mesh/gen_onoff_cli.c index 7200e90908bc..683c3d28b099 100644 --- a/subsys/bluetooth/mesh/gen_onoff_cli.c +++ b/subsys/bluetooth/mesh/gen_onoff_cli.c @@ -35,7 +35,7 @@ static int decode_status(struct net_buf_simple *buf, return 0; } -static int handle_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { if (buf->len != BT_MESH_ONOFF_MSG_MINLEN_STATUS && @@ -43,7 +43,7 @@ static int handle_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ct return -EMSGSIZE; } - struct bt_mesh_onoff_cli *cli = model->user_data; + struct bt_mesh_onoff_cli *cli = model->rt->user_data; struct bt_mesh_onoff_status status; struct bt_mesh_onoff_status *rsp; int err; @@ -75,9 +75,9 @@ const struct bt_mesh_model_op _bt_mesh_onoff_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_onoff_cli_init(struct bt_mesh_model *model) +static int bt_mesh_onoff_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_onoff_cli *cli = model->user_data; + struct bt_mesh_onoff_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -88,9 +88,9 @@ static int bt_mesh_onoff_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_onoff_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_onoff_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_onoff_cli *cli = model->user_data; + struct bt_mesh_onoff_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/gen_onoff_srv.c b/subsys/bluetooth/mesh/gen_onoff_srv.c index 5032af36814a..d76d820761af 100644 --- a/subsys/bluetooth/mesh/gen_onoff_srv.c +++ b/subsys/bluetooth/mesh/gen_onoff_srv.c @@ -23,7 +23,7 @@ static void encode_status(struct net_buf_simple *buf, } } -static void rsp_status(struct bt_mesh_model *model, +static void rsp_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, const struct bt_mesh_onoff_status *status) { @@ -34,10 +34,10 @@ static void rsp_status(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_onoff_srv *srv = model->user_data; + struct bt_mesh_onoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; srv->handlers->get(srv, ctx, &status); @@ -47,7 +47,7 @@ static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int onoff_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int onoff_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_ONOFF_MSG_MINLEN_SET && @@ -55,7 +55,7 @@ static int onoff_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return -EMSGSIZE; } - struct bt_mesh_onoff_srv *srv = model->user_data; + struct bt_mesh_onoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; struct bt_mesh_model_transition transition; struct bt_mesh_onoff_set set; @@ -103,13 +103,13 @@ static int onoff_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return onoff_set(model, ctx, buf, true); } -static int handle_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return onoff_set(model, ctx, buf, false); @@ -135,9 +135,9 @@ const struct bt_mesh_model_op _bt_mesh_onoff_srv_op[] = { }; /* .. include_startingpoint_scene_srv_rst_1 */ -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_onoff_srv *srv = model->user_data; + struct bt_mesh_onoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; /* Only store the next stable on_off state: */ @@ -148,10 +148,10 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 1; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_onoff_srv *srv = model->user_data; + struct bt_mesh_onoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; struct bt_mesh_onoff_set set = { .on_off = data[0], @@ -161,9 +161,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], srv->handlers->set(srv, NULL, &set, &status); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_onoff_srv *srv = model->user_data; + struct bt_mesh_onoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -180,9 +180,9 @@ BT_MESH_SCENE_ENTRY_SIG(onoff) = { }; /* .. include_endpoint_scene_srv_rst_1 */ -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_onoff_srv *srv = model->user_data; + struct bt_mesh_onoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -191,9 +191,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_onoff_srv_init(struct bt_mesh_model *model) +static int bt_mesh_onoff_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_onoff_srv *srv = model->user_data; + struct bt_mesh_onoff_srv *srv = model->rt->user_data; srv->model = model; srv->pub.msg = &srv->pub_buf; @@ -204,7 +204,7 @@ static int bt_mesh_onoff_srv_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_onoff_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_onoff_srv_reset(const struct bt_mesh_model *model) { net_buf_simple_reset(model->pub->msg); } diff --git a/subsys/bluetooth/mesh/gen_plvl_cli.c b/subsys/bluetooth/mesh/gen_plvl_cli.c index 06fd45aa4936..db277550787d 100644 --- a/subsys/bluetooth/mesh/gen_plvl_cli.c +++ b/subsys/bluetooth/mesh/gen_plvl_cli.c @@ -6,7 +6,7 @@ #include #include "model_utils.h" -static int handle_power_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_power_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { if (buf->len != BT_MESH_PLVL_MSG_MINLEN_LEVEL_STATUS && @@ -14,7 +14,7 @@ static int handle_power_status(struct bt_mesh_model *model, struct bt_mesh_msg_c return -EMSGSIZE; } - struct bt_mesh_plvl_cli *cli = model->user_data; + struct bt_mesh_plvl_cli *cli = model->rt->user_data; struct bt_mesh_plvl_status status; struct bt_mesh_plvl_status *rsp; @@ -41,10 +41,10 @@ static int handle_power_status(struct bt_mesh_model *model, struct bt_mesh_msg_c return 0; } -static int handle_last_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_last_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_plvl_cli *cli = model->user_data; + struct bt_mesh_plvl_cli *cli = model->rt->user_data; uint16_t last = net_buf_simple_pull_le16(buf); uint16_t *rsp; @@ -61,10 +61,10 @@ static int handle_last_status(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_plvl_cli *cli = model->user_data; + struct bt_mesh_plvl_cli *cli = model->rt->user_data; uint16_t default_lvl = net_buf_simple_pull_le16(buf); uint16_t *rsp; @@ -81,10 +81,10 @@ static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg return 0; } -static int handle_range_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_plvl_cli *cli = model->user_data; + struct bt_mesh_plvl_cli *cli = model->rt->user_data; struct bt_mesh_plvl_range_status status; struct bt_mesh_plvl_range_status *rsp; @@ -129,9 +129,9 @@ const struct bt_mesh_model_op _bt_mesh_plvl_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_lvl_cli_init(struct bt_mesh_model *model) +static int bt_mesh_lvl_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_cli *cli = model->user_data; + struct bt_mesh_plvl_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -142,9 +142,9 @@ static int bt_mesh_lvl_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_lvl_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_lvl_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_cli *cli = model->user_data; + struct bt_mesh_plvl_cli *cli = model->rt->user_data; net_buf_simple_reset(model->pub->msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/gen_plvl_srv.c b/subsys/bluetooth/mesh/gen_plvl_srv.c index afb8ef674bc5..2dbff8d4b9a9 100644 --- a/subsys/bluetooth/mesh/gen_plvl_srv.c +++ b/subsys/bluetooth/mesh/gen_plvl_srv.c @@ -26,9 +26,9 @@ struct bt_mesh_plvl_srv_settings_data { } __packed; #if CONFIG_BT_SETTINGS -static void bt_mesh_plvl_srv_pending_store(struct bt_mesh_model *model) +static void bt_mesh_plvl_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_srv_settings_data data = { .default_power = srv->default_power, @@ -100,7 +100,7 @@ static int pub(struct bt_mesh_plvl_srv *srv, struct bt_mesh_msg_ctx *ctx, return bt_mesh_msg_send(srv->plvl_model, ctx, &msg); } -static void rsp_plvl_status(struct bt_mesh_model *model, +static void rsp_plvl_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_plvl_status *status) { @@ -111,10 +111,10 @@ static void rsp_plvl_status(struct bt_mesh_model *model, bt_mesh_model_send(model, ctx, &rsp, NULL, NULL); } -static int handle_lvl_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_lvl_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_status status = { 0 }; srv->handlers->power_get(srv, ctx, &status); @@ -150,7 +150,7 @@ static int change_lvl(struct bt_mesh_plvl_srv *srv, return 0; } -static int plvl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int plvl_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_PLVL_MSG_MINLEN_LEVEL_SET && @@ -158,7 +158,7 @@ static int plvl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return -EMSGSIZE; } - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_plvl_status status; struct bt_mesh_plvl_set set; @@ -186,22 +186,22 @@ static int plvl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_plvl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_plvl_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return plvl_set(model, ctx, buf, true); } -static int handle_plvl_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_plvl_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return plvl_set(model, ctx, buf, false); } -static int handle_last_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_last_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_PLVL_OP_LAST_STATUS, BT_MESH_PLVL_MSG_LEN_LAST_STATUS); @@ -213,10 +213,10 @@ static int handle_last_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_default_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_PLVL_OP_DEFAULT_STATUS, BT_MESH_PLVL_MSG_LEN_DEFAULT_STATUS); @@ -228,10 +228,10 @@ static int handle_default_get(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int set_default(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int set_default(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; uint16_t new = net_buf_simple_pull_le16(buf); if (new != srv->default_power) { @@ -259,22 +259,22 @@ static int set_default(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_default_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_default(model, ctx, buf, true); } -static int handle_default_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_default(model, ctx, buf, false); } -static int handle_range_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_PLVL_OP_RANGE_STATUS, BT_MESH_PLVL_MSG_LEN_RANGE_STATUS); @@ -289,10 +289,10 @@ static int handle_range_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int set_range(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int set_range(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_range new; new.min = net_buf_simple_pull_le16(buf); @@ -334,13 +334,13 @@ static int set_range(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_range_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_range(model, ctx, buf, true); } -static int handle_range_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_range(model, ctx, buf, false); @@ -593,9 +593,9 @@ const struct bt_mesh_onoff_srv_handlers bt_mesh_plvl_srv_onoff_handlers = { .get = onoff_get, }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_status status = { 0 }; srv->handlers->power_get(srv, NULL, &status); @@ -604,11 +604,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 2; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_status status = { 0 }; struct bt_mesh_plvl_set set = { .power_lvl = sys_get_le16(data), @@ -618,9 +618,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], change_lvl(srv, NULL, &set, &status); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_status status = { 0 }; srv->handlers->power_get(srv, NULL, &status); @@ -652,9 +652,9 @@ static void plvl_srv_reset(struct bt_mesh_plvl_srv *srv) srv->transient.is_on = false; } -static void bt_mesh_plvl_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_plvl_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; plvl_srv_reset(srv); net_buf_simple_reset(model->pub->msg); @@ -664,9 +664,9 @@ static void bt_mesh_plvl_srv_reset(struct bt_mesh_model *model) } } -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_status status = { 0 }; srv->handlers->power_get(srv, NULL, &status); @@ -674,9 +674,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_plvl_srv_init(struct bt_mesh_model *model) +static int bt_mesh_plvl_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; int err; srv->plvl_model = model; @@ -706,11 +706,11 @@ static int bt_mesh_plvl_srv_init(struct bt_mesh_model *model) } #ifdef CONFIG_BT_SETTINGS -static int bt_mesh_plvl_srv_settings_set(struct bt_mesh_model *model, +static int bt_mesh_plvl_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_srv_settings_data data; if (name) { @@ -731,9 +731,9 @@ static int bt_mesh_plvl_srv_settings_set(struct bt_mesh_model *model, return 0; } -static int bt_mesh_plvl_srv_start(struct bt_mesh_model *model) +static int bt_mesh_plvl_srv_start(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; struct bt_mesh_plvl_status status = { 0 }; struct bt_mesh_model_transition transition = { .time = srv->ponoff.dtt.transition_time, @@ -771,9 +771,9 @@ const struct bt_mesh_model_cb _bt_mesh_plvl_srv_cb = { #endif }; -static int bt_mesh_plvl_setup_srv_init(struct bt_mesh_model *model) +static int bt_mesh_plvl_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_plvl_srv *srv = model->user_data; + struct bt_mesh_plvl_srv *srv = model->rt->user_data; int err; srv->plvl_setup_model = model; diff --git a/subsys/bluetooth/mesh/gen_ponoff_cli.c b/subsys/bluetooth/mesh/gen_ponoff_cli.c index b9127859a739..147f52a15063 100644 --- a/subsys/bluetooth/mesh/gen_ponoff_cli.c +++ b/subsys/bluetooth/mesh/gen_ponoff_cli.c @@ -7,10 +7,10 @@ #include #include "model_utils.h" -static int handle_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_ponoff_cli *cli = model->user_data; + struct bt_mesh_ponoff_cli *cli = model->rt->user_data; enum bt_mesh_on_power_up on_power_up = net_buf_simple_pull_u8(buf); enum bt_mesh_on_power_up *rsp; @@ -41,9 +41,9 @@ const struct bt_mesh_model_op _bt_mesh_ponoff_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_ponoff_cli_init(struct bt_mesh_model *model) +static int bt_mesh_ponoff_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_ponoff_cli *cli = model->user_data; + struct bt_mesh_ponoff_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -54,9 +54,9 @@ static int bt_mesh_ponoff_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_ponoff_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_ponoff_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_ponoff_cli *cli = model->user_data; + struct bt_mesh_ponoff_cli *cli = model->rt->user_data; net_buf_simple_reset(model->pub->msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/gen_ponoff_srv.c b/subsys/bluetooth/mesh/gen_ponoff_srv.c index 21fa4b297da3..98db528cf303 100644 --- a/subsys/bluetooth/mesh/gen_ponoff_srv.c +++ b/subsys/bluetooth/mesh/gen_ponoff_srv.c @@ -61,11 +61,11 @@ static int store_data(struct bt_mesh_ponoff_srv *srv, } -static void bt_mesh_ponoff_srv_pending_store(struct bt_mesh_model *model) +static void bt_mesh_ponoff_srv_pending_store(const struct bt_mesh_model *model) { int err; - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status onoff_status = {0}; @@ -88,10 +88,10 @@ static void store_state(struct bt_mesh_ponoff_srv *srv) #endif } -static void send_rsp(struct bt_mesh_model *model, +static void send_rsp(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_PONOFF_OP_STATUS, BT_MESH_PONOFF_MSG_LEN_STATUS); @@ -100,7 +100,7 @@ static void send_rsp(struct bt_mesh_model *model, bt_mesh_model_send(model, ctx, &msg, NULL, NULL); } -static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { send_rsp(model, ctx); @@ -131,10 +131,10 @@ static void set_on_power_up(struct bt_mesh_ponoff_srv *srv, store_state(srv); } -static int handle_set_msg(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set_msg(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; enum bt_mesh_on_power_up new = net_buf_simple_pull_u8(buf); if (new >= BT_MESH_ON_POWER_UP_INVALID) { @@ -152,13 +152,13 @@ static int handle_set_msg(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *c return 0; } -static int handle_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return handle_set_msg(model, ctx, buf, true); } -static int handle_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return handle_set_msg(model, ctx, buf, false); @@ -219,9 +219,9 @@ const struct bt_mesh_onoff_srv_handlers _bt_mesh_ponoff_onoff_intercept = { .get = onoff_intercept_get, }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; /* Only store the next stable on_off state: */ @@ -232,10 +232,10 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 1; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; struct bt_mesh_onoff_set set = { .on_off = data[0], @@ -245,9 +245,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], srv->onoff_handlers->set(&srv->onoff, NULL, &set, &status); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status status = { 0 }; srv->onoff_handlers->get(&srv->onoff, NULL, &status); @@ -270,9 +270,9 @@ BT_MESH_SCENE_ENTRY_SIG(ponoff) = { .recall_complete = scene_recall_complete, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; bt_mesh_model_msg_init(srv->ponoff_model->pub->msg, BT_MESH_PONOFF_OP_STATUS); @@ -280,9 +280,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_ponoff_srv_init(struct bt_mesh_model *model) +static int bt_mesh_ponoff_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; srv->ponoff_model = model; srv->pub.msg = &srv->pub_buf; @@ -293,9 +293,9 @@ static int bt_mesh_ponoff_srv_init(struct bt_mesh_model *model) return bt_mesh_model_extend(model, srv->onoff.model); } -static void bt_mesh_ponoff_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_ponoff_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; srv->on_power_up = BT_MESH_ON_POWER_UP_OFF; net_buf_simple_reset(srv->pub.msg); @@ -306,13 +306,13 @@ static void bt_mesh_ponoff_srv_reset(struct bt_mesh_model *model) } #ifdef CONFIG_BT_SETTINGS -static int bt_mesh_ponoff_srv_settings_set(struct bt_mesh_model *model, +static int bt_mesh_ponoff_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; struct bt_mesh_onoff_status dummy; struct ponoff_settings_data data; ssize_t size = MIN(len_rd, sizeof(data)); @@ -366,9 +366,9 @@ const struct bt_mesh_model_cb _bt_mesh_ponoff_srv_cb = { #endif }; -static int bt_mesh_ponoff_setup_srv_init(struct bt_mesh_model *model) +static int bt_mesh_ponoff_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_ponoff_srv *srv = model->user_data; + struct bt_mesh_ponoff_srv *srv = model->rt->user_data; int err; srv->ponoff_setup_model = model; diff --git a/subsys/bluetooth/mesh/gen_prop_cli.c b/subsys/bluetooth/mesh/gen_prop_cli.c index 9b8d37e285e1..b9f47191d08d 100644 --- a/subsys/bluetooth/mesh/gen_prop_cli.c +++ b/subsys/bluetooth/mesh/gen_prop_cli.c @@ -22,7 +22,7 @@ struct prop_list_ctx { int status; }; -static int properties_status(struct bt_mesh_model *model, +static int properties_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, enum bt_mesh_prop_srv_kind kind) @@ -31,7 +31,7 @@ static int properties_status(struct bt_mesh_model *model, return -EMSGSIZE; } - struct bt_mesh_prop_cli *cli = model->user_data; + struct bt_mesh_prop_cli *cli = model->rt->user_data; struct bt_mesh_prop_list list; struct prop_list_ctx *rsp; @@ -58,31 +58,31 @@ static int properties_status(struct bt_mesh_model *model, return 0; } -static int handle_mfr_properties_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_mfr_properties_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return properties_status(model, ctx, buf, BT_MESH_PROP_SRV_KIND_MFR); } -static int handle_admin_properties_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_admin_properties_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return properties_status(model, ctx, buf, BT_MESH_PROP_SRV_KIND_ADMIN); } -static int handle_user_properties_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_user_properties_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return properties_status(model, ctx, buf, BT_MESH_PROP_SRV_KIND_USER); } -static int handle_client_properties_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_client_properties_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return properties_status(model, ctx, buf, BT_MESH_PROP_SRV_KIND_CLIENT); } -static int property_status(struct bt_mesh_model *model, +static int property_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, enum bt_mesh_prop_srv_kind kind) @@ -92,7 +92,7 @@ static int property_status(struct bt_mesh_model *model, return -EMSGSIZE; } - struct bt_mesh_prop_cli *cli = model->user_data; + struct bt_mesh_prop_cli *cli = model->rt->user_data; struct bt_mesh_prop_val val; struct bt_mesh_prop_val *rsp; @@ -116,20 +116,20 @@ static int property_status(struct bt_mesh_model *model, return 0; } -static int handle_mfr_property_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_mfr_property_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return property_status(model, ctx, buf, BT_MESH_PROP_SRV_KIND_MFR); } -static int handle_admin_property_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_admin_property_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return property_status(model, ctx, buf, BT_MESH_PROP_SRV_KIND_ADMIN); } -static int handle_user_property_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_user_property_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return property_status(model, ctx, buf, BT_MESH_PROP_SRV_KIND_USER); } @@ -173,9 +173,9 @@ const struct bt_mesh_model_op _bt_mesh_prop_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_prop_cli_init(struct bt_mesh_model *model) +static int bt_mesh_prop_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_prop_cli *cli = model->user_data; + struct bt_mesh_prop_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -186,9 +186,9 @@ static int bt_mesh_prop_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_prop_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_prop_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_prop_cli *cli = model->user_data; + struct bt_mesh_prop_cli *cli = model->rt->user_data; net_buf_simple_reset(model->pub->msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/gen_prop_srv.c b/subsys/bluetooth/mesh/gen_prop_srv.c index 204259886361..9c90c50f769d 100644 --- a/subsys/bluetooth/mesh/gen_prop_srv.c +++ b/subsys/bluetooth/mesh/gen_prop_srv.c @@ -51,9 +51,9 @@ static struct bt_mesh_prop *prop_get(const struct bt_mesh_prop_srv *srv, } #if CONFIG_BT_SETTINGS -static void bt_mesh_prop_srv_pending_store(struct bt_mesh_model *model) +static void bt_mesh_prop_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_prop_srv *srv = model->user_data; + struct bt_mesh_prop_srv *srv = model->rt->user_data; uint8_t user_access[CONFIG_BT_MESH_PROP_MAXCOUNT]; @@ -110,22 +110,24 @@ static void pub_list_build(const struct bt_mesh_prop_srv *srv, /* Owner properties */ -static int handle_owner_properties_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_owner_properties_get(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_PROP_OP_ADMIN_PROPS_STATUS, BT_MESH_PROP_MSG_MAXLEN_PROPS_STATUS); - pub_list_build(model->user_data, &rsp, 1); + pub_list_build(model->rt->user_data, &rsp, 1); bt_mesh_model_send(model, ctx, &rsp, NULL, NULL); return 0; } -static int handle_owner_property_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_owner_property_get(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_prop_srv *srv = model->user_data; + struct bt_mesh_prop_srv *srv = model->rt->user_data; uint16_t id = net_buf_simple_pull_le16(buf); if (id == BT_MESH_PROP_ID_PROHIBITED) { @@ -166,7 +168,7 @@ static int handle_owner_property_get(struct bt_mesh_model *model, struct bt_mesh return 0; } -static int owner_property_set(struct bt_mesh_model *model, +static int owner_property_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { @@ -176,7 +178,7 @@ static int owner_property_set(struct bt_mesh_model *model, return -EMSGSIZE; } - struct bt_mesh_prop_srv *srv = model->user_data; + struct bt_mesh_prop_srv *srv = model->rt->user_data; uint16_t id = net_buf_simple_pull_le16(buf); enum bt_mesh_prop_access user_access = net_buf_simple_pull_u8(buf); @@ -245,13 +247,15 @@ static int owner_property_set(struct bt_mesh_model *model, return 0; } -static int handle_owner_property_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_owner_property_set(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return owner_property_set(model, ctx, buf, true); } -static int handle_owner_property_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_owner_property_set_unack(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return owner_property_set(model, ctx, buf, false); @@ -305,7 +309,8 @@ const struct bt_mesh_model_op _bt_mesh_prop_mfr_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static int handle_client_properties_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_client_properties_get(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { uint16_t start_prop = net_buf_simple_pull_le16(buf); @@ -317,7 +322,7 @@ static int handle_client_properties_get(struct bt_mesh_model *model, struct bt_m BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_PROP_OP_CLIENT_PROPS_STATUS, BT_MESH_PROP_MSG_MAXLEN_PROPS_STATUS); - pub_list_build(model->user_data, &rsp, start_prop); + pub_list_build(model->rt->user_data, &rsp, start_prop); bt_mesh_model_send(model, ctx, &rsp, NULL, NULL); return 0; @@ -334,16 +339,16 @@ const struct bt_mesh_model_op _bt_mesh_prop_client_srv_op[] = { /* User properties */ -static struct bt_mesh_prop_srv *prop_srv_get(struct bt_mesh_model *user_srv_mod, +static struct bt_mesh_prop_srv *prop_srv_get(const struct bt_mesh_model *user_srv_mod, uint16_t model_id) { - struct bt_mesh_model *model = + const struct bt_mesh_model *model = bt_mesh_model_find(bt_mesh_model_elem(user_srv_mod), model_id); - return model ? model->user_data : NULL; + return model ? model->rt->user_data : NULL; } -static struct bt_mesh_prop *user_prop_get(struct bt_mesh_model *model, uint16_t id, +static struct bt_mesh_prop *user_prop_get(const struct bt_mesh_model *model, uint16_t id, struct bt_mesh_prop_srv **srv) { struct bt_mesh_prop_srv *const srvs[] = { @@ -365,7 +370,8 @@ static struct bt_mesh_prop *user_prop_get(struct bt_mesh_model *model, uint16_t return NULL; } -static int handle_user_properties_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_user_properties_get(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_PROP_OP_PROPS_STATUS, @@ -405,7 +411,7 @@ static int handle_user_properties_get(struct bt_mesh_model *model, struct bt_mes return 0; } -static int handle_user_property_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_user_property_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { uint16_t id = net_buf_simple_pull_le16(buf); @@ -450,7 +456,7 @@ static int handle_user_property_get(struct bt_mesh_model *model, struct bt_mesh_ return 0; } -static int user_property_set(struct bt_mesh_model *model, +static int user_property_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { @@ -471,7 +477,7 @@ static int user_property_set(struct bt_mesh_model *model, return -EINVAL; } - struct bt_mesh_prop_srv *user_srv = model->user_data; + struct bt_mesh_prop_srv *user_srv = model->rt->user_data; struct bt_mesh_prop_srv *owner_srv; struct bt_mesh_prop *prop = user_prop_get(model, id, &owner_srv); @@ -520,13 +526,14 @@ static int user_property_set(struct bt_mesh_model *model, return 0; } -static int handle_user_property_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_user_property_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return user_property_set(model, ctx, buf, true); } -static int handle_user_property_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_user_property_set_unack(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return user_property_set(model, ctx, buf, false); @@ -556,9 +563,9 @@ const struct bt_mesh_model_op _bt_mesh_prop_user_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_prop_srv *srv = model->user_data; + struct bt_mesh_prop_srv *srv = model->rt->user_data; struct bt_mesh_prop_val value; struct bt_mesh_prop *prop; @@ -593,9 +600,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_prop_srv_init(struct bt_mesh_model *model) +static int bt_mesh_prop_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_prop_srv *srv = model->user_data; + struct bt_mesh_prop_srv *srv = model->rt->user_data; srv->model = model; srv->pub.msg = &srv->pub_buf; @@ -621,7 +628,7 @@ static int bt_mesh_prop_srv_init(struct bt_mesh_model *model) if ((model->id == BT_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV || model->id == BT_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV)) { int err; - struct bt_mesh_model *usr_prop_srv = bt_mesh_model_find( + const struct bt_mesh_model *usr_prop_srv = bt_mesh_model_find( bt_mesh_model_elem(model), BT_MESH_MODEL_ID_GEN_USER_PROP_SRV); if (!usr_prop_srv) { @@ -647,9 +654,9 @@ static int bt_mesh_prop_srv_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_prop_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_prop_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_prop_srv *srv = model->user_data; + struct bt_mesh_prop_srv *srv = model->rt->user_data; net_buf_simple_reset(srv->pub.msg); @@ -659,11 +666,11 @@ static void bt_mesh_prop_srv_reset(struct bt_mesh_model *model) } #ifdef CONFIG_BT_SETTINGS -static int bt_mesh_prop_srv_settings_set(struct bt_mesh_model *model, +static int bt_mesh_prop_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_prop_srv *srv = model->user_data; + struct bt_mesh_prop_srv *srv = model->rt->user_data; uint8_t entries[CONFIG_BT_MESH_PROP_MAXCOUNT]; ssize_t size = MIN(sizeof(entries), len_rd); diff --git a/subsys/bluetooth/mesh/hci_rpmsg_child_image_overlay.conf b/subsys/bluetooth/mesh/hci_ipc_child_image_overlay.conf similarity index 100% rename from subsys/bluetooth/mesh/hci_rpmsg_child_image_overlay.conf rename to subsys/bluetooth/mesh/hci_ipc_child_image_overlay.conf diff --git a/subsys/bluetooth/mesh/light_ctl_cli.c b/subsys/bluetooth/mesh/light_ctl_cli.c index 9f5f38f3b8fd..2fade9f89a7b 100644 --- a/subsys/bluetooth/mesh/light_ctl_cli.c +++ b/subsys/bluetooth/mesh/light_ctl_cli.c @@ -7,7 +7,7 @@ #include #include "model_utils.h" -static int handle_ctl_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_ctl_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { if (buf->len != BT_MESH_LIGHT_CTL_MSG_MINLEN_STATUS && @@ -15,7 +15,7 @@ static int handle_ctl_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return -EMSGSIZE; } - struct bt_mesh_light_ctl_cli *cli = model->user_data; + struct bt_mesh_light_ctl_cli *cli = model->rt->user_data; struct bt_mesh_light_ctl_status status; struct bt_mesh_light_ctl_status *rsp; @@ -55,10 +55,10 @@ static int handle_ctl_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int handle_temp_range_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_temp_range_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctl_cli *cli = model->user_data; + struct bt_mesh_light_ctl_cli *cli = model->rt->user_data; struct bt_mesh_light_temp_range_status status; struct bt_mesh_light_temp_range_status *rsp; @@ -79,7 +79,7 @@ static int handle_temp_range_status(struct bt_mesh_model *model, struct bt_mesh_ return 0; } -static int handle_temp_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_temp_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { if (buf->len != BT_MESH_LIGHT_CTL_MSG_MINLEN_TEMP_STATUS && @@ -87,7 +87,7 @@ static int handle_temp_status(struct bt_mesh_model *model, struct bt_mesh_msg_ct return -EMSGSIZE; } - struct bt_mesh_light_ctl_cli *cli = model->user_data; + struct bt_mesh_light_ctl_cli *cli = model->rt->user_data; struct bt_mesh_light_temp_status status; struct bt_mesh_light_temp_status *rsp; @@ -128,10 +128,10 @@ static int handle_temp_status(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctl_cli *cli = model->user_data; + struct bt_mesh_light_ctl_cli *cli = model->rt->user_data; struct bt_mesh_light_ctl status; struct bt_mesh_light_ctl *rsp; @@ -181,9 +181,9 @@ const struct bt_mesh_model_op _bt_mesh_light_ctl_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_light_ctl_cli_init(struct bt_mesh_model *model) +static int bt_mesh_light_ctl_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctl_cli *cli = model->user_data; + struct bt_mesh_light_ctl_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -194,9 +194,9 @@ static int bt_mesh_light_ctl_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_light_ctl_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_light_ctl_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctl_cli *cli = model->user_data; + struct bt_mesh_light_ctl_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/light_ctl_srv.c b/subsys/bluetooth/mesh/light_ctl_srv.c index cd8c1345487a..215fae1a6f26 100644 --- a/subsys/bluetooth/mesh/light_ctl_srv.c +++ b/subsys/bluetooth/mesh/light_ctl_srv.c @@ -49,7 +49,7 @@ static void ctl_get(struct bt_mesh_light_ctl_srv *srv, status->remaining_time = MAX(temp.remaining_time, light.remaining_time); } -static int ctl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int ctl_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_LIGHT_CTL_MSG_MINLEN_SET && @@ -57,7 +57,7 @@ static int ctl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return -EMSGSIZE; } - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_lightness_status light_rsp; struct bt_mesh_light_temp_status temp_rsp; @@ -116,10 +116,10 @@ static int ctl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_ctl_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_ctl_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; struct bt_mesh_light_ctl_status status = { 0 }; ctl_get(srv, ctx, &status); @@ -128,13 +128,13 @@ static int handle_ctl_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *c return 0; } -static int handle_ctl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_ctl_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return ctl_set(model, ctx, buf, true); } -static int handle_ctl_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_ctl_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return ctl_set(model, ctx, buf, false); @@ -150,11 +150,11 @@ static void range_encode_status(struct net_buf_simple *buf, net_buf_simple_add_le16(buf, srv->temp_srv.range.max); } -static void temp_range_rsp(struct bt_mesh_model *model, +static void temp_range_rsp(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, enum bt_mesh_model_status status) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_LIGHT_TEMP_RANGE_STATUS, BT_MESH_LIGHT_CTL_MSG_LEN_TEMP_RANGE_STATUS); @@ -165,11 +165,11 @@ static void temp_range_rsp(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static enum bt_mesh_model_status temp_range_set(struct bt_mesh_model *model, +static enum bt_mesh_model_status temp_range_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; struct bt_mesh_light_temp_range temp = { .min = net_buf_simple_pull_le16(buf), .max = net_buf_simple_pull_le16(buf), @@ -186,7 +186,7 @@ static enum bt_mesh_model_status temp_range_set(struct bt_mesh_model *model, return BT_MESH_MODEL_SUCCESS; } -static int handle_temp_range_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_temp_range_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { temp_range_rsp(model, ctx, BT_MESH_MODEL_SUCCESS); @@ -194,7 +194,7 @@ static int handle_temp_range_get(struct bt_mesh_model *model, struct bt_mesh_msg return 0; } -static int handle_temp_range_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_temp_range_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { temp_range_rsp(model, ctx, temp_range_set(model, ctx, buf)); @@ -202,8 +202,8 @@ static int handle_temp_range_set(struct bt_mesh_model *model, struct bt_mesh_msg return 0; } -static int handle_temp_range_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_temp_range_set_unack(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { temp_range_set(model, ctx, buf); @@ -219,10 +219,10 @@ static void default_encode_status(struct net_buf_simple *buf, net_buf_simple_add_le16(buf, srv->temp_srv.dflt.delta_uv); } -static void default_rsp(struct bt_mesh_model *model, +static void default_rsp(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_LIGHT_CTL_DEFAULT_STATUS, BT_MESH_LIGHT_CTL_MSG_LEN_DEFAULT_MSG); @@ -230,10 +230,10 @@ static void default_rsp(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int default_set(struct bt_mesh_model *model, +static int default_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; struct bt_mesh_light_temp temp; uint16_t light; @@ -258,7 +258,7 @@ static int default_set(struct bt_mesh_model *model, return 0; } -static int handle_default_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { default_rsp(model, ctx); @@ -266,13 +266,13 @@ static int handle_default_get(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int handle_default_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return default_set(model, ctx, buf, true); } -static int handle_default_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return default_set(model, ctx, buf, false); @@ -331,9 +331,9 @@ const struct bt_mesh_model_op _bt_mesh_light_ctl_setup_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status light = { 0 }; if (atomic_test_bit(&srv->lightness_srv.flags, @@ -347,11 +347,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 2; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; if (atomic_test_bit(&srv->lightness_srv.flags, LIGHTNESS_SRV_FLAG_EXTENDED_BY_LIGHT_CTRL)) { @@ -367,9 +367,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], lightness_srv_change_lvl(&srv->lightness_srv, NULL, &light, &dummy_light_status, false); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; struct bt_mesh_light_ctl_status status = { 0 }; ctl_get(srv, NULL, &status); @@ -391,9 +391,9 @@ BT_MESH_SCENE_ENTRY_SIG(light_ctl) = { .recall_complete = scene_recall_complete, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; struct bt_mesh_light_ctl_status status = { 0 }; ctl_get(srv, NULL, &status); @@ -402,9 +402,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_light_ctl_srv_init(struct bt_mesh_model *model) +static int bt_mesh_light_ctl_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; srv->model = model; srv->temp_srv.ctl = srv; @@ -416,16 +416,16 @@ static int bt_mesh_light_ctl_srv_init(struct bt_mesh_model *model) return bt_mesh_model_extend(model, srv->lightness_srv.lightness_model); } -static void bt_mesh_light_ctl_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_light_ctl_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; net_buf_simple_reset(srv->pub.msg); } -static int bt_mesh_light_ctl_srv_start(struct bt_mesh_model *model) +static int bt_mesh_light_ctl_srv_start(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_light_temp_status temp_status; struct bt_mesh_light_temp_set temp = { @@ -434,9 +434,9 @@ static int bt_mesh_light_ctl_srv_start(struct bt_mesh_model *model) }; if (!srv->temp_srv.model || - (srv->model->elem_idx > srv->temp_srv.model->elem_idx)) { + (srv->model->rt->elem_idx > srv->temp_srv.model->rt->elem_idx)) { LOG_ERR("Light CTL srv[%d]: Temp. srv not properly initialized", - srv->model->elem_idx); + srv->model->rt->elem_idx); return -EINVAL; } @@ -469,9 +469,9 @@ const struct bt_mesh_model_cb _bt_mesh_light_ctl_srv_cb = { .start = bt_mesh_light_ctl_srv_start, }; -static int bt_mesh_light_ctl_setup_srv_init(struct bt_mesh_model *model) +static int bt_mesh_light_ctl_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctl_srv *srv = model->user_data; + struct bt_mesh_light_ctl_srv *srv = model->rt->user_data; int err; err = bt_mesh_model_extend(model, srv->model); diff --git a/subsys/bluetooth/mesh/light_ctrl_cli.c b/subsys/bluetooth/mesh/light_ctrl_cli.c index cdcf6b839fcb..61986410b557 100644 --- a/subsys/bluetooth/mesh/light_ctrl_cli.c +++ b/subsys/bluetooth/mesh/light_ctrl_cli.c @@ -17,11 +17,11 @@ struct prop_status_ctx { union prop_value val; }; -static int handle_mode(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_mode(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { bool *ack_buf; - struct bt_mesh_light_ctrl_cli *cli = model->user_data; + struct bt_mesh_light_ctrl_cli *cli = model->rt->user_data; uint8_t enabled = net_buf_simple_pull_u8(buf); if (enabled > 1) { @@ -41,11 +41,11 @@ static int handle_mode(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_occupancy(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_occupancy(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { bool *ack_buf; - struct bt_mesh_light_ctrl_cli *cli = model->user_data; + struct bt_mesh_light_ctrl_cli *cli = model->rt->user_data; uint8_t enabled = net_buf_simple_pull_u8(buf); if (enabled > 1) { @@ -65,10 +65,10 @@ static int handle_occupancy(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int handle_light_onoff(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_light_onoff(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_cli *cli = model->user_data; + struct bt_mesh_light_ctrl_cli *cli = model->rt->user_data; struct bt_mesh_onoff_status status; struct bt_mesh_onoff_status *ack_buf; @@ -109,10 +109,10 @@ static int handle_light_onoff(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int handle_prop(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_prop(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_cli *cli = model->user_data; + struct bt_mesh_light_ctrl_cli *cli = model->rt->user_data; struct prop_status_ctx *rsp; const struct bt_mesh_sensor_format *format; union prop_value value; @@ -186,9 +186,9 @@ const struct bt_mesh_model_op _bt_mesh_light_ctrl_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int light_ctrl_cli_init(struct bt_mesh_model *model) +static int light_ctrl_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctrl_cli *cli = model->user_data; + struct bt_mesh_light_ctrl_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -199,9 +199,9 @@ static int light_ctrl_cli_init(struct bt_mesh_model *model) return 0; } -static void light_ctrl_cli_reset(struct bt_mesh_model *model) +static void light_ctrl_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctrl_cli *cli = model->user_data; + struct bt_mesh_light_ctrl_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/light_ctrl_srv.c b/subsys/bluetooth/mesh/light_ctrl_srv.c index 807c18d302c2..63e1ea166b97 100644 --- a/subsys/bluetooth/mesh/light_ctrl_srv.c +++ b/subsys/bluetooth/mesh/light_ctrl_srv.c @@ -710,9 +710,9 @@ static void store_state_data(struct bt_mesh_light_ctrl_srv *srv) } -static void ligth_ctrl_srv_pending_store(struct bt_mesh_model *model) +static void ligth_ctrl_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; LOG_DBG("Store Timeout"); @@ -734,10 +734,10 @@ static void mode_rsp(struct bt_mesh_light_ctrl_srv *srv, bt_mesh_msg_send(srv->model, ctx, &rsp); } -static int handle_mode_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_mode_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; mode_rsp(srv, ctx); @@ -764,10 +764,10 @@ static int mode_set(struct bt_mesh_light_ctrl_srv *srv, return 0; } -static int handle_mode_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_mode_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; int err; err = mode_set(srv, buf); @@ -780,10 +780,10 @@ static int handle_mode_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_mode_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_mode_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; return mode_set(srv, buf); } @@ -799,10 +799,10 @@ static void om_rsp(struct bt_mesh_light_ctrl_srv *srv, bt_mesh_msg_send(srv->model, ctx, &rsp); } -static int handle_om_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_om_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; om_rsp(srv, ctx); @@ -830,10 +830,10 @@ static int om_set(struct bt_mesh_light_ctrl_srv *srv, return 0; } -static int handle_om_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_om_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; int err; err = om_set(srv, buf); @@ -846,18 +846,18 @@ static int handle_om_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ct return 0; } -static int handle_om_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_om_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; return om_set(srv, buf); } -static int handle_light_onoff_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_light_onoff_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; LOG_DBG("Get Light OnOff"); @@ -866,7 +866,7 @@ static int handle_light_onoff_get(struct bt_mesh_model *model, struct bt_mesh_ms return 0; } -static bool transition_get(struct bt_mesh_model *model, +static bool transition_get(const struct bt_mesh_model *model, struct bt_mesh_model_transition *transition, struct net_buf_simple *buf) { @@ -922,26 +922,27 @@ static int light_onoff_set(struct bt_mesh_light_ctrl_srv *srv, struct bt_mesh_ms return 0; } -static int handle_light_onoff_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_light_onoff_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; return light_onoff_set(srv, ctx, buf, true); } -static int handle_light_onoff_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_light_onoff_set_unack(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; return light_onoff_set(srv, ctx, buf, false); } -static int handle_sensor_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_sensor_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; int err; if (!is_enabled(srv)) { @@ -1341,19 +1342,19 @@ static int prop_tx(struct bt_mesh_light_ctrl_srv *srv, return 0; } -static int handle_prop_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_prop_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; uint16_t id = net_buf_simple_pull_le16(buf); return prop_tx(srv, ctx, id); } -static int handle_prop_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_prop_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; uint16_t id = net_buf_simple_pull_le16(buf); int err; @@ -1374,10 +1375,10 @@ static int handle_prop_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_prop_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_prop_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; int err; uint16_t id = net_buf_simple_pull_le16(buf); @@ -1471,9 +1472,9 @@ struct __packed scene_data { uint16_t lightness; }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status light = { 0 }; struct scene_data *scene = (struct scene_data *)&data[0]; @@ -1493,11 +1494,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return sizeof(struct scene_data); } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; struct scene_data *scene = (struct scene_data *)&data[0]; atomic_set_bit_to(&srv->flags, FLAG_OCC_MODE, scene->occ); @@ -1547,26 +1548,26 @@ BT_MESH_SCENE_ENTRY_SIG(light_ctrl) = { .recall = scene_recall, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { LOG_DBG("Update Handler"); - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; light_onoff_encode(srv, srv->pub.msg, srv->state); return 0; } -static int light_ctrl_srv_init(struct bt_mesh_model *model) +static int light_ctrl_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; int err; srv->model = model; if (srv->lightness->lightness_model == NULL || - srv->lightness->lightness_model->elem_idx >= model->elem_idx) { + srv->lightness->lightness_model->rt->elem_idx >= model->rt->elem_idx) { LOG_ERR("Lightness: Invalid element index"); return -EINVAL; } @@ -1615,11 +1616,11 @@ static int light_ctrl_srv_init(struct bt_mesh_model *model) return 0; } -static int light_ctrl_srv_settings_set(struct bt_mesh_model *model, +static int light_ctrl_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; atomic_t data; ssize_t result; @@ -1651,9 +1652,9 @@ static int light_ctrl_srv_settings_set(struct bt_mesh_model *model, return 0; } -static int light_ctrl_srv_start(struct bt_mesh_model *model) +static int light_ctrl_srv_start(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; atomic_set_bit(&srv->flags, FLAG_STARTED); @@ -1699,9 +1700,9 @@ static int light_ctrl_srv_start(struct bt_mesh_model *model) return 0; } -static void light_ctrl_srv_reset(struct bt_mesh_model *model) +static void light_ctrl_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; struct bt_mesh_light_ctrl_srv_cfg cfg = BT_MESH_LIGHT_CTRL_SRV_CFG_INIT; #if CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG struct bt_mesh_light_ctrl_reg_cfg reg_cfg = BT_MESH_LIGHT_CTRL_SRV_REG_CFG_INIT; @@ -1736,9 +1737,9 @@ const struct bt_mesh_model_cb _bt_mesh_light_ctrl_srv_cb = { #endif }; -static int lc_setup_srv_init(struct bt_mesh_model *model) +static int lc_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; int err; srv->setup_srv = model; @@ -1762,11 +1763,11 @@ static int lc_setup_srv_init(struct bt_mesh_model *model) return 0; } -static int lc_setup_srv_settings_set(struct bt_mesh_model *model, +static int lc_setup_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_light_ctrl_srv *srv = model->user_data; + struct bt_mesh_light_ctrl_srv *srv = model->rt->user_data; struct setup_srv_storage_data data; ssize_t result; diff --git a/subsys/bluetooth/mesh/light_hsl_cli.c b/subsys/bluetooth/mesh/light_hsl_cli.c index 9a51602eabb6..b4dd50f9eed9 100644 --- a/subsys/bluetooth/mesh/light_hsl_cli.c +++ b/subsys/bluetooth/mesh/light_hsl_cli.c @@ -34,10 +34,10 @@ static int status_decode(struct bt_mesh_light_hsl_cli *cli, return 0; } -static int handle_hsl_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_hsl_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_cli *cli = model->user_data; + struct bt_mesh_light_hsl_cli *cli = model->rt->user_data; struct bt_mesh_light_hsl_status status; int err; @@ -54,10 +54,10 @@ static int handle_hsl_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int handle_hsl_target_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_hsl_target_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_cli *cli = model->user_data; + struct bt_mesh_light_hsl_cli *cli = model->rt->user_data; struct bt_mesh_light_hsl_status status; int err; @@ -74,7 +74,7 @@ static int handle_hsl_target_status(struct bt_mesh_model *model, struct bt_mesh_ return 0; } -static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { if (buf->len != BT_MESH_LIGHT_HSL_MSG_MINLEN_STATUS && @@ -82,7 +82,7 @@ static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg return -EMSGSIZE; } - struct bt_mesh_light_hsl_cli *cli = model->user_data; + struct bt_mesh_light_hsl_cli *cli = model->rt->user_data; struct bt_mesh_light_hsl status; struct bt_mesh_light_hsl *rsp; @@ -101,10 +101,10 @@ static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg return 0; } -static int handle_range_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_cli *cli = model->user_data; + struct bt_mesh_light_hsl_cli *cli = model->rt->user_data; struct bt_mesh_light_hsl_range_status status; struct bt_mesh_light_hsl_range_status *rsp; @@ -124,10 +124,10 @@ static int handle_range_status(struct bt_mesh_model *model, struct bt_mesh_msg_c return 0; } -static int handle_hue_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_hue_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_cli *cli = model->user_data; + struct bt_mesh_light_hsl_cli *cli = model->rt->user_data; struct bt_mesh_light_hue_status status; struct bt_mesh_light_hue_status *rsp; @@ -159,10 +159,10 @@ static int handle_hue_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int handle_saturation_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_saturation_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_cli *cli = model->user_data; + struct bt_mesh_light_hsl_cli *cli = model->rt->user_data; struct bt_mesh_light_sat_status status; struct bt_mesh_light_sat_status *rsp; @@ -228,9 +228,9 @@ const struct bt_mesh_model_op _bt_mesh_light_hsl_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_light_hsl_cli_init(struct bt_mesh_model *model) +static int bt_mesh_light_hsl_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_hsl_cli *cli = model->user_data; + struct bt_mesh_light_hsl_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->buf; @@ -241,9 +241,9 @@ static int bt_mesh_light_hsl_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_light_hsl_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_light_hsl_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_hsl_cli *cli = model->user_data; + struct bt_mesh_light_hsl_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/light_hsl_srv.c b/subsys/bluetooth/mesh/light_hsl_srv.c index 801202993343..ba8fbb507a91 100644 --- a/subsys/bluetooth/mesh/light_hsl_srv.c +++ b/subsys/bluetooth/mesh/light_hsl_srv.c @@ -61,11 +61,11 @@ static void hsl_get(struct bt_mesh_light_hsl_srv *srv, &hue, &sat, &lightness, current); } -static int handle_hsl_get(struct bt_mesh_model *model, +static int handle_hsl_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_light_hsl_status status; hsl_get(srv, ctx, &status); @@ -74,10 +74,10 @@ static int handle_hsl_get(struct bt_mesh_model *model, return 0; } -static int hsl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int hsl_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_lightness_status lightness; struct bt_mesh_light_hue_status hue; @@ -148,25 +148,25 @@ static int hsl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_hsl_set(struct bt_mesh_model *model, +static int handle_hsl_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return hsl_set(model, ctx, buf, true); } -static int handle_hsl_set_unack(struct bt_mesh_model *model, +static int handle_hsl_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return hsl_set(model, ctx, buf, false); } -static int handle_hsl_target_get(struct bt_mesh_model *model, +static int handle_hsl_target_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status lightness; struct bt_mesh_light_hue_status hue; struct bt_mesh_light_sat_status sat; @@ -187,10 +187,10 @@ static int handle_hsl_target_get(struct bt_mesh_model *model, return 0; } -static void default_rsp(struct bt_mesh_model *model, +static void default_rsp(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; const struct bt_mesh_light_hsl hsl = { .lightness = srv->lightness->default_light, .hue = srv->hue.dflt, @@ -205,10 +205,10 @@ static void default_rsp(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int default_set(struct bt_mesh_model *model, +static int default_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_light_hsl val; light_hsl_buf_pull(buf, &val); @@ -220,7 +220,7 @@ static int default_set(struct bt_mesh_model *model, return 0; } -static int handle_default_get(struct bt_mesh_model *model, +static int handle_default_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -229,7 +229,7 @@ static int handle_default_get(struct bt_mesh_model *model, return 0; } -static int handle_default_set(struct bt_mesh_model *model, +static int handle_default_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -239,7 +239,7 @@ static int handle_default_set(struct bt_mesh_model *model, return 0; } -static int handle_default_set_unack(struct bt_mesh_model *model, +static int handle_default_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -268,11 +268,11 @@ static void range_encode_status(struct net_buf_simple *buf, light_hue_sat_range_buf_push(buf, &range); } -static void range_rsp(struct bt_mesh_model *model, +static void range_rsp(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, enum bt_mesh_model_status status) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_LIGHT_HSL_OP_RANGE_STATUS, BT_MESH_LIGHT_HSL_MSG_LEN_RANGE_STATUS); @@ -280,10 +280,10 @@ static void range_rsp(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int range_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int range_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_light_hsl_range hue, sat; hue.min = net_buf_simple_pull_le16(buf); @@ -301,7 +301,7 @@ static int range_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_range_get(struct bt_mesh_model *model, +static int handle_range_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -310,7 +310,7 @@ static int handle_range_get(struct bt_mesh_model *model, return 0; } -static int handle_range_set(struct bt_mesh_model *model, +static int handle_range_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -329,7 +329,7 @@ static int handle_range_set(struct bt_mesh_model *model, return 0; } -static int handle_range_set_unack(struct bt_mesh_model *model, +static int handle_range_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -397,9 +397,9 @@ const struct bt_mesh_model_op _bt_mesh_light_hsl_setup_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status status = { 0 }; if (atomic_test_bit(&srv->lightness->flags, @@ -413,11 +413,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 2; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; if (atomic_test_bit(&srv->lightness->flags, LIGHTNESS_SRV_FLAG_EXTENDED_BY_LIGHT_CTRL)) { @@ -433,9 +433,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], lightness_srv_change_lvl(srv->lightness, NULL, &light_set, &light_status, false); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status light_status = { 0 }; struct bt_mesh_light_hue_status hue_status = { 0 }; struct bt_mesh_light_sat_status sat_status = { 0 }; @@ -465,9 +465,9 @@ BT_MESH_SCENE_ENTRY_SIG(light_hsl) = { .recall_complete = scene_recall_complete, }; -static int hsl_srv_pub_update(struct bt_mesh_model *model) +static int hsl_srv_pub_update(const struct bt_mesh_model *model) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_light_hsl_status status; hsl_get(srv, NULL, &status); @@ -476,10 +476,10 @@ static int hsl_srv_pub_update(struct bt_mesh_model *model) return 0; } -static int bt_mesh_light_hsl_srv_init(struct bt_mesh_model *model) +static int bt_mesh_light_hsl_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; - struct bt_mesh_model *lightness_srv; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; + const struct bt_mesh_model *lightness_srv; srv->model = model; srv->pub.update = hsl_srv_pub_update; @@ -501,25 +501,25 @@ static int bt_mesh_light_hsl_srv_init(struct bt_mesh_model *model) return bt_mesh_model_extend(model, lightness_srv); } -static int bt_mesh_light_hsl_srv_start(struct bt_mesh_model *model) +static int bt_mesh_light_hsl_srv_start(const struct bt_mesh_model *model) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_light_hue hue = { .transition = &transition }; struct bt_mesh_light_sat sat = { .transition = &transition }; struct bt_mesh_lightness_status lightness = { 0 }; if (!srv->sat.model || - (srv->model->elem_idx > srv->sat.model->elem_idx)) { + (srv->model->rt->elem_idx > srv->sat.model->rt->elem_idx)) { LOG_ERR("Light HSL srv[%d]: Sat. srv not properly initialized", - srv->model->elem_idx); + srv->model->rt->elem_idx); return -EINVAL; } if (!srv->hue.model || - (srv->model->elem_idx > srv->hue.model->elem_idx)) { + (srv->model->rt->elem_idx > srv->hue.model->rt->elem_idx)) { LOG_ERR("Light HSL srv[%d]: Hue srv not properly initialized", - srv->model->elem_idx); + srv->model->rt->elem_idx); return -EINVAL; } @@ -572,10 +572,10 @@ const struct bt_mesh_model_cb _bt_mesh_light_hsl_srv_cb = { .start = bt_mesh_light_hsl_srv_start, }; -static int bt_mesh_light_hsl_setup_srv_init(struct bt_mesh_model *model) +static int bt_mesh_light_hsl_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_hsl_srv *srv = model->user_data; - struct bt_mesh_model *lightness_setup_srv; + struct bt_mesh_light_hsl_srv *srv = model->rt->user_data; + const struct bt_mesh_model *lightness_setup_srv; int err; err = bt_mesh_model_extend(model, srv->model); diff --git a/subsys/bluetooth/mesh/light_hue_srv.c b/subsys/bluetooth/mesh/light_hue_srv.c index 0e8920b0567a..e2e559cc22fe 100644 --- a/subsys/bluetooth/mesh/light_hue_srv.c +++ b/subsys/bluetooth/mesh/light_hue_srv.c @@ -31,9 +31,9 @@ struct settings_data { } __packed; #if CONFIG_BT_SETTINGS -static void hue_srv_pending_store(struct bt_mesh_model *model) +static void hue_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; struct settings_data data = { .range = srv->range, @@ -100,7 +100,7 @@ static struct bt_mesh_model_transition *transition_get(struct bt_mesh_light_hue_ return NULL; } -static int hue_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int hue_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_LIGHT_HSL_MSG_MINLEN_HUE && @@ -108,7 +108,7 @@ static int hue_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return -EMSGSIZE; } - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; struct bt_mesh_light_hue_status status = { 0 }; struct bt_mesh_model_transition transition; struct bt_mesh_light_hue set; @@ -157,10 +157,10 @@ static int hue_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_hue_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_hue_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; struct bt_mesh_light_hue_status status = { 0 }; srv->handlers->get(srv, ctx, &status); @@ -169,13 +169,13 @@ static int handle_hue_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *c return 0; } -static int handle_hue_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_hue_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return hue_set(model, ctx, buf, true); } -static int handle_hue_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_hue_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return hue_set(model, ctx, buf, false); @@ -387,9 +387,9 @@ const struct bt_mesh_lvl_srv_handlers _bt_mesh_light_hue_srv_lvl_handlers = { .move_set = lvl_move_set, }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; struct bt_mesh_light_hue_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -399,11 +399,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 2; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; struct bt_mesh_light_hue_status status = { 0 }; struct bt_mesh_light_hue set = { .lvl = sys_get_le16(data), @@ -413,9 +413,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], bt_mesh_light_hue_srv_set(srv, NULL, &set, &status); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; struct bt_mesh_light_hue_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -431,9 +431,9 @@ BT_MESH_SCENE_ENTRY_SIG(light_hue) = { .recall_complete = scene_recall_complete, }; -static int hue_srv_pub_update(struct bt_mesh_model *model) +static int hue_srv_pub_update(const struct bt_mesh_model *model) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; struct bt_mesh_light_hue_status status; srv->handlers->get(srv, NULL, &status); @@ -443,9 +443,9 @@ static int hue_srv_pub_update(struct bt_mesh_model *model) return 0; } -static int hue_srv_init(struct bt_mesh_model *model) +static int hue_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; int err; srv->model = model; @@ -477,11 +477,11 @@ static int hue_srv_init(struct bt_mesh_model *model) return err; } -static int hue_srv_settings_set(struct bt_mesh_model *model, const char *name, +static int hue_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_data) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; struct settings_data data; ssize_t len; @@ -499,9 +499,9 @@ static int hue_srv_settings_set(struct bt_mesh_model *model, const char *name, return 0; } -static void hue_srv_reset(struct bt_mesh_model *model) +static void hue_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_hue_srv *srv = model->user_data; + struct bt_mesh_light_hue_srv *srv = model->rt->user_data; srv->range.min = BT_MESH_LIGHT_HSL_MIN; srv->range.max = BT_MESH_LIGHT_HSL_MAX; diff --git a/subsys/bluetooth/mesh/light_sat_srv.c b/subsys/bluetooth/mesh/light_sat_srv.c index 290e72172758..bfbf7f951948 100644 --- a/subsys/bluetooth/mesh/light_sat_srv.c +++ b/subsys/bluetooth/mesh/light_sat_srv.c @@ -28,9 +28,9 @@ struct settings_data { } __packed; #if CONFIG_BT_SETTINGS -static void sat_srv_pending_store(struct bt_mesh_model *model) +static void sat_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; struct settings_data data = { .range = srv->range, @@ -65,7 +65,7 @@ static void encode_status(struct net_buf_simple *buf, } } -static int sat_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int sat_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_LIGHT_HSL_MSG_MINLEN_SAT && @@ -73,7 +73,7 @@ static int sat_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return -EMSGSIZE; } - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; struct bt_mesh_light_sat_status status = { 0 }; struct bt_mesh_model_transition transition; struct bt_mesh_light_sat set = { @@ -133,11 +133,11 @@ static int sat_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_sat_get(struct bt_mesh_model *model, +static int handle_sat_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; struct bt_mesh_light_sat_status status = { 0 }; srv->handlers->get(srv, ctx, &status); @@ -146,14 +146,14 @@ static int handle_sat_get(struct bt_mesh_model *model, return 0; } -static int handle_sat_set(struct bt_mesh_model *model, +static int handle_sat_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return sat_set(model, ctx, buf, true); } -static int handle_sat_set_unack(struct bt_mesh_model *model, +static int handle_sat_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -318,9 +318,9 @@ const struct bt_mesh_lvl_srv_handlers _bt_mesh_light_sat_srv_lvl_handlers = { .move_set = lvl_move_set, }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; struct bt_mesh_light_sat_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -330,11 +330,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 2; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; struct bt_mesh_light_sat_status status = { 0 }; struct bt_mesh_light_sat set = { .lvl = sys_get_le16(data), @@ -344,9 +344,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], bt_mesh_light_sat_srv_set(srv, NULL, &set, &status); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; struct bt_mesh_light_sat_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -362,9 +362,9 @@ BT_MESH_SCENE_ENTRY_SIG(light_hue) = { .recall_complete = scene_recall_complete, }; -static int sat_srv_pub_update(struct bt_mesh_model *model) +static int sat_srv_pub_update(const struct bt_mesh_model *model) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; struct bt_mesh_light_sat_status status; srv->handlers->get(srv, NULL, &status); @@ -374,9 +374,9 @@ static int sat_srv_pub_update(struct bt_mesh_model *model) return 0; } -static int sat_srv_init(struct bt_mesh_model *model) +static int sat_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; int err; srv->model = model; @@ -408,11 +408,11 @@ static int sat_srv_init(struct bt_mesh_model *model) return err; } -static int sat_srv_settings_set(struct bt_mesh_model *model, const char *name, +static int sat_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_data) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; struct settings_data data; ssize_t len; @@ -430,9 +430,9 @@ static int sat_srv_settings_set(struct bt_mesh_model *model, const char *name, return 0; } -static void sat_srv_reset(struct bt_mesh_model *model) +static void sat_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_sat_srv *srv = model->user_data; + struct bt_mesh_light_sat_srv *srv = model->rt->user_data; srv->range.min = BT_MESH_LIGHT_HSL_MIN; srv->range.max = BT_MESH_LIGHT_HSL_MAX; diff --git a/subsys/bluetooth/mesh/light_temp_srv.c b/subsys/bluetooth/mesh/light_temp_srv.c index 148828d1e050..415b4687d017 100644 --- a/subsys/bluetooth/mesh/light_temp_srv.c +++ b/subsys/bluetooth/mesh/light_temp_srv.c @@ -25,9 +25,9 @@ struct settings_data { } __packed; #if CONFIG_BT_SETTINGS -static void bt_mesh_light_temp_srv_pending_store(struct bt_mesh_model *model) +static void bt_mesh_light_temp_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; struct settings_data data = { .dflt = srv->dflt, @@ -65,7 +65,7 @@ static void encode_status(struct net_buf_simple *buf, } } -static int temp_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int temp_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_LIGHT_CTL_MSG_MINLEN_TEMP_SET && @@ -73,7 +73,7 @@ static int temp_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return -EMSGSIZE; } - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; struct bt_mesh_light_temp_status status = { 0 }; struct bt_mesh_model_transition transition; struct bt_mesh_light_temp_set set; @@ -111,11 +111,11 @@ static int temp_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_temp_get(struct bt_mesh_model *model, +static int handle_temp_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; struct bt_mesh_light_temp_status status = { 0 }; srv->handlers->get(srv, ctx, &status); @@ -124,14 +124,14 @@ static int handle_temp_get(struct bt_mesh_model *model, return 0; } -static int handle_temp_set(struct bt_mesh_model *model, +static int handle_temp_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return temp_set(model, ctx, buf, true); } -static int handle_temp_set_unack(struct bt_mesh_model *model, +static int handle_temp_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -303,9 +303,9 @@ struct __packed scene_data { int16_t delta_uv; }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; struct bt_mesh_light_temp_status status = { 0 }; struct scene_data *scene = (struct scene_data *)&data[0]; @@ -340,11 +340,11 @@ static void temp_srv_set(struct bt_mesh_light_temp_srv *srv, srv->handlers->set(srv, ctx, set, status); } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; struct scene_data *scene = (struct scene_data *)&data[0]; struct bt_mesh_light_temp_status status = { 0 }; struct bt_mesh_light_temp_set set = { @@ -358,9 +358,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], temp_srv_set(srv, NULL, &set, &status); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; struct bt_mesh_light_temp_status status = { 0 }; srv->handlers->get(srv, NULL, &status); @@ -386,9 +386,9 @@ static void light_temp_srv_reset(struct bt_mesh_light_temp_srv *srv) srv->range.max = BT_MESH_LIGHT_TEMP_MAX; } -static int bt_mesh_light_temp_srv_init(struct bt_mesh_model *model) +static int bt_mesh_light_temp_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; int err; srv->model = model; @@ -418,12 +418,12 @@ static int bt_mesh_light_temp_srv_init(struct bt_mesh_model *model) return err; } -static int bt_mesh_light_temp_srv_settings_set(struct bt_mesh_model *model, +static int bt_mesh_light_temp_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_data) { - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; struct settings_data data; ssize_t len; @@ -441,9 +441,9 @@ static int bt_mesh_light_temp_srv_settings_set(struct bt_mesh_model *model, return 0; } -static void bt_mesh_light_temp_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_light_temp_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_temp_srv *srv = model->user_data; + struct bt_mesh_light_temp_srv *srv = model->rt->user_data; light_temp_srv_reset(srv); net_buf_simple_reset(srv->pub.msg); diff --git a/subsys/bluetooth/mesh/light_xyl_cli.c b/subsys/bluetooth/mesh/light_xyl_cli.c index 1af70ecddaea..4a0e25cf39d4 100644 --- a/subsys/bluetooth/mesh/light_xyl_cli.c +++ b/subsys/bluetooth/mesh/light_xyl_cli.c @@ -34,10 +34,10 @@ static int status_decode(struct bt_mesh_light_xyl_cli *cli, return 0; } -static int handle_xyl_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_xyl_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_xyl_cli *cli = model->user_data; + struct bt_mesh_light_xyl_cli *cli = model->rt->user_data; struct bt_mesh_light_xyl_status status; uint32_t err = status_decode(cli, ctx, buf, BT_MESH_LIGHT_XYL_OP_STATUS, @@ -50,10 +50,10 @@ static int handle_xyl_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return err; } -static int handle_target_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_target_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_xyl_cli *cli = model->user_data; + struct bt_mesh_light_xyl_cli *cli = model->rt->user_data; struct bt_mesh_light_xyl_status status; uint32_t err = status_decode( @@ -66,10 +66,10 @@ static int handle_target_status(struct bt_mesh_model *model, struct bt_mesh_msg_ return err; } -static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_xyl_cli *cli = model->user_data; + struct bt_mesh_light_xyl_cli *cli = model->rt->user_data; struct bt_mesh_light_xyl status; struct bt_mesh_light_xyl *rsp; @@ -90,10 +90,10 @@ static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg return 0; } -static int handle_range_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_xyl_cli *cli = model->user_data; + struct bt_mesh_light_xyl_cli *cli = model->rt->user_data; struct bt_mesh_light_xyl_range_status status; struct bt_mesh_light_xyl_range_status *rsp; @@ -140,9 +140,9 @@ const struct bt_mesh_model_op _bt_mesh_light_xyl_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_light_xyl_cli_init(struct bt_mesh_model *model) +static int bt_mesh_light_xyl_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_cli *cli = model->user_data; + struct bt_mesh_light_xyl_cli *cli = model->rt->user_data; if (!cli) { return -EINVAL; @@ -157,9 +157,9 @@ static int bt_mesh_light_xyl_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_light_xyl_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_light_xyl_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_cli *cli = model->user_data; + struct bt_mesh_light_xyl_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/light_xyl_srv.c b/subsys/bluetooth/mesh/light_xyl_srv.c index 64436c2118da..a312b4a80c96 100644 --- a/subsys/bluetooth/mesh/light_xyl_srv.c +++ b/subsys/bluetooth/mesh/light_xyl_srv.c @@ -23,9 +23,9 @@ struct bt_mesh_light_xyl_srv_settings_data { } __packed; #if CONFIG_BT_SETTINGS -static void bt_mesh_light_xyl_srv_pending_store(struct bt_mesh_model *model) +static void bt_mesh_light_xyl_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xyl_srv_settings_data data = { .default_params = srv->xy_default, @@ -78,7 +78,7 @@ static void xyl_encode_status(struct net_buf_simple *buf, } } -static void xyl_rsp(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, +static void xyl_rsp(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, struct bt_mesh_light_xyl_status *status, uint32_t opcode) { BT_MESH_MODEL_BUF_DEFINE(msg, opcode, @@ -87,7 +87,7 @@ static void xyl_rsp(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int xyl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int xyl_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { if (buf->len != BT_MESH_LIGHT_XYL_MSG_MINLEN_SET && @@ -95,7 +95,7 @@ static int xyl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return -EMSGSIZE; } - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_light_xy_set set; struct bt_mesh_light_xy_status status = { 0 }; @@ -151,11 +151,11 @@ static int xyl_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_xyl_get(struct bt_mesh_model *model, +static int handle_xyl_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xyl_status status = { 0 }; xyl_get(srv, ctx, &status); @@ -164,25 +164,25 @@ static int handle_xyl_get(struct bt_mesh_model *model, return 0; } -static int handle_xyl_set(struct bt_mesh_model *model, +static int handle_xyl_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return xyl_set(model, ctx, buf, true); } -static int handle_xyl_set_unack(struct bt_mesh_model *model, +static int handle_xyl_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return xyl_set(model, ctx, buf, false); } -static int handle_target_get(struct bt_mesh_model *model, +static int handle_target_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xy_status status = { 0 }; struct bt_mesh_lightness_status light = { 0 }; @@ -210,10 +210,10 @@ static void default_encode_status(struct bt_mesh_light_xyl_srv *srv, net_buf_simple_add_le16(buf, srv->xy_default.y); } -static void default_rsp(struct bt_mesh_model *model, +static void default_rsp(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_LIGHT_XYL_OP_DEFAULT_STATUS, BT_MESH_LIGHT_XYL_MSG_LEN_DEFAULT); @@ -221,11 +221,11 @@ static void default_rsp(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int default_set(struct bt_mesh_model *model, +static int default_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xy old_default = srv->xy_default; uint16_t light = from_actual(net_buf_simple_pull_le16(buf)); @@ -248,7 +248,7 @@ static int default_set(struct bt_mesh_model *model, return 0; } -static int handle_default_get(struct bt_mesh_model *model, +static int handle_default_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -257,14 +257,14 @@ static int handle_default_get(struct bt_mesh_model *model, return 0; } -static int handle_default_set(struct bt_mesh_model *model, +static int handle_default_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return default_set(model, ctx, buf, true); } -static int handle_default_set_unack(struct bt_mesh_model *model, +static int handle_default_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -283,11 +283,11 @@ static void range_encode_status(struct net_buf_simple *buf, net_buf_simple_add_le16(buf, srv->range.max.y); } -static void range_rsp(struct bt_mesh_model *model, +static void range_rsp(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, enum bt_mesh_model_status status) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_LIGHT_XYL_OP_RANGE_STATUS, BT_MESH_LIGHT_XYL_MSG_LEN_RANGE_STATUS); @@ -295,10 +295,10 @@ static void range_rsp(struct bt_mesh_model *model, (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static int range_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int range_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xy_range new_range; struct bt_mesh_light_xy_range old_range; enum bt_mesh_model_status status_code; @@ -331,7 +331,7 @@ static int range_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_range_get(struct bt_mesh_model *model, +static int handle_range_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -340,14 +340,14 @@ static int handle_range_get(struct bt_mesh_model *model, return 0; } -static int handle_range_set(struct bt_mesh_model *model, +static int handle_range_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return range_set(model, ctx, buf, true); } -static int handle_range_set_unack(struct bt_mesh_model *model, +static int handle_range_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -417,9 +417,9 @@ struct __packed scene_data { uint16_t light; }; -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xy_status xy_rsp = { 0 }; struct bt_mesh_lightness_status light = { 0 }; struct scene_data *scene = (struct scene_data *)&data[0]; @@ -444,11 +444,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return sizeof(struct scene_data); } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct scene_data *scene = (struct scene_data *)&data[0]; struct bt_mesh_light_xy_status xy_status = { 0 }; struct bt_mesh_light_xy_set xy_set = { @@ -478,9 +478,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], lightness_srv_change_lvl(srv->lightness_srv, NULL, &light, &light_status, false); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xyl_status xyl_status = { 0 }; struct bt_mesh_lightness_status light_status = { 0 }; struct bt_mesh_light_xy_status xy_status = { 0 }; @@ -510,9 +510,9 @@ BT_MESH_SCENE_ENTRY_SIG(light_xyl) = { .recall_complete = scene_recall_complete, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xyl_status status = { 0 }; xyl_get(srv, NULL, &status); @@ -521,10 +521,10 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_light_xyl_srv_init(struct bt_mesh_model *model) +static int bt_mesh_light_xyl_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; - struct bt_mesh_model *lightness_srv; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; + const struct bt_mesh_model *lightness_srv; srv->model = model; srv->pub.msg = &srv->pub_buf; @@ -554,12 +554,12 @@ static int bt_mesh_light_xyl_srv_init(struct bt_mesh_model *model) return bt_mesh_model_extend(model, lightness_srv); } -static int bt_mesh_light_xyl_srv_settings_set(struct bt_mesh_model *model, +static int bt_mesh_light_xyl_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xyl_srv_settings_data data; if (read_cb(cb_arg, &data, sizeof(data)) != sizeof(data)) { @@ -575,9 +575,9 @@ static int bt_mesh_light_xyl_srv_settings_set(struct bt_mesh_model *model, return 0; } -static int bt_mesh_light_xyl_srv_start(struct bt_mesh_model *model) +static int bt_mesh_light_xyl_srv_start(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; struct bt_mesh_light_xy_status status; struct bt_mesh_model_transition transition = { .time = srv->lightness_srv->ponoff.dtt.transition_time, @@ -613,9 +613,9 @@ static int bt_mesh_light_xyl_srv_start(struct bt_mesh_model *model) return 0; } -static void bt_mesh_light_xyl_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_light_xyl_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; net_buf_simple_reset(srv->pub.msg); @@ -634,10 +634,10 @@ const struct bt_mesh_model_cb _bt_mesh_light_xyl_srv_cb = { .reset = bt_mesh_light_xyl_srv_reset, }; -static int bt_mesh_light_xyl_setup_srv_init(struct bt_mesh_model *model) +static int bt_mesh_light_xyl_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_light_xyl_srv *srv = model->user_data; - struct bt_mesh_model *lightness_setup_srv; + struct bt_mesh_light_xyl_srv *srv = model->rt->user_data; + const struct bt_mesh_model *lightness_setup_srv; int err; err = bt_mesh_model_extend(model, srv->model); diff --git a/subsys/bluetooth/mesh/lightness_cli.c b/subsys/bluetooth/mesh/lightness_cli.c index a11690d15a78..8c20c432b3fe 100644 --- a/subsys/bluetooth/mesh/lightness_cli.c +++ b/subsys/bluetooth/mesh/lightness_cli.c @@ -7,7 +7,7 @@ #include "model_utils.h" #include "lightness_internal.h" -static int light_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int light_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, enum light_repr repr) { if (buf->len != BT_MESH_LIGHTNESS_MSG_MINLEN_STATUS && @@ -15,7 +15,7 @@ static int light_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx return -EMSGSIZE; } - struct bt_mesh_lightness_cli *cli = model->user_data; + struct bt_mesh_lightness_cli *cli = model->rt->user_data; struct bt_mesh_lightness_status status; struct bt_mesh_lightness_status *rsp; @@ -43,22 +43,22 @@ static int light_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx return 0; } -static int handle_light_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_light_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return light_status(model, ctx, buf, ACTUAL); } -static int handle_light_linear_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_light_linear_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return light_status(model, ctx, buf, LINEAR); } -static int handle_last_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_last_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_lightness_cli *cli = model->user_data; + struct bt_mesh_lightness_cli *cli = model->rt->user_data; uint16_t last = from_actual(net_buf_simple_pull_le16(buf)); uint16_t *rsp; @@ -75,15 +75,15 @@ static int handle_last_status(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_lightness_cli *cli = model->user_data; + struct bt_mesh_lightness_cli *cli = model->rt->user_data; uint16_t default_lvl = from_actual(net_buf_simple_pull_le16(buf)); uint16_t *rsp; - if (bt_mesh_msg_ack_ctx_match(&cli->ack_ctx, BT_MESH_LIGHTNESS_OP_DEFAULT_STATUS, - ctx->addr, (void **)&rsp)) { + if (bt_mesh_msg_ack_ctx_match(&cli->ack_ctx, BT_MESH_LIGHTNESS_OP_DEFAULT_STATUS, ctx->addr, + (void **)&rsp)) { *rsp = default_lvl; bt_mesh_msg_ack_ctx_rx(&cli->ack_ctx); } @@ -95,10 +95,10 @@ static int handle_default_status(struct bt_mesh_model *model, struct bt_mesh_msg return 0; } -static int handle_range_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_lightness_cli *cli = model->user_data; + struct bt_mesh_lightness_cli *cli = model->rt->user_data; struct bt_mesh_lightness_range_status status; struct bt_mesh_lightness_range_status *rsp; @@ -148,22 +148,21 @@ const struct bt_mesh_model_op _bt_mesh_lightness_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_lvl_cli_init(struct bt_mesh_model *model) +static int bt_mesh_lvl_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_cli *cli = model->user_data; + struct bt_mesh_lightness_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; - net_buf_simple_init_with_data(&cli->pub_buf, cli->pub_data, - sizeof(cli->pub_data)); + net_buf_simple_init_with_data(&cli->pub_buf, cli->pub_data, sizeof(cli->pub_data)); bt_mesh_msg_ack_ctx_init(&cli->ack_ctx); return 0; } -static void bt_mesh_lvl_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_lvl_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_cli *cli = model->user_data; + struct bt_mesh_lightness_cli *cli = model->rt->user_data; net_buf_simple_reset(model->pub->msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); @@ -174,12 +173,10 @@ const struct bt_mesh_model_cb _bt_mesh_lightness_cli_cb = { .reset = bt_mesh_lvl_cli_reset, }; -int lightness_cli_light_get(struct bt_mesh_lightness_cli *cli, - struct bt_mesh_msg_ctx *ctx, enum light_repr repr, - struct bt_mesh_lightness_status *rsp) +int lightness_cli_light_get(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, + enum light_repr repr, struct bt_mesh_lightness_status *rsp) { - BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_LIGHTNESS_OP_GET, - BT_MESH_LIGHTNESS_MSG_LEN_GET); + BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_LIGHTNESS_OP_GET, BT_MESH_LIGHTNESS_MSG_LEN_GET); bt_mesh_model_msg_init(&buf, op_get(LIGHTNESS_OP_TYPE_GET, repr)); struct bt_mesh_msg_rsp_ctx rsp_ctx = { @@ -192,13 +189,11 @@ int lightness_cli_light_get(struct bt_mesh_lightness_cli *cli, return bt_mesh_msg_ackd_send(cli->model, ctx, &buf, rsp ? &rsp_ctx : NULL); } -int lightness_cli_light_set(struct bt_mesh_lightness_cli *cli, - struct bt_mesh_msg_ctx *ctx, enum light_repr repr, - const struct bt_mesh_lightness_set *set, +int lightness_cli_light_set(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, + enum light_repr repr, const struct bt_mesh_lightness_set *set, struct bt_mesh_lightness_status *rsp) { - BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_LIGHTNESS_OP_SET, - BT_MESH_LIGHTNESS_MSG_MAXLEN_SET); + BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_LIGHTNESS_OP_SET, BT_MESH_LIGHTNESS_MSG_MAXLEN_SET); bt_mesh_model_msg_init(&buf, op_get(LIGHTNESS_OP_TYPE_SET, repr)); net_buf_simple_add_le16(&buf, set->lvl); diff --git a/subsys/bluetooth/mesh/lightness_srv.c b/subsys/bluetooth/mesh/lightness_srv.c index 0ee1402db7e3..e7bc74020e69 100644 --- a/subsys/bluetooth/mesh/lightness_srv.c +++ b/subsys/bluetooth/mesh/lightness_srv.c @@ -30,9 +30,9 @@ struct bt_mesh_lightness_srv_settings_data { static const char *const repr_str[] = { "Actual", "Linear" }; #if CONFIG_BT_SETTINGS -static void bt_mesh_lightness_srv_pending_store(struct bt_mesh_model *model) +static void bt_mesh_lightness_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_lightness_srv_settings_data data = { .default_light = srv->default_light, @@ -119,7 +119,7 @@ static int pub(struct bt_mesh_lightness_srv *srv, struct bt_mesh_msg_ctx *ctx, return bt_mesh_msg_send(srv->lightness_model, ctx, &msg); } -static void rsp_lightness_status(struct bt_mesh_model *model, +static void rsp_lightness_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_lightness_status *status, enum light_repr repr) @@ -136,12 +136,12 @@ static void rsp_lightness_status(struct bt_mesh_model *model, bt_mesh_model_send(model, ctx, &rsp, NULL, NULL); } -static int handle_light_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_light_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, enum light_repr repr) { LOG_DBG("%s", repr_str[repr]); - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status status = { 0 }; srv->handlers->light_get(srv, ctx, &status); @@ -151,13 +151,13 @@ static int handle_light_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int handle_actual_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_actual_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return handle_light_get(model, ctx, buf, ACTUAL); } -static int handle_linear_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_linear_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return handle_light_get(model, ctx, buf, LINEAR); @@ -222,7 +222,7 @@ void lightness_srv_change_lvl(struct bt_mesh_lightness_srv *srv, } } -static int lightness_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int lightness_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack, enum light_repr repr) { if (buf->len != BT_MESH_LIGHTNESS_MSG_MINLEN_SET && @@ -230,7 +230,7 @@ static int lightness_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ct return -EMSGSIZE; } - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_lightness_status status; struct bt_mesh_lightness_set set; @@ -268,34 +268,34 @@ static int lightness_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ct return 0; } -static int handle_actual_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_actual_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return lightness_set(model, ctx, buf, true, ACTUAL); } -static int handle_actual_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_actual_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return lightness_set(model, ctx, buf, false, ACTUAL); } -static int handle_linear_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_linear_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return lightness_set(model, ctx, buf, true, LINEAR); } -static int handle_linear_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_linear_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return lightness_set(model, ctx, buf, false, LINEAR); } -static int handle_last_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_last_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_LIGHTNESS_OP_LAST_STATUS, BT_MESH_LIGHTNESS_MSG_LEN_LAST_STATUS); @@ -307,10 +307,10 @@ static int handle_last_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_default_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_LIGHTNESS_OP_DEFAULT_STATUS, BT_MESH_LIGHTNESS_MSG_LEN_DEFAULT_STATUS); @@ -341,10 +341,10 @@ void lightness_srv_default_set(struct bt_mesh_lightness_srv *srv, store_state(srv); } -static int set_default(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int set_default(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; uint16_t new = from_actual(net_buf_simple_pull_le16(buf)); lightness_srv_default_set(srv, ctx, new); @@ -362,22 +362,22 @@ static int set_default(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_default_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_default(model, ctx, buf, true); } -static int handle_default_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_default_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_default(model, ctx, buf, false); } -static int handle_range_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(rsp, BT_MESH_LIGHTNESS_OP_RANGE_STATUS, BT_MESH_LIGHTNESS_MSG_LEN_RANGE_STATUS); @@ -392,10 +392,10 @@ static int handle_range_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int set_range(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int set_range(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_lightness_range new; new.min = from_actual(net_buf_simple_pull_le16(buf)); @@ -437,13 +437,13 @@ static int set_range(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_range_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_range(model, ctx, buf, true); } -static int handle_range_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_range_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return set_range(model, ctx, buf, false); @@ -764,9 +764,9 @@ static void lightness_srv_reset(struct bt_mesh_lightness_srv *srv) srv->transient.is_on = false; } -static void bt_mesh_lightness_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_lightness_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; lightness_srv_reset(srv); net_buf_simple_reset(srv->pub.msg); @@ -776,9 +776,9 @@ static void bt_mesh_lightness_srv_reset(struct bt_mesh_model *model) } } -static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) +static ssize_t scene_store(const struct bt_mesh_model *model, uint8_t data[]) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status status = { 0 }; srv->handlers->light_get(srv, NULL, &status); @@ -786,11 +786,11 @@ static ssize_t scene_store(struct bt_mesh_model *model, uint8_t data[]) return 2; } -static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], +static void scene_recall(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status dummy_status; struct bt_mesh_lightness_set set = { .lvl = from_actual(sys_get_le16(data)), @@ -800,9 +800,9 @@ static void scene_recall(struct bt_mesh_model *model, const uint8_t data[], lightness_srv_change_lvl(srv, NULL, &set, &dummy_status, false); } -static void scene_recall_complete(struct bt_mesh_model *model) +static void scene_recall_complete(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status status; srv->handlers->light_get(srv, NULL, &status); @@ -825,9 +825,9 @@ BT_MESH_SCENE_ENTRY_SIG(lightness) = { .recall_complete = scene_recall_complete, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_lightness_status status = { 0 }; srv->handlers->light_get(srv, NULL, &status); @@ -837,9 +837,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int bt_mesh_lightness_srv_init(struct bt_mesh_model *model) +static int bt_mesh_lightness_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; int err; srv->lightness_model = model; @@ -869,12 +869,12 @@ static int bt_mesh_lightness_srv_init(struct bt_mesh_model *model) } #ifdef CONFIG_BT_SETTINGS -static int bt_mesh_lightness_srv_settings_set(struct bt_mesh_model *model, +static int bt_mesh_lightness_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; struct bt_mesh_lightness_srv_settings_data data; ssize_t result; @@ -940,9 +940,9 @@ int lightness_on_power_up(struct bt_mesh_lightness_srv *srv) } #ifdef CONFIG_BT_SETTINGS -static int bt_mesh_lightness_srv_start(struct bt_mesh_model *model) +static int bt_mesh_lightness_srv_start(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; /* When Light Lightness server is extended by Light LC server, Light LC server will execute * power-up sequence of Light Lightness server according to MshMDLv1.1: 6.5.1.2. Otherwise, @@ -966,9 +966,9 @@ const struct bt_mesh_model_cb _bt_mesh_lightness_srv_cb = { #endif }; -static int bt_mesh_lightness_setup_srv_init(struct bt_mesh_model *model) +static int bt_mesh_lightness_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_lightness_srv *srv = model->user_data; + struct bt_mesh_lightness_srv *srv = model->rt->user_data; int err; srv->lightness_setup_model = model; diff --git a/subsys/bluetooth/mesh/model_utils.c b/subsys/bluetooth/mesh/model_utils.c index 87d14c75df4f..22a1330c1154 100644 --- a/subsys/bluetooth/mesh/model_utils.c +++ b/subsys/bluetooth/mesh/model_utils.c @@ -102,7 +102,7 @@ int32_t model_delay_decode(uint8_t encoded_delay) return encoded_delay * DELAY_TIME_STEP_MS; } -int32_t model_ackd_timeout_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx) +int32_t model_ackd_timeout_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx) { uint8_t ttl = (ctx ? ctx->send_ttl : model->pub->ttl); int32_t time = (CONFIG_BT_MESH_MOD_ACKD_TIMEOUT_BASE + diff --git a/subsys/bluetooth/mesh/model_utils.h b/subsys/bluetooth/mesh/model_utils.h index d4022ea4ba7c..877b4eb1e2c3 100644 --- a/subsys/bluetooth/mesh/model_utils.h +++ b/subsys/bluetooth/mesh/model_utils.h @@ -22,7 +22,7 @@ /** * @brief Create emds model id to identify the model, where @p mod is the model. */ -#define EMDS_MODEL_ID(mod) (((uint16_t)mod->elem_idx << 8) | mod->mod_idx) +#define EMDS_MODEL_ID(mod) (((uint16_t)mod->rt->elem_idx << 8) | mod->rt->mod_idx) #endif /** @@ -67,7 +67,7 @@ model_transition_buf_pull(struct net_buf_simple *buf, } static inline struct bt_mesh_model_transition * -model_transition_get(struct bt_mesh_model *model, +model_transition_get(const struct bt_mesh_model *model, struct bt_mesh_model_transition *transition, struct net_buf_simple *buf) { @@ -91,7 +91,7 @@ model_transition_is_invalid(const struct bt_mesh_model_transition *transition) transition->delay > BT_MESH_MODEL_DELAY_TIME_MAX_MS)); } -int32_t model_ackd_timeout_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx); +int32_t model_ackd_timeout_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx); #endif /* MODEL_UTILS_H__ */ diff --git a/subsys/bluetooth/mesh/scene_cli.c b/subsys/bluetooth/mesh/scene_cli.c index fa30c8641bf9..df943e87c119 100644 --- a/subsys/bluetooth/mesh/scene_cli.c +++ b/subsys/bluetooth/mesh/scene_cli.c @@ -7,11 +7,11 @@ #include #include "model_utils.h" -static int handle_scene_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_scene_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { struct bt_mesh_scene_state *rsp; - struct bt_mesh_scene_cli *cli = model->user_data; + struct bt_mesh_scene_cli *cli = model->rt->user_data; struct bt_mesh_scene_state state; state.status = net_buf_simple_pull_u8(buf); @@ -40,11 +40,11 @@ static int handle_scene_status(struct bt_mesh_model *model, struct bt_mesh_msg_c return 0; } -static int handle_scene_reg(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_scene_reg(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { struct bt_mesh_scene_register *rsp; - struct bt_mesh_scene_cli *cli = model->user_data; + struct bt_mesh_scene_cli *cli = model->rt->user_data; struct bt_mesh_scene_register reg; reg.status = net_buf_simple_pull_u8(buf); @@ -106,9 +106,9 @@ const struct bt_mesh_model_op _bt_mesh_scene_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int scene_cli_init(struct bt_mesh_model *model) +static int scene_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_scene_cli *cli = model->user_data; + struct bt_mesh_scene_cli *cli = model->rt->user_data; if (!cli) { return -EINVAL; @@ -125,9 +125,9 @@ static int scene_cli_init(struct bt_mesh_model *model) } -static void scene_cli_reset(struct bt_mesh_model *model) +static void scene_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_scene_cli *cli = model->user_data; + struct bt_mesh_scene_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/scene_srv.c b/subsys/bluetooth/mesh/scene_srv.c index 0076abcef1d3..455a225f1922 100644 --- a/subsys/bluetooth/mesh/scene_srv.c +++ b/subsys/bluetooth/mesh/scene_srv.c @@ -92,7 +92,7 @@ static struct bt_mesh_scene_srv *srv_find(uint16_t elem_idx) * composition data order. The first scene server that isn't * after this element will be the right one: */ - if (srv->model->elem_idx <= elem_idx) { + if (srv->model->rt->elem_idx <= elem_idx) { return srv; } } @@ -137,10 +137,10 @@ static void scene_status_encode(struct bt_mesh_scene_srv *srv, struct net_buf_si } } -static int scene_status_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int scene_status_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_scene_state *state) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_SCENE_OP_STATUS, BT_MESH_SCENE_MSG_MAXLEN_STATUS); @@ -158,10 +158,10 @@ static void curr_scene_state_get(struct bt_mesh_scene_srv *srv, struct bt_mesh_s state->status = BT_MESH_SCENE_SUCCESS; } -static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; struct bt_mesh_scene_state state; curr_scene_state_get(srv, &state); @@ -170,10 +170,10 @@ static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int scene_recall(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int scene_recall(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; struct bt_mesh_model_transition transition; struct bt_mesh_scene_state state; uint16_t scene; @@ -221,23 +221,23 @@ static int scene_recall(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx return 0; } -static int handle_recall(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_recall(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return scene_recall(model, ctx, buf, true); } -static int handle_recall_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_recall_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return scene_recall(model, ctx, buf, false); } -static int scene_register_status_send(struct bt_mesh_model *model, +static int scene_register_status_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_scene_status status) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_SCENE_OP_REGISTER_STATUS, BT_MESH_SCENE_MSG_MINLEN_REGISTER_STATUS + @@ -253,7 +253,7 @@ static int scene_register_status_send(struct bt_mesh_model *model, return bt_mesh_msg_send(model, ctx, &buf); } -static int handle_register_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_register_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { (void)scene_register_status_send(model, ctx, BT_MESH_SCENE_SUCCESS); @@ -302,7 +302,7 @@ static void entry_recover(struct bt_mesh_scene_srv *srv, bool vnd, const struct bt_mesh_elem *elem = &bt_mesh_comp_get()->elem[data->elem_idx]; const size_t overhead = vnd ? VND_MODEL_SCENE_DATA_OVERHEAD : 0; const struct bt_mesh_scene_entry *entry; - struct bt_mesh_model *mod; + const struct bt_mesh_model *mod; if (vnd) { mod = bt_mesh_model_find_vnd(elem, sys_get_le16(data->data), data->id); @@ -343,14 +343,14 @@ static void page_recover(struct bt_mesh_scene_srv *srv, bool vnd, } } -static ssize_t entry_store(struct bt_mesh_model *mod, +static ssize_t entry_store(const struct bt_mesh_model *mod, const struct bt_mesh_scene_entry *entry, bool vnd, uint8_t buf[]) { struct scene_data *data = (struct scene_data *)buf; ssize_t size; - data->elem_idx = mod->elem_idx; + data->elem_idx = mod->rt->elem_idx; if (vnd) { data->id = mod->vnd.id; @@ -366,13 +366,13 @@ static ssize_t entry_store(struct bt_mesh_model *mod, if (size > entry->maxlen) { LOG_ERR("Entry %s:%u:%u: data too large (%u bytes)", - vnd ? "vnd" : "sig", mod->elem_idx, mod->mod_idx, size); + vnd ? "vnd" : "sig", mod->rt->elem_idx, mod->rt->mod_idx, size); return -EINVAL; } if (size < 0) { LOG_WRN("Failed storing %s:%u:%u (%d)", vnd ? "vnd" : "sig", - mod->elem_idx, mod->mod_idx, size); + mod->rt->elem_idx, mod->rt->mod_idx, size); return size; } @@ -429,18 +429,18 @@ static uint16_t srv_elem_end(const struct bt_mesh_scene_srv *srv) break; } - end = it->model->elem_idx; + end = it->model->rt->elem_idx; } return end; } -static void scene_recall_complete_mod(struct bt_mesh_scene_srv *srv, struct bt_mesh_model *models, - int model_count, bool vnd) +static void scene_recall_complete_mod(struct bt_mesh_scene_srv *srv, + const struct bt_mesh_model *models, int model_count, bool vnd) { for (int j = 0; j < model_count; j++) { const struct bt_mesh_scene_entry *entry; - struct bt_mesh_model *mod = &models[j]; + const struct bt_mesh_model *mod = &models[j]; if (mod == srv->model) { continue; @@ -469,7 +469,7 @@ static void scene_recall_complete(struct bt_mesh_scene_srv *srv) const struct bt_mesh_comp *comp = bt_mesh_comp_get(); uint16_t elem_end = srv_elem_end(srv); - for (int i = srv->model->elem_idx; i < elem_end; i++) { + for (int i = srv->model->rt->elem_idx; i < elem_end; i++) { const struct bt_mesh_elem *elem = &comp->elem[i]; scene_recall_complete_mod(srv, elem->models, elem->model_count, false); @@ -487,14 +487,14 @@ static void scene_store_mod(struct bt_mesh_scene_srv *srv, uint16_t scene, uint8_t page = 0; size_t len = 0; - for (int i = srv->model->elem_idx; i < elem_end; i++) { + for (int i = srv->model->rt->elem_idx; i < elem_end; i++) { const struct bt_mesh_elem *elem = &comp->elem[i]; - struct bt_mesh_model *models = vnd ? elem->vnd_models : elem->models; + const struct bt_mesh_model *models = vnd ? elem->vnd_models : elem->models; int model_count = vnd ? elem->vnd_model_count : elem->model_count; for (int j = 0; j < model_count; j++) { const struct bt_mesh_scene_entry *entry; - struct bt_mesh_model *mod = &models[j]; + const struct bt_mesh_model *mod = &models[j]; ssize_t size; if (mod == srv->model) { @@ -588,10 +588,10 @@ static void scene_delete(struct bt_mesh_scene_srv *srv, uint16_t *scene) *scene = srv->all[--srv->count]; } -static int handle_store(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_store(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; enum bt_mesh_scene_status status; uint16_t scene_number; @@ -606,10 +606,10 @@ static int handle_store(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx return 0; } -static int handle_store_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_store_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; uint16_t scene_number; scene_number = net_buf_simple_pull_le16(buf); @@ -635,10 +635,10 @@ static int delete_scene(struct bt_mesh_scene_srv *srv, struct bt_mesh_msg_ctx *c return 0; } -static int handle_delete(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_delete(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; int err; err = delete_scene(srv, ctx, buf); @@ -651,10 +651,10 @@ static int handle_delete(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ct return 0; } -static int handle_delete_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_delete_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; return delete_scene(srv, ctx, buf); } @@ -702,9 +702,9 @@ static void scene_srv_transition_end(struct k_work *work) } } -static int scene_srv_pub_update(struct bt_mesh_model *model) +static int scene_srv_pub_update(const struct bt_mesh_model *model) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; struct bt_mesh_scene_state state; curr_scene_state_get(srv, &state); @@ -712,9 +712,9 @@ static int scene_srv_pub_update(struct bt_mesh_model *model) return 0; } -static int scene_srv_init(struct bt_mesh_model *model) +static int scene_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; sys_slist_prepend(&scene_servers, &srv->n); @@ -729,10 +729,10 @@ static int scene_srv_init(struct bt_mesh_model *model) return 0; } -static int scene_srv_set(struct bt_mesh_model *model, const char *path, +static int scene_srv_set(const struct bt_mesh_model *model, const char *path, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; uint8_t buf[SCENE_PAGE_SIZE]; uint16_t scene; ssize_t size; @@ -793,9 +793,9 @@ static int scene_srv_set(struct bt_mesh_model *model, const char *path, return 0; } -static void scene_srv_reset(struct bt_mesh_model *model) +static void scene_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; srv->next = BT_MESH_SCENE_NONE; @@ -816,9 +816,9 @@ const struct bt_mesh_model_cb _bt_mesh_scene_srv_cb = { .reset = scene_srv_reset, }; -static int scene_setup_srv_init(struct bt_mesh_model *model) +static int scene_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_scene_srv *srv = model->user_data; + struct bt_mesh_scene_srv *srv = model->rt->user_data; struct bt_mesh_dtt_srv *dtt_srv = NULL; int err; @@ -856,9 +856,9 @@ const struct bt_mesh_model_cb _bt_mesh_scene_setup_srv_cb = { .init = scene_setup_srv_init, }; -void bt_mesh_scene_invalidate(struct bt_mesh_model *mod) +void bt_mesh_scene_invalidate(const struct bt_mesh_model *mod) { - struct bt_mesh_scene_srv *srv = srv_find(mod->elem_idx); + struct bt_mesh_scene_srv *srv = srv_find(mod->rt->elem_idx); if (!srv) { return; @@ -915,7 +915,7 @@ int bt_mesh_scene_srv_set(struct bt_mesh_scene_srv *srv, uint16_t scene, } sprintf(path, "bt/mesh/s/%x/data/%x", - (srv->model->elem_idx << 8) | srv->model->mod_idx, scene); + (srv->model->rt->elem_idx << 8) | srv->model->rt->mod_idx, scene); LOG_DBG("Loading %s", path); diff --git a/subsys/bluetooth/mesh/scheduler_cli.c b/subsys/bluetooth/mesh/scheduler_cli.c index 29c97f36f13a..00656dbebbc2 100644 --- a/subsys/bluetooth/mesh/scheduler_cli.c +++ b/subsys/bluetooth/mesh/scheduler_cli.c @@ -8,10 +8,10 @@ #include "scheduler_internal.h" #include "model_utils.h" -static int handle_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_scheduler_cli *cli = model->user_data; + struct bt_mesh_scheduler_cli *cli = model->rt->user_data; uint16_t schedules; uint16_t *rsp; @@ -30,10 +30,10 @@ static int handle_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ct return 0; } -static int handle_action_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_action_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_scheduler_cli *cli = model->user_data; + struct bt_mesh_scheduler_cli *cli = model->rt->user_data; struct bt_mesh_schedule_entry action_data = {0}; struct bt_mesh_schedule_entry *action = NULL; struct bt_mesh_schedule_entry *rsp; @@ -80,9 +80,9 @@ const struct bt_mesh_model_op _bt_mesh_scheduler_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int scheduler_cli_init(struct bt_mesh_model *model) +static int scheduler_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_scheduler_cli *cli = model->user_data; + struct bt_mesh_scheduler_cli *cli = model->rt->user_data; if (!cli) { return -EINVAL; @@ -99,9 +99,9 @@ static int scheduler_cli_init(struct bt_mesh_model *model) return 0; } -static void scheduler_cli_reset(struct bt_mesh_model *model) +static void scheduler_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_scheduler_cli *cli = model->user_data; + struct bt_mesh_scheduler_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/scheduler_srv.c b/subsys/bluetooth/mesh/scheduler_srv.c index fe81e3c261d8..9b2db9187c09 100644 --- a/subsys/bluetooth/mesh/scheduler_srv.c +++ b/subsys/bluetooth/mesh/scheduler_srv.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "model_utils.h" #include "time_util.h" #include "scheduler_internal.h" @@ -478,7 +478,7 @@ static void scheduled_action_handle(struct k_work *work) WRITE_BIT(srv->active_bitmap, srv->idx, 0); - struct bt_mesh_model *next_sched_mod = NULL; + const struct bt_mesh_model *next_sched_mod = NULL; uint16_t model_id = srv->sch_reg[srv->idx].action == BT_MESH_SCHEDULER_SCENE_RECALL ? BT_MESH_MODEL_ID_SCENE_SRV : BT_MESH_MODEL_ID_GEN_ONOFF_SRV; @@ -488,30 +488,30 @@ static void scheduled_action_handle(struct k_work *work) .delay = 0, }; uint16_t scene = srv->sch_reg[srv->idx].scene_number; - struct bt_mesh_elem *elem = bt_mesh_model_elem(srv->model); + const struct bt_mesh_elem *elem = bt_mesh_model_elem(srv->model); LOG_DBG("Scheduler action fired: %d", srv->sch_reg[srv->idx].action); do { - struct bt_mesh_model *handled_model = + const struct bt_mesh_model *handled_model = bt_mesh_model_find(elem, model_id); if (model_id == BT_MESH_MODEL_ID_SCENE_SRV && handled_model != NULL) { struct bt_mesh_scene_srv *scene_srv = - (struct bt_mesh_scene_srv *)handled_model->user_data; + (struct bt_mesh_scene_srv *)handled_model->rt->user_data; bt_mesh_scene_srv_set(scene_srv, scene, &transition); bt_mesh_scene_srv_pub(scene_srv, NULL); LOG_DBG("Scene srv addr: %d recalled scene: %d", - elem->addr, + elem->rt->addr, srv->sch_reg[srv->idx].scene_number); } if (model_id == BT_MESH_MODEL_ID_GEN_ONOFF_SRV && handled_model != NULL) { struct bt_mesh_onoff_srv *onoff_srv = - (struct bt_mesh_onoff_srv *)handled_model->user_data; + (struct bt_mesh_onoff_srv *)handled_model->rt->user_data; struct bt_mesh_onoff_set set = { .on_off = srv->sch_reg[srv->idx].action, .transition = &transition @@ -522,12 +522,12 @@ static void scheduled_action_handle(struct k_work *work) NULL, &set, &status); bt_mesh_onoff_srv_pub(onoff_srv, NULL, &status); LOG_DBG("Onoff srv addr: %d set: %d", - elem->addr, + elem->rt->addr, srv->sch_reg[srv->idx].action); } - elem = BT_MESH_ADDR_IS_UNICAST(elem->addr + 1) ? - bt_mesh_elem_find(elem->addr + 1) : NULL; + elem = BT_MESH_ADDR_IS_UNICAST(elem->rt->addr + 1) ? + bt_mesh_elem_find(elem->rt->addr + 1) : NULL; if (elem) { next_sched_mod = bt_mesh_model_find(elem, @@ -587,10 +587,10 @@ static void encode_action_status(struct bt_mesh_scheduler_srv *srv, } } -static int send_scheduler_status(struct bt_mesh_model *model, +static int send_scheduler_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_SCHEDULER_OP_STATUS, BT_MESH_SCHEDULER_MSG_LEN_STATUS); @@ -599,12 +599,12 @@ static int send_scheduler_status(struct bt_mesh_model *model, return bt_mesh_msg_send(model, ctx, &buf); } -static int send_scheduler_action_status(struct bt_mesh_model *model, +static int send_scheduler_action_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, uint8_t idx, bool is_reduced) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_SCHEDULER_OP_ACTION_STATUS, is_reduced ? @@ -616,10 +616,10 @@ static int send_scheduler_action_status(struct bt_mesh_model *model, return bt_mesh_msg_send(model, ctx, &buf); } -static int action_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int action_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; uint8_t idx; struct bt_mesh_schedule_entry tmp = { 0 }; @@ -659,7 +659,7 @@ static int action_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_scheduler_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_scheduler_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { LOG_DBG("Rx: scheduler server get"); @@ -668,10 +668,10 @@ static int handle_scheduler_get(struct bt_mesh_model *model, struct bt_mesh_msg_ return 0; } -static int handle_scheduler_action_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_scheduler_action_get(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; uint8_t idx = net_buf_simple_pull_u8(buf); if (idx >= BT_MESH_SCHEDULER_ACTION_ENTRY_COUNT) { @@ -679,19 +679,18 @@ static int handle_scheduler_action_get(struct bt_mesh_model *model, struct bt_me } LOG_DBG("Rx: scheduler server action index %d get", idx); - send_scheduler_action_status(model, ctx, idx, - !is_entry_defined(srv, idx)); + send_scheduler_action_status(model, ctx, idx, !is_entry_defined(srv, idx)); return 0; } -static int handle_scheduler_action_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_scheduler_action_set(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return action_set(model, ctx, buf, true); } -static int handle_scheduler_action_set_unack(struct bt_mesh_model *model, +static int handle_scheduler_action_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { @@ -726,9 +725,9 @@ const struct bt_mesh_model_op _bt_mesh_scheduler_setup_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; if (srv->last_idx == BT_MESH_SCHEDULER_ACTION_ENTRY_COUNT) { encode_status(srv, srv->pub.msg); @@ -738,9 +737,9 @@ static int update_handler(struct bt_mesh_model *model) return 0; } -static int scheduler_srv_init(struct bt_mesh_model *model) +static int scheduler_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; if (srv->time_srv == NULL) { return -ECANCELED; @@ -764,9 +763,9 @@ static int scheduler_srv_init(struct bt_mesh_model *model) return 0; } -static void scheduler_srv_reset(struct bt_mesh_model *model) +static void scheduler_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; srv->idx = BT_MESH_SCHEDULER_ACTION_ENTRY_COUNT; srv->last_idx = BT_MESH_SCHEDULER_ACTION_ENTRY_COUNT; @@ -790,12 +789,12 @@ static void scheduler_srv_reset(struct bt_mesh_model *model) } #ifdef CONFIG_BT_SETTINGS -static int scheduler_srv_settings_set(struct bt_mesh_model *model, +static int scheduler_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_data) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; struct bt_mesh_schedule_entry data = { 0 }; ssize_t len = read_cb(cb_data, &data, sizeof(data)); uint8_t idx = strtol(name, NULL, 16); @@ -818,9 +817,9 @@ const struct bt_mesh_model_cb _bt_mesh_scheduler_srv_cb = { #endif }; -static int scheduler_setup_srv_init(struct bt_mesh_model *model) +static int scheduler_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_scheduler_srv *srv = model->user_data; + struct bt_mesh_scheduler_srv *srv = model->rt->user_data; #if defined(CONFIG_BT_MESH_COMP_PAGE_1) int err = bt_mesh_model_correspond(model, srv->model); diff --git a/subsys/bluetooth/mesh/sensor_cli.c b/subsys/bluetooth/mesh/sensor_cli.c index 4a5b7619aa95..93289fc152e3 100644 --- a/subsys/bluetooth/mesh/sensor_cli.c +++ b/subsys/bluetooth/mesh/sensor_cli.c @@ -63,14 +63,14 @@ static void unknown_type(struct bt_mesh_sensor_cli *cli, } } -static int handle_descriptor_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_descriptor_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { if (buf->len != 2 && buf->len % 8) { return -EMSGSIZE; } - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; struct list_rsp *ack_ctx = NULL; uint32_t count = 0; @@ -108,10 +108,10 @@ static int handle_descriptor_status(struct bt_mesh_model *model, struct bt_mesh_ return 0; } -static int handle_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; struct sensor_data_list_rsp *rsp = NULL; uint32_t count = 0; int err; @@ -199,10 +199,10 @@ static int parse_series_entry(const struct bt_mesh_sensor_type *type, return sensor_column_decode(buf, type, &entry->column, entry->value); } -static int handle_column_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_column_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; struct series_data_rsp *rsp; const struct bt_mesh_sensor_format *col_format; const struct bt_mesh_sensor_type *type; @@ -260,10 +260,10 @@ static int handle_column_status(struct bt_mesh_model *model, struct bt_mesh_msg_ return 0; } -static int handle_series_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_series_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; const struct bt_mesh_sensor_format *col_format; const struct bt_mesh_sensor_type *type; struct series_data_rsp *rsp = NULL; @@ -323,10 +323,10 @@ static int handle_series_status(struct bt_mesh_model *model, struct bt_mesh_msg_ return 0; } -static int handle_cadence_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_cadence_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; struct cadence_rsp *rsp; int err; @@ -372,10 +372,10 @@ static int handle_cadence_status(struct bt_mesh_model *model, struct bt_mesh_msg return 0; } -static int handle_settings_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_settings_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; struct settings_rsp *rsp; if (buf->len % 2) { @@ -415,10 +415,10 @@ static int handle_settings_status(struct bt_mesh_model *model, struct bt_mesh_ms return 0; } -static int handle_setting_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_setting_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; struct setting_rsp *rsp; int err; @@ -520,9 +520,9 @@ const struct bt_mesh_model_op _bt_mesh_sensor_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int sensor_cli_init(struct bt_mesh_model *model) +static int sensor_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -533,9 +533,9 @@ static int sensor_cli_init(struct bt_mesh_model *model) return 0; } -static void sensor_cli_reset(struct bt_mesh_model *model) +static void sensor_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_sensor_cli *cli = model->user_data; + struct bt_mesh_sensor_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/sensor_srv.c b/subsys/bluetooth/mesh/sensor_srv.c index 24a8690bbdcb..3be4b1eb5636 100644 --- a/subsys/bluetooth/mesh/sensor_srv.c +++ b/subsys/bluetooth/mesh/sensor_srv.c @@ -37,9 +37,9 @@ static struct bt_mesh_sensor *sensor_get(struct bt_mesh_sensor_srv *srv, } #if CONFIG_BT_SETTINGS -static void sensor_srv_pending_store(struct bt_mesh_model *model) +static void sensor_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; /* Cadence is stored as a sequence of cadence status messages */ NET_BUF_SIMPLE_DEFINE(buf, (CONFIG_BT_MESH_SENSOR_SRV_SENSORS_MAX * @@ -129,10 +129,10 @@ static int buf_status_add(struct bt_mesh_sensor_srv *srv, return err; } -static int handle_descriptor_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_descriptor_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; if (buf->len != BT_MESH_SENSOR_MSG_MINLEN_DESCRIPTOR_GET && buf->len != BT_MESH_SENSOR_MSG_MAXLEN_DESCRIPTOR_GET) { @@ -178,10 +178,10 @@ static int handle_descriptor_get(struct bt_mesh_model *model, struct bt_mesh_msg return 0; } -static int handle_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; if (buf->len != BT_MESH_SENSOR_MSG_MINLEN_GET && buf->len != BT_MESH_SENSOR_MSG_MAXLEN_GET) { @@ -239,10 +239,10 @@ column_get(const struct bt_mesh_sensor_series *series, return NULL; } -static int handle_column_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_column_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; int err; uint16_t id = net_buf_simple_pull_le16(buf); @@ -340,10 +340,10 @@ static uint16_t max_column_count(const struct bt_mesh_sensor_type *sensor) } } -static int handle_series_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_series_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; const struct bt_mesh_sensor_format *col_format; uint16_t id = net_buf_simple_pull_le16(buf); @@ -478,10 +478,10 @@ const struct bt_mesh_model_op _bt_mesh_sensor_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static int handle_cadence_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_cadence_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; struct bt_mesh_sensor *sensor; uint16_t id; int err; @@ -516,10 +516,10 @@ static int handle_cadence_get(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int cadence_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int cadence_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; struct bt_mesh_sensor *sensor; uint16_t id; @@ -609,22 +609,22 @@ static int cadence_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_cadence_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_cadence_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return cadence_set(model, ctx, buf, true); } -static int handle_cadence_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_cadence_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return cadence_set(model, ctx, buf, false); } -static int handle_settings_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_settings_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; uint16_t id = net_buf_simple_pull_le16(buf); @@ -670,10 +670,10 @@ setting_get(struct bt_mesh_sensor *sensor, uint16_t setting_id) return NULL; } -static int handle_setting_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_setting_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; uint16_t id = net_buf_simple_pull_le16(buf); uint16_t setting_id = net_buf_simple_pull_le16(buf); int err; @@ -724,10 +724,10 @@ static int handle_setting_get(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int setting_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int setting_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, bool ack) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; uint16_t id = net_buf_simple_pull_le16(buf); uint16_t setting_id = net_buf_simple_pull_le16(buf); int err; @@ -795,13 +795,13 @@ static int setting_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_setting_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_setting_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return setting_set(model, ctx, buf, true); } -static int handle_setting_set_unack(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_setting_set_unack(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return setting_set(model, ctx, buf, false); @@ -941,9 +941,9 @@ static void pub_msg_add(struct bt_mesh_sensor_srv *srv, s->state.seq = srv->seq; } -static int update_handler(struct bt_mesh_model *model) +static int update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; struct bt_mesh_sensor *s; bt_mesh_model_msg_init(srv->pub.msg, BT_MESH_SENSOR_OP_STATUS); @@ -986,9 +986,9 @@ static int update_handler(struct bt_mesh_model *model) return (srv->pub.msg->len > original_len) ? 0 : -ENOENT; } -static int sensor_srv_init(struct bt_mesh_model *model) +static int sensor_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; sys_slist_init(&srv->sensors); @@ -1038,9 +1038,9 @@ static int sensor_srv_init(struct bt_mesh_model *model) return 0; } -static void sensor_srv_reset(struct bt_mesh_model *model) +static void sensor_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; net_buf_simple_reset(srv->pub.msg); net_buf_simple_reset(srv->setup_pub.msg); @@ -1062,11 +1062,11 @@ static void sensor_srv_reset(struct bt_mesh_model *model) } } -static int sensor_srv_settings_set(struct bt_mesh_model *model, const char *name, +static int sensor_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; int err = 0; NET_BUF_SIMPLE_DEFINE(buf, (CONFIG_BT_MESH_SENSOR_SRV_SENSORS_MAX * @@ -1130,9 +1130,9 @@ const struct bt_mesh_model_cb _bt_mesh_sensor_srv_cb = { #endif }; -static int sensor_setup_srv_init(struct bt_mesh_model *model) +static int sensor_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_sensor_srv *srv = model->user_data; + struct bt_mesh_sensor_srv *srv = model->rt->user_data; #if defined(CONFIG_BT_MESH_COMP_PAGE_1) int err = bt_mesh_model_correspond(model, srv->model); diff --git a/subsys/bluetooth/mesh/sensor_types.c b/subsys/bluetooth/mesh/sensor_types.c index b04b140f362a..8272a4bde932 100644 --- a/subsys/bluetooth/mesh/sensor_types.c +++ b/subsys/bluetooth/mesh/sensor_types.c @@ -8,7 +8,7 @@ #include #include "sensor.h" #include -#include +#include #include #include diff --git a/subsys/bluetooth/mesh/shell/shell_bat_cli.c b/subsys/bluetooth/mesh/shell/shell_bat_cli.c index 8b938e4cc57e..63ac7367b718 100644 --- a/subsys/bluetooth/mesh/shell/shell_bat_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_bat_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static int cmd_battery_get(const struct shell *shell, size_t argc, char *argv[]) { diff --git a/subsys/bluetooth/mesh/shell/shell_ctl_cli.c b/subsys/bluetooth/mesh/shell/shell_ctl_cli.c index 290a8540bb39..2e693a154265 100644 --- a/subsys/bluetooth/mesh/shell/shell_ctl_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_ctl_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void ctl_print(const struct shell *shell, int err, struct bt_mesh_light_ctl_status *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_ctrl_cli.c b/subsys/bluetooth/mesh/shell/shell_ctrl_cli.c index a7aac10a42af..21d31d43e1aa 100644 --- a/subsys/bluetooth/mesh/shell/shell_ctrl_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_ctrl_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void mode_print(const struct shell *shell, int err, bool rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_dm_cli.c b/subsys/bluetooth/mesh/shell/shell_dm_cli.c index 3ff4420648a3..aeb5db703b19 100644 --- a/subsys/bluetooth/mesh/shell/shell_dm_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_dm_cli.c @@ -13,7 +13,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static int cmd_cfg(const struct shell *shell, size_t argc, char *argv[]) { diff --git a/subsys/bluetooth/mesh/shell/shell_dtt_cli.c b/subsys/bluetooth/mesh/shell/shell_dtt_cli.c index b7ccab36311c..da8bc1c6c619 100644 --- a/subsys/bluetooth/mesh/shell/shell_dtt_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_dtt_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void dtt_print(const struct shell *shell, int err, int32_t rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_hsl_cli.c b/subsys/bluetooth/mesh/shell/shell_hsl_cli.c index b35c1d78d02b..bea9e6bc1074 100644 --- a/subsys/bluetooth/mesh/shell/shell_hsl_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_hsl_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void hsl_print(const struct shell *shell, int err, struct bt_mesh_light_hsl_status *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_lightness_cli.c b/subsys/bluetooth/mesh/shell/shell_lightness_cli.c index c83f6378412e..d14f52d2f3b6 100644 --- a/subsys/bluetooth/mesh/shell/shell_lightness_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_lightness_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void light_print(const struct shell *shell, int err, struct bt_mesh_lightness_status *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_loc_cli.c b/subsys/bluetooth/mesh/shell/shell_loc_cli.c index bd6dff983cad..37d8d061eaae 100644 --- a/subsys/bluetooth/mesh/shell/shell_loc_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_loc_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void global_loc_print(const struct shell *shell, int err, struct bt_mesh_loc_global *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_lvl_cli.c b/subsys/bluetooth/mesh/shell/shell_lvl_cli.c index 8bd65c718256..4b74e7b8f42f 100644 --- a/subsys/bluetooth/mesh/shell/shell_lvl_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_lvl_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void status_print(const struct shell *shell, int err, struct bt_mesh_lvl_status *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_onoff_cli.c b/subsys/bluetooth/mesh/shell/shell_onoff_cli.c index e1ed45624df4..e07f2fa3b72b 100644 --- a/subsys/bluetooth/mesh/shell/shell_onoff_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_onoff_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void status_print(const struct shell *shell, int err, struct bt_mesh_onoff_status *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_plvl_cli.c b/subsys/bluetooth/mesh/shell/shell_plvl_cli.c index 8f38dd21279c..a815d1968099 100644 --- a/subsys/bluetooth/mesh/shell/shell_plvl_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_plvl_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void status_print(const struct shell *shell, int err, struct bt_mesh_plvl_status *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_ponoff_cli.c b/subsys/bluetooth/mesh/shell/shell_ponoff_cli.c index 66bb18b5a42b..4aafb0dd8e21 100644 --- a/subsys/bluetooth/mesh/shell/shell_ponoff_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_ponoff_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void pwr_up_print(const struct shell *shell, int err, enum bt_mesh_on_power_up rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_prop_cli.c b/subsys/bluetooth/mesh/shell/shell_prop_cli.c index 51a2a9045a2e..85e359cee095 100644 --- a/subsys/bluetooth/mesh/shell/shell_prop_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_prop_cli.c @@ -18,7 +18,7 @@ LOG_MODULE_REGISTER(bt_mesh_shell_prop_cli); #include "common/bt_str.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void props_print(const struct shell *shell, int err, struct bt_mesh_prop_list *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_scene_cli.c b/subsys/bluetooth/mesh/shell/shell_scene_cli.c index a2668a2bd8df..9104c6856162 100644 --- a/subsys/bluetooth/mesh/shell/shell_scene_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_scene_cli.c @@ -14,7 +14,7 @@ #define SHELL_SENSOR_CLI_REG_CNT_MAX 32 -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void scene_get_print(const struct shell *shell, int err, struct bt_mesh_scene_state *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_scheduler_cli.c b/subsys/bluetooth/mesh/shell/shell_scheduler_cli.c index 035d74e08853..6bb3a3699bf3 100644 --- a/subsys/bluetooth/mesh/shell/shell_scheduler_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_scheduler_cli.c @@ -15,7 +15,7 @@ #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static struct bt_mesh_schedule_entry set_entry; static int cmd_get(const struct shell *shell, size_t argc, char *argv[]) diff --git a/subsys/bluetooth/mesh/shell/shell_sensor_cli.c b/subsys/bluetooth/mesh/shell/shell_sensor_cli.c index 0d7662295066..3d79f6127ea1 100644 --- a/subsys/bluetooth/mesh/shell/shell_sensor_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_sensor_cli.c @@ -10,7 +10,7 @@ #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void descriptor_print(const struct shell *shell, int err, struct bt_mesh_sensor_descriptor *rsp) @@ -48,7 +48,7 @@ static int cmd_desc_get(const struct shell *shell, size_t argc, char *argv[]) return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; if (argc == 1) { uint32_t count = CONFIG_BT_MESH_SHELL_SENSOR_CLI_MAX_SENSORS; @@ -115,7 +115,7 @@ static int cmd_cadence_get(const struct shell *shell, size_t argc, char *argv[]) return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; struct bt_mesh_sensor_cadence_status rsp; const struct bt_mesh_sensor_type *sensor_type = bt_mesh_sensor_type_get(sensor_id); @@ -153,7 +153,7 @@ static int cadence_set(const struct shell *shell, size_t argc, char *argv[], boo return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; const struct bt_mesh_sensor_type *sensor_type = bt_mesh_sensor_type_get(sensor_id); if (sensor_type == NULL) { @@ -206,7 +206,7 @@ static int cmd_settings_get(const struct shell *shell, size_t argc, char *argv[] return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; uint32_t count = CONFIG_BT_MESH_SHELL_SENSOR_CLI_MAX_SETTINGS; uint16_t ids[CONFIG_BT_MESH_SHELL_SENSOR_CLI_MAX_SETTINGS]; @@ -256,7 +256,7 @@ static int cmd_setting_get(const struct shell *shell, size_t argc, char *argv[]) return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; struct bt_mesh_sensor_setting_status rsp; const struct bt_mesh_sensor_type *sensor_type = bt_mesh_sensor_type_get(sensor_id); const struct bt_mesh_sensor_type *setting_type = bt_mesh_sensor_type_get(setting_id); @@ -286,7 +286,7 @@ static int setting_set(const struct shell *shell, size_t argc, char *argv[], boo return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; const struct bt_mesh_sensor_type *sensor_type = bt_mesh_sensor_type_get(sensor_id); const struct bt_mesh_sensor_type *setting_type = bt_mesh_sensor_type_get(setting_id); @@ -336,7 +336,7 @@ static int cmd_get(const struct shell *shell, size_t argc, char *argv[]) return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; if (argc == 1) { uint32_t count = CONFIG_BT_MESH_SHELL_SENSOR_CLI_MAX_SENSORS; @@ -398,7 +398,7 @@ static int cmd_series_entry_get(const struct shell *shell, size_t argc, char *ar return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; const struct bt_mesh_sensor_type *sensor_type = bt_mesh_sensor_type_get(sensor_id); if (sensor_type == NULL) { @@ -437,7 +437,7 @@ static int cmd_series_entries_get(const struct shell *shell, size_t argc, char * return -ENODEV; } - struct bt_mesh_sensor_cli *cli = mod->user_data; + struct bt_mesh_sensor_cli *cli = mod->rt->user_data; const struct bt_mesh_sensor_type *sensor_type = bt_mesh_sensor_type_get(sensor_id); diff --git a/subsys/bluetooth/mesh/shell/shell_time_cli.c b/subsys/bluetooth/mesh/shell/shell_time_cli.c index 4fbe3fad4ae6..a1fc2caeb210 100644 --- a/subsys/bluetooth/mesh/shell/shell_time_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_time_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void time_print(const struct shell *shell, int err, struct bt_mesh_time_status *rsp) { diff --git a/subsys/bluetooth/mesh/shell/shell_utils.c b/subsys/bluetooth/mesh/shell/shell_utils.c index fcac1dd5cabf..78b7412c71d1 100644 --- a/subsys/bluetooth/mesh/shell/shell_utils.c +++ b/subsys/bluetooth/mesh/shell/shell_utils.c @@ -140,7 +140,7 @@ double shell_model_strtodbl(const char *str, int *err) return (trimmed_buf[0] == '-') ? ((double)intgr - frac_dbl) : ((double)intgr + frac_dbl); } -static bool model_first_get(uint16_t id, struct bt_mesh_model **mod, uint16_t *cid) +static bool model_first_get(uint16_t id, const struct bt_mesh_model **mod, uint16_t *cid) { const struct bt_mesh_comp *comp = bt_mesh_comp_get(); @@ -159,20 +159,20 @@ static bool model_first_get(uint16_t id, struct bt_mesh_model **mod, uint16_t *c return false; } -bool shell_model_first_get(uint16_t id, struct bt_mesh_model **mod) +bool shell_model_first_get(uint16_t id, const struct bt_mesh_model **mod) { return model_first_get(id, mod, NULL); } -bool shell_vnd_model_first_get(uint16_t cid, uint16_t id, struct bt_mesh_model **mod) +bool shell_vnd_model_first_get(uint16_t cid, uint16_t id, const struct bt_mesh_model **mod) { return model_first_get(id, mod, &cid); } -static int instance_set(const struct shell *shell, struct bt_mesh_model **mod, uint16_t mod_id, - uint16_t *cid, uint8_t elem_idx) +static int instance_set(const struct shell *shell, const struct bt_mesh_model **mod, + uint16_t mod_id, uint16_t *cid, uint8_t elem_idx) { - struct bt_mesh_model *mod_temp; + const struct bt_mesh_model *mod_temp; const struct bt_mesh_comp *comp = bt_mesh_comp_get(); if (elem_idx >= comp->elem_count) { @@ -196,13 +196,13 @@ static int instance_set(const struct shell *shell, struct bt_mesh_model **mod, u return 0; } -int shell_model_instance_set(const struct shell *shell, struct bt_mesh_model **mod, uint16_t mod_id, - uint8_t elem_idx) +int shell_model_instance_set(const struct shell *shell, const struct bt_mesh_model **mod, + uint16_t mod_id, uint8_t elem_idx) { return instance_set(shell, mod, mod_id, NULL, elem_idx); } -int shell_vnd_model_instance_set(const struct shell *shell, struct bt_mesh_model **mod, +int shell_vnd_model_instance_set(const struct shell *shell, const struct bt_mesh_model **mod, uint16_t mod_id, uint16_t cid, uint8_t elem_idx) { return instance_set(shell, mod, mod_id, &cid, elem_idx); @@ -212,11 +212,11 @@ static void model_instances_get(uint16_t id, uint16_t *cid, struct shell_model_i uint8_t len) { const struct bt_mesh_comp *comp = bt_mesh_comp_get(); - struct bt_mesh_elem *elem; - struct bt_mesh_model *mod; + const struct bt_mesh_elem *elem; + const struct bt_mesh_model *mod; for (int i = 0; i < len; i++) { - elem = bt_mesh_elem_find(comp->elem[i].addr); + elem = bt_mesh_elem_find(comp->elem[i].rt->addr); if (cid) { mod = bt_mesh_model_find_vnd(elem, *cid, id); @@ -225,8 +225,8 @@ static void model_instances_get(uint16_t id, uint16_t *cid, struct shell_model_i } if (mod) { - arr[i].addr = comp->elem[i].addr; - arr[i].elem_idx = mod->elem_idx; + arr[i].addr = comp->elem[i].rt->addr; + arr[i].elem_idx = mod->rt->elem_idx; } } } diff --git a/subsys/bluetooth/mesh/shell/shell_utils.h b/subsys/bluetooth/mesh/shell/shell_utils.h index 6661437a90bb..9b039593d921 100644 --- a/subsys/bluetooth/mesh/shell/shell_utils.h +++ b/subsys/bluetooth/mesh/shell/shell_utils.h @@ -13,14 +13,14 @@ void shell_model_print_sensorval(const struct shell *shell, struct sensor_value double shell_model_strtodbl(const char *str, int *err); -bool shell_model_first_get(uint16_t id, struct bt_mesh_model **mod); +bool shell_model_first_get(uint16_t id, const struct bt_mesh_model **mod); -bool shell_vnd_model_first_get(uint16_t cid, uint16_t id, struct bt_mesh_model **mod); +bool shell_vnd_model_first_get(uint16_t cid, uint16_t id, const struct bt_mesh_model **mod); -int shell_model_instance_set(const struct shell *shell, struct bt_mesh_model **mod, +int shell_model_instance_set(const struct shell *shell, const struct bt_mesh_model **mod, uint16_t mod_id, uint8_t elem_idx); -int shell_vnd_model_instance_set(const struct shell *shell, struct bt_mesh_model **mod, +int shell_vnd_model_instance_set(const struct shell *shell, const struct bt_mesh_model **mod, uint16_t mod_id, uint16_t cid, uint8_t elem_idx); int shell_model_instances_get_all(const struct shell *shell, uint16_t mod_id); diff --git a/subsys/bluetooth/mesh/shell/shell_xyl_cli.c b/subsys/bluetooth/mesh/shell/shell_xyl_cli.c index b536d1bc7c3e..adadf48b012e 100644 --- a/subsys/bluetooth/mesh/shell/shell_xyl_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_xyl_cli.c @@ -12,7 +12,7 @@ #include "mesh/access.h" #include "shell_utils.h" -static struct bt_mesh_model *mod; +static const struct bt_mesh_model *mod; static void xyl_print(const struct shell *shell, int err, struct bt_mesh_light_xyl_status *rsp) { diff --git a/subsys/bluetooth/mesh/time_cli.c b/subsys/bluetooth/mesh/time_cli.c index e8e808fb3709..fcdaf0b1780e 100644 --- a/subsys/bluetooth/mesh/time_cli.c +++ b/subsys/bluetooth/mesh/time_cli.c @@ -12,11 +12,11 @@ #include "zephyr/logging/log.h" LOG_MODULE_REGISTER(bt_mesh_time_cli); -static int handle_status(struct bt_mesh_model *model, +static int handle_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_cli *cli = model->user_data; + struct bt_mesh_time_cli *cli = model->rt->user_data; struct bt_mesh_time_status status; struct bt_mesh_time_status *rsp; @@ -35,10 +35,10 @@ static int handle_status(struct bt_mesh_model *model, return 0; } -static int handle_time_role_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_time_role_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_cli *cli = model->user_data; + struct bt_mesh_time_cli *cli = model->rt->user_data; enum bt_mesh_time_role status; uint8_t *rsp; @@ -57,10 +57,10 @@ static int handle_time_role_status(struct bt_mesh_model *model, struct bt_mesh_m return 0; } -static int handle_time_zone_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_time_zone_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_cli *cli = model->user_data; + struct bt_mesh_time_cli *cli = model->rt->user_data; struct bt_mesh_time_zone_status status; struct bt_mesh_time_zone_status *rsp; @@ -83,15 +83,14 @@ static int handle_time_zone_status(struct bt_mesh_model *model, struct bt_mesh_m return 0; } -static int handle_tai_utc_delta_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +static int handle_tai_utc_delta_status(const struct bt_mesh_model *model, + struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_cli *cli = model->user_data; + struct bt_mesh_time_cli *cli = model->rt->user_data; struct bt_mesh_time_tai_utc_delta_status status; struct bt_mesh_time_tai_utc_delta_status *rsp; - status.delta_current = - net_buf_simple_pull_le16(buf) - UTC_CHANGE_ZERO_POINT; + status.delta_current = net_buf_simple_pull_le16(buf) - UTC_CHANGE_ZERO_POINT; status.tai_utc_change.delta_new = net_buf_simple_pull_le16(buf) - UTC_CHANGE_ZERO_POINT; status.tai_utc_change.timestamp = bt_mesh_time_buf_pull_tai_sec(buf); @@ -133,9 +132,9 @@ const struct bt_mesh_model_op _bt_mesh_time_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_time_cli_init(struct bt_mesh_model *model) +static int bt_mesh_time_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_time_cli *cli = model->user_data; + struct bt_mesh_time_cli *cli = model->rt->user_data; cli->model = model; net_buf_simple_init(cli->pub.msg, 0); @@ -149,9 +148,9 @@ static int bt_mesh_time_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_time_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_time_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_time_cli *cli = model->user_data; + struct bt_mesh_time_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/time_srv.c b/subsys/bluetooth/mesh/time_srv.c index a41d286f7a37..a3132a105e6b 100644 --- a/subsys/bluetooth/mesh/time_srv.c +++ b/subsys/bluetooth/mesh/time_srv.c @@ -105,10 +105,10 @@ static int16_t get_utc_delta(const struct bt_mesh_time_srv *srv, int64_t uptime) return srv->data.sync.status.tai_utc_delta; } -static int send_zone_status(struct bt_mesh_model *model, +static int send_zone_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; struct bt_mesh_time_zone_status resp = { .current_offset = get_zone_offset(srv, k_uptime_get()), .time_zone_change = srv->data.time_zone_change, @@ -126,10 +126,10 @@ static int send_zone_status(struct bt_mesh_model *model, return bt_mesh_model_send(model, ctx, &msg, NULL, NULL); } -static int send_tai_utc_delta_status(struct bt_mesh_model *model, +static int send_tai_utc_delta_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; struct bt_mesh_time_tai_utc_delta_status resp = { .delta_current = get_utc_delta(srv, k_uptime_get()), .tai_utc_change = srv->data.tai_utc_change, @@ -146,10 +146,10 @@ static int send_tai_utc_delta_status(struct bt_mesh_model *model, return bt_mesh_model_send(model, ctx, &msg, NULL, NULL); } -static int send_role_status(struct bt_mesh_model *model, +static int send_role_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; uint8_t resp = srv->data.role; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_TIME_OP_TIME_ROLE_STATUS, @@ -161,10 +161,10 @@ static int send_role_status(struct bt_mesh_model *model, return bt_mesh_model_send(model, ctx, &msg, NULL, NULL); } -static int send_time_status(struct bt_mesh_model *model, +static int send_time_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, int64_t uptime) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; struct bt_mesh_time_status status; int err; @@ -195,10 +195,10 @@ static void time_status_send_after_delay(struct k_work *work) (void)bt_mesh_time_srv_time_status_send(srv, NULL); } -static int handle_time_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_time_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; if ((srv->data.role != BT_MESH_TIME_CLIENT) && (srv->data.role != BT_MESH_TIME_RELAY)) { @@ -247,7 +247,7 @@ static int handle_time_status(struct bt_mesh_model *model, struct bt_mesh_msg_ct return 0; } -static int handle_time_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_time_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { send_time_status(model, ctx, k_uptime_get()); @@ -255,10 +255,10 @@ static int handle_time_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_time_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_time_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; bt_mesh_time_decode_time_params(buf, &srv->data.sync.status); srv->data.sync.uptime = k_uptime_get(); @@ -275,7 +275,7 @@ static int handle_time_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_zone_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_zone_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { send_zone_status(model, ctx); @@ -283,10 +283,10 @@ static int handle_zone_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_zone_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_zone_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; srv->data.time_zone_change.new_offset = net_buf_simple_pull_u8(buf) - ZONE_CHANGE_ZERO_POINT; @@ -302,7 +302,7 @@ static int handle_zone_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_tai_utc_delta_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_tai_utc_delta_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { send_tai_utc_delta_status(model, ctx); @@ -310,10 +310,10 @@ static int handle_tai_utc_delta_get(struct bt_mesh_model *model, struct bt_mesh_ return 0; } -static int handle_tai_utc_delta_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_tai_utc_delta_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; srv->data.tai_utc_change.delta_new = net_buf_simple_pull_le16(buf) - UTC_CHANGE_ZERO_POINT; @@ -328,7 +328,7 @@ static int handle_tai_utc_delta_set(struct bt_mesh_model *model, struct bt_mesh_ return 0; } -static int handle_role_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_role_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { send_role_status(model, ctx); @@ -336,10 +336,10 @@ static int handle_role_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx * return 0; } -static int handle_role_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_role_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; enum bt_mesh_time_role role; role = net_buf_simple_pull_u8(buf); @@ -409,9 +409,9 @@ const struct bt_mesh_model_op _bt_mesh_time_setup_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_time_srv_init(struct bt_mesh_model *model) +static int bt_mesh_time_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; srv->model = model; srv->data.timestamp = -STATUS_INTERVAL_MIN; @@ -422,9 +422,9 @@ static int bt_mesh_time_srv_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_time_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_time_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; struct bt_mesh_time_srv_data data = { .timestamp = -STATUS_INTERVAL_MIN }; srv->data = data; @@ -438,11 +438,11 @@ static void bt_mesh_time_srv_reset(struct bt_mesh_model *model) } #ifdef CONFIG_BT_MESH_TIME_SRV_PERSISTENT -static int bt_mesh_time_srv_settings_set(struct bt_mesh_model *model, +static int bt_mesh_time_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; struct bt_mesh_time_srv_settings_data data; if (read_cb(cb_arg, &data, sizeof(data)) != sizeof(data)) { @@ -467,9 +467,9 @@ const struct bt_mesh_model_cb _bt_mesh_time_srv_cb = { #endif }; -static int bt_mesh_time_setup_srv_init(struct bt_mesh_model *model) +static int bt_mesh_time_setup_srv_init(const struct bt_mesh_model *model) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; #if defined(CONFIG_BT_MESH_COMP_PAGE_1) int err = bt_mesh_model_correspond(model, srv->model); @@ -486,9 +486,9 @@ const struct bt_mesh_model_cb _bt_mesh_time_setup_srv_cb = { .init = bt_mesh_time_setup_srv_init, }; -int _bt_mesh_time_srv_update_handler(struct bt_mesh_model *model) +int _bt_mesh_time_srv_update_handler(const struct bt_mesh_model *model) { - struct bt_mesh_time_srv *srv = model->user_data; + struct bt_mesh_time_srv *srv = model->rt->user_data; struct bt_mesh_time_status status; int64_t uptime; int err; diff --git a/subsys/bluetooth/mesh/time_util.h b/subsys/bluetooth/mesh/time_util.h index ce1fb746c730..281c7344287a 100644 --- a/subsys/bluetooth/mesh/time_util.h +++ b/subsys/bluetooth/mesh/time_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Nordic Semiconductor ASA + * Copyright (c) 2020-2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ @@ -8,6 +8,7 @@ #define BT_MESH_TIME_UTIL #include +#include #ifdef __cplusplus extern "C" { @@ -19,7 +20,6 @@ extern "C" { #define DAYS_YEAR 365ULL #define DAYS_LEAP_YEAR 366ULL -#define SEC_PER_MIN (60ULL) #define SEC_PER_HOUR (60ULL * SEC_PER_MIN) #define SEC_PER_DAY (24ULL * SEC_PER_HOUR) diff --git a/subsys/bluetooth/mesh/vnd/dm_cli.c b/subsys/bluetooth/mesh/vnd/dm_cli.c index 3d6f2bcbb691..474686192fc4 100644 --- a/subsys/bluetooth/mesh/vnd/dm_cli.c +++ b/subsys/bluetooth/mesh/vnd/dm_cli.c @@ -8,10 +8,10 @@ #include "model_utils.h" #include -static int handle_cfg_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_cfg_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_dm_cli *cli = model->user_data; + struct bt_mesh_dm_cli *cli = model->rt->user_data; struct bt_mesh_dm_cli_cfg_status status; struct bt_mesh_dm_cli_cfg_status *rsp; uint8_t temp; @@ -65,10 +65,10 @@ static bool result_populate(struct bt_mesh_dm_res_entry *entry, return true; } -static int handle_result_status(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_result_status(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_dm_cli *cli = model->user_data; + struct bt_mesh_dm_cli *cli = model->rt->user_data; struct bt_mesh_dm_cli_results status = { .res = cli->res_arr, .entry_cnt = 0 @@ -105,7 +105,7 @@ static int handle_result_status(struct bt_mesh_model *model, struct bt_mesh_msg_ return 0; } -static int handle_msg(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_msg(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { uint8_t opcode = net_buf_simple_pull_u8(buf); @@ -129,9 +129,9 @@ const struct bt_mesh_model_op _bt_mesh_dm_cli_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_dm_cli_init(struct bt_mesh_model *model) +static int bt_mesh_dm_cli_init(const struct bt_mesh_model *model) { - struct bt_mesh_dm_cli *cli = model->user_data; + struct bt_mesh_dm_cli *cli = model->rt->user_data; cli->model = model; cli->pub.msg = &cli->pub_buf; @@ -141,9 +141,9 @@ static int bt_mesh_dm_cli_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_dm_cli_reset(struct bt_mesh_model *model) +static void bt_mesh_dm_cli_reset(const struct bt_mesh_model *model) { - struct bt_mesh_dm_cli *cli = model->user_data; + struct bt_mesh_dm_cli *cli = model->rt->user_data; net_buf_simple_reset(cli->pub.msg); bt_mesh_msg_ack_ctx_reset(&cli->ack_ctx); diff --git a/subsys/bluetooth/mesh/vnd/dm_srv.c b/subsys/bluetooth/mesh/vnd/dm_srv.c index 8995543e6d28..f360a17304a0 100644 --- a/subsys/bluetooth/mesh/vnd/dm_srv.c +++ b/subsys/bluetooth/mesh/vnd/dm_srv.c @@ -24,9 +24,9 @@ struct settings_data { } __packed; #if CONFIG_BT_SETTINGS -static void bt_mesh_dm_srv_pending_store(struct bt_mesh_model *model) +static void bt_mesh_dm_srv_pending_store(const struct bt_mesh_model *model) { - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; struct settings_data data = { .cfg = srv->cfg, @@ -102,10 +102,10 @@ static void new_entry_store(struct dm_result *result) } } -static void cfg_status_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, +static void cfg_status_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, uint8_t status) { - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_DM_CLI_OP, BT_MESH_DM_CONFIG_STATUS_MSG_LEN); @@ -145,10 +145,10 @@ static void result_pack(struct bt_mesh_dm_res_entry *entry, struct net_buf_simpl } } -static void result_status_populate(struct bt_mesh_model *model, struct net_buf_simple *buf, +static void result_status_populate(const struct bt_mesh_model *model, struct net_buf_simple *buf, uint8_t cnt) { - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; for (int i = 0; i < MIN(cnt, srv->results.available_entries); i++) { struct bt_mesh_dm_res_entry *entry = entry_get(srv, i); @@ -157,7 +157,7 @@ static void result_status_populate(struct bt_mesh_model *model, struct net_buf_s } } -static void result_status_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, +static void result_status_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *rx_ctx, uint8_t cnt, int8_t status) { BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_DM_CLI_OP, @@ -177,7 +177,7 @@ static void result_status_send(struct bt_mesh_model *model, struct bt_mesh_msg_c (void)bt_mesh_model_send(model, rx_ctx, &msg, NULL, NULL); } -static void sync_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, uint8_t mode, +static void sync_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, uint8_t mode, uint8_t timeout) { BT_MESH_MODEL_BUF_DEFINE(msg, BT_MESH_DM_SRV_OP, BT_MESH_DM_SYNC_MSG_LEN); @@ -188,10 +188,10 @@ static void sync_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, (void)bt_mesh_model_send(model, ctx, &msg, NULL, NULL); } -static int handle_cfg(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_cfg(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; if (!buf->len) { cfg_status_send(model, ctx, 0); @@ -218,11 +218,11 @@ static int handle_cfg(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_start(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_start(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { int err = 0; - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; uint8_t timeout = srv->cfg.timeout; uint8_t delay = srv->cfg.delay; uint16_t temp = net_buf_simple_pull_le16(buf); @@ -269,7 +269,7 @@ static int handle_start(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx struct dm_request req = { .role = DM_ROLE_REFLECTOR, .ranging_mode = dm_mode, - .rng_seed = ((bt_mesh_primary_addr() + srv->model->elem_idx) << 16) + + .rng_seed = ((bt_mesh_primary_addr() + srv->model->rt->elem_idx) << 16) + srv->target_addr, .start_delay_us = delay, .extra_window_time_us = CONFIG_BT_MESH_DM_SRV_REFLECTOR_RANGING_WINDOW_US @@ -298,10 +298,10 @@ static int handle_start(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx return -err; } -static int handle_result_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_result_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; uint8_t cnt = net_buf_simple_pull_u8(buf); if (!cnt) { @@ -319,11 +319,11 @@ static int handle_result_get(struct bt_mesh_model *model, struct bt_mesh_msg_ctx return 0; } -static int handle_sync(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_sync(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { int err; - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; if (srv->is_busy) { return -EBUSY; @@ -356,7 +356,7 @@ static int handle_sync(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_msg(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_msg(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { uint8_t opcode = net_buf_simple_pull_u8(buf); @@ -425,10 +425,10 @@ static void timeout_work(struct k_work *work) dm_srv->is_busy = false; } -static int bt_mesh_dm_srv_init(struct bt_mesh_model *model) +static int bt_mesh_dm_srv_init(const struct bt_mesh_model *model) { int err; - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; srv->model = model; dm_srv = srv; @@ -447,9 +447,9 @@ static int bt_mesh_dm_srv_init(struct bt_mesh_model *model) return 0; } -static void bt_mesh_dm_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_dm_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; srv->cfg.ttl = CONFIG_BT_MESH_DM_SRV_DEFAULT_TTL; srv->cfg.timeout = CONFIG_BT_MESH_DM_SRV_DEFAULT_TIMEOUT, @@ -460,11 +460,11 @@ static void bt_mesh_dm_srv_reset(struct bt_mesh_model *model) #endif } -static int bt_mesh_dm_srv_settings_set(struct bt_mesh_model *model, const char *name, +static int bt_mesh_dm_srv_settings_set(const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_dm_srv *srv = model->user_data; + struct bt_mesh_dm_srv *srv = model->rt->user_data; struct settings_data data; ssize_t len; diff --git a/subsys/bluetooth/mesh/vnd/le_pair_resp.c b/subsys/bluetooth/mesh/vnd/le_pair_resp.c index 5e9362f62c3f..63e8ef951053 100644 --- a/subsys/bluetooth/mesh/vnd/le_pair_resp.c +++ b/subsys/bluetooth/mesh/vnd/le_pair_resp.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include #include #include @@ -26,7 +26,7 @@ LOG_MODULE_REGISTER(bt_mesh_le_pair_resp); static uint32_t predefined_passkey = BT_PASSKEY_INVALID; -static int handle_reset(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_reset(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { uint32_t passkey; @@ -63,7 +63,7 @@ static int handle_reset(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx return 0; } -static int handle_op(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_op(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { uint8_t op; @@ -84,14 +84,14 @@ const struct bt_mesh_model_op _bt_mesh_le_pair_resp_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_le_pair_resp_init(struct bt_mesh_model *model) +static int bt_mesh_le_pair_resp_init(const struct bt_mesh_model *model) { bt_mesh_le_pair_resp_passkey_invalidate(); return 0; } -static void bt_mesh_le_pair_resp_reset(struct bt_mesh_model *model) +static void bt_mesh_le_pair_resp_reset(const struct bt_mesh_model *model) { bt_mesh_le_pair_resp_passkey_invalidate(); } diff --git a/subsys/bluetooth/mesh/vnd/silvair_enocean_srv.c b/subsys/bluetooth/mesh/vnd/silvair_enocean_srv.c index a185a122c04a..07430decd0a6 100644 --- a/subsys/bluetooth/mesh/vnd/silvair_enocean_srv.c +++ b/subsys/bluetooth/mesh/vnd/silvair_enocean_srv.c @@ -185,7 +185,7 @@ static void button_cb(struct bt_enocean_device *device, } } -static void status_pub(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static void status_pub(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_silvair_enocean_status status, const uint8_t *addr) { BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_SILVAIR_ENOCEAN_PROXY_OP, 8); @@ -309,11 +309,11 @@ static void decommission_device(struct bt_mesh_silvair_enocean_srv *srv) bt_enocean_foreach(find_and_decommission, &addr); } -static int handle_get(struct bt_mesh_model *model, +static int handle_get(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_silvair_enocean_srv *srv = model->user_data; + struct bt_mesh_silvair_enocean_srv *srv = model->rt->user_data; if (buf->len != 0) { return -EMSGSIZE; @@ -328,14 +328,14 @@ static int handle_get(struct bt_mesh_model *model, return 0; } -static int handle_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_set(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { if (buf->len != BT_MESH_SILVAIR_ENOCEAN_PROXY_MSG_MAXLEN - 1) { return -EMSGSIZE; } - struct bt_mesh_silvair_enocean_srv *srv = model->user_data; + struct bt_mesh_silvair_enocean_srv *srv = model->rt->user_data; uint8_t *key; uint8_t *addr_raw; @@ -386,10 +386,10 @@ static int handle_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -static int handle_delete(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_delete(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { - struct bt_mesh_silvair_enocean_srv *srv = model->user_data; + struct bt_mesh_silvair_enocean_srv *srv = model->rt->user_data; if (buf->len != 0) { return -EMSGSIZE; @@ -408,7 +408,7 @@ static int handle_delete(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ct return 0; } -static int handle_message(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +static int handle_message(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { uint8_t sub_opcode; @@ -436,14 +436,14 @@ const struct bt_mesh_model_op _bt_mesh_silvair_enocean_srv_op[] = { BT_MESH_MODEL_OP_END, }; -static int bt_mesh_silvair_enocean_srv_init(struct bt_mesh_model *model) +static int bt_mesh_silvair_enocean_srv_init(const struct bt_mesh_model *model) { if (!initialized) { bt_enocean_init(&enocean_cbs); initialized = true; } - struct bt_mesh_silvair_enocean_srv *srv = model->user_data; + struct bt_mesh_silvair_enocean_srv *srv = model->rt->user_data; srv->mod = model; srv->pub.msg = &srv->pub_buf; @@ -460,9 +460,9 @@ static int bt_mesh_silvair_enocean_srv_init(struct bt_mesh_model *model) return 0; } -static int bt_mesh_silvair_enocean_srv_start(struct bt_mesh_model *model) +static int bt_mesh_silvair_enocean_srv_start(const struct bt_mesh_model *model) { - struct bt_mesh_silvair_enocean_srv *srv = model->user_data; + struct bt_mesh_silvair_enocean_srv *srv = model->rt->user_data; if (IS_ENABLED(CONFIG_BT_MESH_SILVAIR_ENOCEAN_AUTO_COMMISSION) && !bt_addr_le_cmp(&srv->addr, BT_ADDR_LE_NONE)) { @@ -472,9 +472,9 @@ static int bt_mesh_silvair_enocean_srv_start(struct bt_mesh_model *model) return 0; } -static void bt_mesh_silvair_enocean_srv_reset(struct bt_mesh_model *model) +static void bt_mesh_silvair_enocean_srv_reset(const struct bt_mesh_model *model) { - struct bt_mesh_silvair_enocean_srv *srv = model->user_data; + struct bt_mesh_silvair_enocean_srv *srv = model->rt->user_data; if (IS_ENABLED(CONFIG_BT_MESH_SILVAIR_ENOCEAN_AUTO_COMMISSION)) { bt_enocean_commissioning_disable(); @@ -499,10 +499,10 @@ static void bt_mesh_silvair_enocean_srv_reset(struct bt_mesh_model *model) } static int bt_mesh_silvair_enocean_srv_settings_set( - struct bt_mesh_model *model, const char *name, size_t len_rd, + const struct bt_mesh_model *model, const char *name, size_t len_rd, settings_read_cb read_cb, void *cb_arg) { - struct bt_mesh_silvair_enocean_srv *srv = model->user_data; + struct bt_mesh_silvair_enocean_srv *srv = model->rt->user_data; ssize_t result; if (name) { diff --git a/subsys/bluetooth/services/bas_client.c b/subsys/bluetooth/services/bas_client.c index e721f2a90df0..fdd56c2c0315 100644 --- a/subsys/bluetooth/services/bas_client.c +++ b/subsys/bluetooth/services/bas_client.c @@ -181,7 +181,7 @@ static void bas_read_value_handler(struct k_work *work) struct bt_bas_client *bas; bas = CONTAINER_OF(work, struct bt_bas_client, - periodic_read.read_work); + periodic_read.read_work.work); if (!atomic_get(&bas->periodic_read.interval)) { /* disabled */ diff --git a/subsys/bluetooth/services/fast_pair/fp_advertising.c b/subsys/bluetooth/services/fast_pair/fp_advertising.c index 1136e389b73c..072f195987a3 100644 --- a/subsys/bluetooth/services/fast_pair/fp_advertising.c +++ b/subsys/bluetooth/services/fast_pair/fp_advertising.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/subsys/bluetooth/services/fast_pair/fp_crypto/fp_crypto_mbedtls.c b/subsys/bluetooth/services/fast_pair/fp_crypto/fp_crypto_mbedtls.c index 8fd8a29e6525..4c9777035157 100644 --- a/subsys/bluetooth/services/fast_pair/fp_crypto/fp_crypto_mbedtls.c +++ b/subsys/bluetooth/services/fast_pair/fp_crypto/fp_crypto_mbedtls.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include LOG_MODULE_DECLARE(fp_crypto, CONFIG_FP_CRYPTO_LOG_LEVEL); diff --git a/subsys/bluetooth/services/fast_pair/fp_gatt_service.c b/subsys/bluetooth/services/fast_pair/fp_gatt_service.c index fdfb46bbd86a..9bcde4e1102b 100644 --- a/subsys/bluetooth/services/fast_pair/fp_gatt_service.c +++ b/subsys/bluetooth/services/fast_pair/fp_gatt_service.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/subsys/bluetooth/services/fast_pair/fp_keys.c b/subsys/bluetooth/services/fast_pair/fp_keys.c index ca777fa9f360..3ce5d953fabd 100644 --- a/subsys/bluetooth/services/fast_pair/fp_keys.c +++ b/subsys/bluetooth/services/fast_pair/fp_keys.c @@ -434,7 +434,7 @@ static void key_gen_failure_cnt_reset_fn(struct k_work *w) static void timeout_fn(struct k_work *w) { - struct fp_procedure *proc = CONTAINER_OF(w, struct fp_procedure, timeout); + struct fp_procedure *proc = CONTAINER_OF(w, struct fp_procedure, timeout.work); __ASSERT_NO_MSG(is_key_generated(proc->state)); diff --git a/subsys/bluetooth/services/hids.c b/subsys/bluetooth/services/hids.c index b421c344e305..d5d690cae649 100644 --- a/subsys/bluetooth/services/hids.c +++ b/subsys/bluetooth/services/hids.c @@ -219,7 +219,7 @@ static ssize_t hids_inp_rep_read(struct bt_conn *conn, uint8_t idx = rep->idx; struct bt_hids *hids = CONTAINER_OF((rep - idx), struct bt_hids, - inp_rep_group.reports); + inp_rep_group.reports[0]); uint8_t *rep_data; ssize_t ret_len; @@ -266,7 +266,7 @@ static ssize_t hids_outp_rep_read(struct bt_conn *conn, uint8_t idx = rep->idx; struct bt_hids *hids = CONTAINER_OF((rep - idx), struct bt_hids, - outp_rep_group.reports); + outp_rep_group.reports[0]); uint8_t *rep_data; ssize_t ret_len; @@ -307,7 +307,7 @@ static ssize_t hids_outp_rep_write(struct bt_conn *conn, uint8_t idx = rep->idx; struct bt_hids *hids = CONTAINER_OF((rep - idx), struct bt_hids, - outp_rep_group.reports); + outp_rep_group.reports[0]); uint8_t *rep_data; struct bt_hids_conn_data *conn_data = @@ -363,7 +363,7 @@ static ssize_t hids_feat_rep_read(struct bt_conn *conn, uint8_t idx = rep->idx; struct bt_hids *hids = CONTAINER_OF((rep - idx), struct bt_hids, - feat_rep_group.reports); + feat_rep_group.reports[0]); uint8_t *rep_data; ssize_t ret_len; @@ -410,7 +410,7 @@ static ssize_t hids_feat_rep_write(struct bt_conn *conn, uint8_t idx = rep->idx; struct bt_hids *hids = CONTAINER_OF((rep - idx), struct bt_hids, - feat_rep_group.reports); + feat_rep_group.reports[0]); uint8_t *rep_data; struct bt_hids_conn_data *conn_data = diff --git a/subsys/caf/modules/ble_adv.c b/subsys/caf/modules/ble_adv.c index b20fa50f0738..624adafd7879 100644 --- a/subsys/caf/modules/ble_adv.c +++ b/subsys/caf/modules/ble_adv.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/subsys/caf/modules/leds.c b/subsys/caf/modules/leds.c index 681967187fbc..dd0a52ea0f57 100644 --- a/subsys/caf/modules/leds.c +++ b/subsys/caf/modules/leds.c @@ -108,7 +108,8 @@ static void set_off(struct led *led) static void work_handler(struct k_work *work) { - struct led *led = CONTAINER_OF(work, struct led, work); + struct k_work_delayable *delayable_work = k_work_delayable_from_work(work); + struct led *led = CONTAINER_OF(delayable_work, struct led, work); const struct led_effect_step *effect_step = &led->effect->steps[led->effect_step]; diff --git a/subsys/debug/etb_trace/CMakeLists.txt b/subsys/debug/etb_trace/CMakeLists.txt index 927c91adea37..c75c9b4ee6b9 100644 --- a/subsys/debug/etb_trace/CMakeLists.txt +++ b/subsys/debug/etb_trace/CMakeLists.txt @@ -8,3 +8,4 @@ zephyr_library() zephyr_library_sources(etb_trace.c) zephyr_library_sources_ifdef(CONFIG_ETB_TRACE_LOW_POWER etb_trace_lp.c) zephyr_library_include_directories(.) +zephyr_library_include_directories(${ZEPHYR_BASE}/kernel/include) diff --git a/subsys/debug/etb_trace/etb_trace_lp.c b/subsys/debug/etb_trace/etb_trace_lp.c index 92af334fe795..9e4e2d823152 100644 --- a/subsys/debug/etb_trace/etb_trace_lp.c +++ b/subsys/debug/etb_trace/etb_trace_lp.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include diff --git a/subsys/mpsl/fem/Kconfig b/subsys/mpsl/fem/Kconfig index dd393064d093..919c6a73276f 100644 --- a/subsys/mpsl/fem/Kconfig +++ b/subsys/mpsl/fem/Kconfig @@ -74,6 +74,7 @@ config MPSL_FEM_NRF21540_GPIO_SPI select GPIO if ($(dt_node_has_prop,nrf_radio_fem,mode_gpios) || $(dt_node_has_prop,nrf_radio_fem,ant_sel_gpios)) select NRFX_PPI if SOC_SERIES_NRF52X select NRFX_DPPI if SOC_SERIES_NRF53X + select PINCTRL select MPSL_FEM_NCS_SUPPORTED_FEM_USED imply MPSL_FEM_POWER_MODEL if MPSL_FEM # Don't force the model, but make it a default bool "nRF21540 front-end module in GPIO + SPI mode" diff --git a/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c b/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c index 936bc9edacd9..bc1c450c8004 100644 --- a/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c +++ b/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c @@ -20,6 +20,10 @@ #endif #include +#if !defined(CONFIG_PINCTRL) +#error CONFIG_PINCTRL is required for nRF21540 GPIO SPI driver +#endif + #define MPSL_FEM_SPI_IF DT_PHANDLE(DT_NODELABEL(nrf_radio_fem), spi_if) #define MPSL_FEM_SPI_BUS DT_BUS(MPSL_FEM_SPI_IF) #define MPSL_FEM_SPI_REG ((NRF_SPIM_Type *) DT_REG_ADDR(MPSL_FEM_SPI_BUS)) @@ -29,6 +33,12 @@ #define MPSL_FEM_SPI_GPIO_PORT_NO(pin) DT_PROP(MPSL_FEM_SPI_GPIO_PORT(pin), port) #define MPSL_FEM_SPI_GPIO_PIN_NO(pin) DT_GPIO_PIN(MPSL_FEM_SPI_BUS, pin) +#define FEM_SPI_PIN_NUM(node_id, prop, idx) \ + NRF_GET_PIN(DT_PROP_BY_IDX(node_id, prop, idx)), + +#define FEM_SPI_PIN_FUNC(node_id, prop, idx) \ + NRF_GET_FUN(DT_PROP_BY_IDX(node_id, prop, idx)), + static uint32_t fem_nrf21540_spi_configure(mpsl_fem_nrf21540_gpio_spi_interface_config_t *cfg) { #if DT_NODE_HAS_PROP(MPSL_FEM_SPI_BUS, cs_gpios) @@ -41,39 +51,6 @@ static uint32_t fem_nrf21540_spi_configure(mpsl_fem_nrf21540_gpio_spi_interface_ cfg->spi_config = (mpsl_fem_spi_config_t) { .p_spim = MPSL_FEM_SPI_REG, -#if !defined(CONFIG_PINCTRL) - .mosi_pin = { -#if DT_NODE_HAS_PROP(MPSL_FEM_SPI_BUS, mosi_pin) - .p_port = MPSL_FEM_SPI_GPIO_PORT_REG(mosi_gpios), - .port_no = MPSL_FEM_SPI_GPIO_PORT_NO(mosi_gpios), - .port_pin = MPSL_FEM_SPI_GPIO_PIN_NO(mosi_gpios), -#else - .port_pin = MPSL_FEM_GPIO_INVALID_PIN -#endif - }, - - .miso_pin = { -#if DT_NODE_HAS_PROP(MPSL_FEM_SPI_BUS, miso_pin) - .p_port = MPSL_FEM_SPI_GPIO_PORT_REG(miso_gpios), - .port_no = MPSL_FEM_SPI_GPIO_PORT_NO(miso_gpios), - .port_pin = MPSL_FEM_SPI_GPIO_PIN_NO(miso_gpios), -#else - .port_pin = MPSL_FEM_GPIO_INVALID_PIN -#endif - }, - - .sck_pin = { -#if DT_NODE_HAS_PROP(MPSL_FEM_SPI_BUS, sck_pin) - .p_port = MPSL_FEM_SPI_GPIO_PORT_REG(sck_gpios), - .port_no = MPSL_FEM_SPI_GPIO_PORT_NO(sck_gpios), - .port_pin = MPSL_FEM_SPI_GPIO_PIN_NO(sck_gpios), -#else - .port_pin = MPSL_FEM_GPIO_INVALID_PIN -#endif - }, - -#endif // !defined(CONFIG_PINCTRL) - .cs_pin_config = { #if DT_NODE_HAS_PROP(MPSL_FEM_SPI_BUS, cs_gpios) .gpio_pin = { @@ -90,14 +67,6 @@ static uint32_t fem_nrf21540_spi_configure(mpsl_fem_nrf21540_gpio_spi_interface_ } }; -#if defined(CONFIG_PINCTRL) - -#define FEM_SPI_PIN_NUM(node_id, prop, idx) \ - NRF_GET_PIN(DT_PROP_BY_IDX(node_id, prop, idx)), - -#define FEM_SPI_PIN_FUNC(node_id, prop, idx) \ - NRF_GET_FUN(DT_PROP_BY_IDX(node_id, prop, idx)), - static const uint8_t fem_spi_pin_nums[] = { DT_FOREACH_CHILD_VARGS( DT_PINCTRL_BY_NAME(DT_BUS(MPSL_FEM_SPI_IF), default, 0), @@ -130,7 +99,6 @@ static uint32_t fem_nrf21540_spi_configure(mpsl_fem_nrf21540_gpio_spi_interface_ break; } } -#endif // defined(CONFIG_PINCTRL) return 0; } diff --git a/subsys/mpsl/init/Kconfig b/subsys/mpsl/init/Kconfig index ccf09db3db5f..38b3ae9d94c7 100644 --- a/subsys/mpsl/init/Kconfig +++ b/subsys/mpsl/init/Kconfig @@ -10,6 +10,14 @@ config MPSL_THREAD_COOP_PRIO default BT_CTLR_SDC_RX_PRIO if BT_LL_SOFTDEVICE default 8 +config NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE + int + depends on NRF52_ANOMALY_109_WORKAROUND + default 4 + help + Update default EGU instance used by the nRF52 Anomaly 109 workaround + for PWM. The EGU instance 5 is used by the MPSL. + config MPSL_WORK_STACK_SIZE int "Size of the work handler thread stack" default 1024 diff --git a/subsys/mpsl/init/mpsl_init.c b/subsys/mpsl/init/mpsl_init.c index 47933b8c6035..c95325f4e69b 100644 --- a/subsys/mpsl/init/mpsl_init.c +++ b/subsys/mpsl/init/mpsl_init.c @@ -35,6 +35,12 @@ static K_WORK_DELAYABLE_DEFINE(calibration_work, mpsl_calibration_work_handler); extern void rtc_pretick_rtc0_isr_hook(void); +#if IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF52X) + #if IS_ENABLED(CONFIG_NRF52_ANOMALY_109_WORKAROUND) + BUILD_ASSERT(CONFIG_NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE != 5, + "MPSL uses EGU instance 5, please use another one"); + #endif +#endif #define MPSL_LOW_PRIO (4) #if IS_ENABLED(CONFIG_ZERO_LATENCY_IRQS) diff --git a/subsys/net/lib/aws_jobs/src/aws_jobs.c b/subsys/net/lib/aws_jobs/src/aws_jobs.c index 7f43bb7e4ac0..ff180ecf310c 100644 --- a/subsys/net/lib/aws_jobs/src/aws_jobs.c +++ b/subsys/net/lib/aws_jobs/src/aws_jobs.c @@ -4,7 +4,7 @@ *SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include -#include +#include #include #include #include diff --git a/subsys/net/lib/coap_utils/Kconfig b/subsys/net/lib/coap_utils/Kconfig index c19688775e33..57014128e9ca 100644 --- a/subsys/net/lib/coap_utils/Kconfig +++ b/subsys/net/lib/coap_utils/Kconfig @@ -5,8 +5,7 @@ # config COAP_UTILS bool "Support for communication with CoAP" - select COAP - depends on NET_SOCKETS + depends on COAP help Send and receive CoAP non-confirmable requests. Utilize CoAP and Modem libraries. diff --git a/subsys/net/lib/download_client/src/download_client.c b/subsys/net/lib/download_client/src/download_client.c index 8bb83ad16c3d..e17eeb480ada 100644 --- a/subsys/net/lib/download_client/src/download_client.c +++ b/subsys/net/lib/download_client/src/download_client.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #if defined(CONFIG_POSIX_API) #include #include diff --git a/subsys/net/lib/icalendar_parser/src/icalendar_parser.c b/subsys/net/lib/icalendar_parser/src/icalendar_parser.c index 472ac31a7f47..dc1faab40102 100644 --- a/subsys/net/lib/icalendar_parser/src/icalendar_parser.c +++ b/subsys/net/lib/icalendar_parser/src/icalendar_parser.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap_transport.c b/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap_transport.c index 5721bc5730dd..23da707fa8e1 100644 --- a/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap_transport.c +++ b/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap_transport.c @@ -20,7 +20,7 @@ #include #endif #include -#include +#include #include #include #include diff --git a/subsys/net/lib/nrf_cloud/include/nrf_cloud_pgps_utils.h b/subsys/net/lib/nrf_cloud/include/nrf_cloud_pgps_utils.h index 9017e55393fa..5f41e98e17d9 100644 --- a/subsys/net/lib/nrf_cloud/include/nrf_cloud_pgps_utils.h +++ b/subsys/net/lib/nrf_cloud/include/nrf_cloud_pgps_utils.h @@ -1,10 +1,11 @@ /* - * Copyright (c) 2021 Nordic Semiconductor ASA + * Copyright (c) 2021-2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include +#include #ifndef NRF_CLOUD_PGPS_UTILS_H_ #define NRF_CLOUD_PGPS_UTILS_H_ @@ -16,11 +17,8 @@ extern "C" { /* (6.1.1980 UTC - 1.1.1970 UTC) */ #define GPS_TO_UNIX_UTC_OFFSET_SECONDS (315964800UL) #define GPS_TO_UTC_LEAP_SECONDS (18UL) -#define SEC_PER_MIN (60UL) -#define MIN_PER_HOUR (60UL) #define SEC_PER_HOUR (MIN_PER_HOUR * SEC_PER_MIN) -#define HOURS_PER_DAY (24UL) -#define SEC_PER_DAY (HOURS_PER_DAY * SEC_PER_HOUR) +#define SEC_PER_DAY (HOUR_PER_DAY * SEC_PER_HOUR) #define DAYS_PER_WEEK (7UL) #define SECONDS_PER_WEEK (SEC_PER_DAY * DAYS_PER_WEEK) diff --git a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c index 475303930c23..e2fadbb7750e 100644 --- a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c +++ b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/subsys/partition_manager/Kconfig.template.build_strategy b/subsys/partition_manager/Kconfig.template.build_strategy index a7d178b2d92f..8e1b46091877 100644 --- a/subsys/partition_manager/Kconfig.template.build_strategy +++ b/subsys/partition_manager/Kconfig.template.build_strategy @@ -1,3 +1,5 @@ +if !HIDE_CHILD_PARENT_CONFIG + choice prompt "$(module) build strategy" default $(module)_BUILD_STRATEGY_FROM_SOURCE @@ -28,3 +30,5 @@ config $(module)_BUILD_STRATEGY_FROM_SOURCE select PARTITION_MANAGER_ENABLED endchoice + +endif diff --git a/subsys/pcd/Kconfig b/subsys/pcd/Kconfig index 7c2744c3d830..0771e7b7161b 100644 --- a/subsys/pcd/Kconfig +++ b/subsys/pcd/Kconfig @@ -17,7 +17,7 @@ endif config PCD_APP bool "Peripheral CPU DFU Support for Application Processor" - default y if SOC_SERIES_NRF53X && MCUBOOT && BT_RPMSG + default y if SOC_SERIES_NRF53X && MCUBOOT && BT_HCI_IPC config PCD_VERSION_PAGE_BUF_SIZE int diff --git a/subsys/zigbee/osif/zb_nrf_crypto.c b/subsys/zigbee/osif/zb_nrf_crypto.c index 04831243b194..c5313dd5a440 100644 --- a/subsys/zigbee/osif/zb_nrf_crypto.c +++ b/subsys/zigbee/osif/zb_nrf_crypto.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #if CONFIG_CRYPTO_NRF_ECB #include diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index 6ffea27d3935..54d47141da8d 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -68,6 +68,16 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) cmake_parse_arguments(PRE_CMAKE "" "" "IMAGES" ${ARGN}) restore_ncs_vars() + if(NOT SB_CONFIG_PARTITION_MANAGER) + # Disable any Kconfigs for child images in the main application + foreach(config NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE NCS_INCLUDE_RPMSG_CHILD_IMAGE NCS_SAMPLE_REMOTE_SHELL_CHILD_IMAGE + NCS_SAMPLE_DTM_REMOTE_HCI_CHILD_IMAGE NCS_SAMPLE_PERIPHERAL_RADIO_TEST_CHILD_IMAGE B0_BUILD_STRATEGY_USE_HEX_FILE + B0_BUILD_STRATEGY_SKIP_BUILD B0_BUILD_STRATEGY_FROM_SOURCE PM_SINGLE_IMAGE MCUBOOT_BUILD_STRATEGY_USE_HEX_FILE + MCUBOOT_BUILD_STRATEGY_SKIP_BUILD MCUBOOT_BUILD_STRATEGY_FROM_SOURCE) + set_config_bool(${DEFAULT_IMAGE} CONFIG_${config} n) + endforeach() + endif() + foreach(image ${PRE_CMAKE_IMAGES}) if(SB_CONFIG_PARTITION_MANAGER) set_config_bool(${image} CONFIG_PARTITION_MANAGER_ENABLED y) @@ -176,8 +186,10 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) ) endif() - # Use NCS signing script with support for PM - set(${DEFAULT_IMAGE}_SIGNING_SCRIPT "${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/image_signing.cmake" CACHE INTERNAL "MCUboot signing script" FORCE) + if(SB_CONFIG_PARTITION_MANAGER) + # Use NCS signing script with support for PM + set(${DEFAULT_IMAGE}_SIGNING_SCRIPT "${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/image_signing.cmake" CACHE INTERNAL "MCUboot signing script" FORCE) + endif() set(imgtool_extra) if(SB_CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION) diff --git a/sysbuild/Kconfig.netcore b/sysbuild/Kconfig.netcore index dbd4d5dc555d..6f2cea544f24 100644 --- a/sysbuild/Kconfig.netcore +++ b/sysbuild/Kconfig.netcore @@ -2,10 +2,27 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +config EXTERNAL_CONFIGURED_NETCORE + bool + default y + select NETCORE_REMOTE_NRF5340_CPUNET if NET_CORE_BOARD = "nrf5340dk_nrf5340_cpunet" + depends on NET_CORE_IMAGE_HCI_IPC # Zephyr Kconfig enabling HCI IPC on netcore + config SUPPORT_NETCORE bool default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp_ns") +config NETCORE_REMOTE_BOARD_NAME + string + default "nrf5340dk_nrf5340_cpunet" if $(BOARD) = "nrf5340dk_nrf5340_cpuapp" + default "nrf5340dk_nrf5340_cpunet" if $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" + default "thingy53_nrf5340_cpunet" if $(BOARD) = "thingy53_nrf5340_cpuapp" + default "thingy53_nrf5340_cpunet" if $(BOARD) = "thingy53_nrf5340_cpuapp_ns" + +config NETCORE_REMOTE_DOMAIN + string + default "CPUNET" if NETCORE_REMOTE_BOARD_NAME != "" + menu "Network core configuration" depends on SUPPORT_NETCORE @@ -13,7 +30,7 @@ config SUPPORT_NETCORE_EMPTY bool default y -config SUPPORT_NETCORE_HCI_RPMSG +config SUPPORT_NETCORE_HCI_IPC bool default y @@ -43,12 +60,12 @@ config NRF_DEFAULT_MULTIPROTOCOL choice NETCORE prompt "Netcore image" - default NETCORE_EMPTY if NRF_DEFAULT_EMPTY && ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp_ns") - default NETCORE_HCI_RPMSG if NRF_DEFAULT_BLUETOOTH && ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp_ns") - default NETCORE_802154_RPMSG if NRF_DEFAULT_802154 && ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp_ns") - default NETCORE_MULTIPROTOCOL_RPMSG if NRF_DEFAULT_MULTIPROTOCOL && ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp_ns") + default NETCORE_EMPTY if NRF_DEFAULT_EMPTY && NETCORE_REMOTE_BOARD_NAME != "" + default NETCORE_HCI_IPC if NRF_DEFAULT_BLUETOOTH && NETCORE_REMOTE_BOARD_NAME != "" + default NETCORE_802154_RPMSG if NRF_DEFAULT_802154 && NETCORE_REMOTE_BOARD_NAME != "" + default NETCORE_MULTIPROTOCOL_RPMSG if NRF_DEFAULT_MULTIPROTOCOL && NETCORE_REMOTE_BOARD_NAME != "" default NETCORE_NONE - depends on SUPPORT_NETCORE + depends on SUPPORT_NETCORE && !EXTERNAL_CONFIGURED_NETCORE config NETCORE_NONE bool "None" @@ -60,11 +77,11 @@ config NETCORE_EMPTY help Include empty image as the netcore image to use -config NETCORE_HCI_RPMSG - bool "hci_rpmsg" - depends on SUPPORT_NETCORE_HCI_RPMSG +config NETCORE_HCI_IPC + bool "hci_ipc" + depends on SUPPORT_NETCORE_HCI_IPC help - Include hci_rpmsg as the netcore image to use + Include hci_ipc as the netcore image to use config NETCORE_RPC_HOST bool "rpc_host" @@ -91,7 +108,7 @@ if !NETCORE_NONE config NETCORE_IMAGE_NAME string default "empty_net_core" if NETCORE_EMPTY - default "hci_rpmsg" if NETCORE_HCI_RPMSG + default "hci_ipc" if NETCORE_HCI_IPC default "rpc_host" if NETCORE_RPC_HOST default "802154_rpmsg" if NETCORE_802154_RPMSG default "multiprotocol_rpmsg" if NETCORE_MULTIPROTOCOL_RPMSG @@ -101,7 +118,7 @@ config NETCORE_IMAGE_NAME config NETCORE_IMAGE_PATH string default "${ZEPHYR_NRF_MODULE_DIR}/samples/nrf5340/empty_net_core" if NETCORE_EMPTY - default "${ZEPHYR_BASE}/samples/bluetooth/hci_rpmsg" if NETCORE_HCI_RPMSG + default "${ZEPHYR_BASE}/samples/bluetooth/hci_ipc" if NETCORE_HCI_IPC default "${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/rpc_host" if NETCORE_RPC_HOST default "${ZEPHYR_BASE}/samples/boards/nrf/ieee802154/802154_rpmsg" if NETCORE_802154_RPMSG default "${ZEPHYR_NRF_MODULE_DIR}/samples/nrf5340/multiprotocol_rpmsg" if NETCORE_MULTIPROTOCOL_RPMSG @@ -110,16 +127,15 @@ config NETCORE_IMAGE_PATH config NETCORE_IMAGE_BOARD string - default "nrf5340dk_nrf5340_cpunet" if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns") - default "thingy53_nrf5340_cpunet" if ($(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns") - default "nrf7002dk_nrf5340_cpunet" if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp_ns") + default NETCORE_REMOTE_BOARD_NAME + depends on NETCORE_EMPTY help Remote board when building this sample. If not set, the board given to sysbuild is used. config NETCORE_IMAGE_DOMAIN string - default "CPUNET" if (NETCORE_IMAGE_BOARD = "nrf5340dk_nrf5340_cpunet" || NETCORE_IMAGE_BOARD = "thingy53_nrf5340_cpunet" || NETCORE_IMAGE_BOARD = "nrf7002dk_nrf5340_cpunet") + default NETCORE_REMOTE_DOMAIN config NETCORE_APP_UPDATE bool "Network core updates" diff --git a/sysbuild/Kconfig.sysbuild b/sysbuild/Kconfig.sysbuild index d910ab6a2e28..6a0f205968be 100644 --- a/sysbuild/Kconfig.sysbuild +++ b/sysbuild/Kconfig.sysbuild @@ -9,6 +9,7 @@ menuconfig PARTITION_MANAGER bool "Partition Manager" default y if ($(BOARD) != "qemu_cortex_m0" && $(BOARD) != "qemu_cortex_m3" && $(BOARD) != "native_posix" && $(BOARD) != "native_posix_64" && $(BOARD) != "mps2_an521" && $(BOARD) != "qemu_x86" && $(BOARD) != "nrf52_bsim" && $(BOARD) != "nrf5340bsim_nrf5340_cpuapp" && $(BOARD) != "nrf5340bsim_nrf5340_cpunet") + depends on !EXTERNAL_CONFIGURED_NETCORE config PM_MCUBOOT_PAD hex "Memory reserved for MCUBOOT_PAD" diff --git a/sysbuild/netcore.cmake b/sysbuild/netcore.cmake index 0198ada8ed47..c54c879b3ec5 100644 --- a/sysbuild/netcore.cmake +++ b/sysbuild/netcore.cmake @@ -10,7 +10,7 @@ if(SB_CONFIG_SUPPORT_NETCORE AND NOT SB_CONFIG_NETCORE_NONE AND DEFINED SB_CONFI ExternalZephyrProject_Add( APPLICATION ${SB_CONFIG_NETCORE_IMAGE_NAME} SOURCE_DIR ${SB_CONFIG_NETCORE_IMAGE_PATH} - BOARD ${SB_CONFIG_NETCORE_IMAGE_BOARD} + BOARD ${SB_CONFIG_NETCORE_REMOTE_BOARD_NAME} ) if(NOT "${SB_CONFIG_NETCORE_IMAGE_DOMAIN}" IN_LIST PM_DOMAINS) diff --git a/tests/bluetooth/iso/modules/central.c b/tests/bluetooth/iso/modules/central.c index 9b11a3d9ae81..91d92101caee 100644 --- a/tests/bluetooth/iso/modules/central.c +++ b/tests/bluetooth/iso/modules/central.c @@ -79,7 +79,8 @@ static void work_dummy_data_send(struct k_work *work) static uint8_t channel_index; static uint32_t acl_send_count[CONFIG_BT_MAX_CONN]; - struct peer_device *peer = CONTAINER_OF(work, struct peer_device, dummy_data_send_work); + struct peer_device *peer = CONTAINER_OF(work, struct peer_device, + dummy_data_send_work.work); ret = channel_index_get(peer->conn, &channel_index); if (ret) { diff --git a/tests/bluetooth/tester/src/bttester.c b/tests/bluetooth/tester/src/bttester.c index ab660335a3ec..def98192cb84 100644 --- a/tests/bluetooth/tester/src/bttester.c +++ b/tests/bluetooth/tester/src/bttester.c @@ -235,7 +235,7 @@ static uint8_t *recv_cb(uint8_t *buf, size_t *off) return buf; } - k_fifo_put(&cmds_queue, CONTAINER_OF(buf, struct btp_buf, data)); + k_fifo_put(&cmds_queue, CONTAINER_OF(buf, struct btp_buf, data[0])); *off = 0; return new_buf->data; diff --git a/tests/bluetooth/tester/src/mesh.c b/tests/bluetooth/tester/src/mesh.c index 54212520e00a..43a260efb55d 100644 --- a/tests/bluetooth/tester/src/mesh.c +++ b/tests/bluetooth/tester/src/mesh.c @@ -331,7 +331,7 @@ void net_recv_ev(uint8_t ttl, uint8_t ctl, uint16_t src, uint16_t dst, const voi buf.data, buf.len); } -static void model_bound_cb(uint16_t addr, struct bt_mesh_model *model, +static void model_bound_cb(uint16_t addr, const struct bt_mesh_model *model, uint16_t key_idx) { int i; @@ -352,7 +352,7 @@ static void model_bound_cb(uint16_t addr, struct bt_mesh_model *model, LOG_ERR("model_bound is full"); } -static void model_unbound_cb(uint16_t addr, struct bt_mesh_model *model, +static void model_unbound_cb(uint16_t addr, const struct bt_mesh_model *model, uint16_t key_idx) { int i; diff --git a/tests/bluetooth/tester/src/model_handler.c b/tests/bluetooth/tester/src/model_handler.c index f3d611d55d77..fccadff296d5 100644 --- a/tests/bluetooth/tester/src/model_handler.c +++ b/tests/bluetooth/tester/src/model_handler.c @@ -63,7 +63,7 @@ static void lvl_status(struct lvl_ctx *ctx, struct bt_mesh_plvl_status *rsp) static void periodic_led_work(struct k_work *work) { - struct lvl_ctx *ctx = CONTAINER_OF(work, struct lvl_ctx, work); + struct lvl_ctx *ctx = CONTAINER_OF(work, struct lvl_ctx, work.work); ctx->remaining -= ctx->period; @@ -401,7 +401,7 @@ static void light_ctl_status(struct light_ctl_ctx *ctx, static void periodic_led_lightness_work(struct k_work *work) { struct lightness_ctx *ctx = - CONTAINER_OF(work, struct lightness_ctx, work); + CONTAINER_OF(work, struct lightness_ctx, work.work); ctx->remaining -= ctx->period; @@ -493,7 +493,7 @@ static void light_temp_status(struct light_temp_ctx *ctx, static void periodic_light_temp_work(struct k_work *work) { struct light_temp_ctx *ctx = - CONTAINER_OF(work, struct light_temp_ctx, work); + CONTAINER_OF(work, struct light_temp_ctx, work.work); struct light_ctl_ctx *ctl_ctx = CONTAINER_OF(ctx, struct light_ctl_ctx, light_temp_ctx); struct lightness_ctx *lightness_ctx = &ctl_ctx->ctl_lightness_ctx; @@ -586,7 +586,7 @@ static const struct bt_mesh_light_temp_srv_handlers light_temp_srv_handlers = { static void periodic_light_ctl_lightness_work(struct k_work *work) { struct lightness_ctx *ctx = - CONTAINER_OF(work, struct lightness_ctx, work); + CONTAINER_OF(work, struct lightness_ctx, work.work); struct light_ctl_ctx *ctl_ctx = CONTAINER_OF(ctx, struct light_ctl_ctx, ctl_lightness_ctx); struct light_temp_ctx *temp_ctx = &ctl_ctx->light_temp_ctx; @@ -753,7 +753,7 @@ static void hue_status(struct light_hue_ctx *ctx, static void periodic_light_hue_work(struct k_work *work) { struct light_hue_ctx *ctx = - CONTAINER_OF(work, struct light_hue_ctx, work); + CONTAINER_OF(work, struct light_hue_ctx, work.work); struct light_hsl_ctx *hsl_ctx = CONTAINER_OF(ctx, struct light_hsl_ctx, light_hue_ctx); struct light_sat_ctx *sat_ctx = &hsl_ctx->light_sat_ctx; @@ -852,7 +852,7 @@ static void light_sat_status(struct light_sat_ctx *ctx, static void periodic_light_sat_work(struct k_work *work) { struct light_sat_ctx *ctx = - CONTAINER_OF(work, struct light_sat_ctx, work); + CONTAINER_OF(work, struct light_sat_ctx, work.work); struct light_hsl_ctx *hsl_ctx = CONTAINER_OF(ctx, struct light_hsl_ctx, light_sat_ctx); struct light_hue_ctx *hue_ctx = &hsl_ctx->light_hue_ctx; @@ -968,7 +968,7 @@ static void xyl_get(struct bt_mesh_light_xyl_srv *srv, static void periodic_light_xy_work(struct k_work *work) { struct light_xy_ctx *ctx = - CONTAINER_OF(work, struct light_xy_ctx, work); + CONTAINER_OF(work, struct light_xy_ctx, work.work); struct light_xyl_hsl_ctx *xyl_hsl_ctx = CONTAINER_OF(ctx, struct light_xyl_hsl_ctx, xyl_ctx); @@ -1056,7 +1056,7 @@ static const struct bt_mesh_light_xyl_srv_handlers light_xyl_handlers = { static void periodic_light_xyl_hsl_lightness_work(struct k_work *work) { struct lightness_ctx *ctx = - CONTAINER_OF(work, struct lightness_ctx, work); + CONTAINER_OF(work, struct lightness_ctx, work.work); struct light_xyl_hsl_ctx *xyl_hsl_ctx = CONTAINER_OF(ctx, struct light_xyl_hsl_ctx, lightness_ctx); struct light_hue_ctx *hue_ctx = &xyl_hsl_ctx->hsl_ctx.light_hue_ctx; @@ -1167,7 +1167,7 @@ static void get_faults(uint8_t *faults, uint8_t faults_size, uint8_t *dst, } } -static int fault_get_cur(struct bt_mesh_model *model, uint8_t *test_id, +static int fault_get_cur(const struct bt_mesh_model *model, uint8_t *test_id, uint16_t *company_id, uint8_t *faults, uint8_t *fault_count) { @@ -1181,7 +1181,7 @@ static int fault_get_cur(struct bt_mesh_model *model, uint8_t *test_id, return 0; } -static int fault_get_reg(struct bt_mesh_model *model, uint16_t company_id, +static int fault_get_reg(const struct bt_mesh_model *model, uint16_t company_id, uint8_t *test_id, uint8_t *faults, uint8_t *fault_count) { @@ -1198,7 +1198,7 @@ static int fault_get_reg(struct bt_mesh_model *model, uint16_t company_id, return 0; } -static int fault_clear(struct bt_mesh_model *model, uint16_t company_id) +static int fault_clear(const struct bt_mesh_model *model, uint16_t company_id) { LOG_DBG("company_id 0x%04x", company_id); @@ -1211,7 +1211,7 @@ static int fault_clear(struct bt_mesh_model *model, uint16_t company_id) return 0; } -static int fault_test(struct bt_mesh_model *model, uint8_t test_id, +static int fault_test(const struct bt_mesh_model *model, uint8_t test_id, uint16_t company_id) { LOG_DBG("test_id 0x%02x company_id 0x%04x", test_id, company_id); diff --git a/tests/bluetooth/tester/src/model_handler.h b/tests/bluetooth/tester/src/model_handler.h index b839c02fbf79..f94ca0d9c173 100644 --- a/tests/bluetooth/tester/src/model_handler.h +++ b/tests/bluetooth/tester/src/model_handler.h @@ -39,7 +39,7 @@ extern struct bt_mesh_light_hsl_cli light_hsl_cli; extern struct bt_mesh_scheduler_cli scheduler_cli; struct model_data { - struct bt_mesh_model *model; + const struct bt_mesh_model *model; uint16_t addr; uint16_t appkey_idx; }; diff --git a/tests/crypto/prj.conf b/tests/crypto/prj.conf index c7428c7874bb..804a7202c6d3 100644 --- a/tests/crypto/prj.conf +++ b/tests/crypto/prj.conf @@ -9,7 +9,6 @@ CONFIG_LOG_BACKEND_SHOW_COLOR=n CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n CONFIG_LOG_PRINTK=y CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_FAIL_FAST=y CONFIG_TEST_LOGGING_DEFAULTS=n CONFIG_SPEED_OPTIMIZATIONS=y diff --git a/tests/crypto/src/common_test.h b/tests/crypto/src/common_test.h index 0fe8c6e43ccf..808c193e98a9 100644 --- a/tests/crypto/src/common_test.h +++ b/tests/crypto/src/common_test.h @@ -8,7 +8,7 @@ #include #include #include "common.h" -#include +#include #include #include diff --git a/tests/drivers/flash_patch/prj.conf b/tests/drivers/flash_patch/prj.conf index 632ee267901e..7991e542e4ac 100644 --- a/tests/drivers/flash_patch/prj.conf +++ b/tests/drivers/flash_patch/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_DISABLE_FLASH_PATCH=y CONFIG_REBOOT=y # Required by CONFIG_DISABLE_FLASH_PATCH diff --git a/tests/drivers/fprotect/app/prj.conf b/tests/drivers/fprotect/app/prj.conf index 19df65c18248..6ae89bfa3442 100644 --- a/tests/drivers/fprotect/app/prj.conf +++ b/tests/drivers/fprotect/app/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_FPROTECT=y CONFIG_FPROTECT_APP=y diff --git a/tests/drivers/fprotect/negative/prj.conf b/tests/drivers/fprotect/negative/prj.conf index a0fe8a461790..20bb80230bcb 100644 --- a/tests/drivers/fprotect/negative/prj.conf +++ b/tests/drivers/fprotect/negative/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2019 Nordic Semiconductor ASA +# Copyright (c) 2019-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_STACK_SIZE=8192 CONFIG_TEST_USERSPACE=n CONFIG_USERSPACE=n diff --git a/tests/drivers/fprotect/positive/prj.conf b/tests/drivers/fprotect/positive/prj.conf index ec209c6b0cd4..a8dc854b1f29 100644 --- a/tests/drivers/fprotect/positive/prj.conf +++ b/tests/drivers/fprotect/positive/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2019 Nordic Semiconductor ASA +# Copyright (c) 2019-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_STACK_SIZE=8192 CONFIG_TEST_USERSPACE=n CONFIG_USERSPACE=n diff --git a/tests/drivers/lpuart/prj.conf b/tests/drivers/lpuart/prj.conf index 28a0a86158e0..f88d6ef212f1 100644 --- a/tests/drivers/lpuart/prj.conf +++ b/tests/drivers/lpuart/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2021 Nordic Semiconductor +# Copyright (c) 2021-2023 Nordic Semiconductor # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_XOSHIRO_RANDOM_GENERATOR=y CONFIG_ENTROPY_GENERATOR=y CONFIG_ASSERT=y diff --git a/tests/drivers/lpuart/src/main.c b/tests/drivers/lpuart/src/main.c index 56d35229f282..aa9536bed7d7 100644 --- a/tests/drivers/lpuart/src/main.c +++ b/tests/drivers/lpuart/src/main.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/drivers/nrfx_integration_test/prj.conf b/tests/drivers/nrfx_integration_test/prj.conf index b0452cb738e5..ad0d8c19aed1 100644 --- a/tests/drivers/nrfx_integration_test/prj.conf +++ b/tests/drivers/nrfx_integration_test/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ASSERT=y # Prevent compilation of Zephyr I2C and SPI driver shims (enabling of the nrfx # Kconfig options would cause them to be compiled, even though the corresponding diff --git a/tests/lib/at_cmd_custom/prj.conf b/tests/lib/at_cmd_custom/prj.conf index 68437f9ae28c..08ce30ecbaeb 100644 --- a/tests/lib/at_cmd_custom/prj.conf +++ b/tests/lib/at_cmd_custom/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # ZTEST CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # NewLib C CONFIG_NEWLIB_LIBC=y diff --git a/tests/lib/at_cmd_parser/at_cmd_parser/prj.conf b/tests/lib/at_cmd_parser/at_cmd_parser/prj.conf index 12dc1dd1c8db..abdc7da9e46d 100644 --- a/tests/lib/at_cmd_parser/at_cmd_parser/prj.conf +++ b/tests/lib/at_cmd_parser/at_cmd_parser/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_AT_CMD_PARSER=y CONFIG_HEAP_MEM_POOL_SIZE=2048 diff --git a/tests/lib/at_cmd_parser/at_params/prj.conf b/tests/lib/at_cmd_parser/at_params/prj.conf index 12dc1dd1c8db..abdc7da9e46d 100644 --- a/tests/lib/at_cmd_parser/at_params/prj.conf +++ b/tests/lib/at_cmd_parser/at_params/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_AT_CMD_PARSER=y CONFIG_HEAP_MEM_POOL_SIZE=2048 diff --git a/tests/lib/at_cmd_parser/at_utils/prj.conf b/tests/lib/at_cmd_parser/at_utils/prj.conf index 12dc1dd1c8db..abdc7da9e46d 100644 --- a/tests/lib/at_cmd_parser/at_utils/prj.conf +++ b/tests/lib/at_cmd_parser/at_utils/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_AT_CMD_PARSER=y CONFIG_HEAP_MEM_POOL_SIZE=2048 diff --git a/tests/lib/contin_array/prj.conf b/tests/lib/contin_array/prj.conf index 97b4edf28a75..93636dffd91f 100644 --- a/tests/lib/contin_array/prj.conf +++ b/tests/lib/contin_array/prj.conf @@ -1,4 +1,3 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_CONTIN_ARRAY=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/lib/data_fifo/prj.conf b/tests/lib/data_fifo/prj.conf index 8722a6bfc783..fd86b2b8a7c0 100644 --- a/tests/lib/data_fifo/prj.conf +++ b/tests/lib/data_fifo/prj.conf @@ -2,4 +2,3 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_MAIN_STACK_SIZE=50000 CONFIG_DATA_FIFO=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/lib/date_time/prj.conf b/tests/lib/date_time/prj.conf index 49ea6d7a4fff..49ee3e6c67db 100644 --- a/tests/lib/date_time/prj.conf +++ b/tests/lib/date_time/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # ZTEST CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # Date-time library CONFIG_DATE_TIME=y diff --git a/tests/lib/edge_impulse/prj.conf b/tests/lib/edge_impulse/prj.conf index 903146c049d4..38d6cfedd3f9 100644 --- a/tests/lib/edge_impulse/prj.conf +++ b/tests/lib/edge_impulse/prj.conf @@ -1,6 +1,5 @@ # Tests CONFIG_ZTEST_SHUFFLE=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST=y # Required by Edge Impulse library diff --git a/tests/lib/gcf_sms/prj.conf b/tests/lib/gcf_sms/prj.conf index f219fbf27991..7d431a97e9ea 100644 --- a/tests/lib/gcf_sms/prj.conf +++ b/tests/lib/gcf_sms/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # ZTEST CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # NewLib C CONFIG_NEWLIB_LIBC=y diff --git a/tests/lib/hw_unique_key/prj.conf b/tests/lib/hw_unique_key/prj.conf index 824a862e250c..b208a26fc168 100644 --- a/tests/lib/hw_unique_key/prj.conf +++ b/tests/lib/hw_unique_key/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_HW_UNIQUE_KEY=y CONFIG_NORDIC_SECURITY_BACKEND=y CONFIG_CC3XX_BACKEND=y diff --git a/tests/lib/hw_unique_key_tfm/prj.conf b/tests/lib/hw_unique_key_tfm/prj.conf index 3d036fe8ffce..5bcccd9f6517 100644 --- a/tests/lib/hw_unique_key_tfm/prj.conf +++ b/tests/lib/hw_unique_key_tfm/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_BOOTLOADER_MCUBOOT=n CONFIG_NRF_SECURITY=y diff --git a/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt b/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt index d81f65c8b62d..cb0ee18fae8f 100644 --- a/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt +++ b/tests/lib/nrf_modem_lib/lte_net_if/CMakeLists.txt @@ -39,7 +39,10 @@ target_sources(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/lte_net_if target_sources(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/lte_net_if/lte_ip_addr_helper.c) target_sources(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/nrf91_sockets.c) -target_include_directories(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/lte_net_if) +target_include_directories(app PRIVATE + ${ZEPHYR_NRF_MODULE_DIR}/lib/nrf_modem_lib/lte_net_if + ${ZEPHYR_BASE}/subsys/net/lib/sockets + ) add_compile_definitions(CONFIG_NRF_MODEM_LIB_MEM_DIAG) add_compile_definitions(CONFIG_NRF_MODEM_LIB_NET_IF_CONNECT_TIMEOUT_SECONDS=30) diff --git a/tests/lib/nrf_modem_lib/nrf91_sockets/CMakeLists.txt b/tests/lib/nrf_modem_lib/nrf91_sockets/CMakeLists.txt index cc62352d1d56..e51a65553385 100644 --- a/tests/lib/nrf_modem_lib/nrf91_sockets/CMakeLists.txt +++ b/tests/lib/nrf_modem_lib/nrf91_sockets/CMakeLists.txt @@ -9,7 +9,10 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(nrf91_sockets_test) -target_include_directories(app PRIVATE ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/) +target_include_directories(app PRIVATE + ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/ + ${ZEPHYR_BASE}/subsys/net/lib/sockets + ) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_socket.h) cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_os.h) diff --git a/tests/lib/nrf_modem_lib/nrf_modem_lib_trace/src/main.c b/tests/lib/nrf_modem_lib/nrf_modem_lib_trace/src/main.c index d36cd45d1584..36892c4f575e 100644 --- a/tests/lib/nrf_modem_lib/nrf_modem_lib_trace/src/main.c +++ b/tests/lib/nrf_modem_lib/nrf_modem_lib_trace/src/main.c @@ -6,10 +6,10 @@ #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/tests/lib/pcm_mix/prj.conf b/tests/lib/pcm_mix/prj.conf index e5a8f693a368..2f8409acd243 100644 --- a/tests/lib/pcm_mix/prj.conf +++ b/tests/lib/pcm_mix/prj.conf @@ -1,4 +1,3 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_PCM_MIX=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/lib/pcm_stream_channel_modifier/prj.conf b/tests/lib/pcm_stream_channel_modifier/prj.conf index 3f79a010050f..67f0b568c146 100644 --- a/tests/lib/pcm_stream_channel_modifier/prj.conf +++ b/tests/lib/pcm_stream_channel_modifier/prj.conf @@ -1,4 +1,3 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_PSCM=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/lib/ram_pwrdn/prj.conf b/tests/lib/ram_pwrdn/prj.conf index 2d8ea3758e39..fe832e7432f9 100644 --- a/tests/lib/ram_pwrdn/prj.conf +++ b/tests/lib/ram_pwrdn/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_NANO=n CONFIG_RAM_POWER_DOWN_LIBRARY=y diff --git a/tests/lib/sfloat/prj.conf b/tests/lib/sfloat/prj.conf index 56491884bbdd..8b2f9b982cbd 100644 --- a/tests/lib/sfloat/prj.conf +++ b/tests/lib/sfloat/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # ZTEST CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # SFLOAT library CONFIG_SFLOAT=y diff --git a/tests/lib/tone/prj.conf b/tests/lib/tone/prj.conf index d41ef9f315c3..dcc94bca30f0 100644 --- a/tests/lib/tone/prj.conf +++ b/tests/lib/tone/prj.conf @@ -1,8 +1,5 @@ CONFIG_ZTEST=y CONFIG_CMSIS_DSP=y CONFIG_NEWLIB_LIBC=y -CONFIG_CMSIS_DSP_FASTMATH=y -CONFIG_CMSIS_DSP_TABLES=y CONFIG_MAIN_STACK_SIZE=8192 CONFIG_TONE=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/modules/lib/zcbor/decode/prj.conf b/tests/modules/lib/zcbor/decode/prj.conf index 150fb1a14f4b..9c16677f7f23 100644 --- a/tests/modules/lib/zcbor/decode/prj.conf +++ b/tests/modules/lib/zcbor/decode/prj.conf @@ -1,8 +1,7 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZCBOR=y diff --git a/tests/modules/lib/zcbor/encode/prj.conf b/tests/modules/lib/zcbor/encode/prj.conf index 150fb1a14f4b..9c16677f7f23 100644 --- a/tests/modules/lib/zcbor/encode/prj.conf +++ b/tests/modules/lib/zcbor/encode/prj.conf @@ -1,8 +1,7 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZCBOR=y diff --git a/tests/modules/lib/zcbor/raw_encode/prj.conf b/tests/modules/lib/zcbor/raw_encode/prj.conf index 150fb1a14f4b..9c16677f7f23 100644 --- a/tests/modules/lib/zcbor/raw_encode/prj.conf +++ b/tests/modules/lib/zcbor/raw_encode/prj.conf @@ -1,8 +1,7 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZCBOR=y diff --git a/tests/modules/mcuboot/direct_xip/prj.conf b/tests/modules/mcuboot/direct_xip/prj.conf index d5b9782763ec..3f22f4b414e2 100644 --- a/tests/modules/mcuboot/direct_xip/prj.conf +++ b/tests/modules/mcuboot/direct_xip/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP=y diff --git a/tests/modules/mcuboot/external_flash/prj.conf b/tests/modules/mcuboot/external_flash/prj.conf index 0c2f56e0ad84..2a882e371b73 100644 --- a/tests/modules/mcuboot/external_flash/prj.conf +++ b/tests/modules/mcuboot/external_flash/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/nrf5340_audio/macros/prj.conf b/tests/nrf5340_audio/macros/prj.conf index 1d97b0e7c434..9a75212e89d0 100644 --- a/tests/nrf5340_audio/macros/prj.conf +++ b/tests/nrf5340_audio/macros/prj.conf @@ -1,3 +1,2 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/nrf5340_audio/sw_codec_lc3/prj.conf b/tests/nrf5340_audio/sw_codec_lc3/prj.conf index 42e00eea2824..ce816fad9192 100644 --- a/tests/nrf5340_audio/sw_codec_lc3/prj.conf +++ b/tests/nrf5340_audio/sw_codec_lc3/prj.conf @@ -3,8 +3,6 @@ CONFIG_IRQ_OFFLOAD=y CONFIG_FPU=y CONFIG_NEWLIB_LIBC=y CONFIG_CMSIS_DSP=y -CONFIG_CMSIS_DSP_FASTMATH=y -CONFIG_CMSIS_DSP_TABLES=y CONFIG_SW_CODEC_LC3_T2_SOFTWARE=y CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE=n @@ -14,4 +12,3 @@ CONFIG_BT=n CONFIG_MAIN_STACK_SIZE=80000 CONFIG_LC3_ENC_CHAN_MAX=2 CONFIG_LC3_DEC_CHAN_MAX=2 -CONFIG_ZTEST_NEW_API=y diff --git a/tests/subsys/app_event_manager/prj.conf b/tests/subsys/app_event_manager/prj.conf index 9a2c630c3046..c22fa4a913b5 100644 --- a/tests/subsys/app_event_manager/prj.conf +++ b/tests/subsys/app_event_manager/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2019 Nordic Semiconductor ASA +# Copyright (c) 2019-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST_SHUFFLE=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST=y # Assert test mode must be enabled, because assert post action handler must return (i.e. not abort) diff --git a/tests/subsys/audio_module/prj.conf b/tests/subsys/audio_module/prj.conf index 30ad2497da6e..0c4676358ce7 100644 --- a/tests/subsys/audio_module/prj.conf +++ b/tests/subsys/audio_module/prj.conf @@ -5,7 +5,6 @@ # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_STACK_SIZE=8196 CONFIG_IRQ_OFFLOAD=y CONFIG_AUDIO_MODULE_TEST=y diff --git a/tests/subsys/bluetooth/fast_pair/crypto/prj.conf b/tests/subsys/bluetooth/fast_pair/crypto/prj.conf index 68f9737e47e9..a8646d803574 100644 --- a/tests/subsys/bluetooth/fast_pair/crypto/prj.conf +++ b/tests/subsys/bluetooth/fast_pair/crypto/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_SHUFFLE=y CONFIG_BT_FAST_PAIR_CRYPTO_OBERON=y diff --git a/tests/subsys/bluetooth/fast_pair/crypto/prj_mbedtls.conf b/tests/subsys/bluetooth/fast_pair/crypto/prj_mbedtls.conf index 7d9a7b513772..d9b4b703beb4 100644 --- a/tests/subsys/bluetooth/fast_pair/crypto/prj_mbedtls.conf +++ b/tests/subsys/bluetooth/fast_pair/crypto/prj_mbedtls.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_SHUFFLE=y CONFIG_BT_FAST_PAIR_CRYPTO_MBEDTLS=y CONFIG_MBEDTLS_HEAP_SIZE=16384 diff --git a/tests/subsys/bluetooth/fast_pair/crypto/prj_tinycrypt.conf b/tests/subsys/bluetooth/fast_pair/crypto/prj_tinycrypt.conf index 0684c7a5501e..68d77285668a 100644 --- a/tests/subsys/bluetooth/fast_pair/crypto/prj_tinycrypt.conf +++ b/tests/subsys/bluetooth/fast_pair/crypto/prj_tinycrypt.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_SHUFFLE=y CONFIG_BT_FAST_PAIR_CRYPTO_TINYCRYPT=y diff --git a/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/prj.conf b/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/prj.conf index 9bd442a539f4..b4521720cf28 100644 --- a/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/prj.conf +++ b/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_SHUFFLE=y CONFIG_SETTINGS=y diff --git a/tests/subsys/bluetooth/fast_pair/storage/factory_reset/prj.conf b/tests/subsys/bluetooth/fast_pair/storage/factory_reset/prj.conf index aebbd5b92ee5..b92715a86949 100644 --- a/tests/subsys/bluetooth/fast_pair/storage/factory_reset/prj.conf +++ b/tests/subsys/bluetooth/fast_pair/storage/factory_reset/prj.conf @@ -5,7 +5,6 @@ # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # Do not randomize test order, tests depend on predefined execution order. CONFIG_ZTEST_SHUFFLE=n diff --git a/tests/subsys/bluetooth/gatt_dm/prj.conf b/tests/subsys/bluetooth/gatt_dm/prj.conf index df04d7b8e958..caebeb562e81 100644 --- a/tests/subsys/bluetooth/gatt_dm/prj.conf +++ b/tests/subsys/bluetooth/gatt_dm/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2019 Nordic Semiconductor ASA +# Copyright (c) 2019-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_NETWORKING=y CONFIG_BT=y diff --git a/tests/subsys/bluetooth/mesh/light_ctrl/prj.conf b/tests/subsys/bluetooth/mesh/light_ctrl/prj.conf index cb7e4bce6fd8..55195d4e9726 100644 --- a/tests/subsys/bluetooth/mesh/light_ctrl/prj.conf +++ b/tests/subsys/bluetooth/mesh/light_ctrl/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # Ztest configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_MOCKING=y CONFIG_ZTEST_PARAMETER_COUNT=30 diff --git a/tests/subsys/bluetooth/mesh/light_ctrl/src/main.c b/tests/subsys/bluetooth/mesh/light_ctrl/src/main.c index 5fd6f2c21939..b653428579ad 100644 --- a/tests/subsys/bluetooth/mesh/light_ctrl/src/main.c +++ b/tests/subsys/bluetooth/mesh/light_ctrl/src/main.c @@ -45,19 +45,15 @@ static struct { /** Mocks ******************************************/ -static struct bt_mesh_model mock_lightness_model = { .elem_idx = 0 }; +static const struct bt_mesh_model mock_lightness_model = { + .rt = &(struct bt_mesh_model_rt_ctx){.elem_idx = 0}}; -static struct bt_mesh_lightness_srv lightness_srv = { - .lightness_model = &mock_lightness_model -}; +static struct bt_mesh_lightness_srv lightness_srv = {.lightness_model = &mock_lightness_model}; -static struct bt_mesh_light_ctrl_srv light_ctrl_srv = - BT_MESH_LIGHT_CTRL_SRV_INIT(&lightness_srv); +static struct bt_mesh_light_ctrl_srv light_ctrl_srv = BT_MESH_LIGHT_CTRL_SRV_INIT(&lightness_srv); -static struct bt_mesh_model mock_ligth_ctrl_model = { - .user_data = &light_ctrl_srv, - .elem_idx = 1, -}; +static const struct bt_mesh_model mock_ligth_ctrl_model = { + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &light_ctrl_srv, .elem_idx = 1}}; enum light_ctrl_timer { STATE_TIMER, @@ -147,12 +143,12 @@ int32_t model_delay_decode(uint8_t encoded_delay) return 0; } -struct bt_mesh_elem *bt_mesh_model_elem(struct bt_mesh_model *mod) +const struct bt_mesh_elem *bt_mesh_model_elem(const struct bt_mesh_model *mod) { return NULL; } -struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, +const struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, uint16_t id) { return NULL; @@ -192,8 +188,8 @@ void bt_mesh_model_msg_init(struct net_buf_simple *msg, uint32_t opcode) net_buf_simple_init(msg, 0); } -int bt_mesh_model_extend(struct bt_mesh_model *mod, - struct bt_mesh_model *base_mod) +int bt_mesh_model_extend(const struct bt_mesh_model *mod, + const struct bt_mesh_model *base_mod) { return 0; } diff --git a/tests/subsys/bluetooth/mesh/light_hue/prj.conf b/tests/subsys/bluetooth/mesh/light_hue/prj.conf index 1bb790fea6fb..5f379c9aa638 100644 --- a/tests/subsys/bluetooth/mesh/light_hue/prj.conf +++ b/tests/subsys/bluetooth/mesh/light_hue/prj.conf @@ -6,7 +6,6 @@ # Ztest configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_MOCKING=y CONFIG_ZTEST_PARAMETER_COUNT=30 diff --git a/tests/subsys/bluetooth/mesh/light_hue/src/main.c b/tests/subsys/bluetooth/mesh/light_hue/src/main.c index a368a7cfadd4..3a2d0708262d 100644 --- a/tests/subsys/bluetooth/mesh/light_hue/src/main.c +++ b/tests/subsys/bluetooth/mesh/light_hue/src/main.c @@ -95,10 +95,8 @@ static struct bt_mesh_light_hue_srv_handlers light_hue_srv_handlers = { static struct bt_mesh_light_hue_srv light_hue_srv = BT_MESH_LIGHT_HUE_SRV_INIT(&light_hue_srv_handlers); -static struct bt_mesh_model mock_light_hue_srv_model = { - .user_data = &light_hue_srv, - .elem_idx = 1, -}; +static const struct bt_mesh_model mock_light_hue_srv_model = { + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &light_hue_srv, .elem_idx = 1}}; /** Mocks ******************************************/ @@ -123,7 +121,7 @@ static int hue_status_pub(struct net_buf_simple *buf) return 0; } -int bt_mesh_msg_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +int bt_mesh_msg_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { uint16_t opcode; @@ -150,8 +148,8 @@ void bt_mesh_model_msg_init(struct net_buf_simple *msg, uint32_t opcode) net_buf_simple_add_be16(msg, opcode); } -int bt_mesh_model_extend(struct bt_mesh_model *mod, - struct bt_mesh_model *base_mod) +int bt_mesh_model_extend(const struct bt_mesh_model *mod, + const struct bt_mesh_model *base_mod) { return 0; } diff --git a/tests/subsys/bluetooth/mesh/scheduler_model/action_planning/prj.conf b/tests/subsys/bluetooth/mesh/scheduler_model/action_planning/prj.conf index f43b47f76dbc..927ea79bbc02 100644 --- a/tests/subsys/bluetooth/mesh/scheduler_model/action_planning/prj.conf +++ b/tests/subsys/bluetooth/mesh/scheduler_model/action_planning/prj.conf @@ -6,7 +6,6 @@ # Ztest configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_BUF=y diff --git a/tests/subsys/bluetooth/mesh/scheduler_model/action_planning/src/main.c b/tests/subsys/bluetooth/mesh/scheduler_model/action_planning/src/main.c index 37f7b1fa3862..9b8237095f03 100644 --- a/tests/subsys/bluetooth/mesh/scheduler_model/action_planning/src/main.c +++ b/tests/subsys/bluetooth/mesh/scheduler_model/action_planning/src/main.c @@ -133,78 +133,83 @@ struct test_scene_srv scene_srv[5] = { static struct bt_mesh_model mock_models_elem1[3] = { { - .user_data = &sched_srv[0], + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &sched_srv[0]}, .id = BT_MESH_MODEL_ID_SCHEDULER_SRV, }, { - .user_data = &onoff_srv[0].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &onoff_srv[0].srv}, .id = BT_MESH_MODEL_ID_GEN_ONOFF_SRV, }, { - .user_data = &scene_srv[0].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &scene_srv[0].srv}, .id = BT_MESH_MODEL_ID_SCENE_SRV, }, }; static struct bt_mesh_model mock_models_elem2[2] = { { - .user_data = &onoff_srv[1].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &onoff_srv[1].srv}, .id = BT_MESH_MODEL_ID_GEN_ONOFF_SRV, }, { - .user_data = &scene_srv[1].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &scene_srv[1].srv}, .id = BT_MESH_MODEL_ID_SCENE_SRV, }, }; static struct bt_mesh_model mock_models_elem3[2] = { { - .user_data = &onoff_srv[2].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &onoff_srv[2].srv}, .id = BT_MESH_MODEL_ID_GEN_ONOFF_SRV, }, { - .user_data = &scene_srv[2].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &scene_srv[2].srv}, .id = BT_MESH_MODEL_ID_SCENE_SRV, }, }; static struct bt_mesh_model mock_models_elem4[3] = { { - .user_data = &sched_srv[1], + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &sched_srv[1]}, .id = BT_MESH_MODEL_ID_SCHEDULER_SRV, }, { - .user_data = &onoff_srv[3].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &onoff_srv[3].srv}, .id = BT_MESH_MODEL_ID_GEN_ONOFF_SRV, }, { - .user_data = &scene_srv[3].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &scene_srv[3].srv}, .id = BT_MESH_MODEL_ID_SCENE_SRV, }, }; static struct bt_mesh_model mock_models_elem5[2] = { { - .user_data = &onoff_srv[4].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &onoff_srv[4].srv}, .id = BT_MESH_MODEL_ID_GEN_ONOFF_SRV, }, { - .user_data = &scene_srv[4].srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &scene_srv[4].srv}, .id = BT_MESH_MODEL_ID_SCENE_SRV, }, }; -static struct bt_mesh_elem mock_elems[5] = { - { .addr = 1, .model_count = 3, .models = mock_models_elem1 }, - { .addr = 2, .model_count = 2, .models = mock_models_elem2 }, - { .addr = 3, .model_count = 2, .models = mock_models_elem3 }, - { .addr = 4, .model_count = 3, .models = mock_models_elem4 }, - { .addr = 5, .model_count = 2, .models = mock_models_elem5 } +static const struct bt_mesh_elem mock_elems[5] = { + {.rt = &(struct bt_mesh_elem_rt_ctx){.addr = 1}, .model_count = 3, + .models = mock_models_elem1}, + {.rt = &(struct bt_mesh_elem_rt_ctx){.addr = 2}, .model_count = 2, + .models = mock_models_elem2}, + {.rt = &(struct bt_mesh_elem_rt_ctx){.addr = 3}, .model_count = 2, + .models = mock_models_elem3}, + {.rt = &(struct bt_mesh_elem_rt_ctx){.addr = 4}, .model_count = 3, + .models = mock_models_elem4}, + {.rt = &(struct bt_mesh_elem_rt_ctx){.addr = 5}, .model_count = 2, + .models = mock_models_elem5} }; struct mock_comp_data { size_t elem_count; - struct bt_mesh_elem *elem; + const struct bt_mesh_elem *elem; } mock_comp = { .elem_count = 5, .elem = mock_elems }; static struct bt_mesh_model *sched_mod_elem1 = &mock_models_elem1[0]; @@ -214,19 +219,19 @@ static void mod_elem_idx_prep(void) { for (size_t i = 0; i < ARRAY_SIZE(mock_elems); i++) { for (size_t j = 0; j < mock_elems[i].model_count; j++) { - mock_elems[i].models[j].elem_idx = i; + mock_elems[i].models[j].rt->elem_idx = i; } } } /* Redefined mocks */ -struct bt_mesh_elem *bt_mesh_model_elem(struct bt_mesh_model *mod) +const struct bt_mesh_elem *bt_mesh_model_elem(const struct bt_mesh_model *mod) { - return &mock_comp.elem[mod->elem_idx]; + return &mock_comp.elem[mod->rt->elem_idx]; } -struct bt_mesh_elem *bt_mesh_elem_find(uint16_t addr) +const struct bt_mesh_elem *bt_mesh_elem_find(uint16_t addr) { uint16_t index; @@ -234,14 +239,14 @@ struct bt_mesh_elem *bt_mesh_elem_find(uint16_t addr) return NULL; } - index = addr - mock_comp.elem[0].addr; + index = addr - mock_comp.elem[0].rt->addr; if (index >= mock_comp.elem_count) { return NULL; } return &mock_comp.elem[index]; } -struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, uint16_t id) +const struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, uint16_t id) { uint8_t i; @@ -320,13 +325,13 @@ void bt_mesh_time_encode_time_params(struct net_buf_simple *buf, { } -int bt_mesh_msg_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +int bt_mesh_msg_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { return 0; } -int _bt_mesh_time_srv_update_handler(struct bt_mesh_model *model) +int _bt_mesh_time_srv_update_handler(const struct bt_mesh_model *model) { return 0; } diff --git a/tests/subsys/bluetooth/mesh/scheduler_model/message_validity/prj.conf b/tests/subsys/bluetooth/mesh/scheduler_model/message_validity/prj.conf index 09cc225d1395..ca7918e97c62 100644 --- a/tests/subsys/bluetooth/mesh/scheduler_model/message_validity/prj.conf +++ b/tests/subsys/bluetooth/mesh/scheduler_model/message_validity/prj.conf @@ -6,7 +6,6 @@ # Ztest configuration with new API CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST_MOCKING=y diff --git a/tests/subsys/bluetooth/mesh/scheduler_model/message_validity/src/main.c b/tests/subsys/bluetooth/mesh/scheduler_model/message_validity/src/main.c index 1aff73345fbe..904ff3c08eaf 100644 --- a/tests/subsys/bluetooth/mesh/scheduler_model/message_validity/src/main.c +++ b/tests/subsys/bluetooth/mesh/scheduler_model/message_validity/src/main.c @@ -121,52 +121,52 @@ static struct bt_mesh_scheduler_cli sched_cli = { * | Scene Srv | * */ -static struct bt_mesh_model mock_models_elem[4] = { +static const struct bt_mesh_model mock_models_elem[4] = { { - .user_data = &sched_srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &sched_srv}, .id = BT_MESH_MODEL_ID_SCHEDULER_SRV, }, { - .user_data = &sched_cli, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &sched_cli}, .id = BT_MESH_MODEL_ID_SCHEDULER_CLI, }, { - .user_data = &onoff_srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &onoff_srv}, .id = BT_MESH_MODEL_ID_GEN_ONOFF_SRV, }, { - .user_data = &scene_srv, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &scene_srv}, .id = BT_MESH_MODEL_ID_SCENE_SRV, }, }; -static struct bt_mesh_elem mock_elem = { - .addr = 1, +static const struct bt_mesh_elem mock_elem = { + .rt = &(struct bt_mesh_elem_rt_ctx){.addr = 1}, .model_count = ARRAY_SIZE(mock_models_elem), .models = mock_models_elem, }; struct mock_comp_data { size_t elem_count; - struct bt_mesh_elem *elem; + const struct bt_mesh_elem *elem; } mock_comp = { .elem_count = 1, .elem = &mock_elem }; -static struct bt_mesh_model *mock_mod_srv = &mock_models_elem[0]; -static struct bt_mesh_model *mock_mod_cli = &mock_models_elem[1]; +static const struct bt_mesh_model *mock_mod_srv = &mock_models_elem[0]; +static const struct bt_mesh_model *mock_mod_cli = &mock_models_elem[1]; /* Redefined mocks */ -struct bt_mesh_elem *bt_mesh_model_elem(struct bt_mesh_model *mod) +const struct bt_mesh_elem *bt_mesh_model_elem(const struct bt_mesh_model *mod) { return &mock_comp.elem[0]; } -struct bt_mesh_elem *bt_mesh_elem_find(uint16_t addr) +const struct bt_mesh_elem *bt_mesh_elem_find(uint16_t addr) { - return (addr == mock_comp.elem[0].addr ? &mock_comp.elem[0] : NULL); + return (addr == mock_comp.elem[0].rt->addr ? &mock_comp.elem[0] : NULL); } -struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, uint16_t id) +const struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, uint16_t id) { uint8_t i; @@ -224,7 +224,7 @@ void bt_mesh_time_encode_time_ress(struct net_buf_simple *buf, { } -int bt_mesh_msg_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +int bt_mesh_msg_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { ztest_check_expected_value(model); @@ -235,7 +235,7 @@ int bt_mesh_msg_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -int bt_mesh_msg_ackd_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +int bt_mesh_msg_ackd_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf, const struct bt_mesh_msg_rsp_ctx *rsp) { ztest_check_expected_value(model); @@ -246,7 +246,7 @@ int bt_mesh_msg_ackd_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *c return 0; } -int _bt_mesh_time_srv_update_handler(struct bt_mesh_model *model) +int _bt_mesh_time_srv_update_handler(const struct bt_mesh_model *model) { return 0; } diff --git a/tests/subsys/bluetooth/mesh/scheduler_model/timing/prj.conf b/tests/subsys/bluetooth/mesh/scheduler_model/timing/prj.conf index e627fcbd2a65..7990ce3e79e4 100644 --- a/tests/subsys/bluetooth/mesh/scheduler_model/timing/prj.conf +++ b/tests/subsys/bluetooth/mesh/scheduler_model/timing/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # Ztest configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_BUF=y diff --git a/tests/subsys/bluetooth/mesh/scheduler_model/timing/src/main.c b/tests/subsys/bluetooth/mesh/scheduler_model/timing/src/main.c index b2d47fd11ad9..94ba5d43a479 100644 --- a/tests/subsys/bluetooth/mesh/scheduler_model/timing/src/main.c +++ b/tests/subsys/bluetooth/mesh/scheduler_model/timing/src/main.c @@ -24,17 +24,18 @@ static struct bt_mesh_scheduler_srv scheduler_srv = K_SEM_DEFINE(action_fired, 0, 1); -static struct bt_mesh_model mock_sched_model = { - .user_data = &scheduler_srv, - .elem_idx = 1, +static const struct bt_mesh_model mock_sched_model = { + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &scheduler_srv, .elem_idx = 1} }; -static struct bt_mesh_model mock_scene_model = { - .user_data = &scene_srv, - .elem_idx = 1, +static const struct bt_mesh_model mock_scene_model = { + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &scene_srv, .elem_idx = 1} +}; + +static const struct bt_mesh_elem dummy_elem = { + .rt = &(struct bt_mesh_elem_rt_ctx){.addr = 1} }; -static struct bt_mesh_elem dummy_elem; static struct tm start_tm; static int gfire_cnt; @@ -52,7 +53,7 @@ int32_t model_transition_decode(uint8_t encoded_transition) return 0; } -struct bt_mesh_elem *bt_mesh_model_elem(struct bt_mesh_model *mod) +const struct bt_mesh_elem *bt_mesh_model_elem(const struct bt_mesh_model *mod) { return &dummy_elem; } @@ -62,8 +63,8 @@ struct bt_mesh_elem *bt_mesh_elem_find(uint16_t addr) return NULL; } -struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, - uint16_t id) +const struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, + uint16_t id) { return &mock_scene_model; } @@ -110,13 +111,13 @@ void bt_mesh_time_encode_time_params(struct net_buf_simple *buf, { } -int bt_mesh_msg_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, - struct net_buf_simple *buf) +int bt_mesh_msg_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, + struct net_buf_simple *buf) { return 0; } -int _bt_mesh_time_srv_update_handler(struct bt_mesh_model *model) +int _bt_mesh_time_srv_update_handler(const struct bt_mesh_model *model) { return 0; } diff --git a/tests/subsys/bluetooth/mesh/sensor_subsys/prj.conf b/tests/subsys/bluetooth/mesh/sensor_subsys/prj.conf index e3369b3d56d4..db33aa05519f 100644 --- a/tests/subsys/bluetooth/mesh/sensor_subsys/prj.conf +++ b/tests/subsys/bluetooth/mesh/sensor_subsys/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # Ztest configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_CBPRINTF_FP_SUPPORT=y CONFIG_NET_BUF=y diff --git a/tests/subsys/bluetooth/mesh/silvair_enocean_model/CMakeLists.txt b/tests/subsys/bluetooth/mesh/silvair_enocean_model/CMakeLists.txt index 69416c192f1c..44f4ed7f1a6a 100644 --- a/tests/subsys/bluetooth/mesh/silvair_enocean_model/CMakeLists.txt +++ b/tests/subsys/bluetooth/mesh/silvair_enocean_model/CMakeLists.txt @@ -5,7 +5,7 @@ # cmake_minimum_required(VERSION 3.20.0) -include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(bt_mesh_silvair_enocean_test) FILE(GLOB app_sources src/*.c) diff --git a/tests/subsys/bluetooth/mesh/silvair_enocean_model/prj.conf b/tests/subsys/bluetooth/mesh/silvair_enocean_model/prj.conf index 8731ff95502c..8d691a9f3860 100644 --- a/tests/subsys/bluetooth/mesh/silvair_enocean_model/prj.conf +++ b/tests/subsys/bluetooth/mesh/silvair_enocean_model/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # Ztest configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_MOCKING=y CONFIG_NET_BUF=y diff --git a/tests/subsys/bluetooth/mesh/silvair_enocean_model/src/main.c b/tests/subsys/bluetooth/mesh/silvair_enocean_model/src/main.c index 80c79ee92902..f97ace372764 100644 --- a/tests/subsys/bluetooth/mesh/silvair_enocean_model/src/main.c +++ b/tests/subsys/bluetooth/mesh/silvair_enocean_model/src/main.c @@ -39,18 +39,18 @@ static struct bt_enocean_device mock_enocean_device = { } }; -static struct bt_mesh_model mock_model = { - .user_data = &srv +static const struct bt_mesh_model mock_model = { + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &srv} }; -static struct bt_mesh_model mock_lvl_model = { +static const struct bt_mesh_model mock_lvl_model = { .pub = &srv.buttons[0].lvl.pub, - .user_data = &srv.buttons[0].lvl, + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &srv.buttons[0].lvl}, }; -static struct bt_mesh_model mock_onoff_model = { +static const struct bt_mesh_model mock_onoff_model = { .pub = &srv.buttons[0].onoff.pub, - .user_data = &srv.buttons[0].onoff + .rt = &(struct bt_mesh_model_rt_ctx){.user_data = &srv.buttons[0].onoff} }; static const struct bt_enocean_callbacks *enocean_cbs; @@ -109,20 +109,20 @@ int32_t model_delay_decode(uint8_t encoded_delay) return encoded_delay * DELAY_TIME_STEP_MS; } -struct bt_mesh_elem *bt_mesh_model_elem(struct bt_mesh_model *mod) +const struct bt_mesh_elem *bt_mesh_model_elem(const struct bt_mesh_model *mod) { return NULL; } -struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, - uint16_t id) +const struct bt_mesh_model *bt_mesh_model_find(const struct bt_mesh_elem *elem, + uint16_t id) { return NULL; } int bt_mesh_onoff_cli_set_unack(struct bt_mesh_onoff_cli *cli, - struct bt_mesh_msg_ctx *ctx, - const struct bt_mesh_onoff_set *set) + struct bt_mesh_msg_ctx *ctx, + const struct bt_mesh_onoff_set *set) { ztest_check_expected_value(cli); ztest_check_expected_value(set->on_off); @@ -162,7 +162,7 @@ void bt_mesh_model_msg_init(struct net_buf_simple *msg, uint32_t opcode) net_buf_simple_add_le16(msg, opcode & 0xffff); } -int bt_mesh_model_data_store(struct bt_mesh_model *model, bool vnd, +int bt_mesh_model_data_store(const struct bt_mesh_model *model, bool vnd, const char *name, const void *data, size_t data_len) { diff --git a/tests/subsys/bluetooth/mesh/time_model/prj.conf b/tests/subsys/bluetooth/mesh/time_model/prj.conf index f43b47f76dbc..927ea79bbc02 100644 --- a/tests/subsys/bluetooth/mesh/time_model/prj.conf +++ b/tests/subsys/bluetooth/mesh/time_model/prj.conf @@ -6,7 +6,6 @@ # Ztest configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_BUF=y diff --git a/tests/subsys/bluetooth/mesh/time_model/src/main.c b/tests/subsys/bluetooth/mesh/time_model/src/main.c index b2a58df86022..c4158b6565d7 100644 --- a/tests/subsys/bluetooth/mesh/time_model/src/main.c +++ b/tests/subsys/bluetooth/mesh/time_model/src/main.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include "time_internal.h" @@ -69,7 +69,8 @@ static void tc_teardown(void *f) _bt_mesh_time_srv_cb.reset(mock_elem[0].models); } -int bt_mesh_model_extend(struct bt_mesh_model *extending_mod, struct bt_mesh_model *base_mod) +int bt_mesh_model_extend(const struct bt_mesh_model *extending_mod, + const struct bt_mesh_model *base_mod) { return 0; } @@ -78,7 +79,7 @@ void bt_mesh_model_msg_init(struct net_buf_simple *msg, uint32_t opcode) { } -int bt_mesh_msg_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +int bt_mesh_msg_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) { struct bt_mesh_time_status status; @@ -122,7 +123,7 @@ int bt_mesh_msg_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, return 0; } -int bt_mesh_model_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, +int bt_mesh_model_send(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *msg, const struct bt_mesh_send_cb *cb, void *cb_data) { return 0; diff --git a/tests/subsys/bootloader/bl_crypto/prj.conf b/tests/subsys/bootloader/bl_crypto/prj.conf index 683825160d7e..cd411e180291 100644 --- a/tests/subsys/bootloader/bl_crypto/prj.conf +++ b/tests/subsys/bootloader/bl_crypto/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2018 Nordic Semiconductor ASA +# Copyright (c) 2018-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_STACK_SIZE=4800 CONFIG_TEST_USERSPACE=n CONFIG_USERSPACE=n diff --git a/tests/subsys/bootloader/bl_storage/prj.conf b/tests/subsys/bootloader/bl_storage/prj.conf index ad48e8f9e3e9..60b64edd8dfa 100644 --- a/tests/subsys/bootloader/bl_storage/prj.conf +++ b/tests/subsys/bootloader/bl_storage/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_TEST_USERSPACE=n CONFIG_USERSPACE=n CONFIG_STDOUT_CONSOLE=n diff --git a/tests/subsys/bootloader/bl_validation/prj.conf b/tests/subsys/bootloader/bl_validation/prj.conf index 094506bbf022..3ea6d57a6cd6 100644 --- a/tests/subsys/bootloader/bl_validation/prj.conf +++ b/tests/subsys/bootloader/bl_validation/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2018 Nordic Semiconductor ASA +# Copyright (c) 2018-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_STACK_SIZE=6144 CONFIG_SECURE_BOOT=y CONFIG_FW_INFO=y diff --git a/tests/subsys/bootloader/bl_validation_ff_key/prj.conf b/tests/subsys/bootloader/bl_validation_ff_key/prj.conf index 8798a7984e11..5cf402595402 100644 --- a/tests/subsys/bootloader/bl_validation_ff_key/prj.conf +++ b/tests/subsys/bootloader/bl_validation_ff_key/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_SECURE_BOOT=y CONFIG_SB_PUBLIC_KEY_FILES="ff_pub.pem" CONFIG_FW_INFO=y diff --git a/tests/subsys/bootloader/bl_validation_neg/prj.conf b/tests/subsys/bootloader/bl_validation_neg/prj.conf index 5380dba044c1..57bb9cb11b1f 100644 --- a/tests/subsys/bootloader/bl_validation_neg/prj.conf +++ b/tests/subsys/bootloader/bl_validation_neg/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_SECURE_BOOT=y CONFIG_FW_INFO=y CONFIG_SECURE_BOOT_CRYPTO=y diff --git a/tests/subsys/bootloader/bl_validation_unittest/prj.conf b/tests/subsys/bootloader/bl_validation_unittest/prj.conf index f5185b4d56e7..5430cb3bb9a1 100644 --- a/tests/subsys/bootloader/bl_validation_unittest/prj.conf +++ b/tests/subsys/bootloader/bl_validation_unittest/prj.conf @@ -1,8 +1,7 @@ # -# Copyright (c) 2018 Nordic Semiconductor ASA +# Copyright (c) 2018-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/subsys/caf/sensor_data_aggregator/prj.conf b/tests/subsys/caf/sensor_data_aggregator/prj.conf index d54ca118cf9b..4cf57d9b19f3 100644 --- a/tests/subsys/caf/sensor_data_aggregator/prj.conf +++ b/tests/subsys/caf/sensor_data_aggregator/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # Configuration required by Application Event Manager CONFIG_APP_EVENT_MANAGER=y diff --git a/tests/subsys/caf/sensor_manager/prj.conf b/tests/subsys/caf/sensor_manager/prj.conf index 42fcb85cc162..cfcd67d9c1d7 100644 --- a/tests/subsys/caf/sensor_manager/prj.conf +++ b/tests/subsys/caf/sensor_manager/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # ################################################################################ # Application configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_CAF=y CONFIG_CAF_SENSOR_MANAGER=y diff --git a/tests/subsys/debug/cpu_load/prj.conf b/tests/subsys/debug/cpu_load/prj.conf index 951d7ca005fa..03875455ae25 100644 --- a/tests/subsys/debug/cpu_load/prj.conf +++ b/tests/subsys/debug/cpu_load/prj.conf @@ -1,5 +1,4 @@ CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_CPU_LOAD=y CONFIG_NRFX_TIMER1=y CONFIG_CPU_LOAD_USE_SHARED_DPPI_CHANNELS=y diff --git a/tests/subsys/dfu/dfu_multi_image/prj.conf b/tests/subsys/dfu/dfu_multi_image/prj.conf index afeee0010751..b344c0c864e7 100644 --- a/tests/subsys/dfu/dfu_multi_image/prj.conf +++ b/tests/subsys/dfu/dfu_multi_image/prj.conf @@ -1,8 +1,7 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_DFU_MULTI_IMAGE=y diff --git a/tests/subsys/dfu/dfu_target/mcuboot/prj.conf b/tests/subsys/dfu/dfu_target/mcuboot/prj.conf index 5610e58b21ef..072faecc5e2a 100644 --- a/tests/subsys/dfu/dfu_target/mcuboot/prj.conf +++ b/tests/subsys/dfu/dfu_target/mcuboot/prj.conf @@ -1,9 +1,8 @@ # -# Copyright (c) 2019 Nordic Semiconductor ASA +# Copyright (c) 2019-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y diff --git a/tests/subsys/dfu/dfu_target/smp/prj.conf b/tests/subsys/dfu/dfu_target/smp/prj.conf index 13d92bc8833f..5f1775817032 100644 --- a/tests/subsys/dfu/dfu_target/smp/prj.conf +++ b/tests/subsys/dfu/dfu_target/smp/prj.conf @@ -4,7 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y CONFIG_NET_BUF=y diff --git a/tests/subsys/dfu/dfu_target_stream/prj.conf b/tests/subsys/dfu/dfu_target_stream/prj.conf index 15e76c21691d..e63171d10e44 100644 --- a/tests/subsys/dfu/dfu_target_stream/prj.conf +++ b/tests/subsys/dfu/dfu_target_stream/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_STREAM_FLASH=y CONFIG_STREAM_FLASH_ERASE=y CONFIG_DFU_TARGET=y diff --git a/tests/subsys/emds/emds_api/prj.conf b/tests/subsys/emds/emds_api/prj.conf index 03901be79025..6d599942cdd1 100644 --- a/tests/subsys/emds/emds_api/prj.conf +++ b/tests/subsys/emds/emds_api/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # Ztest configuration CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_PM_SINGLE_IMAGE=y diff --git a/tests/subsys/emds/emds_flash/prj.conf b/tests/subsys/emds/emds_flash/prj.conf index 574532de120f..ac4c8f22fb78 100644 --- a/tests/subsys/emds/emds_flash/prj.conf +++ b/tests/subsys/emds/emds_flash/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_PM_SINGLE_IMAGE=y diff --git a/tests/subsys/event_manager_proxy/prj.conf b/tests/subsys/event_manager_proxy/prj.conf index 0d8429036710..8c55a9b0ace7 100644 --- a/tests/subsys/event_manager_proxy/prj.conf +++ b/tests/subsys/event_manager_proxy/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_MULTICORE_DEFAULT_SETTINGS=n CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/subsys/event_manager_proxy/prj_icmsg.conf b/tests/subsys/event_manager_proxy/prj_icmsg.conf index 0440679b9957..67232207bd01 100644 --- a/tests/subsys/event_manager_proxy/prj_icmsg.conf +++ b/tests/subsys/event_manager_proxy/prj_icmsg.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_MULTICORE_DEFAULT_SETTINGS=n CONFIG_ENTROPY_GENERATOR=y diff --git a/tests/subsys/event_manager_proxy/src/data.c b/tests/subsys/event_manager_proxy/src/data.c index 88e8f6394ff8..5dc6896e524e 100644 --- a/tests/subsys/event_manager_proxy/src/data.c +++ b/tests/subsys/event_manager_proxy/src/data.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include -#include +#include #include #include diff --git a/tests/subsys/fw_info/prj.conf b/tests/subsys/fw_info/prj.conf index b0ca6b32066e..a20d061580e9 100644 --- a/tests/subsys/fw_info/prj.conf +++ b/tests/subsys/fw_info/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2019 Nordic Semiconductor ASA +# Copyright (c) 2019-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_TEST_USERSPACE=n CONFIG_USERSPACE=n CONFIG_STDOUT_CONSOLE=n diff --git a/tests/subsys/net/lib/download_client/CMakeLists.txt b/tests/subsys/net/lib/download_client/CMakeLists.txt index dade560abb23..95764e73efa1 100644 --- a/tests/subsys/net/lib/download_client/CMakeLists.txt +++ b/tests/subsys/net/lib/download_client/CMakeLists.txt @@ -16,6 +16,7 @@ target_include_directories(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/include/net/ ${ZEPHYR_BASE}/subsys/net/ip/ + ${ZEPHYR_BASE}/subsys/net/lib/sockets src/ ) diff --git a/tests/subsys/net/lib/download_client/prj.conf b/tests/subsys/net/lib/download_client/prj.conf index df7b283c6ea8..b609998988f5 100644 --- a/tests/subsys/net/lib/download_client/prj.conf +++ b/tests/subsys/net/lib/download_client/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y CONFIG_FLASH=y CONFIG_ZTEST_MOCKING=y -CONFIG_ZTEST_NEW_API=y CONFIG_ZTEST_STACK_SIZE=4096 CONFIG_MAIN_STACK_SIZE=4096 CONFIG_ZTEST_PARAMETER_COUNT=30 diff --git a/tests/subsys/net/lib/fota_download/prj.conf b/tests/subsys/net/lib/fota_download/prj.conf index db3636fd77a0..9f004c411e2c 100644 --- a/tests/subsys/net/lib/fota_download/prj.conf +++ b/tests/subsys/net/lib/fota_download/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_FLASH=y CONFIG_FW_INFO=y CONFIG_SYS_HASH_FUNC32=y diff --git a/tests/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt b/tests/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt index 84ce813b7032..88195fffb052 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt +++ b/tests/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt @@ -12,7 +12,7 @@ FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources} - $ENV{ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_util.c + ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_util.c ) set(options @@ -55,11 +55,11 @@ target_compile_options(..__nrf__subsys__net__lib__lwm2m_client_utils ) set(includes -"$ENV{ZEPHYR_BASE}/subsys/net/lib/lwm2m/" -"$ENV{ZEPHYR_BASE}/../nrfxlib/nrf_modem/include/" -"$ENV{ZEPHYR_BASE}/../modules/lib/cjson/" -"$ENV{ZEPHYR_BASE}/../nrf/subsys/net/lib/nrf_cloud/include/" -"$ENV{ZEPHYR_BASE}/../nrf/subsys/net/lib/fota_download/include/" +"${ZEPHYR_BASE}/subsys/net/lib/lwm2m/" +"${ZEPHYR_BASE}/../nrfxlib/nrf_modem/include/" +"${ZEPHYR_BASE}/../modules/lib/cjson/" +"${ZEPHYR_BASE}/../nrf/subsys/net/lib/nrf_cloud/include/" +"${ZEPHYR_BASE}/../nrf/subsys/net/lib/fota_download/include/" "src/" ) diff --git a/tests/subsys/net/lib/lwm2m_client_utils/prj.conf b/tests/subsys/net/lib/lwm2m_client_utils/prj.conf index db9f2b39fa06..71eac1850d8d 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/prj.conf +++ b/tests/subsys/net/lib/lwm2m_client_utils/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_NEWLIB_LIBC=y CONFIG_HEAP_MEM_POOL_SIZE=16384 CONFIG_LWM2M_CLIENT_UTILS=y diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/CMakeLists.txt b/tests/subsys/net/lib/lwm2m_fota_utils/CMakeLists.txt index 4a9133b455a7..f278430c7f89 100644 --- a/tests/subsys/net/lib/lwm2m_fota_utils/CMakeLists.txt +++ b/tests/subsys/net/lib/lwm2m_fota_utils/CMakeLists.txt @@ -14,9 +14,9 @@ FILE(GLOB app_sources src/*.c ) target_sources(app PRIVATE ${app_sources} - $ENV{ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_registry.c - $ENV{ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c - $ENV{ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_util.c + ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_registry.c + ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_obj_firmware.c + ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_util.c ) @@ -39,6 +39,7 @@ set(options -DCONFIG_DFU_TARGET_MCUBOOT=y -DCONFIG_DFU_TARGET_MODEM_DELTA=y -DCONFIG_FOTA_DOWNLOAD_MCUBOOT_FLASH_BUF_SZ=512 + -DCONFIG_LWM2M_VERSION_1_0=y ) target_compile_options(app @@ -56,9 +57,9 @@ target_compile_options(..__nrf__subsys__dfu__dfu_target ) set(includes -"$ENV{ZEPHYR_BASE}/subsys/net/lib/lwm2m/" -"$ENV{ZEPHYR_BASE}/../nrfxlib/nrf_modem/include/" -"$ENV{ZEPHYR_BASE}/../nrf/subsys/net/lib/fota_download/include/" +"${ZEPHYR_BASE}/subsys/net/lib/lwm2m/" +"${ZEPHYR_BASE}/../nrfxlib/nrf_modem/include/" +"${ZEPHYR_BASE}/../nrf/subsys/net/lib/fota_download/include/" "src/" ) diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/prj.conf b/tests/subsys/net/lib/lwm2m_fota_utils/prj.conf index c110f35805ba..baeff28f23e4 100644 --- a/tests/subsys/net/lib/lwm2m_fota_utils/prj.conf +++ b/tests/subsys/net/lib/lwm2m_fota_utils/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_LWM2M_CLIENT_UTILS=y CONFIG_LWM2M_CLIENT_UTILS_FIRMWARE_UPDATE_OBJ_SUPPORT=y CONFIG_LWM2M_CLIENT_UTILS_ADV_FIRMWARE_UPDATE_OBJ_SUPPORT=y diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/prj_obj5.conf b/tests/subsys/net/lib/lwm2m_fota_utils/prj_obj5.conf index d1a756f06af2..adfd2083f63b 100644 --- a/tests/subsys/net/lib/lwm2m_fota_utils/prj_obj5.conf +++ b/tests/subsys/net/lib/lwm2m_fota_utils/prj_obj5.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2022 Nordic Semiconductor ASA +# Copyright (c) 2022-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_LWM2M_CLIENT_UTILS=y CONFIG_LWM2M_CLIENT_UTILS_FIRMWARE_UPDATE_OBJ_SUPPORT=y CONFIG_LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT=y diff --git a/tests/subsys/net/lib/mcumgr_smp_client/prj.conf b/tests/subsys/net/lib/mcumgr_smp_client/prj.conf index b9263f23170f..f34514591c17 100644 --- a/tests/subsys/net/lib/mcumgr_smp_client/prj.conf +++ b/tests/subsys/net/lib/mcumgr_smp_client/prj.conf @@ -4,7 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y CONFIG_NET_BUF=y diff --git a/tests/subsys/net/lib/nrf_cloud/cloud/prj.conf b/tests/subsys/net/lib/nrf_cloud/cloud/prj.conf index 71d6d88792e0..b04fef6cf005 100644 --- a/tests/subsys/net/lib/nrf_cloud/cloud/prj.conf +++ b/tests/subsys/net/lib/nrf_cloud/cloud/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2022 Nordic Semiconductor +# Copyright (c) 2022-2023 Nordic Semiconductor # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # ZTEST with new API CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # Network CONFIG_NETWORKING=y diff --git a/tests/subsys/net/lib/nrf_cloud/fota_common/prj.conf b/tests/subsys/net/lib/nrf_cloud/fota_common/prj.conf index 87f221717a82..d6788fc07fde 100644 --- a/tests/subsys/net/lib/nrf_cloud/fota_common/prj.conf +++ b/tests/subsys/net/lib/nrf_cloud/fota_common/prj.conf @@ -1,12 +1,11 @@ # -# Copyright (c) 2022 Nordic Semiconductor +# Copyright (c) 2022-2023 Nordic Semiconductor # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # ZTEST with new API CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_NRF_CLOUD_MQTT=y diff --git a/tests/subsys/nrf_profiler/prj.conf b/tests/subsys/nrf_profiler/prj.conf index e223b69f3b6f..abd58ef27665 100644 --- a/tests/subsys/nrf_profiler/prj.conf +++ b/tests/subsys/nrf_profiler/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y # Do not allow to randomize test order. Profiler events are expected to appear in a given order, # so that unit tests must run only once in a predefined order. CONFIG_ZTEST_SHUFFLE=n diff --git a/tests/subsys/pcd/prj.conf b/tests/subsys/pcd/prj.conf index 066f4256d9b3..0425f7aec1d1 100644 --- a/tests/subsys/pcd/prj.conf +++ b/tests/subsys/pcd/prj.conf @@ -1,10 +1,9 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_FLASH=y CONFIG_DEBUG_OPTIMIZATIONS=y CONFIG_PCD_APP=y diff --git a/tests/subsys/zigbee/osif/crypto/prj.conf b/tests/subsys/zigbee/osif/crypto/prj.conf index 63012de7e7d6..310c6c2fb922 100644 --- a/tests/subsys/zigbee/osif/crypto/prj.conf +++ b/tests/subsys/zigbee/osif/crypto/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_ENTROPY_GENERATOR=y CONFIG_CRYPTO=y CONFIG_CRYPTO_NRF_ECB=y diff --git a/tests/subsys/zigbee/osif/nvram/prj.conf b/tests/subsys/zigbee/osif/nvram/prj.conf index 03ffc1eb1f25..32db6647676b 100644 --- a/tests/subsys/zigbee/osif/nvram/prj.conf +++ b/tests/subsys/zigbee/osif/nvram/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2019 Nordic Semiconductor ASA +# Copyright (c) 2019-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y diff --git a/tests/subsys/zigbee/osif/serial/serial_async_api/prj.conf b/tests/subsys/zigbee/osif/serial/serial_async_api/prj.conf index e6a8e8fce3a8..391e72316b7e 100644 --- a/tests/subsys/zigbee/osif/serial/serial_async_api/prj.conf +++ b/tests/subsys/zigbee/osif/serial/serial_async_api/prj.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # @@ -8,4 +8,3 @@ CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_RING_BUFFER=y CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/subsys/zigbee/osif/serial/serial_basic_api/prj.conf b/tests/subsys/zigbee/osif/serial/serial_basic_api/prj.conf index e6a8e8fce3a8..391e72316b7e 100644 --- a/tests/subsys/zigbee/osif/serial/serial_basic_api/prj.conf +++ b/tests/subsys/zigbee/osif/serial/serial_basic_api/prj.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # @@ -8,4 +8,3 @@ CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_RING_BUFFER=y CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/subsys/zigbee/osif/serial/serial_via_logger/prj.conf b/tests/subsys/zigbee/osif/serial/serial_via_logger/prj.conf index 9889b02fc5a9..0b1b39b35c67 100644 --- a/tests/subsys/zigbee/osif/serial/serial_via_logger/prj.conf +++ b/tests/subsys/zigbee/osif/serial/serial_via_logger/prj.conf @@ -1,9 +1,8 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_RING_BUFFER=y diff --git a/tests/subsys/zigbee/osif/timer_counter/prj.conf b/tests/subsys/zigbee/osif/timer_counter/prj.conf index 6c053dc9ba8b..bc00fbacfc94 100644 --- a/tests/subsys/zigbee/osif/timer_counter/prj.conf +++ b/tests/subsys/zigbee/osif/timer_counter/prj.conf @@ -1,9 +1,8 @@ # -# Copyright (c) 2019 Nordic Semiconductor ASA +# Copyright (c) 2019-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_COUNTER=y diff --git a/tests/subsys/zigbee/osif/timer_ktimer/prj.conf b/tests/subsys/zigbee/osif/timer_ktimer/prj.conf index a5ee836ff71d..7f6f4b6a878c 100644 --- a/tests/subsys/zigbee/osif/timer_ktimer/prj.conf +++ b/tests/subsys/zigbee/osif/timer_ktimer/prj.conf @@ -1,8 +1,7 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/subsys/zigbee/zboss_api/alarm_api/prj.conf b/tests/subsys/zigbee/zboss_api/alarm_api/prj.conf index 7fae0c91eed3..8c6cdb9cb5a1 100644 --- a/tests/subsys/zigbee/zboss_api/alarm_api/prj.conf +++ b/tests/subsys/zigbee/zboss_api/alarm_api/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_NCS_SAMPLES_DEFAULTS=y diff --git a/tests/subsys/zigbee/zboss_api/callback_api/prj.conf b/tests/subsys/zigbee/zboss_api/callback_api/prj.conf index 7cbd6e348d6b..8eecc3e3dd1b 100644 --- a/tests/subsys/zigbee/zboss_api/callback_api/prj.conf +++ b/tests/subsys/zigbee/zboss_api/callback_api/prj.conf @@ -1,11 +1,10 @@ # -# Copyright (c) 2020 Nordic Semiconductor ASA +# Copyright (c) 2020-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y CONFIG_NCS_SAMPLES_DEFAULTS=y diff --git a/tests/tfm/secure_services/prj.conf b/tests/tfm/secure_services/prj.conf index a5ee836ff71d..7f6f4b6a878c 100644 --- a/tests/tfm/secure_services/prj.conf +++ b/tests/tfm/secure_services/prj.conf @@ -1,8 +1,7 @@ # -# Copyright (c) 2021 Nordic Semiconductor ASA +# Copyright (c) 2021-2023 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # CONFIG_ZTEST=y -CONFIG_ZTEST_NEW_API=y diff --git a/tests/unity/example_test/src/foo/foo.h b/tests/unity/example_test/src/foo/foo.h index 8ef4af4dba02..3d72dad2f6a9 100644 --- a/tests/unity/example_test/src/foo/foo.h +++ b/tests/unity/example_test/src/foo/foo.h @@ -7,7 +7,7 @@ #ifndef __FOO_H #define __FOO_H -#include +#include int foo_init(void *handle); diff --git a/west.yml b/west.yml index d4520ce83533..d651d2304339 100644 --- a/west.yml +++ b/west.yml @@ -45,7 +45,7 @@ manifest: defaults: remote: ncs - group-filter: [-nrf-802154, -dragoon, -find-my, -ant, -babblesim, -sidewalk, -bsec] + group-filter: [-nrf-802154, -dragoon, -find-my, -ant, -babblesim, -sidewalk, -bsec, +optional] # "projects" is a list of git repositories which make up the NCS # source code. @@ -61,7 +61,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: f59385bdd3af03f3d825e60089a6ec3fcf8c40a2 + revision: 883c3709f9c8fd845a8dfa39d2583d5c665a915b import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -79,6 +79,8 @@ manifest: - canopennode - chre - cmsis + - cmsis-dsp + - cmsis-nn - edtt - fatfs - hal_nordic @@ -111,7 +113,7 @@ manifest: - name: hostap repo-path: sdk-hostap path: modules/lib/hostap - revision: a6eb01d932fbfb26d9dbb84ee6e5c80b05b57ada + revision: 54964593bf724bac503217915f9b1f20c77d7d45 userdata: ncs: upstream-url: https://w1.fi/cgit/hostap/ @@ -128,7 +130,7 @@ manifest: compare-by-default: true - name: mcuboot repo-path: sdk-mcuboot - revision: adab597a0eb0eb9c030a7b797748a49ca89988c2 + revision: beebb23f8e2d744ef89819e584928377ef6c444a path: bootloader/mcuboot - name: qcbor url: https://github.com/laurencelundblade/QCBOR.git @@ -141,7 +143,7 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: d736ae146727d437e74b77691f253290ecdeea11 + revision: ba22034a7ce2fe6efaccb6dc61e3f9a5e0e149b2 - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m @@ -149,7 +151,7 @@ manifest: - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: 496275a1cd657f31a4943fdf77acbdacd957a818 + revision: 1a15f4cdb4d6c1f431a12064625df06fe45e660a submodules: - name: nlio path: third_party/nlio/repo @@ -191,13 +193,13 @@ manifest: compare-by-default: false - name: sidewalk repo-path: sdk-sidewalk - revision: 16dc7e611e03b3549d2e694c8e077c16246bf98a + revision: cc49dd2edd793bb77d5c0ea725012b1540f7fa68 submodules: true groups: - sidewalk - name: find-my repo-path: sdk-find-my - revision: 103345872da1b5b0e36d2ef7f8a1208c84612d8e + revision: de25273096aa6ab735121cb849ad10a9b46a67fd groups: - find-my - name: azure-sdk-for-c @@ -236,7 +238,7 @@ manifest: remote: throwtheswitch - name: memfault-firmware-sdk path: modules/lib/memfault-firmware-sdk - revision: 1.3.3 + revision: 1.5.1 remote: memfault - name: ant repo-path: sdk-ant