Commit graph

2414 commits

Author SHA1 Message Date
Michał Narajowski
da1663ed3b test/bluetooth/tester: Use Health Client Unack API
Unacknowledged API is now separate from Ack.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-12-16 10:15:36 +01:00
Asbjørn Sæbø
bd3f5d9b2b Bluetooth: Audio: Increase L2CAP buffer count
Increase the L2CAP buffer count, for the media control shell to work.

(The buffer count was set to an even higher value in the
topic-le-audio branch, but that setting was not upmerged.)

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-12-15 14:59:55 -05:00
Asbjørn Sæbø
fabbb87986 Bluetooth: Audio: Enable controller extended and periodic adv for tests
The le-audio host shell enables extended advertising.  Therefore, for
the shell to be usable, extended and periodic advertising must also be
enabled for the controller.

The controller configuration are added to board-specific files for the
time being, as the advertising features are still experimental
upstream.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-12-15 14:59:55 -05:00
Krzysztof Kopyściński
0f6dc7a3cd bluetooth: tester: allow to set DisplayYesNo IO capability
This allows us to run SCPK tests with it.

signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-12-15 15:08:37 +01:00
Emil Gydesen
912c5f29ed Bluetooth: Shell: Update audio.conf to use BT_FILTER_ACCEPT_LIST
Update the configuration file to use BT_FILTER_ACCEPT_LIST
instead of the deprecated BT_WHITELIST.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-12-07 09:39:59 -06:00
Lingao Meng
7464c8a923 Bluetooth: Mesh: Add build multi extened advertising test
Add new testcase to tests/bluetooth/mesh that builds mesh with
multi advertising sets.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-12-02 09:23:54 +02:00
Vinayak Kariappa Chettimada
2af787f28e tests: Bluetooth: Update to use Periodic Advertising enable ADI flags
Update Babblesim test to use Periodic Advertising enable and
ADI flags.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-26 10:26:17 -05:00
Andries Kruithof
984ebd519a Bluetooth: controller: remove obsolete defines
The define for PDU_AC_LL_SIZE_EXTRA was removed in main, but not in
the topic-branch. The merge of topic/branch erroneously reintroduced
this define, so it needs to be removed

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-25 10:46:08 -05:00
Andries Kruithof
a60f0ac7a4 tests: edtt: re-enable HCI tests
HCI tests HCI/DSU/BV-05-C and HCI/GEV/BV-01-C fail when
compiling with debug optimisations turned on.
Therefor revert to not compiling with debug optimisations.

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-25 10:44:34 -05:00
Vinayak Kariappa Chettimada
2fe6127425 tests: Bluetooth: bsim: Add missing BT_ISO_RX_MTU value
Add missing BT_ISO_RX_MTU config as needed by the test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-25 10:43:51 -05:00
Vinayak Kariappa Chettimada
9b90b3d6be tests: Bluetooth: bsim: Improve incoming data information message
Add flags, sequence number and timestamp to incoming data
message print in the test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-25 10:43:51 -05:00
Jordan Yates
8e99db5801 Kconfig: net: deprecate NET_BUF_USER_DATA_LEN
As user data sizes are now set on a per pool basis, this Kconfig option
has no purpose.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates
df327eeb58 net: buf: POOL_FIXED_DEFINE explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Johan Lundin
403fbfcc12 Bluetooth: Adds preprocessor to L2CAP tester app
Adds preprocessor ifdefs to reconfigure() in L2CAP tester application
depending on the KConfig option CONFIG_BT_L2CAP_ECRED
Fixes issue #40456

Signed-off-by: Johan Lundin <johan.lundin@nordicsemi.no>
2021-11-22 23:10:47 -05:00
Andries Kruithof
9a9ccfec15 tests: edtt run gap and gatt tests with new LLCP
For consistency we run the gatt and gap tests also with the new
LLCP. The test lists for legacy and new LLCP are identical
and therefor no separate test lists have been introduced

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-20 11:59:04 -05:00
Andries Kruithof
9191dd77da tests: controller: give mock-file same name as in BT controller
Rename the mockup file from ull_periph.c into ull_peripheral.c
so that it has the same name as its equivalent in the BT
controller

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-20 08:01:14 -05:00
Szymon Janc
d268c99266 test/bluetooth/tester: Re-pair on lost bond
If IUT is acting as a central device and peer lost bond we need
to re-pair to restore bond. PTS is not sending any WID for this
so bonding needs to be initiated implicitly by IUT.

