Commit graph

1613 commits

Author SHA1 Message Date
Aleksander Wasaznik c6ad4a7927 Bluetooth: samples: Switch to one-time adv
This patch removes all uses of the adv auto-resume feature in the
Bluetooth samples. The auto-resume feature is planned for deprecation.

Samples that are not intended to demonstrate a technique to do with
re-connection simply do not restart the advertiser, in interest of
simplicity. The user is expected to reboot the sample when needed.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-05-29 10:48:04 -07:00
Emil Gydesen a66672885d samples: Bluetooth: Audio: Add missing board/conf
Add missing configuration files for the nRF5340DK
and missing configuration values for the unicast
samples w.r.t. buffer sizes and encryption.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-28 09:55:30 +02:00
Johan Hedberg 641b77b740 Bluetooth: samples: hci_ipc: Fix incorrect NULL pointer check
The condition was the inverse of what it should have been, leading to an
inevitable NULL pointer dereference later.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-05-27 08:15:28 -07:00
Vinayak Kariappa Chettimada 68bd4da4c6 samples: Bluetooth: hci_vs_scan_req: Build for BT_LL_SW_SPLIT only
Build the vendor specific sample hci_vs_scan_req for
BT_LL_SW_SPLIT variant of the Controller only.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-25 11:26:26 +03:00
Yassine El Aissaoui 4a755a3157 samples: tests: bluetooth: Add support for rd_rw612_bga
Adding bt_tester support.

Adding bt_tester app build
with Twister for rd_rw612_bga board

Fix failing tests/samples due to unsufficent MPU ressources
by releasing unnecessary MPU regions.

Disable twister build on samples that are not meant to
be supported on this board, so exclude it from the test cases.

Update peripheral/central ht sample.yaml files
to test build for rd_rw612_bga.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-05-25 11:23:04 +03:00
Babak Arisian b0dceffacc Bluetooth: Audio: add bt_audio_get_chan_count
Implement a function bt_audio_get_chan_count that takes an enum
bt_audio_location and returns the number of channels in that value.