This was affecting GAP/SEC/AUT/BV-25-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-19 20:11:34 +01:00
Andries Kruithof
9ee28afe9f tests: controller: remove outdated comment
The comment 'kconfig cheats' is outdated and misleading
and thus it must be removed

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-18 19:03:43 -05:00
Vinayak Kariappa Chettimada
640e20204c tests: Bluetooth: bsim: Use host BIG Sync APIs
Use the host BIG Sync APIs to test the BIG Sync establish
and Sync Terminate implementation in the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
000833e427 tests: Bluetooth: bsim: Updates related to BIG Create Sync
Updates related to BIG Create Sync testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
d5489837cf tests: bluetooth: bsim: Receive the BIG Info callback
Added implementation to receive the BIG Info callback.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
91be9f1001 tests: Bluetooth: bsim: Fix test_iso to sync periodic advertising
Fix the bsim test_iso application so as to sync with periodic
adveritising. Increase the timeout so that the test passes.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
71e15176e1 Bluetooth: controller: BIGInfo in ACAD with mandatory parameters
Construction of BIGInfo with mandatory parameters and
placing it in the ACAD of Periodic Advertising PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
136bb35111 tests: Bluetooth: bsim: Check ISO allocation release on terminate
Added tests to check Broadcast ISO allocations are released
on terminate, and new Broadcast ISO create is successful.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Johann Fischer
c77903996b tests: remove usage of CONFIG_USB_UART_CONSOLE
Remove option CONFIG_USB_UART_CONSOLE where it has no influence
or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking
a detour through CONFIG_USB_UART_CONSOLE.

Check the compatibility of chosen property instead
of usage of CONFIG_USB_UART_CONSOLE option.
Align how to wait for the readiness of CDC ACM UART.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-18 14:29:18 +01:00
Andries Kruithof
f023b5f611 Bluetooth: controller: push topic branch to main
Pushes all work done in the topic-ble-llcp branch into main branch
This is a refactoring of the LL control procedures; the refactored
control procedures are hidden behind a KConfig option and
per default disabled

Goal of the refactoring:

close issue Link Layer Control Procedure overhaul #15256
make it easier to add/update control procedures
Refactoring consists in principal of writing explicit state machines
for the control procedures.
To reduce the risk of regression errors unit-tests have been added

Following control procedures are implemented:

Connection update procedure
Channel map update procedure
Encryption procedure
Feature exchange procedure
Version exchange procedure
ACL termination procedure
Connection parameters request procedure
LE Ping procedure
Data Length Update procedure
PHY update procedure
Min. nr. Of channels used procedure
Constant Tone extension request procedure

This is a joined work by the people listed in the signed-off-by
list (in alphabetical order)

Signed-off-by: Andries Kruithof Andries.Kruithof@nordicsemi.no
Signed-off-by: Erik Brockhoff erbr@oticon.com
Signed-off-by: Piotr Pryga piotr.pryga@nordicsemi.no
Signed-off-by: Szymon Janc szymon.janc@codecoup.pl
Signed-off-by: Thomas Ebert Hansen thoh@oticon.com
Signed-off-by: Tommie Skriver tosk@demant.com

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-16 21:24:37 -05:00
Emil Gydesen
7b73472139 Bluetooth: shell: Enable ISO for the BT shell
Enable ISO (unicast and broadcast) for the BT shell.
This allows users to use the ISO features (if supported by
the controller) in the shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-13 08:00:16 -05:00
Herman Berget
49c2c37417 tests: bluetooth: tester: Reading multiple variable length
Adds support for reading multiple variable length characteristics.
Previously read_multiple() always set the variable flag to false.

This is used by GATT/CL/GAT/BV-03-C.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2021-11-13 07:54:27 -05:00
Vinayak Kariappa Chettimada
6820141a3b tests: Bluetooth: bsim: Check duplicate Periodic Adv Sync create
Add test to check duplicate Periodic Advertiser Sync Create
is not permitted.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-12 14:08:19 +01:00
Martí Bolívar
7ff74e0ab9 Bluetooth: controller: support FEMs via devicetree
A FEM in this case is an external Front-End Module. This is basically
a range booster with some extra amplification in the TX and RX paths.