This PR fixes #69617
(https://github.com/zephyrproject-rtos/zephyr/issues/69617)

Signed-off-by: Babak Arisian <bbaa@demant.com>
2024-05-24 09:55:37 -05:00
Alexander Sarmanow 1ed18ad5b2 samples: bluetooth: df: fix misleading comment in rx overlay
The comment is talking about Tx and AoD, while this sample code is about
Rx and AoA.

Signed-off-by: Alexander Sarmanow <asarmanow@gmail.com>
2024-05-24 08:05:19 -04:00
Emil Gydesen 04e38ae176 samples: Bluetooth: Fix incorrect comments about adv sets
Several places we simply had
/* Create a non-connectable non-scannable advertising set */
regardless of the type of advertising it was.

Modified the comment to omit the scannable part
and corrected the connectable part.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-24 07:46:43 -04:00
Jens Rehhoff Thomsen 1c70e87047 Bluetooth samples: Fix broadcast source device name
The device name explicitly added in the advertising data.

Signed-off-by: Jens Rehhoff Thomsen <jthm@demant.com>
2024-05-22 13:45:11 -05:00
Vinayak Kariappa Chettimada bd3a2f5bd1 samples: Bluetooth: hci_ipc: Use LTO when building ISO features
Use Link Time Optimisation (LTO) when building Controller
with Isochronous channels support.

nRF53x SoCs has 256KB flash and using speed optimisation,
which is the default today, overflows flash when adding
new features related to ISO support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-22 13:38:14 -05:00
Emil Gydesen f58ac3476f Bluetooth: CAP: Add reference to the set member for CAP discover
Since the CSIP API expects a set member struct for nearly all
functionality, the reference to the full set member (along with
the CAS specific CSIS) should be given to the application.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-18 15:51:26 +03:00
Karthikeyan Krishnasamy 5e7d74bd23 samples: bluetooth: hci_uart: fix dtsi path in overlay
fix dtsi overlay include path for nrf9160dk_nrf52840

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-05-17 14:40:15 -05:00
Jens Rehhoff Thomsen a2ebe49259 Bluetooth samples: Keep broadcast assistant connected
When Broadcast Sink is connected to Broadcast Assistant then keep
connection when Broadcast Source is removed.

Signed-off-by: Jens Rehhoff Thomsen <jthm@demant.com>
2024-05-17 12:41:04 +02:00
Lyle Zhu 4c7b19fa5a samples: Bluetooth: HFP_AG: Initialize version
Add a new example handsfree_ag to demonstrate
usage of the handsfree audio gateway APIs.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-05-16 09:15:49 +02:00
Johan Hedberg 18c23daee3 Bluetooth: Kconfig: Merge BT_HCI_VS_EXT into BT_HCI_VS
The naming of these two options was problematic, since it's both of them
are about vendor extensions, even though one has _EXT in the name and
the other doesn't. Just merge one option into the other. This has a
slight overhead on the controller side of enabling some more vendor
features if BT_HCI_VS is enabled, but that should hopefully be
acceptable.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-05-14 18:21:11 -04:00
Johan Hedberg 28bdcbd3c5 Bluetooth: samples: hci_uart_async: Use existing H4 defines
Use existing H4 defines from hci_types.h instead of redefining them.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-05-10 14:37:57 -05:00
Vinayak Kariappa Chettimada 2c6306d099 Bluetooth: Controller: BT_CTLR_ISO_TX_BUFFER_SIZE from BT_ISO_TX_MTU
Derive BT_CTLR_ISO_TX_BUFFER_SIZE from BT_ISO_TX_MTU to have
optimal Controller memory allocations.
BT_CTLR_ISO_TX_BUFFER_SIZE can be set lower than
BT_ISO_TX_MTU in which case upper layer can send fragmented
SDU to the Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-05-10 15:02:10 +02:00
Brandon Allen 5e0a21c54c samples: Bluetooth: broadcast_audio_sink: rm nrf52820 from sample.yaml
nrf52833dk/nrf52820 does not compile so remove it from platform_allow list

Signed-off-by: Brandon Allen <bwallen1997@outlook.com>
2024-05-06 14:59:52 +01:00
Emil Gydesen 353a05b116 Bluetooth: BAP: Unicast server depend on PACS
When in the BAP unicast server role, at least PAC sink
or PAC source shall be set.

In order to fulfill this new requirement, a few other Kconfig
options had to be changed to a `depends on` from `select` to
avoid recursive Kconfig requirements. This change may require
some applications to update their configurations according
to the migration guide.

The change from `select` to `depends on` is ideal anyhow
as that is the recommended way to add dependencies.

This can checked via the combined BT_PACS Kconfig value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-30 14:30:45 -04:00
Johan Hedberg d590bcb5e0 Bluetooth: Remove BT_HCI_RESERVE and BT_HCI_RAW_RESERVE
In most cases these were defined as 1. Saving one byte for the rest
doesn't really justify the added complexity that comes with these
options. Removing them also simplifies the interface between HCI
transports/drivers and the host stack, which in turn helps pave the way
for having HCI as a proper Zephyr driver API.

Fixes #71907

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-04-29 11:01:27 +02:00
Giancarlo Stasi f3fc534f92 Samples: Bluetooth: Vendor Specific: support for HCI Scan Request
Example of usage of HCI vendor specific Set Scan Request Reports
command, Scan Request Received Event and corresponding callback
to get application events. The sample application shows usage as an
alternative to extended advertisent saving precious RAM.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
2024-04-26 16:08:08 +02:00
Théo Battrel 8f7df0b49f Bluetooth: Samples: Dev name in AD instead of SD
With the deprecation of `BT_LE_ADV_OPT_USE_NAME` and
`BT_LE_ADV_OPT_FORCE_NAME_IN_AD` samples were updated to not use the
macro adding the device name in the advertising/scan response data
anymore.

Instead the name was explicitly added to the scan response data in
`periodic_adv` sample. But because it was using an extended advertiser
and was already adding data in the AD, the name should have been put in
the advertising data and not the scan response data.

Update the sample to add the device name in the advertising data.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-26 09:30:02 +02:00
Vinayak Kariappa Chettimada 12dc399c4d tests: bsim: Bluetooth: central_hr peripheral_hr coverage
Add bsim test coverage for central_hr and peripheral_hr
samples.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-23 21:29:10 +00:00
Vinayak Kariappa Chettimada 12b39307f3 samples: Bluetooth: Support sysbuild for central_hr and peripheral_hr
Add support for using sysbuild for central_hr and
peripheral_hr samples so that hci_ipc sample is built
for nRF53x SoCs boards.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-23 21:29:10 +00:00
Vinayak Kariappa Chettimada b7012f1555 samples: Bluetooth: central_hr extended advertising support
Update central_hr sample to support using extended
advertising and hence be long range compatible on SoCs
that support Bluetooth Low Energy Coded PHY.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-23 21:29:10 +00:00
Vinayak Kariappa Chettimada bdf6230236 samples: Bluetooth: Add LED blinking to peripheral_hr
Add LED blinking state to peripheral_hr indicating
advertising state, and LED On state to indicate connected
to a central device, respectively.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-23 21:29:10 +00:00
Vinayak Kariappa Chettimada 5acb79f4e4 samples: Bluetooth: peripheral_hr extended advertising support
Update peripheral_hr sample to support using extended
advertising and hence be long range compatible on SoCs
that support Bluetooth Low Energy Coded PHY.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-23 21:29:10 +00:00
Sylvio Alves 4a4d7584ff boards: rename and update esp32 related conf and overlay files
There are several esp32-based boards that its conf and overlay
files are missing proper renaming to match cpu cluster.

This also removes all _SOC_ name from files.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-04-23 15:36:13 +02:00
Théo Battrel 7bc63985af Bluetooth: Samples: Remove uses of auto name in AD
The advertiser options to automatically add the name in the scan
response and the advertising data will be deprecated.

Update the samples that were using those options by explicitly adding
the device name in the advertising data or the scan response data.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-23 12:42:24 +02:00
Kamil Gawor b2890564e9 boards: nordic: nrf54h20dk: Add configuration for BLE
Add default configuration related to BLE protocol,
for Application and Radio core on nRF54h20 platform.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2024-04-18 08:49:51 -07:00
Rubin Gerritsen 46d3bf11c9 samples: bluetooth: Increase sync timeout to allow packet loss
The periodic advertiser samples use a periodic advertising interval
in the range of 1 to 1.2 seconds.

Previously the sync timeout of 1.7 seconds would cause the sync to be
lost after failing to receive a single periodic advertising packet.
This change therefore aims to improve the user experience.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-04-17 14:34:23 +02:00
Vinayak Kariappa Chettimada cd58325b2a samples: Bluetooth: hci_ipc comment about NRF_DEFAULT_IRQ_PRIORITY
Update comment about use of NRF_DEFAULT_IRQ_PRIORITY in
hci_ipc sample for Nordic nRF53x series.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-12 13:48:57 +02:00
Vinayak Kariappa Chettimada 7ece6aed16 Bluetooth: Controller: Fix regression in BT_RX_STACK_SIZE use
Fix regression in BT_RX_STACK_SIZE use due to
commit b91728619c ("Bluetooth: host: remove
`CONFIG_BT_RECV_BLOCKING`").

Profiling of Controller Rx thread has been mentioned in
commit 586ba9fd13 ("Bluetooth: Controller: Increase
BT_RX_STACK_SIZE for BT_HCI_RAW enabled").

Also, move the TX_STACK_SIZE value as default in Kconfig
from the explicit value being set in hci_ipc sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-12 13:48:57 +02:00
Jonathan Rico e3ff993000 Network: L2: remove IPSP
Remove IPSP support from the tree.

It has no maintainers, and is regularly broken. The fact that it's
nontrivial to set-up in linux makes it hard to fix reported issues.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-11 12:48:50 +02:00
Dominik Ermel 5a0ecb9641 flash: Move dependency on FLASH_PAGE_LAYOUT where it belongs
The commit adds dependency on Kconfig FLASH_PAGE_LAYOUT to subsystems
that really require it:
 FCB, NVS, LittleFS
and removes direct selection from '*.conf' files where no longer
needed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-10 10:01:40 +02:00
Torsten Rasmussen b9f3d68863 samples: tests: additional overlay and conf file adjustments
Adjustments of overlay and conf files to adjust for the MERGE removal.

The revert of MERGE requires specific overlay and conf files for boards
which relied on the MERGE feature.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-04-09 23:35:54 +02:00
Ping Wang f1d174e0d3 Bluetooth: Audio: broadcast assistant sync to PA
broadcast_audio_assistant application sync to PA and obtain the correct
subgroup information used by BASS.

Signed-off-by: Ping Wang <pinw@demant.com>
2024-04-08 09:17:33 -04:00
Fin Maaß a9afee1d12 samples: use appropriate sys_randX_get()
use the appropriate sys_randX_get() instead
of always sys_rand32_get().

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-04-05 10:57:45 -05:00
Emil Gydesen 4844dabf3a Samples: Bluetooth: Add encrypted broadcast audio source
Add support for supplying a broadcast code to the
broadcast audio sample, which will, if non-empty, encrypt
the broadcast.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-03 22:30:57 +01:00
Piotr Pryga 73bdf622f1 samples: bluetooth: hci_ipc: Add nrf54h20 DK board overlay
There are required DTS entries to nable peripherals required
for IPC communication between Radio and APP CPUs.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-04-03 10:27:02 +03:00
Luis Ubieda 92e0d0bbfc bluetooth: nus: Change Kconfigs prefix to BT_ZEPHYR_NUS
To prevent future conflicts with NCS's NUS implementation, whose
Kconfig's are prefixed with BT_NUS.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-04-02 10:36:01 +03:00
Ryan Chu 2759a35a18 Samples: Bluetooth: Fix PAwR sample failed to set subevent data
Be respectful of PAwR subevents while scheduling scan activities.
The radio will be swtiched from scan to PAwR when it is closed to
the next subevent interval.

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2024-03-29 15:59:09 -05:00
Alberto Escolar Piedras feecb751b2 samples/bluetooth/unicast_audio_server: Fix nrf5340bsim board name
The nrf5340bsim_nrf5340_cpuapp hwmv1 board name
was replaced with nrf5340bsim/nrf5340/cpuapp in hwmv2.
Let's fix it

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 18:38:47 -04:00
Aleksandr Khromykh c97a8131c1 Samples: Bluetooth: HCI: add missed callback pointer
USB initialization function mandates pointer to
callback. Seems this pointer was missed in hci_usb sample.
Commit fixes this.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2024-03-25 15:12:23 +01:00
Luis Ubieda d834ec875e samples: bluetooth: nus: Add Peripheral NUS sample
Demonstrating basic usage of NUS to exchange data.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-03-22 10:25:37 +01:00
Herman Berget 976da5da5c samples: hci_uart_async: Dont try to receive 0 bytes
It is not necessary and it ends up in an nrfx assert.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2024-03-22 10:24:38 +01:00
Jamie McCrae e6a873a971 samples: bluetooth: mesh: Fix usage of board name checking
Fixes using outdated hwmv1 board name checking with proper board
defines

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-22 10:06:04 +01:00
Hang Fan b25eb36cb8 Bluetooth: Samples: Add name check for periodic adv sync
Add missing name check to filter the advertising we want.

Signed-off-by: Hang Fan <fanhang8@gmail.com>
2024-03-22 09:00:09 +01:00
Alberto Escolar Piedras f3360265e6 tests|samples/bluetooth: Fix sysbuild due to BOAD_IDENTIFIER
After https://github.com/zephyrproject-rtos/zephyr/pull/70438
got merged simultaneously with
https://github.com/zephyrproject-rtos/zephyr/pull/70564
all these tests stopped building properly due to the
change of avaliable variables in Kconfig & cmake.
Let's fix them.
As a bonus, as for kconfig the BOARD_TARGET_STRING is the
same for the hwmv1 backwards compatible name, let's
just remove the check for the old names.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-21 18:44:04 +01:00
Emil Gydesen 0dcf3c197e Bluetooth: Audio: Increase PA sync timeouts
Increase the timeouts to be 60 instead of 6.
The reason for this is that some controllers (like the Zephyr
controller) will reserve some of these to ensure stability,
and in fact with skip = 5 and retry = 6, it would still
send the PA reports at every interval.

To accomodate a higher timeout value, the functions used to
convert PA intervals to PA timeouts have been updated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-21 15:24:14 +01:00