This feature is supported for the Nordic open source controller. See
the changes to the ubx_bmd345eval_nrf52840 board for a quick summary
of what you have to do to take advantage of this.

(This patch doesn't actually remove the feature in the openisa HAL,
though, because that never implemented the required GPIO handling
routines.)

We are using the 'fem' property previously added to the
nordic,nrf-radio's devicetree binding, which points to the FEM that is
in use. If you have this property and the node it points to is
enabled, the controller subsystem respects it. Otherwise, FEM support
is disabled.

This obsoletes the following Kconfig options, which are now unused:

- CONFIG_BT_CTLR_GPIO_PA
- CONFIG_BT_CTLR_GPIO_PA_PIN
- CONFIG_BT_CTLR_GPIO_PA_POL_INV
- CONFIG_BT_CTLR_GPIO_PA_OFFSET

- CONFIG_BT_CTLR_GPIO_LNA
- CONFIG_BT_CTLR_GPIO_LNA_PIN
- CONFIG_BT_CTLR_GPIO_LNA_POL_INV
- CONFIG_BT_CTLR_GPIO_LNA_OFFSET

- CONFIG_BT_CTLR_FEM_NRF21540
- CONFIG_BT_CTLR_GPIO_PDN_PIN
- CONFIG_BT_CTLR_GPIO_PDN_POL_INV
- CONFIG_BT_CTLR_GPIO_CSN_PIN
- CONFIG_BT_CTLR_GPIO_CSN_POL_INV
- CONFIG_BT_CTLR_GPIO_PDN_CSN_OFFSET

The PA and LNA pins are now specified via fem-specific devicetree
properties in the FEM node:

- The "generic" PA/LNA case is handled with the ctx-gpios and
  crx-gpios properties of the generic-fem-two-ctrl-pins compatible,
  respectively.

- If the fem is an nRF21540, use the tx-en-gpios and rx-en-gpios
  properties instead (and also respectively). This allows us to specify
  FEM properties in a way that makes sense for the hardware datasheet,
  while still handling them in a uniform way within the controller.

We support this in the nRF5 HAL with a new radio_nrf5_fem.h
sub-header, which pulls in radio_nrf5_fem_generic.h or
radio_nrf5_fem_nrf21540.h depending on the fem node's compatible, if
one is defined. These in turn let us replace the implementation
routines in radio.c with DT equivalents.

Keep in-tree users and devicetree binding documentation up to date.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-11-11 21:52:24 +01:00
Piotr Pryga
f758daa14b Bluetooth: controller: add missing ADI support in per adv chains
Recently there was added ADI support to periodic advertising.
There was missing implementation of ADI for periodic advertising
chained PDUs and direction finding. Also unit tests for periodic
advertising chains required update to handle ADI field.

The commit provides missing implementation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-11 18:36:54 +01:00
Asbjørn Sæbø
3a7f6e843c Bluetooth: Audio: Media control BabbleSim tests
This commit add the BabbleSim tests for the media control client, the
media control service and the media proxy.  This is a part of the
upmerge of the le-audio media control files.

These tests have been developed and maintained along with the media
control functionality.  The tests are believed to cover all
implemented media control functionality.

The commit is a pure copy of the files and content in the
topic-le-audio branch, with the exception that some include paths have
been modified to correspond to new locations of files and that the
tests have been guarded with ifdefs.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>

test guards
2021-11-11 15:31:37 +01:00
Asbjørn Sæbø
3fb8761c4f Bluetooth: Audio: Add build tests for media control
Add entries for media control builds to testcase list.  This is a part
of the upmerge of media control from the topic-le-audio branch.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-11-11 15:31:37 +01:00
Asbjørn Sæbø
251d939015 Bluetooth: Audio: Media control project settings
Upmerge of the project settings for media control from the
topic-le-audio branch.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>

audio.conf changes
2021-11-11 15:31:37 +01:00
Szymon Janc
d80e480f20 tests: bluetooth: tester: Add support for advertising with target RPA
This allows to do directed advertising with peer address set to RPA.
To do this according to specification IUT must first read Central
Address Resolution characteristic to check if peer supports it.

This is affecting GAP/CONN/DCON/BV-05-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-09 19:54:30 -05:00
Szymon Janc
03487ec592 tests: bluetooth: tester: Adjust Directed Advertising to latest BTP
This makes implementation in sync with autopts.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-09 19:54:30 -05:00
Johan Hedberg
32d08a43ce tests: hci_prop_evt: Fix net_buf reference handling
Update net_buf_ref usage so it's clear where the new reference goes to.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2021-11-09 22:21:23 +02:00
Emil Gydesen
e748e76988 Bluetooth: Audio: Move csis.h to include/bluetooth/audio
Move the header file csis.h from the internal location to
the public include directory. This file is supposed to provide
the public API for CSIS and the CSIS client, but is not fully
complete yet.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Emil Gydesen
fa1a7a723e Bluetooth: Audio: Add CSIS BSIM tests
Add a couple of babblesim tests for the CSIS server
and client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Emil Gydesen
c7b49cf1e4 Bluetooth: Audio: Add coordinated sets identification service client
Adds the coordinated set identification service (CSIS) client.

    This is still a work in progress and thus there are no public
    API for it yet, and some code changes will still be needed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Emil Gydesen
d55aeb4a1e Bluetooth: Audio: Add coordinated sets identification service server
Adds the coordinated set identification service (CSIS) server.

This is still a work in progress and thus there are no public
API for it yet, and some code changes will still be needed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-09 11:17:20 +01:00
Ingar Kulbrandstad
59d5ef1e24 Bluetooth: Mesh: Moved composition data out of mesh shell
The mesh shell module owns the composition data for the shell
application, which makes it impossible to use it outside of the
application itself. To support the shell as a generic debugging
component that can be added to any application, we have moved the
composition data out of shell.c, and into the application.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2021-11-08 11:07:11 -05:00
Szymon Janc
5f16b9ce83 tests: bluetooth: tester: Fix not marking chan as unused on disconnect
This fix not being able to re-connect channel after disconnect.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-08 11:06:51 -05:00
Pavel Hübner
104714394f kernel: Introduce K_MEM_SLAB_DEFINE_STATIC
As the already existing macro K_MEM_SLAB_DEFINE results in
two variable definitions, the preceding static modifier leads to
a seemingly working solution, though linkage conflicts will occur
when the same memory slab name is used across multiple modules.

The new K_MEM_SLAB_DEFINE_STATIC macro duplicates the functionality of
K_MEM_SLAB_DEFINE with the difference that the static keywords are
internally prepended before both variable definitions.

The implementation has been tested on my Zephyr project (the build
issue faded out). The documentation has been updated altogether
with all incorrect occurences of static K_MEM_SLAB_DEFINE.

Signed-off-by: Pavel Hübner <pavel.hubner@hardwario.com>
2021-11-07 05:36:48 -05:00
Vinayak Kariappa Chettimada
4a75738189 tests: Bluetooth: bsim: Verify Periodic Advertiser duplicate filter
Verify Periodic Advertiser ADI support and duplicate filter.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-04 13:32:00 +01:00
Vinayak Kariappa Chettimada
c5eab2011f Bluetooth: Controller: Extended Advertising back-to-back chaining
Add LLL implementation to chain Extended Advertising PDUs
back-to-back.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:36:49 -04:00
Vinayak Kariappa Chettimada
5f5a50aa14 tests: Bluetooth: bsim: Add iterations to multiple conn to peripherals
Add iterations of connections and disconnections to
Babblesim test of Bluetooth Low Energy Central role
functionality by scanning for other devices and establishing
connection to upto 62 peripherals with a strong enough
signal.

Enable Auto PHY Update and Auto Data Length Update procedure
in the central_multilink sample.

Enable Auto PHY Update and Auto Data Length Update procedure
in the peripheral_identity sample. Fixed issues related to
rotation of identities after maximum number of connection
iterations are repeated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:59:00 +01:00
Vinayak Kariappa Chettimada
de445e2a89 tests: Bluetooth: bsim: Add mixed legacy and extended advertising
Add mixed Legacy Directed Advertising and Extended Advertising
test in the babblesim coverage for Extended Advertising
feature.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:59:00 +01:00
Vinayak Kariappa Chettimada
ffd34dae01 tests: Bluetooth: bsim: Missing Ext Adv Parameter initialization
Initialize the Extended Advertising Enable Parameter in the
test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:59:00 +01:00
Szymon Janc
7e0502ebe3 tests: bluetooth: tester: Add support for pairing failed event
This event is sent if pairing failed.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-01 21:48:52 -04:00