Commit graph

2110 commits

Author SHA1 Message Date
Nirosharn Amarasinghe
05940a8f66 tests: bluetooth: controller: restructured and update ISO-AL unit tests
-- Included TX tests
-- Re-factored to use FFF

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-11-10 09:29:42 +01:00
Théo Battrel
e9c542ab5b Bluetooth: Add the cryptographic toolbox function h8
Add to the cryptographic toolbox the h8 function, defined in the Bluetooth
Core Vol. 6, part E 1.1.1.

Also add test and SMP self test for this function. The data used for those
are from the Bluetooth Core.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-10 09:28:28 +01:00
Théo Battrel
f16738b62b Bluetooth: Move crypto toolbox functions from smp.c to their own files
Move functions defined in the Cryptographic toolbox of the Bluetooth
specification inside their own files in the following folder:
`zephyr/subsys/bluetooth/bt_crypto`. The functions were previously
implemented in `zephyr/subsys/bluetooth/host/smp.c`.

The cryptographic toolbox functions can now be accessed from outside of the
host.

In addition to that, tests for each cryptographic toolbox functions have
been added.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-10 09:28:28 +01:00
Erik Brockhoff
c180afec11 Bluetooth: controller: Adding user ext. anchor point move to ctrl/CPR
Adding support for allowing user extension code to support deferring
anchor point moves. Refactored LLCP only.
Note: This is NOT supported by LEGACY LLCP impl.
KConfig'd by BT_CTLR_USER_CPR_ANCHOR_POINT_MOVE
Modified ll_conn_update API, to accommodate passing offsets
Modified CPR/CU context data structure
Modified CPR/CU procedure to handle anchor point move wait state
Fixed up unit tests, adding anchor point move cases to CPR/CU test

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-09 10:43:17 +01:00
Erik Brockhoff
2a236e52db Bluetooth: controller: rename pdu_data_llctr struct SCA member
Rename struct member to adhere to general naming pattern

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-09 09:34:35 +00:00
Sean Madigan
34cd4e520d Tests: Bluetooth: Add bt_disable babblesim test with gatt
Add babblesim test for bt_disable which enables bt, starts a connection,
GATT discovers, reads, writes then disables BT in a loop.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Sean Madigan
c3711ebc43 Tests: Bluetooth: Add bt_disable babblesim test
Add babblesim test for bt_disable which just enables and disables BT in
a loop.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-09 09:03:50 +00:00
Alberto Escolar Piedras
cd3c3cf6eb Bluetooth: Audio: CAP test: Fix sim_id
The cap test was reusing another test sim_id which
causes trouble at random when tests are parallelized.
Fix it by giving it its own id.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2022-11-08 14:37:30 +01:00
Emil Gydesen
20aa2f0f22 tests: Bluetooth: Audio shell tests for ASE SNK/SRC = 0
Add build tests for setting the counter of sink or
source ASEs to 0.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-08 10:48:54 +01:00
Pavel Vasilyev
8fdec22fc0 test: bluetooth: mesh_shell: Remove setting BT_MAX_CONN
Only 1 connection is needed with default setting of mesh_shell.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-11-08 10:47:24 +01:00
Erik Brockhoff
76439d0ba4 Bluetooth: controller: integrating SCA procedure and adding HCI API
Adding controller support for updating SCA in ACL and ISO peripherals
Adding HCI API support for le_request_peer_sca and complete event.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-08 10:44:54 +01:00
Erik Brockhoff
b3b4b9e322 Bluetooth: controller: implementing SCA update procedure PDU flow
Adding PDU flow and unittest for Sleep clock accuracy procedure

Signed-off-by: Erik Brockhoff <erbr@oticon.com>

wip kconf
2022-11-08 10:44:54 +01:00
Erik Brockhoff
6b324122e7 Bluetooth: controller: fix CIS REQ event generation and rejection
Check LE event mask state as well as host controlled feature mask state
and reject CIS request accordingly.
Release pre-allocated ISO resources on rejection of request

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-11-08 09:38:21 +00:00
Pavel Vasilyev
e42d9d80ac tests: bluetooth: mesh_shell: Disable BT_EXT_ADV for qemu_cortex_m3
mesh_shell sample doesn't fit into flash with the extended advertising.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-11-05 19:55:39 +01:00
Théo Battrel
effb76c61e Bluetooth: Move re-implementation of snprintk
Move the function in the `subsys/testsuite/ztest/src/ztest_mock.c` files.

This is motivated by the fact that there is others re-implementation of
`*printk` functions using libc counterparts in the `ztest_mock.c` file.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-02 13:28:57 +01:00
Théo Battrel
a57dbb15db Bluetooth: Consolidate duplicated code
The file `tests/bluetooth/host/keys/bt_keys_get_addr/src/main.c` was using
functions from `tests/bluetooth/host/host_mocks/print_utils.c` which were
exactly the same as the one in `common/log.h`.

The code was duplicated because the test author wanted to include
`common/log.h` to get the stringifying functions, but could not due to
unwanted side-effects.

See the comment from the unit test author here:
https://github.com/zephyrproject-rtos/zephyr/pull/48676#discussion_r973672151

The new `common/bt_str.h` does not have side-effects, so it is
suitable for unit tests.

The `snprintk` function has been redefined inside the `main.c` to use the
libc because of the kernel being not compiled entirely.

Also, the `CONFIG_LOG`, `CONFIG_BT_DEBUG_LOG` and
`CONFIG_TEST_LOGGING_DEFAULTS` have been disabled in the Kconfig files
of each `keys` tests. That so logs are not compiled and so, there is
no need to link the `printk` functions that are used by the logs.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-11-02 13:28:57 +01:00
Ingar Kulbrandstad
7367980bea Bluetooth: Mesh: Extended advertiser as default
Setting the extended advertiser as default advertiser
to improve both preformence and reliability.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2022-11-01 08:52:56 +00:00
Yuval Peress
f460c21578 test: update how unit tests set sources
Replaces cases of setting SOURCES before calling find_package with
proper target_sources.

Signed-off-by: Yuval Peress <peress@google.com>
2022-10-31 17:01:59 +01:00
Emil Gydesen
2fd9c82658 Bluetooth: Audio: Increase some values for the audio shell
Increase some value for the shell to be more useful when
working with some audio devices.

Also adds debugging for more services and profiles.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-31 16:43:41 +09:00
Mariusz Skamra
3ea297960d Bluetooth: audio: Remove capablilities leftovers
Remove dead code that remained after
https://github.com/zephyrproject-rtos/zephyr/pull/51425 was merged.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-31 16:39:05 +09:00
Keith Packard
268087646d tests/bluetooth: Use memcpy to put data into net_buf
net_buf does not hold strings, it holds counted bytes. Use memcpy to place
data into the buffer during testing rather than strncpy as the latter
generates warnings because the destination will not be nul-terminated.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-10-29 11:32:06 +03:00
Emil Gydesen
460ac477c1 tests: Bluetooth: Update broadcast_iso test to support PA sync term cb
The callback is now called whenever the PA sync is terminated,
even if it was locally terminated. The test case has been
updated to handle that.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-28 07:56:41 +00:00
Aleksander Wasaznik
339ac358cd Bluetooth: Host: BS tests: bsim_test_bond_overwrite_allowed/denied
These tests prove the existence of a bug in the local identity feature.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-10-27 13:16:59 +02:00
Jonathan Rico
d870df0054 Bluetooth: tests: use a single definition of the fff global
Linking fails on ubuntu 22.04 because of multiple definitions of the `fff`
global, which is defined by `DEFINE_FFF_GLOBALS`.

Only define it in the tests' `main.c` instead of the mocks.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-10-26 13:29:19 +02:00
Mariusz Skamra
2627063ab2 Bluetooth: audio: pacs: Replace capabilities API with pacs
This changes the API to use proper naming convention, as the code has
been moved out of capabilities.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-26 08:49:00 +02:00
Emil Gydesen
7a1e827a8b Bluetooth: Audio: Make CAP acceptor more explicit
Remove the generic CONFIG_BT_CAP and CONFIG_BT_DEBUG_CAP
and only use Kconfigs specific to the individual roles.

This also includes renaming cap.c to cap_acceptor.c.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-24 10:39:11 +02:00
Emil Gydesen
ce05cb5c2c Bluetooth: Audio: CAP initiator discover CSIS
The CAP initiator will now discover, or return a
known, CSIS instance included by CAS (if any).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-24 10:39:11 +02:00
Emil Gydesen
2e42105df0 Bluetooth: Audio: CSIS: Refactor CSIS client discover API
The API will now take a simple bt_conn instead of a
set member struct. This is due to the set member struct
being moved to the stack. The reasoning for this is that
having the struct in the stack, rather than in the
application, the stack itself can initiate the CSIS
discovery which is useful if the remote device
has a service that includes a CSIS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-24 10:39:11 +02:00
Emil Gydesen
7a49de12af Bluetooth: Audio: Implement CAP initiator discover
This is the primary discovery of the CAS on the remote device,
but does not include discovering the (optional) CSIS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-24 10:39:11 +02:00
Emil Gydesen
760177b1be Bluetooth: Audio: Add CAP initiator skeleton
Add skeleton for the expected APIs and
implementation. May be subject to change as
implementation progresses.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-24 10:39:11 +02:00
Emil Gydesen
31bf99cbd2 Bluetooth: ISO: Change ISO seq_num to 16-bit
The sequence number is by the core spec defined as 16-bit.
We had implemented a workaround for the wrapping of the
sequence number, which required the type to be larger
than 16-bit (32-bit).

However, since the definition of the sequence number,
and the use of, is poorly defined by the core spec, we
are reverting this workaround and reducing the sequence
number to 16-bit again. This way it is more in line
with the core spec, as well as more intuitive given the
other uses for the sequence number.

This change moves the responsibility of using the
right value to the upper layers, as the stack can
and will no longer provide any guarantees.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-24 10:38:49 +02:00
Aleksander Wasaznik
e2e326dded Bluetooth: Add unit tests for bt_addr_le_eq
Add some basic unit tests for bt_addr_le_eq.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-10-19 15:40:18 +03:00
Aleksander Wasaznik
17fc4b811c Bluetooth: Replace 'bt_addr_le_cmp(x) != 0' with 'bt_addr_le_eq(x)'
These should be equivalent. The '_eq'-form is more readable.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-10-19 15:40:18 +03:00
Aleksander Wasaznik
ea558187b5 Bluetooth: Replace bt_addr_le_cmp in bool context with !bt_addr_le_eq
These should be equivalent. The new form is more readable.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-10-19 15:40:18 +03:00
Aleksander Wasaznik
21e5dcb42a Bluetooth: Replace 'bt_addr_le_cmp(x) == 0' with 'bt_addr_le_eq(x)'
These should be equivalent. The '_eq'-form is more readable.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-10-19 15:40:18 +03:00
Aleksander Wasaznik
9db3fa82d1 Bluetooth: Replace all '!bt_addr_le_cmp' with 'bt_addr_le_eq'
There should be functional equivalence between these two forms. And the
'_eq'-form is more readable.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-10-19 15:40:18 +03:00
Ahmed Moheb
d354179a68 include: Add missed 'zephyr' prefix while including header files
Add missed 'zephyr' prefix to files paths while including.
Also, remove that paths from libraries include paths to generate
compilation error if shortened path is used.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-18 14:12:45 +02:00
Sean Madigan
5b1dd71f3e Bluetooth: kconfig: Add config options for PAST
Add config options specific for periodic advertising sync transfer.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-10-17 10:14:10 +02:00
Ahmed Moheb
7ef05751a3 tests: bluetooth: host: Fix CI failures with bt_keys_get_addr() UT
CI tests were failing due to a recent change to zassume_true()
implementation.
While the test case is still skipped when assumption fails, but it is
now causing the final execution result to fail.

zassume_true() was replaced by ztest_test_skip() combined with
a conditional 'if' statement to get the required effect.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-14 12:40:46 +02:00
Emil Gydesen
7ab1cafbc2 Bluetooth: Audio: Add Broadcast source application AD
This refactors how the BAP broadcast source handles the
extended and periodic advertising.

First it removes the start and stop of the extended
advertising, and instead expects the application
(or upper layers) to do this.

Second it exposes API functions to get the
necessary advertising data from BAP (service data and
the BASE), which the upper layers will then also
be responsible for setting and updating.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-14 09:51:39 +02:00
Krzysztof Kopyściński
aa0c52f212 tests: bluetooth: tester: Improve stability of MESH/NODE/TNPT/BV-05-C
IUT is requested to send 2 multi-segmented model messages. In mean time,
third may be sent from Config Model Publication Status may be sent,
which is also segmented. One of the 3 messages will fail to be sent,
but test is passing if it is Status one. Let's increase number of
possible concurrent transmissions to allow all three messages to be
sent.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2022-10-13 09:56:38 +02:00
Ahmed Moheb
385527bdd6 tests: bluetooth: Remove deprecated definitions
Remove ZTest deprecated definitions that aren't used anymore.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-11 11:29:42 +02:00
Ahmed Moheb
b8d5aaccd2 tests: bluetooth: Use ZTest new APIs with bt_buf_get_cmd_complete() UT
Migrate bt_buf_get_cmd_complete() UT to use the new APIs of ZTest
framework.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-11 11:29:42 +02:00
Ahmed Moheb
c7c0e2d654 tests: bluetooth: Use ZTest new APIs with bt_buf_get_evt() UT
Migrate bt_buf_get_evt() UT to use the new APIs of ZTest framework.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-11 11:29:42 +02:00
Ahmed Moheb
8c9235c2b0 tests: bluetooth: Use ZTest new APIs with bt_buf_get_rx() UT
Migrate bt_buf_get_rx() UT to use the new APIs of ZTest framework.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-11 11:29:42 +02:00
Ahmed Moheb
ea67890fdc tests: bluetooth: Use ZTest new APIs with bt_buf_get_type() UT
Migrate bt_buf_get_type() UT to use the new APIs of ZTest framework.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-11 11:29:42 +02:00
Ahmed Moheb
2254fab332 tests: bluetooth: host: Add UT for bt_foreach_bond()
Unit test project for bt_foreach_bond().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-11 11:29:29 +02:00
Ahmed Moheb
0d5a49e815 tests: bluetooth: host: Add UT for bt_keys_foreach_type()
Unit test project for bt_keys_foreach_type().
This part of subsys/bluetooth/host/keys.c unit testing.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-10-11 11:14:10 +02:00
Ingar Kulbrandstad
8e6d5561f6 tests: Bluetooth: Mesh: adv test buffer management
The advertiser runs in a loop, pulling advertising buffers from a queue.
Features covered:
Queue overflow
Sending order
Buffer freeing
Dedicated buffer pools

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2022-10-11 11:11:57 +02:00
Troels Nilsson
6137e8bc60 tests: Bluetooth: bsim: Ext. adv. duration handling change fixes
Update bsim test to account for timing difference introduced
by Extended Advertising duration fixes.

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-10-10 13:55:37 +02:00
Emil Gydesen
02d6661d71 Bluetooth: Shell: Add support for sending sine tone with the audio shell
added `audio start_sine` and `audio stop_sine` to start/stop
sending an LC3 encoded sine tone.

This code is heavily inspired from the sine tone implementation
from the unicast_client sample implementation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-07 13:22:53 +02:00
Mariusz Skamra
28ce0a96b1 Bluetooth: audio: capabilities: Remove redundant direction parameter
The direction is used to identify the list to append the registered
capabilities. There is no need to keep it in the bt_audio_capabilities,
it can be provided as a function parameter instead.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-06 22:41:27 +00:00
Gerard Marull-Paretas
97ef197d05 include: add missing zephyr/ prefix
Some files still manage to get into the tree without the zephyr/ include
prefix (likely because they lack CI coverage).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-06 10:41:02 +02:00
Emil Gydesen
9e256681a4 Bluetooth: Audio: Fix syncing to multiple BIS for broadcast sink shell
Fixed an issue with syncing to multiple BIS as the broadcast
sink in the shell. Also changed a check in the broadcast
sink implementation from an assert to a `if` to provide
a better way of handling bad input.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-05 12:42:09 +02:00
Anders Storrø
bea54c5691 Bluetooth: Mesh: Shell: Make prov features dynamic
Alters several provisioning related features to allow commands to be
functional with application defined Provisioning properties &
capabilities.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2022-10-04 10:33:30 +02:00
Nirosharn Amarasinghe
c56f546670 tests: Bluetooth: controller: Disabled ISO-AL Unit Tests
Tests will be restructured in a future commit. Temporarily disabled to
partition the changes to allow tests to be a separate PR.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-10-03 13:22:13 +02:00
Nirosharn Amarasinghe
896049bae2 tests: bluetooth: controller: updated BSIM ISO ISO-AL emit callback I/F
Updated callback function parameters to match new interface parameters.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-10-03 13:22:13 +02:00
Mariusz Skamra
9ecbee2587 Bluetooth: audio: capabilities: Remove callbacks
This removes the callbacks from capabilities. The callbacks are used for
unicast server role only, while the capabilities are used for the
broadcast sink role as well. Thus the callbacks can be removed as there
is another bt_audio_unicast_server_cb API that is specific for unicast
server role.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-03 10:17:21 +02:00
Mariusz Skamra
124d66e885 Bluetooth: audio: tbs_client: Make GTBS client only build option
Refactor Kconfig to add a way to enable GTBS only client.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-03 10:15:03 +02:00
Troels Nilsson
a96dfe9ce9 tests: bluetooth: BSIM tests compile function enhancement
Allow ZEPHYR_MODULES to be specified to support non-west builds

Return the error code when/if a build fails instead of always 0

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-10-03 10:13:51 +02:00
Aleksandr Khromykh
be18ed7a98 tests: Bluetooth: Mesh: optimize mesh bsim compilation
Remove not used test suites from compilations for low latency
configuration.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-10-03 10:12:34 +02:00
Aleksandr Khromykh
bab80595df tests: Bluetooth: Mesh: add proxy mix mesh bsim test
The commit adds proxy mix advertiser test that checks
mix of transmission between pb gatt, proxy and adv bearers.
The exact test scenario is described in proxy_mixin.sh file.

Additionally, the separate test configuration has been added.
All bsim mesh tests have been implemented not considering that
GATT frames are possible if PB-GATT or GATT Proxy are enabled.
The solution to avoid this misimplementation is to create
the separate configuration for tests with enabled
PB-GATT and GATT Proxy features. The commit adds this as well.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
2022-10-03 10:12:34 +02:00
Anders Storrø
901767a47a Bluetooth: Mesh: Shell: Add cfg opt for health srv
Adds Kconfig option for the Mesh Shell Health server.

The shell implementation of Health Server test commands is
dependent on the user adding and initializing the shell Health
Server instance in their application to make the commands functional.
To prevent any confussion about how these commands work, a Kconfig
option has been added to allow conditional compilation of these
commands. In this way the user must actively enable this feature, making
the conditional requirements more clear.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2022-10-03 10:12:25 +02:00
Szymon Janc
f09220d050 test: Bluetooth: EDTT: Disable invalid tests
Some tests assume that if IUT accepted HCI_LE_Set_Data_Length command
than HCI_LE_Data_Length_Change event will always be sent. This is not
the case anymore as HCI_LE_Data_Length_Change is sent only if effective
parameters changed.

Those tests should be re-enabled when EDDT implementation is updated.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-10-03 10:08:34 +02:00
Szymon Janc
6673cb1f60 Bluetooth: Controller: Fix DLE HCI params parsing
LE Write Suggested Default Data Length and LE Set Data Length commands
are suggestions from host and should be validated only as per HCI
specification regarding internal setting of LLCP.

LLCP is allowed to use other values if needed.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-10-03 10:08:34 +02:00
Ahmed Moheb
a341792ca0 tests: bluetooth: host: Remove unused definitions and inclusions
Clean up sources by removing unused definitions and inclusions.

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-29 10:17:38 +00:00
Jonathan Rico
5f8e657a22 Bluetooth: att: limit EATT MTU to max buffer size
If a device sends an MTU that is bigger than our maximum tx buffer size,
that could cause assertion failures down the line.

This PR limits it to the maximum we support (CONFIG_BT_L2CAP_TX_MTU).

The issue has been observed with a gatt discovery procedure, but is likely
present in other places in att.c.

To reproduce it, we need two zephyr shell devices, with one having a larger
MTU than the other:
- connect
- do data length update to the bigger MTU
- set security to 2, EATT channels get connected
- launch a gatt discovery from the device with the larger MTU
- observe kernel panic on the other device when it attempts to add too much
memory to a net buf.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-09-29 10:16:57 +00:00
Herman Berget
a5ce3da6ab Bluetooth: Tests: Fix uninitialized value in eatt_notif test
The chan_opt field was not set, and on some platforms it ended up with
an invalid value. Explicitly set the field on all GATT parameter structs
and make the discovery params static.

Fixes #50520

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-09-28 13:12:08 +02:00
Erik Brockhoff
183370277b Bluetooth: controller: fixing slot reservation for connection setup
With introduction of refactored LLCP was also introduced an error
re. calculation of initial slot reservation in connection setups.

Due to this error a bigger slot was reserved, leading to failure due to
connection overlaps in multiple.sh test.
Also the removal of this 'overhead' in slot reservations calls for
bigger time-allowance for l2pcap_stress test.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-09-27 10:02:07 +00:00
Emil Gydesen
874c45241e Bluetooth: Audio: Remove caching ASE on release
Remove the support for caching ASEs on release.

This is mainly due to the 2-stage design in Zephyr: We
have the bt_audio_stream and the bt_audio_ep, where the
the latter represents an ASE in most cases.

However, once the endpoint goes into the codec configured
state, then a stream must be bound to it. This would be fine
(although a stream is technically not established at this point),
except that a stream is also, for unicast, specified for a
specific ACL. Once the ACL disconnects, the stream technically
becomes invalid, and if the stream is invalid, so is the endpoint.

Based on that, there's no reason (or even option) to keep the
endpoint in a codec configured state, as it would not
have a valid stream associated with it.

If we want to support an ASE going into the codec
configured state on ASE release (or ACL disconnect),
the relationsship between ASEs and streams needs to
be redefined.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-09-27 09:16:21 +00:00
Vinayak Kariappa Chettimada
9b30a91e9b tests: Bluetooth: Upload Launch Studio Project and ICS
Uploaded the Bluetooth Launch Studio generated projects and
ICS files. These files can be imported into Bluetooth users
Launch Studio, with their Bluetooth SIG account, and
generate the test plans.

This file provide detailed information in Launch Studio of
the supported Core features, Host Services and Profiles,
and Audio services.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-09-26 13:21:08 +02:00
Ahmed Moheb
fab9c5a140 tests: bluetooth: host: Add UT for bt_keys_get_addr()
Unit test project for bt_keys_get_addr().
This part of subsys/bluetooth/host/buf.c unit testing

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-26 13:05:47 +02:00
Ahmed Moheb
fd888df41d tests: bluetooth: host: Add mocks for keys.c
Add required mocks to be able to compile and test /bluetooth/host/keys.c

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-26 13:05:47 +02:00
Jonathan Rico
77e1a9dcad Bluetooth: host: l2cap: add alloc_seg callback
This callback allows use-cases where the SDU is much larger than the l2cap
MPS. The stack will then try to allocate using this callback if specified,
and fall-back on using the buffer's pool (previous behavior).

This way one can define two buffer pools, one with a very large buffer
size, and one with a buffer size >= MPS, and the stack will allocate from
that instead.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-09-26 11:05:04 +02:00
Jonathan Rico
7a6872d837 Bluetooth: host: add l2cap stress-test
This test reproduces more-or-less #34600.

It has a central that connects to multiple peripherals, opens one l2cap CoC
channel per connection, and transmits a few SDUs largely exceeding the MPS
of the channel.

In this commit, the test doesn't pass, but when it passes (after the
subsequent commits), error and warning messages are expected from the
stack, as this is not the happy path.

We can later debate on whether these particular error messages should be
downgraded to debug.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-09-26 11:05:04 +02:00
Aleksandr Khromykh
43fe45af0f tests: Bluetooth: Mesh: add adv tx complete cb tests
Add bsim tests to check tx callback behavior for advertiser.
Feature coverage:
TX Complete callback execution
Callback order
Packets are freed before the end callback is called

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-09-15 16:30:34 +00:00
Aleksandr Khromykh
0cc0249fe4 tests: Bluetooth: Mesh: create skeleton for adv bsim tests
Create skeleton for bsim adv tests with stub for
tx complete callback tests.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-09-15 16:30:34 +00:00
Michał Barnaś
dae8efa692 ztest: remove the obsolete NULL appended to zassert macros
This commit removes the usage of NULL parameter as message in
zassert_* macros after making it optional

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Ahmed Moheb
db5ef779c4 tests: bluetooth: host: Add UT for bt_buf_get_type()
Unit test project for bt_buf_get_type().
This part of subsys/bluetooth/host/buf.c unit testing

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-09 10:06:19 +02:00
Ahmed Moheb
e544792ae1 tests: bluetooth: host: Add UT for bt_buf_get_evt()
Unit test project for bt_buf_get_evt().
This part of subsys/bluetooth/host/buf.c unit testing

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-09 10:06:19 +02:00
Ahmed Moheb
13203cc801 tests: bluetooth: host: Add UT for bt_buf_get_cmd_complete()
Unit test project for bt_buf_get_cmd_complete().
This part of subsys/bluetooth/host/buf.c unit testing

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-09 10:06:19 +02:00
Ahmed Moheb
4abff8a625 tests: bluetooth: host: Add UT for bt_buf_get_rx()
Unit test project for bt_buf_get_rx().
This part of subsys/bluetooth/host/buf.c unit testing

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-09 10:06:19 +02:00
Ahmed Moheb
cb5ba5bea8 tests: bluetooth: host: Add mocks for buf.c
Add required mocks to be able to compile and test /bluetooth/host/buf.c

Signed-off-by: Ahmed Moheb <ahmed.moheb@nordicsemi.no>
2022-09-09 10:06:19 +02:00
Szymon Czapracki
1e4960b28e Bluetooth: Add IAS tests
Add babblesim tests for IAS.

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
2022-09-09 10:05:46 +02:00
Szymon Czapracki
ac6c35728a Bluetooth: Add IAS shell
This commit adds IAS functionality to the shell.

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>

shell fixes
2022-09-09 10:05:46 +02:00
Vinayak Kariappa Chettimada
b304eaa29b Bluetooth: Controller: Add Kconfig for experimental AD Data Chaining
Add a Kconfig for Advertising Data Chaining in Extended and
Periodic Advertising, permitting AD data lengths of upto
1650 bytes. The implementation is experimental and needs
further testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-09-08 10:12:56 +02:00
Vinayak Kariappa Chettimada
34154e3efe Bluetooth: Controller: Fix BT_CTLR_ADV_DATA_LEN_MAX Kconfig dependency
Fix BT_CTLR_ADV_DATA_LEN_MAX and other Kconfig dependencies,
and clean up the use of PDU_AC_LL_SIZE_MAX which is used to
allocate scratch packet to be atleast able to accommodate
the minimum 31 bytes AD data such that it is sufficient to
transmit and/or receive scan response PDUs when either
broadcaster or observer alone is supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-09-08 10:12:56 +02:00
Anders Storrø
36e34fce41 Bluetooth: Mesh: Add CDB depend on to prov Kconfig
The current implementation of provisioning features is dependent on CDB
to compile, which is reflected poorly in the Kconfig options for mesh.

This commit alters the Kconfig options for provisioning to be dependent
on the CDB option to compile.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2022-09-06 12:35:48 +02:00
Gerard Marull-Paretas
79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Michal Narajowski
5c27067dcd Bluetooth: Mesh: Align Config Client API with Health Client API
This PR adds a `*_cli_*` infix to the Config Client API to match
the changes in Health Client. The old API is marked as deprecated.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2022-09-05 13:56:25 +03:00
Torsten Rasmussen
abc3be5965 cmake: remove obsolete CONFIG_ZTEST_NEW_API from CMakeLists.txt
Follow-up: #49243, #48732

With the introduction of Kconfig for unit_testing board and setting
ZTEST_NEW_API in testcase.yaml, the need and support of setting this
directly in CMakeLists.txt is obsolete.

Remove the code line.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-09-05 10:24:10 +02:00
Emil Gydesen
0753ec558d Bluetooth: Shell: Remove nRF board overlays
The board overlays were added to increase the baud rate,
which was useful when scanning when there were many devices.

For that scenario it is probably better to use the
scan filters.

The changed baudrate in the overlays made it harder
to easily switch between e.g. the BT shell and other
applications, as the default baudrate is different, and
you'd need to restablish a connection to the boards UART
to handle the changes.

The other values in the overlays also do not really
provide any advantage to have for just the shell
application.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-09-05 10:17:31 +02:00
Herman Berget
02894c720c Bluetooth: Test: Add test to verify L2CAP sending not changing user data
Regression test for an issue where in cases where sending a buffer over
L2CAP failed, the buffer user data was not restored.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-09-01 14:58:08 +00:00
Aleksandr Khromykh
85fdede4b4 tests: Bluetooth: Mesh: make ext adv default in bsim mesh
Make extended advertiser as deafult advertiser for
general and persistent bsim BLE Mesh tests.
Leave legacy advertiser as default advertiser for
low latency bsim BLE Mesh tests.

The legacy advertiser provides quite poor performance.
Even more, it is not fully compatible with specification
since might spur more frames occasionally then requested.
This is fundamental issue since it cannot stop an advertisement
in exact time. The extended advertiser doesn't have such problem.
However, it is not well tested yet. Since extended advertiser is
not experimental anymore in both controller and host this is
the right time to make ext advertiser as a default in Mesh either.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-08-31 21:55:53 +00:00
Erik Brockhoff
7719bc6785 Bluetooth: controller: llcp: fix unhandled rsp in periph phy upd proc
Re. peripheral phy update procedure: UNKNOWN_RSP from central was not
handled, leading to stall of procedure and subsequent procedure timeout

Proper handle and unit test for case added.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-08-26 11:56:33 +02:00
Vinayak Kariappa Chettimada
649a6250bf tests: Bluetooth: bsim: Verify multiple broadcaster and chain PDU
Added BabbleSim test to reuse the Broadcaster Multiple and
Oberver samples to verify multiple advertising sets and
transmission of Extended Advertising Chain PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-23 16:21:00 +02:00
Lang Xie
b41d19d85e Bluetooth: Host: Add bsim test for GATT multi notify
Checks that bt_gatt_notify_multiple works as expected.

Signed-off-by: Lang Xie <lang.xie@nordicsemi.no>
2022-08-19 14:09:43 +02:00
Aleksandr Khromykh
46f0d86227 tests: Bluetooth: Mesh: adapt bsim beacon tests for ext adv
Beacon test had trick for extended advertiser. That has been added as
conditional compilation. Additionally, waiting beacon procedure
waits for 1 more second to avoid boundary case since
the extended advertiser is more precisionive.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-08-19 12:08:27 +02:00
Aleksandr Khromykh
be8d357775 tests: Bluetooth: Mesh: fix reprovisioning test with ext adv
Extended advertiser has better latency without any delays than legacy one.
If couple of config model commands start sequently then
the first ones are received normally but the next one are transmitted in
parallel with leftover communication (retransmissions) of the previous one.
That causes collisions and broken test despite the functionality itself
is ok. Adding delays between commands solves crossovering tx time.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-08-19 12:08:27 +02:00
Aleksandr Khromykh
f7c77da5c8 tests: Bluetooth: Mesh: adapt bsim lpn tests for ext adv
mesh extended advertiser is not well tested. As the first step
the mesh babblesim tests should pass on extended advertiser as well
as on legacy advertiser. Minor fix to avoid lpn collisions in
friendship tests with multi lpns.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-08-19 12:08:27 +02:00
Mariusz Skamra
6219c12035 Bluetooth: csis: Expose bt_csis_generate_rsi function
The function will be used to update the RSI value. The returned value
can be later used in advertisement data for set identification. This
removes the need of specific bt_csis_advertise function so that the user
can call the API to generate new RSI once needed (e.g. on RPA change).
This allows the user to manage the advertisement data to fit it's needs.

< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
        Extended advertising: Disabled (0x00)
        Number of sets: 1 (0x01)
        Entry 0
          Handle: 0x00
          Duration: 0 ms (0x00)
          Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Extended Advertising Enable (0x08|0x0039) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 33
        Handle: 0x00
        Operation: Complete extended advertising data (0x03)
        Fragment preference: Minimize fragmentation (0x01)
        Data length: 0x1d
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        Unknown EIR field 0x2e: 16e61d64dc45
        Name (complete): audio test shell
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Extended Advertising Data (0x08|0x0037) ncmd 1
	Status: Success (0x00)
< HCI Command: LE Set Advertising Set Random Address (0x08|0x0035) plen 7
        Advertising handle: 0x00
        Advertising random address: 4E:21:29:F8:94:93 (Resolvable)
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Advertising Set Random Address (0x08|0x0035) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
        Extended advertising: Enabled (0x01)
        Number of sets: 1 (0x01)
        Entry 0
          Handle: 0x00
          Duration: 0 ms (0x00)
          Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Extended Advertising Enable (0x08|0x0039) ncmd 1
        Status: Success (0x00)

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-19 12:07:31 +02:00
Herman Berget
3a02e60398 Bluetooth: Tests: Add tests for EATT flag API
Checks that both notifications and requests work using the different
channel options.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-08-19 11:59:52 +02:00
Herman Berget
8873b7f05d Bluetooth: Tests: Use chan_opt BT_ATT_CHAN_ANY
The chan_opt field of GATT parameter structs must be set.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-08-19 11:59:52 +02:00
Gerard Marull-Paretas
aa1d2cf3d0 tests: bluetooth: initialize devices at compile time
Initialize devices at compile time, allowing to constify device pointer.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Torsten Rasmussen
1a119b4121 tests: use CONFIG_ZTEST_NEW_API=y for bluetooth/controller/ctrl_cte_req
The bluetooth/controller/ctrl_cte_req wrongly defaulted to old Ztest API
after the introduction of the new unit_testing board.

Enforce use of CONFIG_ZTEST_NEW_API to get test working again.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-19 05:15:07 +09:00
Torsten Rasmussen
c23be568fb tests: add Kconfig file to bluetooth ctrl_data_length_update testcases
With Kconfig support in unittest the bluetooth ctrl_data_length_update
test fails because the symbols being configured are promptless or
disabled because of dependencies.

Add a Kconfig file to make needed symbols visible in unittest mode.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-18 14:29:14 +02:00
Torsten Rasmussen
0f15d89a26 tests: remove testing for board unit_testing
Remove boilerplate code:
> if (NOT BOARD STREQUAL unit_testing)
>    message(FATAL_ERROR "This project can only be used with...")
> endif()

as that is now handled by boards.cmake when validating the board.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-18 14:29:14 +02:00
Mariusz Skamra
541d946d10 Bluetooth: audio: Add HAS client support for preset switching
This adds client support for switching the active preset along with bsim
tests implementation.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-18 12:46:27 +02:00
Mariusz Skamra
8b06f7a5e1 Bluetooth: shell: Add multi-cis support
Add support for multiple CIS.

Relates: ASCS/SR/SPE/BI-{15,16}-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-17 12:10:51 +02:00
Mariusz Skamra
e0d36beb72 Bluetooth: audio: Add security requirements check
The LE Audio related profiles define specific security requirements that
client have to met to gain access to related characteristics. This
introduces internal wrapper API for GATT characteristics and CCC
descriptors to ensure the security.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-16 12:19:43 +02:00
Andries Kruithof
6fe1299c33 Bluetooth: controller: llcp: fix CI tests for new LLCP
Setting the new LLCP as default exposed errors in CI tests, which
are fixed here
Note that advanced scheduling needs to be disabled. Work is in
progress for implementing this for the new LLCP

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2022-08-14 21:59:09 +02:00
Jonathan Rico
96f077f8c1 Bluetooth: gatt: reproduce #48880
Modify bsim_test_notify to fail in the same way as #48880.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-08-14 17:14:41 +02:00
Andries Kruithof
d2d241ac9a Bluetooth: llcp: test: fix bsim test for eatt
The Babblesim test for eatt for reconfiguration of MTU is not
foolproof. Central actually generates two mtu update events.
This is fixed by only setting the reconfigured flag when the MTU actually
changes to the new values

In the Babblesim test for eatt for collision the peripheral
needs to sync with central to ensure collisions occur.

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2022-08-10 12:39:16 +02:00
Gerard Marull-Paretas
a7c3e7e84a doxygen: remove redundant usages of def
The def command Indicates that a comment block contains documentation
for a #define macro. This is useful if the comment block documents a
macro not adjacent to it, e.g.

```c
/**
 * @def MAX(x,y)
 * @brief Computes the maximum of @a x and @a y.
 */
 #ifdef XXX
 #define MAX(x,y) ...
 #endif
```

However, it is not necessary if the comment is adjacent to the
definition, e.g.

```c
/**
 * @brief Computes the maximum of @a x and @a y.
 */
 #define MAX(x,y) ...
```

This patch removes all unnecessary def entries in-tree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-09 12:29:28 +02:00
Krzysztof Kopyściński
f71741cea0 tests: bluetooth: tester: add support for testing Multiple Notifications
Enabled Multiple Notifications and added command for
bt_gatt_notify_multiple().

Increased possible number of connections to execute GATT/SR/GAN/BV-02-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2022-08-05 13:01:46 +02:00
Yuval Peress
000bdb16c7 test: BT: ctrl_isoal: run clang-format
Run clang-format on the ctrl_isoal test's main.c

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-03 21:20:40 +02:00
Yuval Peress
4659524374 ztest: mock: Remove ztest mock from BT ctrl_isoal
Remove use of ztest mock Kconfig from BT ctrl_isoal tests.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-03 21:20:40 +02:00
Yuval Peress
fb5fabc3fb ztest: mock: Update BT ctrl_isoal allocation to use fff
Remove references to ztest mock used in `sink_sdu_emit_test`.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-03 21:20:40 +02:00
Yuval Peress
926830e546 ztest: mock: Update BT ctrl_isoal allocation to use fff
Remove references to ztest mock used in `sink_sdu_write_test`.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-03 21:20:40 +02:00
Yuval Peress
8589e34a50 ztest: mock: Update BT ctrl_isoal allocation to use fff
Remove references to ztest mock used in `sink_sdu_alloc_test`.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-03 21:20:40 +02:00
Vinayak Kariappa Chettimada
e6c8aaf629 Bluetooth: Controller: Refactor DF impl to add aux offset in ULL context
Refactor DF implementation to add aux offset in the aux
pointer field of the parent PDU when chain PDU is added
and/or is duplicated when PDU contents are updated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-03 12:02:47 +02:00
Vinayak Kariappa Chettimada
aa5c0c0a90 Bluetooth: Controller: Rename Kconfig to BT_CTLR_ADV_AUX_PDU_BACK2BACK
Rename Kconfig BT_CTLR_ADV_PDU_BACK2BACK to
BT_CTLR_ADV_AUX_PDU_BACK2BACK to represent use of
back-to-back for Extended Advertising PDU chaining support
similar to BT_CTLR_ADV_SYNC_PDU_BACK2BACK that is used to
represent the use of back-to-back for Periodic Advertising
PDU chaining support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-03 12:02:47 +02:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Michal Narajowski
fab8e29ee2 Bluetooth: Mesh: Add model publish support to Health Client
Mesh Profile Specification errata 11310
Section 4.4.4.1
"This model shall support model publication, as defined in Section
4.2.2 of the Mesh Profile specification and model subscription,
as defined in section 4.2.3 of the Mesh Profile specification."

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2022-08-01 18:04:42 +01:00
Michal Narajowski
e98df9f160 tests: bluetooth: tester: Fix Health Fault Test command
The buffer for response was too small.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2022-08-01 18:04:42 +01:00
Aleksander Wasaznik
419c540a5c Bluetooth: Test: Split up test "uuid"
Create a separate file and test suite for each tested function.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-08-01 18:05:12 +02:00
Aleksander Wasaznik
a2bbc422a2 Bluetooth: Test bt_uuid_to_str
Add missing unit tests for `bt_uuid_to_str`.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2022-08-01 18:05:12 +02:00
Kumar Gala
2c990384d6 tests: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from tests.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-28 20:52:20 +02:00
Lingao Meng
e80161c86d Bluetooth: Mesh: Fix unable iv recovery 0 0 -> 1 0
According Mesh Spec 1.0.1:

Upon receiving and successfully authenticating to
Secure Network beacon for a primary subnet whose
IV Index is 1 or more higher than the current known IV
Index, the node shall set its current IV Index and its
current IV Update procedure state from the values in
this Secure Network beacon.

Look like test_iv_index.c:81
``` C

(bt_mesh_net_iv_update(TEST_IV_IDX + 1, BCN_IV_IN_IDLE));

```

This test case already exists, but the wrong testcase
to test wrong code.

Move `is_iv_recovery` into `bt_mesh_net_iv_update`.
First check whether it is IV recovery, and then carry out
the subsequent IV normal update procedure.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-07-28 19:47:36 +01:00
Emil Gydesen
d4b132a059 Bluetooth: Audio: Unicast client read available contexts
Read the available contexts during discovery and subscribe
for notifications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-28 08:29:29 +02:00
Benjamin Björnsson
33b43547e8 tests: bluetooth: bttester: Update test to use DEVICE_DT_GET
Update test to use DEVICE_DT_GET in order to remove usage of
device_get_binding.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-27 18:44:22 +02:00
Piotr Pryga
ae56306557 tests: Bluetooth: llpc: Fix enc proc assert on released ctx num
Due to added call to ull_cp_tx_nrf call in common function event_done,
encryption test test_encryption_start_periph_rem_no_ltk failed with
assert caused by unexpected number of free control procedure contexts.

That is caused by internal call to rr_check_done and lr_check_done
in the ull_cp_tx_nrf that frees last unreleased context.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-25 15:17:22 +02:00
Piotr Pryga
01a8d2bdf9 tests: Bluetooth: llpc: Add at-instant conn evt proc in collision UT
Unit tests reposnsible for verification of collisions mitigation
didn't have handling for delayed completion of PHY Update control
procedure. The PHY Update is completed on event generated when
"at-instant" connection event is on air.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-25 15:17:22 +02:00
Piotr Pryga
64d67604b7 tests: Bluetooth: llcp: Add handling delayed PHY UPD compl in CTE REQ UT
The PHY Update control procedure completion is delayed to event
"instant-on-air". That has to be handled in CTE Request control
procedure unit test.

The changes required are:
- Added handling of event done for "at-instant" connection event.
  This is required to call ull_cp_tx_ntf function to send an
  envet "instant-on-air" to PHY Update procedure state machine.
  This is the delayed completion of PHY Update procedure.
- Remote requested PHY Update completion is also delayed and completed
  on "instant-on-air" event, hence the local CTE Request is not executed
  at the same connection event as PHY Update completion. This caused
  changes to check_phy_update_and_cte_req_complete function. The functin
  does not hanle CTE Request completion anymore. This also implies
  changes to run_phy_update_central and run_phy_update_peripheral.
  These function do not need to get CTE request argument anymore
  because it was just passed to check_phy_update_and_cte_req_complete.
  The check_phy_update_cte_req_complete was renamed to check_phy_update.
  The test test_cte_req_wait_for_remote_phy_update_complete was changed
  to execute and verify local CTE request procedure explicitly after
  completion of PHY Update.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-25 15:17:22 +02:00
Piotr Pryga
f2f65b9a42 tests: Bluetooth: llcp: Add missing at-instant conn event processing
The test_phy_update_central_rem_collision didn't have processing
of an "at-instant" connection event. Thas causes the remote requesed
PHY update to hand in waiting for instant on air state and whole
test to fail.

To fix the problem, proper processing of "at-instant" connection evnet
has to be added. In consequence the local PHY update procedure, that
as waiting for end of the remote procedure is delayed by one connection
event.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-25 15:17:22 +02:00
Piotr Pryga
0204506165 tests: Bluetooth: llpc: Add instant on air notification for PHY UPD
Unit tests does not maintain connection events hence there is no
notification to PHY upodate state machine about instant on air
event. That has to be simulated by explicit call to ull_cp_tx_nrf.

In unit tests the event_done function is responsible for handling
all steps done at end of connection event, so it is the best place
to simulate the instant on air event and send it to LLCP state machine.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-25 15:17:22 +02:00
Yuval Peress
43f9f806a9 ztest: mock: update BT host_long_adv_recv to FFF
Migrate the BT tests for host_long_adv_recv to use FFF instead of
ztest mock which is being deprecated.

Signed-off-by: Yuval Peress <peress@google.com>
2022-07-25 15:15:24 +02:00
Yuval Peress
2b828f2af7 ztest: mock: Remove unused mocking dependency from BT ctrl_hci
The BT ctrl_hci test was enabling ztest mocking but never using it.

Signed-off-by: Yuval Peress <peress@google.com>
2022-07-22 10:33:17 +02:00
Yuval Peress
42115c3f9e ztest: mock: Remove unused mock from BT ctrl_sw_privacy_unit
The BT test ctrl_sw_privacy_unit was enabling mocking but never using
it. Clean it up and remove the Kconfig.

Signed-off-by: Yuval Peress <peress@google.com>
2022-07-22 10:32:27 +02:00
Emil Gydesen
df75bfd8f6 Bluetooth: Audio: Add PACS location read for unicast client
The unicast client will now read the PACS location value
during the discovery procedure, as well as subscribing to
it.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-19 12:27:00 +00:00
Pavel Vasilyev
b9078e98e6 tests: Bluetooth: Mesh: Add ability to abort bsim mesh tests by ctrl-c
Sometimes there is a need to interrupt mesh babblesim tests when
debugging or implementing new tests. Calling Ctrl-C doesn't work as it
only aborts the test script, but not the executables. This fix adds a
trap for Ctrl-C to kill all test instances run by the script.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-07-19 10:30:56 +02:00
Tomislav Milkovic
0fe2c1fe90 everywhere: Fix legacy include paths
Any project with Kconfig option CONFIG_LEGACY_INCLUDE_PATH set to n
couldn't be built because some files were missing zephyr/ prefix in
includes
Re-run the migrate_includes.py script to fix all legacy include paths

Signed-off-by: Tomislav Milkovic <milkovic@byte-lab.com>
2022-07-18 16:16:47 +00:00
Jonathan Rico
7411b451da Bluetooth; GATT: don't immediately cancel CCC write request
`bt_gatt_unsubscribe` was pending a write to the CCC and then immediately
canceling it.

Fixes #47682 .

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-15 10:01:15 +02:00
Fredrik Danebjer
04a080bf70 Bluetooth: Audio: TBS Client optional procedures actually optional
This change makes the optional procedures in the TBS Client optional
and configurable through Kconfig.

Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
2022-07-14 15:48:28 +00:00
Piotr Pryga
aaaeefdb11 tests: Bluetooth: llcp: ctrl cte req migrate to new ZTEST API
Migrate LLCP unit tests in ctrl_cte_req to new ZTEST API.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-14 10:38:31 +02:00
Piotr Pryga
8be0999dfb tests: Bluetooth: df: connectionless cte tx migrate to new ZTEST API
Migrate tests in connectionless_cte_tx to new ZTEST API.

Remove main.c source file because is unncessary when automatic
unit tests registration is available. Also former use of
predicate to select unit tests for execution is removed
because the tests are split into two distinct tests suites
that has its't own setup and teardown phases.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-13 16:13:57 +02:00
Piotr Pryga
11da98fde0 tests: Bluetooth: df: connectionless cte rx migrate to new ZTEST API
Migrate tests in connectionless_cte_rx to new ZTEST API.

Remove main.c source file because is unncessary when automatic
unit tests registration is available.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-13 16:13:57 +02:00
Piotr Pryga
587319dea5 tests: Bluetooth: df: cte chains migrate to new ZTEST API
Migrate tests in connectionless_cte_chains to new ZTEST API.

Remove main.c source file because is unncessary when automatic
unit tests registration is available.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-13 16:13:57 +02:00
Piotr Pryga
38dc61cb30 tests: Bluetooth: df: set conn cte tx params migrate to new ZTEST API
Migrate tests in connection_cte_tx_params to new ZTEST API.

Remove main.c source file because is unncessary when automatic
unit tests registration is available.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-13 16:13:57 +02:00
Piotr Pryga
6496d10276 tests: Bluetooth: df: conn cte req migrate to new ZTEST API
Migrate tests in connected_cte_req to new ZTEST API.

Remove main.c source file because is unncessary when automatic
unit tests registration is available.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-07-13 16:13:57 +02:00
Jonathan Rico
ee190f49c2 Shell: bluetooth: don't refer to commit message text
One sometimes forgets files can be distributed outside of git..

Added a concise usage example of the command above the config.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 15:38:46 +02:00
Emil Gydesen
c699ae5850 Bluetooth: Audio: Expose broadcast sink adv data to application
In the broadcast sink `scan_recv` which is called when we
scan for broadcast source, we now also provide the entire
AD struct to the application.

The reason for this is that the advertising data may
contain other information that is useful for the application
like the broadcaster device name or any other
vendor/application specific data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-12 14:17:02 +02:00
Emil Gydesen
9b15426455 Bluetooth: Audio: Refactor ISO allocation endpoints
Modify how the ISO channels are allocated for the audio streams,
as well as how the CIG is allocated for the unicast group.

This fixes an issue where the unicast group could not be
fully allocated before _after_ the bt_audio_streams had been
configured by bt_audio_stream_config, thus making it impossible
to create a unicast group before the connections have been established.

This leaves us with 3 basic data types:
1) Streams allocated by the application
2) Endpoints that represent ASEs
3) Audio_iso which is used to couple streams and ISO channels.

The Unicast Group for the unicast client will now have the same
lifetime as the ISO CIG for the central.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-12 14:12:08 +02:00
Jonathan Rico
76f74344a8 Shell: kernel: Add runtime log filtering command
Use `kernel log-level modulename severity`
Also enable it for the Bluetooth Shell.

Then one can compile-in a lot of BT modules like so:

CONFIG_BT_DEBUG_HCI_CORE=y
CONFIG_BT_DEBUG_L2CAP=y
CONFIG_BT_DEBUG_ATT=y
CONFIG_BT_DEBUG_GATT=y

And at runtime select only, e.g. GATT

kernel log-level bt_hci_core 0
kernel log-level bt_l2cap 0
kernel log-level bt_att 0

And then re-enable L2CAP if needed later

kernel log-level bt_l2cap 4

And so on..

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico
57fec48109 Bluetooth: shell: add nrf52840dk and nrf53dk overlays
Run the shell at 1Meg with flow control on nRF52840 and nRF5340 DKs.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 12:24:43 +02:00
Jonathan Rico
38cd73d47d Bluetooth: gatt: check subscription before notifying
Check that the client has subscribed before sending a notification.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-12 11:14:29 +02:00
Emil Gydesen
4b953eabf8 Bluetooth: Audio: Moved ASCS metadata verification to higher layer
Instead of rejecting metadata at the BAP layer, we now
expect the higher layer to provide the verification.

The reason for this is that the higher layer may be better
equiped at determining which metadata it supports.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-08 20:08:45 +00:00
Emil Gydesen
e1114bf3dd Bluetooth: Audio: Add CAP acceptor set member support
The CAP acceptor can now be a set member. This allows
the CAP acceptor to register a CSIS instance and include
it in the CAS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-08 20:08:45 +00:00
Emil Gydesen
1bf4d85442 Bluetooth: Audio: Enable CAP acceptor for shell and bsim
Enable the CAP acceptor for the audio shell configuration
and the babblesim test cases.

Enabling CAP does add some additional requirements, and if
a BAP unicast client attempts to use it without conforming to
those requirement, it won't be able to update the metadata.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-08 20:08:45 +00:00
Emil Gydesen
e712a2462b Bluetooth: Audio: Add get_by_ccid for TBS
This is needed for the CAP acceptor to properly
verify the CCID_List in the metadata.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-08 20:08:45 +00:00
Erik Brockhoff
3fbfb6537e bluetooth: controller: Implements Peripheral CIS Create Procedure
Implements PDU flow and unittest of CIS Create on Peripheral
Hooks CIS Create into the controller and fixes a few minor
things in ull to allow for running with NEW LLCP
Also handles CONFIG based comilation of CIS Create

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-08 09:36:00 +02:00
Erik Brockhoff
6cf357bd9d bluetooth: controller: Integrate CIS Terminate with controller
Hooks the CIS terminate into the controller and fixes a few minor
things in ull_conn(_iso).c
Also handles CONFIG based comilation of CIS_TERMINATE
also fixes a minor issue in helpers_pdu

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-08 09:36:00 +02:00
Erik Brockhoff
22ddc01f36 bluetooth: controller: CIS Terminate Procedure PDU flow and unittest
Implementing PDU flow and unittest for PDU flow of CIS Terminate.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-08 09:36:00 +02:00
Carles Cufi
8e8cc7e490 tests: bluetooth: ctrl_isoal: Remove unnecessary test_main
With thew new ztest API, test_main() is not required anymore, so get rid
of it.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-07-07 10:47:23 +02:00
Carles Cufi
f096d944de ztest API migration: bluetooth/host_long_adv_recv
Migrate the tests at `bluetooth/host_long_adv_recv` to the new
ztest API.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-07-07 10:47:14 +02:00
Carles Cufi
c82c9f5d1e ztest API migration: bluetooth/uuid
Migrate the tests at `bluetooth/uuid` to the new ztest API.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-07-07 10:47:14 +02:00
Carles Cufi
5a0b1f2b07 ztest API migration: bluetooth/adv
Migrate the tests at `bluetooth/adv` to the new ztest API.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-07-07 10:47:14 +02:00
Erik Brockhoff
1433852ac5 bluetooth: tests: Fixup conf to make sure new LLCP is selected for EDTT
The choice of LLCP by selecting 'y' option of the proper CHOICE config
Turns out a couple of tests fail with refactored LLCP, disabled for now

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-07 10:18:29 +02:00
Thomas Ebert Hansen
154d67d90b Bluetooth: controller: llcp: Fix data pause/resume
llcp_tx_pause_data() calls ull_tx_q_pause_data() for each pause_mask,
while llcp_tx_resume_data() only calls ull_tx_q_resume_data() when
conn->llcp.tx_q_pause_data_mask == 0 leading to an unbalanced number of
calls to ull_tx_q_pause_data()/ull_tx_q_resume_data() which can leave
the data path of the TX Q paused.

Fix such that only the first call to llcp_tx_pause_data() will pause the
data path of the TX Q.

Add unit test to verify correct pause/resume behavior.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-07-07 10:00:44 +02:00
Pieter De Gendt
aba4c4ea3e uart_pipe: move driver from console to serial
The uart_pipe driver is not dependent on any console driver,
however a serial driver is required.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-07 09:59:49 +02:00
Emil Gydesen
4b05d75f72 Bluetooth: Audio: Update broadcast_sink_test to use ISO
Update the broadcast_sink_test to use ISO to sync to the
broadcast source BIG, testing both the syncing functionality
as well as the sync stop and delete functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Emil Gydesen
deae9d7239 Bluetooth: Audio: Update broadcast_source_test to use ISO
Update the broadcast_source_test to actually create the
BIG and send data over ISO.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Erik Brockhoff
1ff458ec87 Bluetooth: controller: llcp: fixing tx buffer queue handling
Misc. fixups to get the tx buffer alloc mechanism to work as intended

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-06 13:08:09 +02:00
Tristan Honscheid
be19051248 ztest API Migration: bluetooth/gatt
Migrate the unit tests at `bluetooth/gatt` to use
the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-06 12:44:59 +02:00
Kumar Gala
17871969d2 tests: bluetooth: mesh: Convert to use gpio_dt_spec
Move test to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 11:23:00 +02:00
Fredrik Danebjer
2283aad798 Bluetooth: Audio: Removed Streaming Context from LC3 PAC Record
This fix removes the Streaming_Audio_Context LTV from the LC3 Codec
helper macro, and subsequently a faulty exposure of this LTV in the
PAC records used.

Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
2022-07-06 10:46:22 +02:00
Emil Gydesen
8e08d79676 Bluetooth: Audio: Rename MICP mic_dev disable to mute disable
Made it more clear that the disable functionality is to
disable the mute functionality, but and not disabling
the microphone device itself.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
28f6e37ba8 Bluetooth: Audio: Rename struct bt_micp and cleanup
Rename struct bt_micp to bt_mic_ctlr as it is only
used ofr microphone controller now.

This also allow cleanup of the bt_micp struct, thus
removing the common internal micp_internal.h header file
and reducing the size of the implementation by not
using a union of the structs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
c8a6a51566 Bluetooth: Audio: Remove bt_micp argument for MICP mic_dev API
Since there is a split API now, the mic_dev does not need
to take a bt_micp pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
e95b640df6 Bluetooth: Audio: Specify MICP Mic Dev API
Modify the existing bt_micp API for the
MICP Microphone Device to be more specific
by adding mic_dev as an infix. This follows
the naming scheme used for the MICP microphone
controller (mic_ctlr).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
3cf59fae72 Bluetooth: Audio: Add separate API for MICP mic ctlr
Add a bt_micp_mic_ctlr API that is used only
for the MICP Microphone Controller (Client).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
ff509027c1 Bluetooth: Audio: Rename bt_micp_aics functions
The AICS functionality is also possible via the bt_aics
API, and this was just a way to ensure that the AICS
instance was part of a MICS.

Removing makes MICP much simpler, and we can expect user
to know the context of a AICS.

This also fixes a few bad/missing guards.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
1245da298e Bluetooth: Audio: Rename remaning MICS files to MICP roles
Rename mics => micp_mic_dev (MICP Microphone Device)
Rename mics_client -> micp_mic_ctlr (MICP Microphone Controller)

This does not change any lines in the code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
9eb5d0795f Bluetooth: Audio: Rename MICS to MICP
Use the profile abbreviation, MICP, instead of the
service abbreviation, MICS, for the MICP implementation.

The server implementation will use MICP and the client
implementation will use MICP_CLIENT for now, as that will
be updated in a future commit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
67e570ea7e Bluetooth: Audio: Rename mics.h the Kconfig to micp
Rename the files to match the name of the profile (MICP)
instead of the service (MICS).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen
ec8a6c83fa tests: bluetooth: Fix bad Audio preset macro for broadcast sink
Fix a bad macro usage after multiple commits were merged.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-05 16:31:54 +02:00
Mariusz Skamra
a36d64b8d8 Bluetooth: att: Fix EATT channel security requirements
Core Vol 3, Part G, Section 5.3.2 Channel Requirements states that
"The channel shall be encrypted". It does not mention any additional
security requirements that can be specified bt higher layer profiles.
This enables link encryption requirement for EATT channel.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-07-05 12:19:07 +02:00
Emil Gydesen
2071c66249 Bluetooth: Audio: Disable HAS when unicast_server is disabled
The HAS depends on the unicast server, and should be
disabled in the `no_unicast_server` as well as depend
on the CONFIG_BT_AUDIO_UNICAST_SERVER config.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Emil Gydesen
bb6c0866d8 Bluetooth: Audio: Add PACS for broadcast sink
Add support for using PACS and/or capabilities for
the broadcast sink role. PACS and capabilities were
originally only supported for the unicast server
role, so the PACS callbacks were moved their own
struct, as if a device supports both the unicast
server role and the broadcast sink role, it will
only have a single PACS instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Tristan Honscheid
79fcb6ab43 ztest API Migration: bluetooth/ll_settings
Migrate the unit tests at `bluetooth/ll_settings` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:58:02 +02:00
Tristan Honscheid
074a46adb3 ztest API Migration: bluetooth/init
Migrate the unit tests at `bluetooth/init` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:57:50 +02:00
Tristan Honscheid
84f39cf4a6 ztest API Migration: bluetooth/hci_prop_evt
Migrate the unit tests at `bluetooth/hci_prop_evt` to use the
new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:57:34 +02:00
Tristan Honscheid
4ea68e4604 ztest API Migration: bluetooth/hci_codecs_info
Migrate the unit tests at `bluetooth/hci_codecs_info` to use
the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:57:20 +02:00
Tristan Honscheid
d76da3ee94 ztest API Migration: bluetooth/ctrl_user_ext
Migrate the unit tests at `bluetooth/ctrl_user_ext` to
use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:56:24 +02:00
Tristan Honscheid
144d11e539 ztest API Migration: bluetooth/ctrl_sw_privacy_unit
Migrate the unit tests at `bluetooth/ctrl_sw_privacy_unit` to
use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:56:08 +02:00
Tristan Honscheid
8b76ea680f ztest API Migration: bluetooth/bluetooth
Migrate the unit tests at `bluetooth/bluetooth` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:54:11 +02:00
Tristan Honscheid
24845d56ce ztest API Migration: bluetooth/ctrl_sw_privacy
Migrate the unit tests at `bluetooth/ctrl_sw_privacy` to use
the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-07-04 15:53:37 +02:00
Reto Schneider
7a6c5710ff cmake: Update cmake_minimum_required to 3.20.0
As Zephyr currently requires CMake version 3.20.0, update all
occurrences of cmake_minimum_required.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-07-04 10:18:45 +02:00
Yuval Peress
ffc0983547 test: unittest: Fix deprecated ZephyrUnittest
Fix the deprecated calls to loading ZephyrUnittest by replacing them
with `Zephyr COMPONENTS unittest`.

Signed-off-by: Yuval Peress <peress@google.com>
2022-06-29 06:04:32 -04:00
Andries Kruithof
c16f788959 Bluetooth: controller: llcp: update unit tests with changes in PHY proc
The pausing and timing of data transmission is changed in the PHY update
procedure, so that conformance tests passes. This requires an update
in unittests as well

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2022-06-29 10:25:37 +02:00
Emil Gydesen
c5fc32756a Bluetooth: Audio: Remove hardcoded location and context for LC3 macros
The BT_CODEC_LC3_CONFIG_* macros had a hardcoded location
and context, which makes them a lot less usable.

Updates the macro, and the macros that used them.
This also removes the BT_CODEC_LC3_CONFIG and instead
just uses the BT_CODEC_LC3_CONFIG_N macro, which has
then been renamed to BT_CODEC_LC3_CONFIG.

As an addition, the macros and their input has
also been better documented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-29 10:24:49 +02:00
Erik Brockhoff
8b1d50b981 Bluetooth: controller: llcp: fix issue re. missing ack of terminate ind
On remote terminate on central the conn clean-up would happen before ack
of terminate ind was sent to peer.
Now clean-up is 'postponed' until subsequent event.
Also now data tx is paused on rx of terminate ind to ensure no data is
tx'ed after rx of terminate ind

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-06-28 11:07:04 +02:00
Erik Brockhoff
522e0b5ade Bluetooth: controller: fixing issue re. erroneous DLE changed events
Only apply change to effective DLE times if current max times are too
small to accommodate. Similar to legacy implementation
Update unit tests to new DLE ntf behavior

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-06-28 11:06:15 +02:00
Krzysztof Chruscinski
041f0e5379 all: logging: Remove log_strdup function
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Emil Gydesen
7148146348 Bluetooth: CSIS: Implement ordered access procedure for CSIS client
the CSIS client now has a ordered access procedure function.
The function implements the procedure as per the CSIP spec,
where it will verify that 1 or more members are unlocked,
and the execture a procedure on each member in ascending
order of rank.

The procedure can be anything (even a non-BT procedure),
and it will be up to the applicaiton to implement
what to do in that.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-23 09:08:05 +02:00
Emil Gydesen
d995901a76 Bluetooth: CSIS: Remove const for members in API
Having the members array being const causes a lot of
limitations in the implementatation, and was
occasionally even disregarded. Removed to make the
implementation more flexible.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-23 09:08:05 +02:00
Vinayak Kariappa Chettimada
1f2cbbf318 tests: Bluetooth: bsim: Add GATT Write test
Add BabbleSim test to verify central_gatt_write and
peripheral_gatt_write.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-06-22 12:22:29 +02:00
Morten Priess
44f8166c3b test: bluetooth: Fix hci_test_app iso_data_pool element size
Size of ISO RX data pool did not account for the EDTT timestamp.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-06-22 12:21:16 +02:00
Nirosharn Amarasinghe
64c9a521d4 tests: bluetooth: Reworked ISO-AL RX unit tests
Fixes incorrect use of the test framework and updates tests according
to the new test API.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-06-22 12:21:16 +02:00
Anders Storrø
11e238a1ff Tests: Bluetooth: Mesh: Mesh shell prj stack size
Increases the main stack size of the mesh shell test application.
This resolves issue where application is not able to pass initialization
step.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2022-06-20 10:28:15 +02:00
Rubin Gerritsen
bdc19bf274 tests: bluetooth: bsim: Pretend that the controller supports CIS
The test relies on enabling connection iso features in the host. As the
controller does not yet support them, this configuration does not really
make sense. But because the test is not using this functionality, we
work around it by pretending the controller supports it.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-06-17 10:49:51 -05:00
Herman Berget
63c68dbbbb Bluetooth: Tester: Add support for EATT connection
A new command is added to connect EATT channels.

Affects L2CAP/TIM/BV-03-C, which tests requirements on ATT.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-06-17 10:48:05 -05:00
Gerard Marull-Paretas
74ed64139c tests: remove redundant <zephyr/zephyr.h> includes
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:13:11 +02:00
Piotr Pryga
f4faf948fc tests: Bluetooth: df: remove unnecessary testcase.yaml
The testcase.yaml file in tests/bluetooth/df directory makes
twister trying to build tests that are not available.
All tests in the df subdirectory have private testcase.yaml
files.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-06-13 12:12:27 +02:00
Piotr Pryga
fded540143 tests: Bluetooth: df: Missing conf for max num of CTE in per adv chain
Implementation of ll_df_set_cl_cte_tx_params was updated to verify
if the number of requested CTE in a periodic advertising chain is less
or equal to maximum supported value that is provided by CONFIG_BT_CTLR-
_DF_PER_ADV_CTE_NUM_MAX Kconfig option. In the past the value was
verified against maximum value allowed by BT Core Spec Vol 4, Part E,
section 7.8.80. Check against BT Core spec provided value could lead to
memory overwrite.

The unit tests start to fail because default value of the CONFIG_BT_-
CTLR_DF_PER_ADV_CTE_NUM_MAX is 1, hence is shall be changed in unit test
configuration file.

The commit adds missing configuration.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-06-13 12:12:27 +02:00
Piotr Pryga
f731a12e9b tests: Bluetooth: df: Wrong feature set for features_used
Wrong feature was enabled for a connection object as one the currently
used features. The enabled feature was CTE response. In case if the
feature exchange has not happened, it is verified if CTE request feature
is enabled, not the CTE response feature. The problem is in a common
code that prepares connection object for unit tests.

The commit fixes enabled features preparation for a connection object.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-06-13 12:12:27 +02:00
Mariusz Skamra
146124e7f9 tests: has: Extend tests with preset selection commands
The commands are used to change the active preset.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-06-07 18:55:04 +02:00
Emil Gydesen
c513fd87e1 Bluetooth: ISO: Rename sn to seq_num
Rename the `sn` field(s) to `seq_num` to be more readable
and clear what the value covers.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-07 18:53:44 +02:00
Emil Gydesen
6786bbdb32 Bluetooth: ISO: Add sn and ts to bt_iso_chan_send
Add two new parameters to bt_iso_chan_send:
sn: The packet sequence number which shall be incremeted
per SDU interval.
ts: An optional timestamp value used to synchronize SDUs.

The sequence number in the API uses a 32-bit value even though
the sequence number for the HCI command is 16-bit. This is to
properly handle wrapping of sequence numbers, which is much
easier to do with additional bits allocated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-07 18:53:44 +02:00
Pavel Vasilyev
dc4889e8be tests: bluetooth: mesh: Test RPL fragmentation
Ensure that RPL fragmentation doesn't occur.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-06-07 11:53:31 +02:00
Alperen Sener
12e57d414c tests/bluetooth/tester: Set mesh message cache size to 10
MESH/NODE/RLY/BI-02-C case requires cache size of 10

Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
2022-06-05 14:45:24 +02:00
Mariusz Skamra
36c8324add tests: audio: Fix audio direction in test
This fixes direction that shall be BT_AUDIO_DIR_SOURCE in this
particular case.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-06-05 14:44:21 +02:00
Mariusz Skamra
33991f2dde Bluetooth: audio: Expose API methods to change the available contexts
This exposes API methods to change the available context types.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-06-05 14:44:21 +02:00
Emil Gydesen
0eb5b3ac03 Bluetooth: Shell: Add gatt notify-mult command
Add GATT command to test the bt_gatt_notify_multiple
function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-05 14:29:33 +02:00
Asbjørn Sæbø
b41bc06869 Bluetooth: Audio: Media tests - remove superfluous includes
Remove #includes that are not required.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-06-05 14:27:05 +02:00
Asbjørn Sæbø
704851abb8 Bluetooth: Audio: Test - add missing newline
Add missing newline to printk().

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-06-05 14:27:05 +02:00
Asbjørn Sæbø
7daf7260e3 Bluetooth: Audio: Test - add "PASSED" output to BabbleSim tests
Redefine PASS macro to add "PASSED" to the output.  This makes passes
easier to grep for by ensuring a consistent pattern in the output.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-06-05 14:27:05 +02:00
Mariusz Skamra
0492ef5bbf Bluetooth: audio: Fix call control client build
error: 'CONFIG_BT_TBS_MAX_PROVIDER_NAME_LENGTH' undeclared (first use
			in this function); did you mean
			'CONFIG_BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH'?
  292 |            CONFIG_BT_TBS_MAX_PROVIDER_NAME_LENGTH);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |            CONFIG_BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH
etc.

This fixes build errors that were seen while building call control
client without server side (`CONFIG_BT_TBS`) enabled.
The options like BT_TBS_CLIENT_MAX_URI_LENGTH and
BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH have been removed because those
were not used in the code. In fact the client implementation used the
common options for BT_TBS_MAX_URI_LENGTH and
BT_TBS_MAX_PROVIDER_NAME_LENGTH that were moved in this patch to the
common Kconfig section.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-27 17:47:58 -07:00
Fabio Baltieri
e24314f10f include: add more missing zephyr/ prefixes
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 15:20:27 -07:00
Vinayak Kariappa Chettimada
192e2a8f94 Bluetooth: Controller: Fix Data Length Request Cmd parameter checking
Fix Data Length Request CMD parameter checking to not
restrict invalid maximum Tx time values. This addresses
conformance test cases that provide maximum Tx time values
of 2128 us when not supporting Coded PHY in the Controller
implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-27 15:19:06 -07:00
Vinayak Kariappa Chettimada
ad1aae29e5 tests: Bluetooth: EDTT: Fix incorrectly disabled legacy LLCP tests
Fix incorrectly disabled tests that had been passing on
legacy LLCP implementation in the Controller.

Regression introduced in commit f023b5f611 ("Bluetooth:
controller: push topic branch to main").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-27 15:19:06 -07:00
Piotr Pryga
131c089aaf Bluetooth: Controller: llcp: Fix wrong eff time calc if PHY changed
If there is a PHY change on a connection it may happen that effective
RX and TX time changes also. That change is applied after an instant.

Implemented handling of effective time calculation is based on the
maximum PDU length, new PHY and local (default) maximum TX or RX time.

The maximum TX value is set to default one that corresponds to PHY 1M
during the Controller initialization. It can be updated by host to other
value. By default Zephyr Host updates it to max possible TX time for all
supported PHYs. If PHY CODED is enabled, it is the longest possible TX
duration 17040 us.

The maximum RX value is set to default during connection creation.
In case of use of legacy advertising, the value is also related with
PHY 1M. It can be updated by data length extension procedure.

If the maximum RX value is set to some value and there is a change
of a PHY to one that requires more time to send a PDU with the same
length, then the maximum RX value is wrongly calculated.

Function pu_calc_eff_time returns a value that is the default_time
argument. The problem is that the default_time should be adjusted
to new maximum RX time required for a new PHY.

To solve that there should be an evaluation of a new maximum RX and
TX time based on new PHY.

The commit adds missing evaluation.

The problem occurred in DF tests that check collision mitigation
between PHY update control procedure and CTE request control procedure.

There was missing CONFIG_BT_CTLR_PHY_CODED option in CTE request
unit tests. The code was working because the ULL implementation of
PHY change control procedure does not verify if PHY CODED is supported.

When missing support was enabled, tests showed wrong evaluation of
maximum RX time. It also unveiled error in CTE request unit tests
implementation. The default_tx_time was set to wrong value 2120 us
as if PHY CODED was not supported. To fix it, the value was changed
to PDU_DC_PAYLOAD_TIME_MAX_CODED.

There was also added a mock for a feature exchange procedure done
during unit tests setup step. That allows to correctly calculate
maximum TX time by ull_dle_max_time_get function.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-26 16:29:10 +02:00
Vinayak Kariappa Chettimada
59eef60665 Bluetooth: Controller: Fix filter accept list and privacy default
Fix filter accept list and privacy feature Kconfig default
based on whether host has them enabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-26 12:26:43 +02:00
Andries Kruithof
c2e07a304b Bluetooth: controller: llcp: send correct collision code
Upon collision either the error code for different procedure
collision or same procedure collision must be transmitted,
which is fixed in this PR. Previously always the error code
for same procedure collision was sent

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2022-05-20 10:29:46 +02:00
Piotr Pryga
b9dcc3d4e4 tests: Bluetooth: df: Add missing conn handle assignment
There was missing assignment to a global variable that stores
connection handle. The value was always the same, hence it test
were not failing. The value was passed over from setup state
done for other tests. This change makes sure there is always
correct handle stored in global variable.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
5922b211c3 tests: Bluetooth: df: Add missing peer supported feature information
There was missing information about supported CTE response feature
by peer device. That caused a test_set_conn_cte_req_enable to fail.
The test expected that peer device supprots CTE response.

The missing information is added in a common code responsible for
connection object preparation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
f0e456dc50 tests: Bluetooth: df: Fix wrong max antenna switch pattern len config
Due to change in Kconfig CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN
the Kconfigs in tests were wrong and tests were not building.
The commit sets the max antenna switch pattern length to actual
maximum value.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
f35b22a541 tests: Bluetooth: llcp: cte_req: remove invalid rsp test
There is a test that verifies a behavior of CTE request control
procedure if receives LL_UNKNOWN_RSP. The expected behavior
is to terminate connection if that is response handling is
not implemented by a command. Other unexpected responses are
treated as new remote control procedures.

The CTE request has implemented handling of LL_UNKNOWN_RSP,
hence this particular test is no longer valid.

There is still open question how to handle other unexpected
reposne PDUs while waiting for LL_CTE_RSP. That is not defined
by BT 5.3. Core specification and not decided by community.

The test is removed to because it fails and blocks CI.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
3664e6ca68 tests: Bluetooth: Add missing NTF release
There were couple of test cases where Host notification object
was not released. The commit adds missing release calls.

Also commnets related with check if RX queue is empty were
changed to describe what is verified then.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
0dfb5fc5c8 tests: Bluetooth: cte_req: Enable not used test case
There was a test case that was never executed. It was not
added to a test suite in test_main. The commit adds the
test case.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Piotr Pryga
d6dc5bd282 tests: Bluetooth: cte_req: Add tests for handling LL_UNKNOWN_RSP
Add test that verify correct behavior of the CTE request procedure
in case of reception of LL_UNKNOWN_RSP PDU from peer device.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-19 13:21:58 +02:00
Vinayak Kariappa Chettimada
f755550ec0 samples: Bluetooth: Remove explicit Ext and Periodic Adv Kconfig enable
Remove the explicit enable of Extended and Periodic
Advertising support in Controller, the feature is no
longer experimental in the Controller and is now enabled
by default when application uses them by enabling as
Host feature.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-16 18:25:14 +02:00
Erik Brockhoff
9498310c53 Bluetooth: controller: Implement cross connection CPR mutual exclusion
Porting mechanism as used in legacy LLCP to refactored CPR.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:40:36 +02:00
Erik Brockhoff
84a8294624 Bluetooth: test: Implementing mechanism to emulate multiple connections
Expanding the test helpers for unit tests to allow for emulation of
multiple connections.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:40:36 +02:00
Emil Gydesen
3f247b212b Bluetooth: ISO: Add Kconfig for ISO central/peripheral
Add two new Kconfigs: BT_ISO_CENTRAL and BT_ISO_PERIPHERAL
that is used to do central or peripheral only builds,
similar to the BT_CENTRAL or BT_PERIPHERAL Kconfigs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-13 12:44:47 -07:00
Anas Nashif
09d565e72c tests: bluetooth: define testcases in yaml file
Define testcases in yaml to workaround inconsistencies in parsing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 12:16:57 -04:00
Mariusz Skamra
b86355b2e6 tests: bsim: Add HAS test for reading of preset list
This adds Read Presets operation bsim test.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-13 08:46:21 -07:00
Mariusz Skamra
305d5bc119 tests: shell: Add shell for HAS client
This adds shell module for HAS client with it's initial functionality.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-13 08:46:21 -07:00
Piotr Pryga
e1c441d4c4 tests: Bluetooth: cte_req: Set missing is_enabled flag
CTE request tests were not working because there was missing
a code that sets conn.llcp.cte_req.is_enabled flag.
If the flag is not set, then the CTE request state machine
comletes its execution immediately as if the request was
disabled by Host in the meantime.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-13 10:25:39 -05:00
Piotr Pryga
e81414d28f Bluetooth: Controller: Fix CTE_REQ disable lock if there is no CTE_RSP
The periodic CTE_REQ disable command, requested by Host, may be locked
until connection is dropped due to missing CTE_RSP from peer device.
That is caused by implementation of CTE_REQ disable and CTE_REQ
control procedure handling.

The procedure is marked as active when CTE request was send to peer
device. It is marked as inactive after completion of the procedure.
That caused locking of CTE disable on a semaphore.

The BT 5.3 Core Spec, Vol 4, Part E, section 7.8.85 says the HCI_LE_-
Connection_CTE_Request_Enable should be considered active on a conne-
ction from when Host successfully issues the command with Enable=0x1
until a command is issued with Enable=0x0 or single LLCP CTE request
has finished (CTE_Request_Interval=0x0). Also there is a clarification
from BT SIG that the command with Enable=0x0 does not affect any
initiated LLCP CTE request. That means Controller is allowed to finish
already started procedure and it is not allowed to start new LLCP CTE
request procedure after completion of the command with Enable=0x0.

Taking that into account, there is no need to synchronize ULL and LLL
in regard of disable the LLCP CTE request while the procedure is
pending. Controller is free to complete the procedure or terminate it.

The change removes all code related with cte_req.is_active, disable
callback and waiting of ULL for LLL to finish the LLCP CTE request.

The ULL will complete the HCI_LE_Connection_Request_Enable with
Enable=0x0 immediately. In case the procedure is disabled in before
the response arrives, then further processing of the response is
dropped and the procedure context released.

The context is not released by the code responsible for disable
handling, to have single place where it is done.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-13 10:25:39 -05:00
Emil Gydesen
83c7baf34a Bluetooth: Audio: Add recv_info to audio recv callback
The audio stream receive callback now contains a
recv_info struct, which contain crucial information
such as timestamps and packet validity.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:28 +02:00
Emil Gydesen
6191a76f55 Bluetooth: Audio: Add _DIR_ infix to BT_AUDIO_SINK/SOURCE
The values represent an enum, and it makes sense for the
enum values to follow the enum type name, so an
_DIR_ infix was added to the values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Emil Gydesen
19d7420f07 Bluetooth: Audio: Standadize the use of enum bt_audio_dir
Many functions and struct fields had the directory/type
value, but named in different ways and stored in different ways.

This change updates all uses of it to use the same name
and type.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Emil Gydesen
6b41e9991d Bluetooth: Audio: Rename enum bt_audio_pac_type
The enum bt_audio_pac_type does not fully
represent the what the value is used for.

The typical use of it is not for just published
audio capabilities (PAC), but rather describes the
type, or direction, of audio endpoints.

For the unicast client, the type/direction is
relative to the unicast server.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Morten Priess
ffc07e0293 tests: bluetooth: Added VS RX data path to ISO test
Verifies ISOAL functionality for VS RX data path by implementing weak
function ll_data_path_sink_create, and implementing sink callbacks.

Test verifies construction of sink and checks that SDUs are emitted in
VS sink implementation.

Test relies on the Nordic synchronous receiver implementation, and is
compiled under CONFIG_BT_CTLR_ISO_VENDOR_DATA_PATH, which is enabled in
the project file.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-05-10 18:55:35 +02:00
Vinayak Kariappa Chettimada
7fff64f65a tests: Bluetooth: bsim: Assign BT_CTLR_ADV_DATA_LEN_MAX value
Assign BT_CTLR_ADV_DATA_LEN_MAX value to 255 to match the
corresponding BT_CTLR_SCAN_DATA_LEN_MAX value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-09 09:28:34 +02:00
Emil Gydesen
5628b29b01 Bluetooth: Audio: broadcast_source_create array of stream pointers
The bt_audio_broadcast_source_create function will now
take an array of stream pointers, instead of an array
of streams. This is to make the API more flexible as
well as more consistent with the unicast API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-09 09:28:14 +02:00
Emil Gydesen
6e60451e09 Bluetooth: Audio: Change array of unicast streams to array of pointers
In bt_audio_unicast_group_create, bt_audio_unicast_group_add_streams
and bt_audio_unicast_group_remove_streams to use an array
of pointers, instead of an array of streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-09 09:28:14 +02:00
Gerard Marull-Paretas
ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Piotr Pryga
41a05e707d tests: Bluetooth: llcp: Add tests to check instant if no PHY change
There were no unit tests that verify if instant value send in
LL_PHY_UPDATE_IND PDU are correct. The commit adds missing tests.

Besides that there is a small update to all ull_cp_phy_update calls,
to improve readability of the code. Magic number was changed to
HOST_INITIATED macro.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-06 11:50:59 +02:00
Morten Priess
112c38e757 tests: bluetooth: Updates for ISOAL unittest
Minor adjustments due to implementation changes.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-05-06 11:32:30 +02:00
Piotr Pryga
fecc193630 tests: Bluetooth: df: Enable refactored LLCPs for df conn test
There was missing kconfig option that enables refactored LLCPs.
That caused build error in Direction Finding connection_cte_tx_params.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-05 14:41:59 -05:00
Piotr Pryga
ccbe5a56e8 tests: Bluetooth: df: Fix ref to renamed ll_scan_set member
The ll_scan_set::per_sync was renamed to ll_scan_set::periodic.
Direction finding connectionless_cte_rx test didn't build.

The commit fixes the issue.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-05 14:41:59 -05:00
Herman Berget
29e3188703 Bluetooth: Tests: Mark test scripts as executable.
The mode change was showing up in the git diff after running all bsim
tests.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-05-05 14:40:21 -05:00
Herman Berget
51dde9e87a Bluetooth: Tests: Reduce simulation time for L2CAP test
The test was running for unnecessarily long.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-05-05 14:40:21 -05:00
Herman Berget
e73d530cb4 Bluetooth: Host: Add test for EATT reconfigure callback
Check that the att_mtu_updated callback is called when receiving a
reconfigure request.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-05-04 10:35:31 +03:00
Emil Gydesen
0ceb27553f Tests: Bluetooth: Audio: Update unicast bsim tests with release procedure
Add the release procedure for the unicast audio tests.
This also run the existing tests multiple times to ensure
that the states are properly changed across multiple
attempts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-28 14:18:11 +02:00
Emil Gydesen
84e923cea3 Bluetooth: Audio: Group and cleanup test steps in unicast client bsim test
Move the test steps into functions for more reusability and
readability.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-28 14:18:11 +02:00
Thomas Ebert Hansen
20cb60ecd2 Bluetooth: controller: Fix central enc termination
Terminate connection with a MIC failure if an unexpected control PDU
is received during the Encryption Start procedure.

Add a greedy option to pdu_is_expected() to make sure the procedure
processes all unexpected control PDU in all cases.

Add unit test inspired by Bluetooth Qualification test
LL/SEC/CEN/BV-14-C,
Central Receiving unexpected PDU during encryption start

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-28 12:55:48 +02:00
Thomas Ebert Hansen
70e38b1cbb Bluetooth: controller: Fix central enc reject
Add support for both LL_REJECT_IND and LL_REJECT_EXT_IND when waiting
for the the response to the LL_ENC_REQ and LL_START_ENC_REQ.

Add unit test to test both LL_REJECT_IND and LL_REJECT_EXT_IND as
responses to LL_ENC_REQ.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-28 12:55:48 +02:00
Thomas Ebert Hansen
268d00623b Bluetooth: controller: Fix periph enc reject
Chose correct rejection PDU based on features supported on remote peer
when rejecting due to missing LTK.

Update unit test setup with faking that a feature exchange procedure
has run.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-28 12:55:48 +02:00
Thomas Ebert Hansen
06feb0202c Bluetooth: controller: Fix periph enc termination
Terminate connection with a MIC failure if an unexpected control PDU
is received during the Encryption Start procedure.

Add unit test inspired by Bluetooth Qualification test
LL/SEC/PER/BI-05-C,
Peripheral Receiving unexpected PDU during encryption start

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-28 12:55:48 +02:00
Szymon Janc
6ac7bda97d tests: Bluetooth: Add test for invalid LLCP PDU sized
This verifies that invalid size PDUs are detected.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-04-28 12:52:57 +02:00
Erik Brockhoff
26f6941048 Bluetooth: controller: using REJECT_IND when EXT_IND was not negotiated
Unless a feature exchange determines support for REJECT_EXT_IND use
REJECT_IND for collision rejection

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-27 10:09:03 +02:00
Erik Brockhoff
06078ee54e Bluetooth: controller: DO TODO, compile out members of struct re. CPR
Compile out misc. members not used when Connection Parameter Request
is not supported.
Implement missing tests re. unsupported features in CU/CPR procedure

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-27 10:09:03 +02:00
Erik Brockhoff
0d015fd212 Bluetooth: test: adding helper to verify CTE_RSP notification
This to remove TODO and improve the CTE unit test

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-27 10:09:03 +02:00
Mariusz Skamra
5bd1c68dee Bluetooth: tests: Add shell build tests for hearing access service
Add entries for HAS builds to testcase list.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-04-27 10:08:56 +02:00
Alexandru Carbuneanu
59dd898c2b test: bsim: Notification EATT test
Increasing the test coverage of notification on EATT bearers.
- test implementation

Signed-off-by: Alexandru Carbuneanu <alexandru.carbuneanu@nordicsemi.no>
2022-04-27 10:08:42 +02:00
Michał Narajowski
54cd46ac68 tests/bluetooth/tester: Refactor Read UUID callback
ATT_READ_BY_TYPE_RSP returns Attribute Data List so handle it in the
application.

This affects GATT/CL/GAR/BV-03-C.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2022-04-26 17:38:53 +02:00
Erik Brockhoff
d8f0c1adf6 Bluetooth: controller: implement connection termination on invalid pdus
When a running procedure receives a REJECT or UNKNOWN_RSP PDU that is
not an expected part of the procedure flow this leads to termination
of the connection

This affects procedures:
CU/CPR, CTE, PHY, PING, DLE, FEX, VEX, CHMU

Unit tests are updated to cover the updated behaviour.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-26 14:06:16 +02:00
Emil Gydesen
a796927961 Bluetooth: Audio: Make PACS location optional
Make the PACS location characteristic optional, and
also optionally writable.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-26 09:00:48 +02:00
Vinayak Kariappa Chettimada
b035a0a2f5 tests: Bluetooth: init: Cover ext. adv without ext. scan filter policy
Update debug project configuration file to cover building of
Bluetooth with Extended Advertising support without Extended
Scan Filter Policy.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-25 11:44:22 -07:00
Herman Berget
3aef3dae02 Bluetooth: Host: Add test for GATT tx complete callback
Checks that the callback given to bt_gatt_notify_cb is called.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-24 19:46:41 +02:00
Herman Berget
23d4788afa Bluetooth: Host: Add more tests for GATT client becoming change-aware
For clients with both a single and multiple ATT channels:
 - Read a characteristic before reading the DB hash and then retrying
 - Read the DB hash and then do the reads
 - Retry the reads without reading the DB hash

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-20 16:10:46 +02:00
Herman Berget
2a5d9d10d1 Bluetooth: Host: Update GATT caching test to encrypt the link
EATT channels shall be encrypted. Without encrypting the link, all
requests will be sent on the fixed ATT channel.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-20 16:10:46 +02:00
Herman Berget
e5004d9261 Bluetooth: Tests: Wait for sync from other devices only
The sync mechanism using Babblesim backchannels picked up self-sent
messages. Use the device number as data to disambiguate messages from
other devices.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-20 16:10:46 +02:00
Asbjørn Sæbø
b0d5db147b Bluetooth: Audio: Media control - pass structs by reference
Changes the media_proxy API to pass structs by reference instead of by
value.

Also pass structs by reference in internal functions in media player
and in media controller test.

Add pointer checks to the public API implementation where
user/application code provides structs by reference.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-04-20 15:51:01 +02:00
Asbjørn Sæbø
fa5b8a1e38 Bluetooth: Audio: MCC - pass structs by reference
Changes the media control client API to pass structs by reference
instead of by value.

Also change internals of test to pass struct by reference.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-04-20 15:51:01 +02:00
Aleksandr Khromykh
83169f51af tests: Bluetooth: Mesh: test of IV index behavior
Testing of IV update, IV recovery and deferring of
the IV update procedure in case of ongoing segmented
transaction.

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2022-04-19 11:47:57 +02:00
Szymon Czapracki
827890c075 Bluetooth: audio: Add initial Hearing Access Service shell
This adds initial shell support for HAS.

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
2022-04-15 10:32:54 -07:00
Tristan Honscheid
aa8f740abf ztest API Migration: bluetooth/l2cap
Migrate the unit tests at `bluetooth/l2cap` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-04-14 09:07:23 +02:00
Tristan Honscheid
7e7855d669 ztest API Migration: bluetooth/at
Migrate the unit tests at `bluetooth/at` to use the new ztest API.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2022-04-14 09:06:57 +02:00
Erik Brockhoff
f056eb516d Bluetooth: controller: Implementing LL param checks for refactored CPR
Now refactored Connection Parameter Request procedure supports
parameter checking, and implements reject_ext_ind on invalid parameters

Updates to TODO description for remaining work

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-12 09:57:43 +02:00
Lingao Meng
37e561f42e Bluetooth: Host: Add choice select whether BT RX
Change CONFIG_BT_RECV_IS_RX_THREAD into a
choice:CONFIG_BT_RECV_CONTEXT with the following options
(names can be discussed further of course):

    CONFIG_BT_RECV_BLOCKING
    CONFIG_BT_RECV_WORKQ_BT
    CONFIG_BT_RECV_WORKQ_SYS

This way users would be able to choose what to run most of
the BLE stack on, they wouldn't be forced to a single model.

We would default to CONFIG_BT_RECV_BLOCKING so that we wouldn't
need to change the system workqueue stack size by default, instead
asking users to do so if they select the CONFIG_BT_RECV_WORKQ_SYS option

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-04-11 10:58:09 +02:00
Mariusz Skamra
e9b40ebc69 Bluetooth: has: Satisfy profile security requirement
This enables Secure Connections pairing (actually disables legacy)
to satisfy security requirements of the Hearing Access Profile.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-04-11 10:23:13 +02:00
Yuval Peress
53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00
Anas Nashif
be5fa636d3 tests: bluetooth: nrf52_bsim requires a special setup
This platform requires a special setup and has its own workflow. Do not
list it as integration platform as it violates the rule of having to be
built which is not possible due to missing environment.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-08 09:31:01 +02:00
Szymon Janc
218225b17a tests/bluetooth/tester: Disable EATT autoconnect
Don't autoconnect EATT as this was confusing PTS and resulted in
multiple tests failures. When needed PTS will connect EATT bearer.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-04-07 19:06:41 +02:00
Herman Berget
811980dc20 Bluetooth: Host: Add test for change-unaware client
Checks that the server returns "Database Out Of Sync" error on two bearers
when the client is change-unaware and returns success after the database
hash has been read.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-07 09:38:26 +02:00
Mariusz Skamra
29f043707f Bluetooth: tests: Add Hearing Access Service bsim tests
This extends the bsim tests with the HAS client/server and server
standalone test cases.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-04-07 09:37:53 +02:00
Lingao Meng
20ff55e234 Bluetooth: host: Optimize L2CAP resource usage
Making sure struct bt_l2cap_chan has absolutely no members related
to dynamic channels.

That way we ensure that there is no overhead for a build where only
fixed channels are used.

It's not enough that the dynamic channel-related members are put behind
ifdefs - they should be completely moved out from the struct definition.

Furthermore, the public l2cap.h header file already has a struct
that's meant to be used for dynamic channels: struct bt_l2cap_le_chan!

However, currently dynamic channel support is a mess - it's a mix
between these two structs. The bt_l2cap_le_chan struct should really
be an extension of the bt_l2cap_chan struct, i.e. the former should
contain as a member the latter.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-04-07 09:37:12 +02:00
Asbjørn Sæbø
285db0dfc7 Bluetooth: Audio: Align BabbleSim simulation lengths with other tests
Use same simulation length for TBS, bass, broadcas and unicast as for
the other tests.  Simulation length must be larger than time-out
value, to give the test a chance to time out.

The time-out value have previosly been aligned for the other tests.
TBS was not done at that time, as it was still being upstreamed.
(Unsure about why bass, unicast and broadcast were not done at the
same time - they may have been in PRs).

See commits f7cd6afb79 and
73f5ffcf4e

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-04-06 11:24:12 +02:00
Yuval Peress
5416abfe5f util: convert wait_for macro to uppercase
This macro conflicts with C++'s std::condition_variable::wait_for
and makes it very difficult to use Zephyr with C++. Replace it with
an all uppercase name which fits the naming standard better.

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-04 09:50:28 -05:00
Thomas Ebert Hansen
fefa83d5ed Bluetooth: controller: Rework procedure pause logic
llcp_lr_pause()/llcp_rr_pause() only pauses currently pending procedures
in their respective request machines, any future initiations are not
paused, thus they are allowed to run, when the opposite was expected.

Change the procedure pause logic into a global pause on the request
machines them self, this is essence what the per-procedure pause
flag was trying to achieve.

Add new query function llcp_?r_ispaused() to not expose the logic behind
the pause functionality.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-04 15:34:09 +02:00
Thomas Ebert Hansen
79092c3cf4 Bluetooth: controller: Rework TX data pause
Change LLCP TX data pause into using mask to allow for pausing from
multiple different sources - but only once per source
(the underlying TX queue still just has an integer counter).

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-04-04 15:34:09 +02:00
Andries Kruithof
b909647d0a Bluetooth: controller: llcp: serialize phy update notifications
The PHY update procedure may trigger a DLE update in certain
situations
When a limited number of rx buffers is available there may not be
enough for doing the phy update and dle update notifications
at once.

Fixes #41788

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-04-04 15:33:59 +02:00
Herman Berget
db3a6e17fa Bluetooth: Host: Add test for autoconnection of EATT channels
Checks that CONFIG_BT_EATT_MAX EATT channels are created automatically
after connection.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-04 14:22:22 +02:00
Herman Berget
bc6501b611 Bluetooth: Host: Move common bsim test code
Much of the test code will be the same for multiple tests, so move it to
a common file.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-04 14:22:22 +02:00
Herman Berget
e4b6407596 Bluetooth: Host: Update connection test to use bt_eatt_count
The test now uses the public bt_eatt_count function to wait until the
expected number of EATT channels are connected.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-04 14:22:22 +02:00
Herman Berget
101a9a7525 Bluetooth: Host: Automatically create EATT channels on connection
If the Kconfig BT_EATT_AUTO_CONNECT is enabled (on by default), the
host will try to connect BT_EATT_MAX EATT channels when a connection
to a peer is established.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-04-04 14:22:22 +02:00
Vinayak Kariappa Chettimada
7b9ef30b53 tests: Bluetooth: bsim: Increase to 250 simultaneous connections.
Increase to 250 simultaneous connections in the BabbleSim
test. Update connection interval to accommodate 250
non-overlapping connections and a scan window. And make the
use of is_disconnecting flag consistent between central and
peripheral sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-04 10:24:34 +02:00
Erik Brockhoff
046ef86e7a bluetooth: controller: optimizing random get in encryption procedure
Utilizing packed location of SKDm/s and IVm/s to only call
csrand_get() once

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-02 15:40:02 +02:00
Erik Brockhoff
e42d453e3e bluetooth: controller: use global ull_conn_event_counter() in procedures
Replace the use of local event_counter() functions with one defined
in ull_conn.c

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-02 15:40:02 +02:00
Erik Brockhoff
0a9b4a41c7 bluetooth: controller: test: removing TODO and un-skip ctrl-hci unittest
No longer skip this test case
Remove TODO re. chmap test
Def'ing out CENTRAL API tests as ull_central is mocked
Fix rssi test case
Fix feature_exchange_wrong_handle test case

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-02 15:40:02 +02:00
Erik Brockhoff
045735787d bluetooth: controller: removing 'no-brainer' TODOs from refactored LLCP
Getting rid of TODOs that are fairly straight forward to resolve
* introduce role checks in ENC API
* Remove ASSERT on re-rx of LL_VERSION_IND, ignore instead
* in tests/.../ctrl_chmu: rename variable and initialize initial ch map
* in tests/.../mock_ctrl/util.c: Changing TODO into FYI
* in tests/.../helper_features.h update mask and remove TODO comment
* in ull_llcp_remote.c: re-order cases in proc_with_instant switch
* in ull_conn_upd.c: PARAM REQ only uses REJECT_EXT_IND
* in ull_llcp_common.c: in CENTRAL on rx of LL_MIN_USED_CHANNELS_IND
     chose to do nothing re. channel map. Update unit test accordingly

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-04-02 15:40:02 +02:00
Vinayak Kariappa Chettimada
cf21a0cdb3 tests: Bluetooth: init: Periodic Advertising ADI support
Add build only tests to cover Periodic Advertising ADI
support in advertising state and in Periodic
Synchronization state.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-01 12:39:37 -05:00
Katarzyna Giadla
681e3a16c7 tests: Change duplicated names of the test cases
Some names of the test cases are duplicated within the project.
This commit contains the proposed names of the test scenarios.

Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
2022-03-30 17:42:01 -04:00
Asbjørn Sæbø
ed2ea2c7df Bluetooth: Audio: Media - truncate strings for notification
Truncate strings being notified to fit the ATT_MTU, to prevent
notifications from not being delivered due to being too long.

For now uses the minimum ATT_MTU, as the MCS does not yet track
connections.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-28 12:46:53 +02:00
Emil Gydesen
a7ed7b7250 Bluetooth: Audio: Make bt_tbs_client_cb const
Add `const` for the bt_tbs_client_cb as it is a singleton
that should not change over time.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Emil Gydesen
7eef8d705f Bluetooth: Audio: Add TBS server and client BSIM tests
Add babblesim tests for the TBS server and client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Emil Gydesen
b32491df11 Bluetooth: Audio: Add Telephone Bearer Client shell module
Add a shell module for the TBS client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Emil Gydesen
500a1792b8 Bluetooth: Audio: Add TBS shell module
Add a shell module for the TBS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Emil Gydesen
9c2cf4ded5 Bluetooth: Host: Add auth_info_cb struct
Add a new callback structure for Bluetooth authentication

This struct is meant to replace the information-only
callbacks in bt_conn_auth_cb. The reason for this is that
due to the nature of bt_conn_auth_cb, it can only be registered
once. To allow mulitple users gain information about pairing
and bond deletions, this new struct is needed.

Samples, tests, etc. are updated to use the new struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:17:18 -07:00
Marek Pieta
cceb3edbee tests: Bluetooth: ctrl_sw_privacy_unit: Add missing definition
Change adds missing CONFIG_BT_CTLR_FAL_SIZE definition to fix build
issue.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2022-03-25 16:13:06 +01:00
Vinayak Kariappa Chettimada
683fc11f3a tests: Bluetooth: Fix ctrl_iso unit test to include dependencies
Fix ctrl_iso ISOAL unit tests to include mockup Kconfig
dependency options.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-25 12:52:11 +01:00
Mariusz Skamra
916a9828a1 Bluetooth: tests: Remove ATT MTU Exchange from VCS and MICS bsim tests
This patch removes the redundant test case step.
Neither VCS/VCP nor MICS/MICP require ATT MTU to be other than default
23 bytes.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-25 10:41:19 +01:00
Mariusz Skamra
6eafc64855 Bluetooth: audio: Enable auto ATT MTU Exchange for BASS and unicast client
This enables automatic MTU exchange for services that require MTU size
bigger than default ATT MTU to operate.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-25 10:41:19 +01:00
Szymon Janc
573c0d59e0 tests/bluetooth/tester: Add support for auto connection establishment
autopts was updated to properly require support for Accept Filter List
in Auto Connection Establishment Procedure related tests. This patch
enabled support for it and adds required BTP support.

This was affecting following qualification test cases:
GAP/CONN/ACEP/BV-03-C
GAP/CONN/ACEP/BV-04-C

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-03-24 10:45:49 +01:00
Asbjørn Sæbø
92b35bea92 Bluetooth: Audio - media - do not use non-default values in settings
Remove some project-specific settings for media, rely on defaults
instead.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-23 12:50:53 +01:00
Asbjørn Sæbø
308390f5af Bluetooth: Audio: MCS config file cleanup
- Rename MCS configs that are only used by MCC to "MCC", add some more
  documentation.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-23 12:50:53 +01:00
Asbjørn Sæbø
29aa654600 Bluetooth: Audio: Media control Kconfig
Add Kconfig file for the media proxy, for high-level media control
configuration.

The media proxy did not have a Kconfig file, it was relying on the
Kconfigs for GATT media control client and server.

The purpose is to unify the media control configurations, to make the
different media control functionalities available separately, and to
separate the high-level media control from the bluetooth media control
server and client.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-23 12:50:53 +01:00
Asbjørn Sæbø
e3a7ed4766 Bluetooth: Audio: Separate Kconfig for MPL
Separate out the Kconfig for the media player.
Also removes some unused MCS configs.

The media player has been using MCS configs, while it should be the
other way around.

Also, this will make it easier to move the media player elsewhere, as
has been discussed.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-23 12:50:53 +01:00
Erik Brockhoff
c2ab404e97 edtt: updating tests list re. refactored LLCP
Updating test lists, commenting out test that fail with refactored LLCP
Introducing refactored LLCP specific test lists for GAP and GATT

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-03-22 12:35:32 +01:00
Tim Sørensen
9312b79b1c edtt: Extend Zephyr EDTT test app with IXIT request/response command
This command is used to obtain 'Implementation eXtra Information for Test'
(IXIT) values that are required to proceed with BT qualification tests.

Signed-off-by: Tim Sørensen <tims@demant.com>
2022-03-22 12:35:32 +01:00
Thomas Ebert Hansen
df732bfb8b tests: Bluetooth: EDTT: Add ISO data support
Implement the following commands:
- CMD_LE_FLUSH_ISO_DATA
- CMD_LE_ISO_DATA_READY
- CMD_LE_ISO_DATA_WRITE
- CMD_LE_ISO_DATA_READ

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-22 12:35:32 +01:00
Nirosharn Amarasinghe
3cdaf72d9d bluetooth: controller: Add ISO-AL TX unframed fragmentation
- Implemented ISO-AL TX interface functions for fragmentation of
  unframed PDUs
- Implemented ISO-AL source construct and its creation for an input
  data path

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-03-21 19:03:56 +01:00
Vinayak Kariappa Chettimada
9b7fb70539 tests: Bluetooth: bsim: Use non-zero SID to catch regressions
Use non-zero SID value so that regressions in use of
Periodic Advertiser List implementation is catch in
testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-21 12:49:45 +01:00
Szymon Janc
e932564f3a tests/bluetooth/tester: Enable security validation for GATT subsciption
This was affecting following qualification test cases:
GAP/SEC/SEM/BV-56-C
GAP/SEC/SEM/BV-57-C
GAP/SEC/SEM/BV-58-C
GAP/SEC/SEM/BV-59-C
GAP/SEC/SEM/BV-60-C
GAP/SEC/SEM/BV-61-C

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-03-21 10:14:53 +01:00
Mariusz Skamra
09b2fe1893 Bluetooth: shell: Add Hearing Access Service
Add Hearing Access Service to Bluetooth shell application.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-21 10:14:15 +01:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Alperen Sener
7dd34ce458 tests: Bluetooth: Mesh: Test secure network beacon intervals
Add tests checking that secure network beacon interval cannot be
less than 10s and not more than 600s for a provisioned node.

Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
2022-03-17 11:36:41 +01:00
Mariusz Skamra
145948efa0 Bluetooth: audio: Remove BT_CODEC_META_CONTEXT_* defines
There are no more context defines specific to metadata, the ones
coming from Assigned Numbers shall be used.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-16 10:25:31 +01:00
Thomas Ebert Hansen
7f4471c84e Bluetooth: controller: Rename local proc ctx config
Rename
BT_CTLR_LLCP_PROC_CTX_BUF_NUM
to
BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
to match naming scheme of
BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-14 11:38:09 +01:00
Thomas Ebert Hansen
33cb9e3433 Bluetooth: controller: Add remote proc ctx pool
Add a separate procedure context pool for remote initiated procedures.
Make it configurable in size by BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM.
Fix all unit tests referring to the amount of free context buffers.

Fixes #41823

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-14 11:38:09 +01:00
Emil Gydesen
18466530ab Bluetooth: PACS: Refactor PAC location read/write
Refactor the PAC location read and write. Instead
of storing the location in the service, the
location is now stored in the application, and
is retrieved by the service via callbacks.

Similarly, if a client writes the location, this
request is being sent to the application.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-11 11:36:19 -08:00
Pavel Vasilyev
30cd0d4338 tests: Bluetooth: Mesh: Throw error code from tx_end to caller
Return error code from tx_end callback to bt_mesh_test_send caller. This
will help to understand where test failed.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-03-11 11:00:30 +01:00
Pavel Vasilyev
8a3f3dc49b tests: Bluetooth: Mesh: Don't fail inside bt_mesh_test_recv
Don't fail inside bt_mesh_test_recv, but return error code instead.
Caller shall check error code and fail.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-03-11 11:00:30 +01:00
Pavel Vasilyev
672f116c6a tests: Bluetooth: Mesh: Don't start provisioning until provisioner ready
Don't start provisioning devices until provisioner is ready.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-03-11 11:00:30 +01:00
Pavel Vasilyev
8ef6b7681f tests: bluetooth: mesh_shell: Increase main thread stack size
Increase main thread stack size so that the sample can be run on
nrf52832 and nrf52840 DKs.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-03-10 14:31:03 -05:00
Emil Gydesen
0d719ba893 Bluetooth: Audio: Add endpoint type to capabilities config cb
The capabilities callback did not provide information about
the type of the endpoint being configured, making it
impossible for the application to determine if it is a
sink or source endpoint.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:07:17 -05:00
Emil Gydesen
b880637231 Bluetooth: Audio: Remove bidirectional audio streams
Audio streams as defined by the BAP spec does not
support bidirectional audio streams. This commit
updates the API and implementation to match that.

The use a bidirectional CIS with 2 audio stream will
be added in a future commit.

This removes the _IN_ and _OUT_ and _INOUT_ QOS
values, as well as the direction of the codec QOS
struct.

To keep direction for internal use, the direction
has been added to the endpoint struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:07:17 -05:00
Emil Gydesen
a1395c17a3 Bluetooth: Audio: Add BASS BSIM tests
Add the BASS babbleism tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:06:44 -05:00
Emil Gydesen
956518a33b Bluetooth: Audio: Add BASS client shell
Add the BASS client shell module.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:06:44 -05:00
Emil Gydesen
dcbd1a555f Bluetooth: Audio: Add BASS shell
Add support for the BASS server shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:06:44 -05:00
Emil Gydesen
e485305b7c Bluetooth: Audio: Fix ordering of array size after array parameter
Make it consistent for audio.h and capabilities.h that the
array size parameter appear after the array parameter.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Emil Gydesen
a01cc054c9 Bluetooth: Audio: Use size_t for audio.h array len arguments
Use size_t instead of uint8_t to describe array lengths.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Emil Gydesen
d64328ebe5 Bluetooth: Audio: Add support for add/rem streams for unicast group
Add a function to add more and remove streams
to and from a unicast group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Andries Kruithof
0927b89540 Bluetooth: tests: Fixup conf to make sure new LLCP is selected
Selecting the new LLCP is a 'choice' in Kconfig, so setting
CONFIG_BT_Ll_SW_LLCP_LEGACY to 'n' does not select the new LLCP
Instead CONFIG_BT_LL_SW_LLCP needs to be set explicitly to 'y'

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-03-10 13:17:50 -05:00
Aleksandr Khromykh
660fa1b5ce tests: Bluetooth: Mesh: add heartbeat publication to bsim test
Extend the existing bsim Heartbeat test
to check the publication callback functionality.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-03-10 13:16:40 -05:00
Herman Berget
0e5d438ee2 Bluetooth: Host: Add test for issue #42306
Checks that only CONFIG_BT_EATT_MAX EATT bearers get connected.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-03-10 13:26:46 +01:00
Emil Gydesen
8924d5c6be tests: Bluetooth: GATT server test add missing bt_conn_ref
Add missing bt_conn_ref for the gatt server test.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-09 15:04:57 +02:00
Emil Gydesen
47f991b29c tests: Bluetooth: Audio: BSIM uniform use of default_conn
Update the Bluetooth Audio babblesim tests to all use
default_conn, and use it correctly.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-09 15:04:57 +02:00
Krzysztof Chruscinski
47ae656cc1 all: Deprecate UTIL_LISTIFY and replace with LISTIFY
UTIL_LISTIFY is deprecated. Replacing it with LISTIFY.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Thomas Ebert Hansen
4b18770145 tests: Bluetooth: Test unsupported LLCP opcodes
Test the rejection (LL_UNKNOWN_RSP) of unsupported remotely initiated
procedures in both the central and peripheral role.

Unsupported opcodes are handled by Kconfig manipulation and removal of
source files.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-07 16:15:54 +01:00
Thomas Ebert Hansen
250075d3dd tests: Bluetooth: Test invalid LLCP opcodes
Test the rejection (LL_UNKNOWN_RSP) of invalid remotely initiated
procedures in both the central and peripheral role.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-07 16:15:54 +01:00
Asbjørn Sæbø
eecd94409c Bluetooth: OTS - Client APIs to have instance as first parameter
Move the instance as the first parameter of the client function calls
and callbacks, for consistency with the server implementation.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
70eefae1d2 Bluetooth: OTS - Merge server and client header files
- Move content of client header file to common header file.
- Rename content from "otc" to "ots_client".
- Remove empty client header file.
- Update users.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
da89dcfbcd Bluetooth: OTC - Move metadata bitfields to common files
Move the metadata request bitfields to the common header files.
This is part of merging the ots_client and ots header files.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
76cf124060 Bluetooth: OTS - rename client files
Rename OTS client files from "otc" to "ots_client".

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
352dd3763e Bluetooth: OTS - join Kconfig for OTS server and client
Merge Kconfig file for OTS server and client.
Rename the client config from _OTC to _OTS_CLIENT

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
69b731d824 Bluetooth: OTC: Rename two functions
Rename functions to follow common pattern (module, action, noun).

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Asbjørn Sæbø
0d6e18a052 Bluetooth: OTC: Move OTC files to OTS folder
Move the OTC files to the OTS folders for further refactoring.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-07 10:47:43 +01:00
Carlo Caione
e3d2306334 tests: bluetooth: controller: s/STACKSIZE/STACK_SIZE/
Otherwise CI complains.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-03-02 13:20:52 +01:00
Nirosharn Amarasinghe
0f8d9b430b tests: bluetooth: controller: Add ISO AL unit test
Ztest based unit test of ISO adaptation layer.
Testing of unframed case, single SDU, recombined from
one and two PDUs.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-03-02 11:22:33 +01:00
Vinayak Kariappa Chettimada
da61751342 tests: Bluetooth: bsim: Test ISO data send
Added implementation to test ISO data send in Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-01 14:54:35 +01:00
Alexandru Carbuneanu
e4df2434c3 tests: bsim: first L2CAP ecred bsim test
First L2CAP ecred bsim test.

Signed-off-by: Alexandru Carbuneanu <alexandru.carbuneanu@nordicsemi.no>
Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
2022-02-28 11:09:42 +01:00
Emil Gydesen
628b54a959 Bluetooth: Audio: Remove ISO disconnected and connected cbs
The callbacks were implemented to notify the application
about the state of the ISO. However, since then, callbacks
such as `started` and `stopped` have been implemented,
and as such the `connected` and `disconnected` callbacks
no longer server any purpose.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-02-28 11:04:37 +01:00
Szymon Janc
0b01cf14e1 tests/bluetooth/tester: Add support for rejecting connection parameters
This is required for GAP/CONN/CPUP/BV-05-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:09:09 -08:00
Szymon Janc
3cbec153b2 tests/bluetooth/tester: Add support for multiple GATT subscriptions
This is required by GATT/CL/GAI/BI-01-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:08:45 -08:00
Szymon Janc
382e53c255 tests/bluetooth/tester: Fix possible buffer overflow
Make sure we have enough space for notification data.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-25 10:08:45 -08:00
Mariusz Skamra
57ad6af3a0 tests: bsim: unicast_server_test: Fix codec specific capabilities
This fixes format of codec specific capabilities in PAC record.

Fixes: #43058
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-02-25 10:05:33 -08:00
Herman Berget
47a7fb8d03 Bluetooth: Host: Add test for EATT connection with encryption
Check that the connection request is retried and succeeds when
CONFIG_BT_EATT_SEC_LEVEL=2.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-02-25 10:04:10 -08:00
Lingao Meng
3efe1e8c05 test: bluetooth: Update Bluetooth Mesh build test
Update project configuration.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-02-24 13:51:09 -08:00
Trond Einar Snekvik
134c0c3562 Bluetooth: Mesh: Re-enable pb_adv_reprovision test
Re-enables the failing test, undoing the change in #43070.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-23 11:35:38 -08:00
Trond Einar Snekvik
b9eda3d939 Bluetooth: Mesh: Reduce number of reprovision runs in test
The pb_adv_reprovision test takes a long time to execute, as it's
running 10 provisioning sessions in a row. Any side effects from the
provisioning process should come into play already on the first
reprovisioning, so we can safely reduce this to only 3 provisioning runs
without losing any test coverage.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-23 11:35:38 -08:00
Trond Einar Snekvik
5aafc8cd0c Bluetooth: Mesh: Increase BSIM test timeout to 5 minutes
The wallclock time timeout of the test execution is limited to let CI
abandon hanging test cases. Increase this timeout to account for
additional tests running in parallel in CI, which has caused enough
resource contention to make CI break the time limit.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-23 11:35:38 -08:00
Vinayak Kariappa Chettimada
6c8ae61bb1 tests: Bluetooth: bsim: ISO Broadcast Channel Map Update Procedure
Updated tests to perform ISO Broadcast Channel Map Update
Procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-02-23 13:16:07 +01:00
Aleksandr Khromykh
5653358825 test: Bluetooth: Mesh: additional model extension checks
This PR add more checks for model extension functionality for BLE Mesh.
It adds checking of:
* Models across multiple elements (should not share subscription lists)
* Sibling models (if models that extend the same model share
  a subscription list)
* Subscription list entry allocation (models within extension list
  use subscription list capacity of each other).

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2022-02-22 10:11:20 -08:00
Andries Kruithof
fefe959c06 Bluetooth: controller: llcp: update CMake version for unittesting
The minimum CMake version required is 3.20.0, but the unittests
for the LLCP controller still referred to 3.13.1 as the minimum

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-02-22 10:09:57 -08:00
Trond Einar Snekvik
c1d5e1fda0 Bluetooth: Mesh: Disable pb_adv_reprovision
pb_adv_reprovision is failing in CI, but the error cannot be reproduced
locally. Disable the test as a hotfix for main, so we can determine the
issue and re-enable the test in a separate PR.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2022-02-22 09:53:41 -05:00
Carles Cufi
4b8f1c04ab kconfig: Rename the ZTEST stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Szymon Janc
c631469539 tests/bluetooth/tester: Allocate L2CAP channel only when needed
This fix leaking channels when autorization or key size are tested.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-22 10:23:33 +01:00
Szymon Janc
4b40915004 test/bluetooth/tester: Don't clear auth requirements on L2CAP server
We have single server but it can accept multiple connections so
keep same requirements for all connection attempts.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2022-02-22 10:23:33 +01:00
Pavel Vasilyev
6bbc1c8e62 tests: Bluetooth: Mesh: Test secure network beacons processing
Add tests checking that:
- invalid beacons are dropped and do not affect beacon interval;
- valid beacons with old Net Keys are either processed or dropped
depending on the Key Refresh phase;

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-02-21 22:10:24 -05:00
Asbjørn Sæbø
34de2af394 Bluetooth: audio - remove BT_AUDIO_DEBUG
Remove the BT_AUDIO_DEBUG Kconfig option.

Given that all the audio modules are guarded by the BT_AUDIO config,
it seems excessive to also have a separate guard for audio module
debug. It is sufficient that this is turned on/off module by module.

Note that the BT_AUDIO_DEBUG was also located in the wrong file - the
babs Kconfig file, not the main Kconfig file.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-02-21 22:03:04 -05:00
Andries Kruithof
dcddfb567f bluetooth: controller: llcp: expand cen and per
The abbreviations cen and per may be confusing, so they are
expanded into central and peripheral

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-02-21 19:43:10 -05:00
Andries Kruithof
2f98f8f7cf Bluetooth: controller: llcp: inclusive naming in unittests
There were some references to slave and master left in the unittests
for the refactored LLCP.
These are changed in respectively peripheral and central

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-02-21 19:43:10 -05:00
Herman Berget
4c980233af Bluetooth: Host: Add L2CAP collision mitigation test
Tests that when a collision happens, the connection attempt is retried
and that it succeeds.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-02-21 19:40:42 -05:00
Andries Kruithof
43ed49c1e6 Bluetooth: tests: edtt: fix buffer overflow error
HCI/GEV/BV-01-C tries to send 255 bytes over HCI, as part of sending
an unknown/unsupported command, but the default buffer size
is 65, which results in a buffer overflow and undefined behaviour.
Instead of crashing hard we now check the buffer length.
In order for EDTT tests to pass we set the buffer size to 255

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2022-02-05 06:19:00 -05:00
Asbjørn Sæbø
73f5ffcf4e Bluetooth: Audio: Fix timeout message in BabbleSim tests
Update the WAIT_TIME definition and timeout-message so that the time
out message actually prints the elapsed time instead of "0".

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-02-04 11:17:08 +01:00
Asbjørn Sæbø
f7cd6afb79 Bluetooth: Audio: Align time-outs in babblesim tests
Increase the simulation lengths in the test scripts (where needed) to
be longer than the WAIT_TIME defined in common.h, so that simulations
will not end before the test has a chance to do proper time out.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-02-04 11:17:08 +01:00
Piotr Pryga
e87172f483 Bluetooth: Controller: llcp: Fix failing UT for version exchange
Test that verifies correct handling of Version exchanged procedure
called twice on the same connection failed. The reason was wrong
number of expected free procedure context objects. It was expected
that there will be one context not released.
That was wrong because the context is released just after the procedure
completes in idle state. The second and following calls to the procedure
do not start any PDU exchange, so the procedure ends immediately.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-02 10:53:51 +01:00
Piotr Pryga
ee4d3acf79 tests: Bluetooth: df: Add CTE REQ expected positive behavior tests
Add expected positive behavior tests for direction fingin in connected
mode.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-02 10:53:51 +01:00
Piotr Pryga
405ee0d04c tests: Bluetooth: df: Fix not building connection CTE req tests
The tests for direction finding connected mode were not building
correclty. There were missing Kconfig options that enable missing
functionality to be tested.
Tests were not failing because there were no expected positive
behavior tests added.
Added changes allow to validate all implemented test cases.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-02 10:53:51 +01:00
Piotr Pryga
c86ca9a3d6 tests: Bluetooth: llcp: Add CTE REQ and PHY change collision tests
To avoid violation of BT 5.3 Core Vol 6, Part B section 5.1.10.1
there was added a command pause mechanism that allows to postpone
handling of CTE REQ if there is pending PHY change procedure or
PHY change if there is pending CTE REQ procedure.

The commit adds unit tests for the functionality.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-02 10:53:51 +01:00
Vinayak Kariappa Chettimada
f759c813bb tests: Bluetooth: Fix missing Scan Max Data for Broadcast Audio test
Fix missing Kconfig value for Scan Max Data in the
Broadcast Audio test.

Regression in commit faa89c779c ("Bluetooth: Controller:
Fix Periodic Adv Report to scan max data length").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-01-31 12:13:08 +01:00
Emil Gydesen
9140a8ac46 Bluetooth: shell: Add LE Audio shell commands
Adds audio.c which covers all the LE Audio shell commands.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
e572fc565f Bluetooth: Audio: Add broadcast audio BSIM tests
Add broadcast babblesim test cases that tests basically
functionality. Due to the lack of ISO support in the
controller, this won't actually start any audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
cf06fa85f2 Bluetooth: Audio: Add BAP broadcast sink support
Add support for the BAP broadcast sink role. This role
allows a device to sync to a broadcast ISO stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
ab87e0a2ba Bluetooth: Audio: Add BAP broadcast source support
Add the BAP broadcast source implementation. This role
allows a device to broadcast ISO data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
5b25c33554 Bluetooth: Audio: Add BAP unicast audio BSIM tests
Add initial babblesim tests for unicast audio.
Due to lack of ISO support in the babblesim, these
won't attempt to actual initate audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
59bafc430f Bluetooth: Audio: Add BAP unicast client support
Add the BAP unicast client implementation. This role
can discover BAP unicast server services and initiate
BAP audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
03862b3db5 Bluetooth: Audio: Add BAP unicast server support
Add the Basic Audio Profile (BAP) unicast server
functionality. This allows a device to act as the
unicast server role, which can accept unicast streams
initiated by a unicast client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
5de473782e Bluetooth: Tests: Fix ctrl iso audio dependency
Change the dependency from BT_AUDIO to ISO.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Thomas Ebert Hansen
520a5b11c7 tests: Bluetooth: bsim: Fix test names
The LL test for LLCP are using the old non-inclusive names.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-01-26 13:10:29 +01:00
Thomas Ebert Hansen
22f8143286 tests: Bluetooth: bsim: Remove unknown tests
Remove unknown tests from the GATT test list.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-01-26 13:10:29 +01:00
Emil Gydesen
1041f0c2ac Bluetooth: GATT: Initial GATT BSIM tests
Adds initial GATT BSIM tests for the client
and server functionality, testing simple
reads and writes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-21 14:39:16 -05:00
Piotr Pryga
4d3985f93c Bluetooth: Controller: Enable PDU CP bit when CTE RX is enabled
The CP bit is read in DF connected mode while interpreting
LL_CTE_RSP PDU, hence it must be available in struct pdu_data
type.

There were missing two Kconfig options in new LLCP tests.
They were reponsbile for disable of CP bit instruct pdu_data.
That caused tests to fail during compilation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 09:30:23 -05:00
Piotr Pryga
b6be9fef1c tests: Bluetooth: Fix failing tests related with direction finding
Fixes build issues for tests in related with CTE REQ and
hci commands.
Fixes issues in unit tests for CTE REQ/RSP control proedures.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 09:30:23 -05:00
Anders Storrø
54271d23e8 Bluetooth: Mesh: Bsim test for LPN terminate cb
Test covering a corner case scenario where the LPN has received a
friend offer, but has not yet established a connection. In this case
the LPN terminate callback should not be triggered if the LPN is
disabled, which is monitored by this test.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2022-01-18 10:41:18 -05:00
Emil Gydesen
ffd4fd571a Bluetooth: CSIS: Merge the two client discovery functions
Merges bt_csis_client_discover and
bt_csis_client_discover_sets, as they should be done
together for the discovery procedure from the CSIP
spec.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
e9703294b1 Bluetooth: CSIS: Rename bt_csis_client_set
Rename struct bt_csis_client_set to
struct bt_csis_client_csis_inst, as that is more descriptive
of the actual content of the struct.

This also avoids the confusion about what a "set" is,
which is clearly not a single instance of CSIS
on a single remote server.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
47e23ab344 Bluetooth: CSIS: Add bt_csis_client_set_info struct
Several APIs worked on the bt_csis_client_set struct,
which not only included information about a set, but
also a reference to a specific CSIS instance.

A specialized struct only for the set information
is more useful in those scenarios.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
3953289fda Bluetooth: CSIS: Modify bt_csis_client_get_lock_state to read all members
Modify bt_csis_client_get_lock_state to be the Ordered Access
procedure, which means that instead of reading a single lock value
on a single device, it will read the lock value for all
set members supplied in the function, and return true if any
of them is locked, or false otherwise.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
f13aa0e059 Bluetooth: CSIS: Remove addr from bt_csis_client_set_member
Remove the addr struct from bt_csis_client_set_member as that
was only used by the upper layers and not the CSIS client
itself, and as such should only reside in the
upper layers.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
f2401ecbe9 Bluetooth: CSIS: Don't expose SIRK type to upper layers
Change how the SIRK is exposed to the upper layers.
The SIRK will always be the unencrypted 16 octet
SIRK now, instead of a struct.

This not only allows us to avoid having a
__packed struct in the API, but also gives a better
API as we don't expose encrypted data to the upper layers.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
061fb633a5 Bluetooth: CSIS: Remove conn from bt_csis_client_lock_changed_cb
The connection pointer can be inferred based on the
set pointer, by using e.g. CONTAINER_OF.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
fa1be6436a Bluetooth: CSIS: Refactor bt_csis_client_discover_sets to use member
Refactor bt_csis_client_discover_sets to use the
bt_csis_client_set_member struct instead of a bt_conn.
The bt_csis_client_set_member represents a remote server
(set member), and make it possible to avoid sending indexes
of instances around instead of bt_csis.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
728f390f65 Bluetooth: CSIS: Remove unused functions and callbacks from csis.h
Remove the lock and release sets functions, as well
as the discover member function as they have been removed
from the implementation a while ago.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Emil Gydesen
2bf89990ee Bluetooth: CSIS: Expose bt_csis to client via bt_csis_client_set_member
Use the bt_csis_client_set_member struct to store the individual
bt_csis client struct. This way they are exposed to the
client application.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-18 10:40:33 -05:00
Anders Storrø
499c4fb1e3 Bluetooth: Mesh: Add LPN-disable BabbleSim test
Adds test to check correct behaviour for disabling
LPN feature.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2022-01-17 15:49:46 -05:00
Morten Priess
7c89f1fe9f Bluetooth: controller: Support for separate ISO RX data path
Provides interface, data structures and demuxing capability for ISO RX
PDU allocation and transport from LLL to HCI.
Uses the RXFIFO composite for simplicity and reduced overhead.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-01-13 10:32:37 +01:00
Herman Berget
6ede31428d Bluetooth: Host: Reassemble extended advertising reports
The host reassembles fragmented advertising reports from the controller.

Non-complete advertising reports from different advertisers may not be
interleaved. If non-complete advertising reports from an advertiser
is received while advertising reports from another advertiser is
reassembled, an error message is logged and the advertising report is
discarded. Future scan results may be incomplete.

Advertising reports from legacy PDUs or complete extended advertising
reports may be interleaved as these do not require reassembly.

If the controller sends more advertising data than fits in the
reassembly buffer, the data is truncated. Further advertising reports
from the advertiser are discarded until the final complete advertising
report is received and discarded.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-01-07 15:35:39 +02:00
Piotr Pryga
26a66ee299 tests: Bluetooth: df: Fix not building unit tests
There were changes done to controller code that cause
tests to do not build and fail during execution.
Changes are related with:
- modified code related with extended advertising ADI
  field handling
- added generic double buffer data structure that is
  used in controller
- moved code that was building only when DF is enabled
- added EVENTS_PHYEND that is not available in nrfbsim
  board

The PR addresses those issues.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-04 09:10:05 -05:00
Piotr Pryga
578902960d Bluetooth: Controller: Add CTE recv and sample in connected mode
In connected mode when Receiving Constant Tone Extensions feature
is enabled, controller shall be able to receive CTE in any
data channel packet.
The commit adds required changes to allow receive of CTE for
all data channel packets in peripheral role.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-04 09:10:05 -05:00
Alberto Escolar Piedras
8baee12f71 tests: bsim: Make all tests scripts executable
Test scripts should be executable.
The regression system will work around it by making them executable
if they are not, but that causes changes to the local tree.
Fix it instead so people doesn't get local changes when running regression.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2022-01-04 11:06:19 +01:00
Alberto Escolar Piedras
2e3acec199 tests: bsim: Use different sim_ids for different tests
Different tests should use different simulation ids so they don't
collide with each other at random when run in parallel.
Fix it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2022-01-04 11:06:19 +01:00
Aleksandr Khromykh
18569edbea bsim: test: fix missing warnings in bsim test build system
bsim test build system hides compile warnings.
The problem had been fixed before but due to a regression came again.
This commit adds extra cc flags to prevent this.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-01-03 20:35:20 +01:00
Vinayak Kariappa Chettimada
48f4eb9a4e tests: Bluetooth: bsim: Test updated to use Periodic Sync Recv Enable
Updated the ISO BabbleSim test to use Periodic Sync Receive
enable command to disable Periodic Sync reports and yet
receive the BIGInfo report.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-12-29 18:01:17 +01:00
Pavel Vasilyev
b1d2bb0b47 tests: Bluetooth: Mesh: Add tests to cover message publication
This commit adds 3 tests that check:
- Publish period state
- Publish retransmit count and interval steps states
- Canceling periodic publication and publication retransmission

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-12-23 14:57:54 +01:00
Aleksandr Khromykh
0350e38d62 test: Bluetooth: Mesh: fix racing between bsim devices in provisioning test
Bsim devices work asynchronously before access to Phy.
Interprocess OOB communication might be broken because of this.
PR adds synchronization for devices. Drift is 100ms between them.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-12-23 11:20:08 +01:00
Andries Kruithof
fca65843b9 Bluetooth: controller: inclusive naming for EDTT
Update the testnames according to the Bluetooth 5.3 specification
for inclusive naming

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-12-22 17:49:36 +01:00
Piotr Pryga
c0889b0cc1 tests: Bluetooth: df: remove duplicated code from CTE req tests
There is a common implementation of connection handling code
that may be shared by tests: connection_cte_req and connection_cte-
tx_params.
This commit removes code implemented in common.c and common.h
files. The same code is currently available in ../df/common/
directory.
All calls were updated to use function from common implementation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-12-22 12:18:17 +01:00
Piotr Pryga
d4b0cbee8e tests: Bluetooth: df: Add tests for set conn CTE TX params
Add unit tests for HCI command HCI_LE_Set_Connection_CTE_-
Transmit_Parameters.

Part of a code that was available in df/connection_cte_req/common.c,
related with artificial handling of connection, is moved to
df/common/bt_conn_common.c.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-12-22 12:18:17 +01:00
Henrik Brix Andersen
b3c1eea269 Revert "tests: Bluetooth: Mesh: Add tests to cover message publication"
This reverts commit 9b99ab6896.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-21 07:46:26 +01:00
Pavel Vasilyev
9b99ab6896 tests: Bluetooth: Mesh: Add tests to cover message publication
This commit adds 3 tests that check:
- Publish period state
- Publish retransmit count and interval steps states
- Canceling periodic publication and publication retransmission

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-12-20 17:42:24 +01:00
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
Szymon Janc
d0b02cde2c tests: bluetooth: tester: Fix NULL pointer dereference in error path
bt_conn_unref() requires valid conn pointer but could be called with
NULL in case valid connection was not found in disconnect_eatt_chans().

Fixes #39851

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-10-29 10:12:55 -04:00
Yuval Peress
723bb46269 tests: BT: migrate connectionless tx to ztest register
Migrating the test suites to the register functionality allows the
main.c source to focus on the state of the system instead of "which"
test to run. In this example, test_main() now calls:
* ut_bt_setup() and updates the state
* common_create_adv_set(), updates the state, and notifies the
  registered tests that the state has been updated which would trigger
  a run.
* common_delete_adv_set(), updates the state, and again notifies
  the registered tests that the state has been updated.

Signed-off-by: Yuval Peress <peress@chromium.org>
2021-10-28 16:57:51 -04:00
Anas Nashif
59648f9001 tests: bluetooth: tester: reference autoPTS in README
Reference autoPTS documentation with more details on how to use this
test.

Fixes #1251

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-10-25 08:02:58 -04:00
Szymon Janc
349f9dfc71 tests: bluetooth: tester: Fix memory corruption in reconfigured_cb
Pass proper length when memsetting struct.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-10-25 12:23:14 +03:00
Jacob Siverskog
046f29a8cb Bluetooth: ATT: Fix typo in defines
Fix typo in ATT first/last attribute defines.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-10-23 20:39:36 -04:00
Ilhan Ates
69abe7de8c Bluetooth: tester: Add directed adv support
GAP/CONN/DCON/BV-01-C test case needs directed advertising
support.

Signed-off-by: Ilhan Ates <ilhan.ates@nordicsemi.no>
2021-10-22 16:38:13 +02:00
Szymon Janc
d7b37d8cc8 tests: bluetooth: tester: Increase ATT prepare write buffers count
GATT/SR/GAW/BV-10-C requires more buffers as it tests nested long
writes.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-10-22 16:37:38 +02:00
Szymon Janc
8a780680ad tests: bluetooth: tester: Add support for security_changed callback
This allows to track security levels and check for lost bond of peer
peripherals.

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

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-10-22 16:37:23 +02:00
Emil Gydesen
5c40c8005c Bluetooth: shell: Add audio infix for audio tests
Rename shell testcases from bluetooth.shell.*
to bluetooth.shell.audio.*

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-22 11:30:56 +02:00
Emil Gydesen
f49d69ee00 Bluetooth: shell: Move LE audio configuration to a new file
Move the LE audio configuration to a new audio.conf file
in the bluetooth shell project, similar to the mesh.conf
file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-22 11:30:56 +02:00
Szymon Janc
17c01328b1 tests: bluetooth: tester: Add support for L2CAP channels options
This allows for better control over IUT behaviour by Upper Tester.

PTS and TS require inconsistent behaviour in terms of how IUT should
return credits. Some tests require return on explicit UT request and
some require that IUT returns credits autonomously.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-10-18 12:44:46 +02:00
Aleksandr Khromykh
bd925abead test: Bluetooth: Mesh: subscription tree of extended models
PR adds testing of subscription of the tree of extended models.
Extended models should share subscription list among them.

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2021-10-13 10:12:11 -04:00
Piotr Pryga
b61101144a tests: Bluetooth: bsim_test_iso: Change wait time in BIG receiver
The receiver and transmitter in the test are synchronized by
use of sleep functions. The change in handling of periodic
advertising synchronized event caused missmach in waiting
times. Receiver is notified about established synchronization
later that it was in the past. Due to that the wait for end
of transmitter operation was too long.

Temporary fix for the problem is decrease of receiver sleep
time by one periodic advertising interval.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-10-07 21:36:55 -04:00
Michał Narajowski
5d0f2fbc1d tests: bluetooth: tester: Adjust Segment Retransmit Count
In test cases MESH/NODE/TNPT/BV-04-C and MESH/NODE/TNPT/BI-01-C
the PTS is sending incomplete Seg Ack 3 times and in some cases we run
out of retransmit attempts before PTS sends complete Seg Ack. As a
workaround, increase Segment Retransmit Count to improve stability of
these tests.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-10-07 15:45:22 -04:00
Michał Narajowski
4cb935f264 tests: bluetooth: tester: Set Config Client timeout to larger value
In some scenarios when there is a need for multiple re-transmissions of
segmented messages the default value of 2 seconds may be not enough.

In my experience this improves stability of Configuration Client tests
involving multiple PTS instances.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-10-06 22:20:22 -04:00
Vinayak Kariappa Chettimada
4f04f3d979 tests: Bluetooth: mesh: Remove explicit disable of CSA#2
Remove explicit disable of Channel Selection Algorithm #2
in the mesh tests that use Extended Advertising.

Fixes #39188.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-06 11:36:12 -05:00
Anders Storrø
4e15da8332 bsim: test: Add test for heartbeat sub API
Adds test for verifying correct behaviour for heartbeat subscription
API.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2021-10-05 19:23:18 -04:00
Szymon Janc
ab6c090d74 tests: bluetooth: tester: Add support for L2CAP channel reconfiguration
This allows UT to reconfigure MTU of a channel and get notfied when
channel configuration changed.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-10-04 11:05:03 +02:00
Vinayak Kariappa Chettimada
ac1e99f0e5 tests: Bluetooth: bsim: Updated advx tests with periodic adv list
Updated the bsim_bt_advx test with use of periodic
advertiser list.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-01 21:48:51 +02:00
Vinayak Kariappa Chettimada
bf01d55107 Bluetooth: Controller: Implement Periodic Advertiser List
Implement support for Periodic Advertiser List to be used
in LE Periodic Advertising Create Sync command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-01 21:48:51 +02:00
Piotr Pryga
982743b765 tests: Bluetooth: df: Add test to verify correctness of relase of PDUs
Add unit tests that will ensure the CTE disable operation does not
cause breaking of LLL operations by too early release of chained PDUs.
The tests verify if numbers of PDUs in free PDUs fifo and free PDUs
memory pool are correct.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-10-01 14:32:49 -04:00
Szymon Janc
6cfc6fa8e1 tests: bluetooth: tester: Add support for L2CAP Credits command
This allows IUT to return credits on specified L2CAP channel when
requested by Upper Tester.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-09-30 08:28:34 -04:00
Vinayak Kariappa Chettimada
273cf4687b tests: Bluetooth: bsim: Use separate DUT and TST EDTT builds
Use separate DUT and TST builds in EDTT HCI tests so that
the tester can send Data Length Requests with txOctets and
maxTxTime as required by the test specification. TST build
has HCI parameter checks disabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-30 11:47:57 +02:00
Aleksandr Khromykh
5130db3005 test: Bluetooth: Mesh: OOB public key provisioning
PR includes test that combines and checks OOB public key
provisioning with all possible OOB authentications
and OOB public key provisioning without auithentication.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-29 15:34:13 -04:00
Aleksandr Khromykh
68d8a263b6 test: Bluetooth: Mesh: add provisioning with OOB auth tests
BubbleSim tests that check provisioning with all possible (from spec)
OOB authentications

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-28 19:54:00 -04:00
Aleksandr Khromykh
009ecdfda0 test: Bluetooth: Mesh: clean up warnings in Mesh scanner test
Clean up warnings in the BubbleSim Mesh scanner test.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-28 19:54:00 -04:00
Agata Ponitka
bd8b9ee830 Bluetooth: Tester: Add the OOB Authentication method
Adding support for automatic testing OOB Authentication method.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-09-28 11:44:33 +02:00
Aleksandr Khromykh
0a40c69b21 bsim: test: fix missing of warnings in bsim tests build system
bsim test build system hides compile warnings.
This commit adds extra cc flags to prevent this.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-22 09:15:03 -04:00
Carles Cufi
947b38ac0a Bluetooth: controller: Replace slave with peripheral
Replace the old slave term with the new peripheral
one from the Bluetooth spec v5.3.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-21 13:01:29 +02:00
Carles Cufi
76bf881e42 Bluetooth: controller: Replace whitelist with FAL
Replace the old whitelist-related terms with the new filter accept list
one from the Bluetooth spec v5.3.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-21 13:01:29 +02:00
Carles Cufi
e2f85b1124 Bluetooth: tests: Align with terms in v5.3 spec
Align with the new inclusive naming terms in the v5.3 spec in the
Bluetooth tests.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-20 20:01:32 +02:00
Ludvig Samuelsen Jordet
cf3f219441 Bluetooth: Mesh: Test reprovisioning
This adds tests for config client reset and reprovisioning of a node.

Signed-off-by: Ludvig Samuelsen Jordet <ludvig.jordet@nordicsemi.no>
2021-09-16 13:25:46 -04:00
Szymon Janc
24007fb2ad tests: bluetooth: tester: Fix build with EATT disabled
For ECFC L2CAP test we user overlay with disabled EATT and
bt_eatt_disconnect_one() is available only with EATT enabled.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-09-15 16:58:06 +02:00
Carles Cufi
6de4747979 Bluetooth: Update terms in public API to spec v5.3
The Bluetooth Core Specification, version 5.3, has introduced multiple
changes to several widely-used terms in order to make them inclusive.
Update the public API to reflect this, excluding hci.h, which will be
done in a subsequent commit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-15 14:02:50 +03:00
Krzysztof Kopyściński
fa2f83bf8b Bluetooth: host: add testing API (disconnect one EATT channel)
To test fallback to remaining bearers PTS might request IUT to
disconnect one of the connected EATT channels, while the others remain
intact. Test function must be added, because we cannot create L2CAP
server on EATT PSM and manage this server as normal and have EATT
enabled at same time.

This is affecting GATT/SR/GAW/BV-14-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-09-09 10:30:31 +02:00
Krzysztof Kopyściński
7a687b8a5d Tests: bluetooth: tester: accomodate L2CAP connect commant to BTP change
BTP change extended L2CAP_CONNECT command by ECFC flag, which determines
which connection procedure is used (non-enhanced or ecred). Now, only
this flag determines the procedure used, not number of requested
channels.

This was affecting L2CAP/ECFC/BV-25-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-09-09 10:28:10 +02:00
Emil Gydesen
eaf6cf745d Bluetooth: Audio: Fix vcs_client_test duplicate conn_callbacks
The conn_callbacks was duplicated in the file, due to a missing
delete when BT_CONN_CB_DEFINE was introduced.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-07 09:56:35 +02:00
Krzysztof Kopyściński
bd068e475d Tests: bluetooth: tester: find connection for get_attr_val_rp
To check security of connection  in read_value() we need to actually
pass connection not NULL.

This is affecting GATT/SR/GAR/BI-11-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-09-06 09:23:06 -04:00
Piotr Pryga
4e43295d22 tests: Bluetooth: df: fix compilation error in per adv chain tests
There was a change in parameters list of function ull_adv_sync_pdu_-
alloc. There was a call in commmon.c file in connectionless_cte_chains
unit tests with use of former parameters list. That caused a compilation
error.

The commit fixes the compilation issue.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-09-04 10:54:36 -04:00
Trond Einar Snekvik
2435419416 tests: bluetooth: mesh: Remove dead code
Removes all the dead ternary expressions in the mesh bluetooth tester.

Fixes #37983.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-08-31 11:03:06 -04:00
Michał Narajowski
a614fc02ad Bluetooth: tester: Configure L2CAP Connection Response
Some test cases require the IUT to respond with a certain error. To get
the stack to return this error to PTS the application needs to be
configured specifically for this test case.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-08-30 14:40:59 +02:00
Emil Gydesen
f0e1823846 Bluetooth: bsim: Update bsim_test_iso to use defined broadcast code size
Use the #define for the broadcast code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Vinayak Kariappa Chettimada
3f14c4602c tests: Bluetooth: bsim: Include Periodic Adv Chan Map Update Indication
Include Periodic Advertising Channel Map Update Indication
in the BabbleSim test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-27 09:34:16 -04:00
Pavel Vasilyev
cd294c12c3 tests: Bluetooth: Mesh: Verify that all stored mesh entries removed
This ensures that all mesh settings were removed from persistent storage
after node reset.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-26 14:04:38 -04:00
Pavel Vasilyev
f82086fff5 tests: Bluetooth: Mesh: Use meaningful names in persistent test cfg
This should improve code readability.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-26 14:04:38 -04:00
Pavel Vasilyev
7ffefccc4f tests: Bluetooth: Mesh: Test node reprovisioning with persistent storage
This commit adds a test checking that a node removes all data from
persistent storage after being unprovisioned.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-26 14:04:38 -04:00
Pavel Vasilyev
79af744dc1 tests: Bluetooth: Mesh: Make mesh initialization function generic
This commit makes this small piece of code reusable in other tests.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-26 14:04:38 -04:00
Emil Gydesen
f79b39c104 Bluetooth: shell: Remove accidentally added debug config
Remove two debug config values from the BT shell that
was accidentally merged.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 13:42:22 -04:00
Emil Gydesen
51f2022f7b Bluetooth: Audio: Add initial server values in bt_vcs_register_param
Add support for setting initial values in bt_vcs_register_param
when registering a VCS service

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:13:58 -04:00
Vinayak Kariappa Chettimada
6c9a54c533 tests: Bluetooth: bsim: Minor re-arrange Kconfig in prj file
Re-arrange Host Kconfigs to group about Controller Kconfigs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-24 07:33:48 -04:00
Emil Gydesen
c47dae8c6d Bluetooth: ISO: Update connected ISO API
Update the connected ISO API to be more
similar to the broadcast ISO API as well
as the HCI spec.

This updated API allows for more flexibility
and will better support scenarios such as true
wireless setup, as ISO channels and connections
are more independent now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Alberto Escolar Piedras
9249609071 boards: bsim: fix bug with single settings file for few bsim devices
Reapply the part of 4b5cd92312
that added new functionality/fixed the actual issues described
in the original commit message withtout the further cleanup.

There was also some cross-commit content from
2b91ebe16e
as part of the cleanup in test_friendship.c which is also included.
+ added cleanup also to test_provision.c on request from Aleksandr.

Original commit msg:
-----------
Multiple bsim devices cannot store individual settings
with the existing settings backend for bsim.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
-----------

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2021-08-24 12:37:51 +02:00
Alberto Escolar Piedras
26d7d7c8c8 Revert "boards: bsim: fix bug with single settings file for few bsim devices"
This reverts commit 4b5cd92312.

global_device_nbr is used by many bsim tests.
And many of those are now off tree in preparation of the LE-Audio
work. Removing this for cleanliness now is not nice on others.
=> Revert

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2021-08-24 12:37:51 +02:00
Aleksandr Khromykh
2b91ebe16e test: Bluetooth: Mesh: test replay attack on ble mesh rpc
The test checks the resistance of ble mesh stack to replay attack.
Replay protection cache shall store seqAuth last frames.
Device shall filter out such messages on the transport layer.
Power on\off sequence shouldn't impact that
since replay protection cache is stored in settings subsystem.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-08-23 18:55:53 -04:00
Aleksandr Khromykh
4b5cd92312 boards: bsim: fix bug with single settings file for few bsim devices
Multiple bsim devices cannot store individual settings
with the existing settings backend for bsim.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-08-23 18:55:53 -04:00
Johann Fischer
72be0ed332 tests: bluetooth: shell: update shell over CDC ACM UART configuration
Add usb.overlay which contains chosen node and cdc-acm-uart node.
Update USB configuration and test case.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Krzysztof Kopyściński
c94e53c9f5 Tests: bluetooth: tester: increase CONFIG_BT_ATT_PREPARE_COUNT
This is required for GATT/SR/GAW/BV-14-C

signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-08-21 21:34:08 -04:00
Ingar Kulbrandstad
2130e2b549 Bluetooth: Mesh: Test scanner when receiving invalid packets.
The scanner should not cause a device to crash or malfunction
if invalid packets are received.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2021-08-20 19:00:08 -04:00
Trond Einar Snekvik
705e056e4c test: Bluetooth Mesh: Catch friendship unseg app decrypt error
Increases the friendship unseg app payload size in the friend message
test and enables asserts to test the error described in #37519.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-08-20 12:49:28 +02:00
Torsten Rasmussen
1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Omkar Kulkarni
3dd61cfc5b bluetooth: mesh: Add test to check IVU counter
Adds a test to check value of the IV Update
counter at the time of provisioning based on
the status of IV Update flag. Also ensures that
the counter is reset if the mesh stack state
is reset.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2021-08-19 10:19:43 -04:00
Omkar Kulkarni
f868ca3497 bluetooth: mesh: Fix IVU duration counter update
When device is first provisioned with IV Update
flag is set to 0, it should wait for minimum of
96 hours before going into IV Update In Progress
state. Such limit does not apply, if device is
provisioned with IV Update flag is set to 1.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2021-08-19 10:19:43 -04:00
Pavel Vasilyev
75a51e9c50 Bluetooth: Mesh: Check access layer persistence storage
This commit tests persistence storage for access layer:
- Model publication
- Model subscription
- Model app keys binding
- Model data

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-19 10:19:02 -04:00
Pavel Vasilyev
0e647ee14f Bluetooth: Mesh: Fix overwriting existing entries in test backend
This commits fixes an issue where an existing entry in a settings file
causes settings file corruption when storing new value.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-08-19 10:19:02 -04:00
Piotr Pryga
5a4e0dca31 tests: Bluetooth: df: Add tests for enable CTE req and sampling HCI cmd
Add unit tests for HCI commands:
- HCI_LE_Set_Connection_CTE_Receive_Parameters,
- HCI_LE_Connection_CTE_Request_Enable.
Tests validate current implementation of commands handling in HCI/ULL.
Handling of the HCI_LE_Connection_CTE_Request_Enable is not complete,
thus tests don't validate positive behavior the functions.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-18 20:11:10 -04:00
Vinayak Kariappa Chettimada
13d9b5c2ed tests: Bluetooth: bsim: Add a little wait for connection establishment
Add a little wait before completing the test to ensure both
central and peripheral side of the test completes before the
test exits.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-17 17:36:19 +02:00
Vinayak Kariappa Chettimada
cd8735b36a tests: Bluetooth: bsim: Verify Extended Active Scanning
Added tests to verify Extended Active Scanning support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-17 17:36:19 +02:00
Trond Einar Snekvik
d0bf124837 tests: Bluetooth Mesh: Use unique names for all simulations
Adds a low_lat name to the duplicated low_lat babblesim tests to allow
them to run in parallel with their counter parts.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-08-17 06:04:08 -04:00
Vinayak Kariappa Chettimada
7ade4a2321 tests: Bluetooth: bsim: Use wait lower than advertising interval
Fix failure due to advertising report count being
incremented faster than the wait loop that had longer delay
compared to the received interval of the advertising report.

Fixes #37652.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-13 10:58:21 +02:00
Krzysztof Kopyściński
00bfac00ae Bluetooth: gatt: Add option to read multiple without variable length
Currently, with EATT enabled, when bt_gatt_read is called with multiple
handles first it'll try to use gatt_read_mult_vl, and if it fails
gatt_read_mult will be used to try again. Add option to skip
the gatt_read_mult_vl and use gatt_read_mult right away. This is needed
by tests that expect BT_ATT_OP_READ_MULT_REQ but support variable
lenght, thus don't return BT_ATT_ERR_NOT_SUPPORTED.

Removed fallback from read multiple vl to read multiple on
BT_ATT_ERR_NOT_SUPPORTED error.

This was affecting:
GATT/CL/GAR/BV-05-C, GATT/CL/GAR/BI-18-C, GATT/CL/GAR/BI-19-C,
GATT/CL/GAR/BI-20-C, GATT/CL/GAR/BI-21-C, GATT/CL/GAR/BI-22-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-08-12 11:07:08 -04:00
Lingao Meng
8e1682d1ea samples: conn_cb replace to const zsector
It is more efficient and saves part of RAM
by replacing it with static one dynamically.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-11 13:42:28 +02:00
Vinayak Kariappa Chettimada
f1f40b6675 tests: Bluetooth: bsim: Test random address change on adv re-enable
Verify that random address is changed when enabling an
already enabled advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
df3498bb75 tests: Bluetooth: init: Cover strict adv and scan enable/disable
Cover the strict advertising and scanning enable/disable
debug usecase.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Vinayak Kariappa Chettimada
cd344fe24c tests: Bluetooth: bsim: test advertising re-enable
Test advertising re-enable to cover reset of event counter,
duration and the number of events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-11 07:32:59 -04:00
Piotr Pryga
86c4d9001b tests: Bluetooth: df: Add tests for use of CTE in per adv chains
Bluetooth host may request to send more than one CTE in
connectionless mode. That is relized by periodic advertising
chained PDUs.
To check correctness of implementation of such functionality
new unit tests were added.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-07 20:50:03 -04:00
Lingao Meng
ce40fa434f tester: bluetooth: gatt: fix null pointer case CASE failed
GATT/SR/GAD/BV-03-C will read attr value, but we parse NULL
from `attr->read` which point to `attr_read` function.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-05 17:34:57 +02:00
Johann Fischer
3240e0cc51 tests: remove USB configuration option
Remove USB configuration option, replace it where necessary
with USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Lingao Meng
36a385386a Tester: Bluetooth: Mesh: Rename function avoiding conflict
Since `write` or `read` belong with system standard API, so rename
this to avoiding conflict.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-03 10:21:16 -04:00
Lingao Meng
3911ce8d40 Bluetooth: Mesh: Mark as internal function
Marks funcs:`show_faults` as internal, avoiding conflict.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-03 10:21:16 -04:00
Krzysztof Kopyściński
c8a196c65b Tests: Bluetooth: Tester: enable EATT by default
Since Zephyr supports EATT, which is reflected in ICS GATT_2_3
(Enhanced ATT bearer Attribute Protocol Supported (L2CAP fixed EATT PSM
supported) and GATT_2_3a (Enhanced ATT bearer supported over LE)
in GATT tests preamble 4.2.1.4 (Setup EATT Bearer over LE) is used
instead of 4.2.1.2 (Setup ATT Bearer over LE). Let's enable
EATT by default, allowing to run almost all GATT tests without
additional overlay.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-08-03 13:56:41 +02:00
Omkar Kulkarni
6c41bf6135 bsim_bt: mesh: persistence storage testing
Adds support for testing of persistence storage
for mesh Babblesim tests. Adds a sample test
for testing provisioning data.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2021-07-29 13:29:03 +02:00
Vinayak Kariappa Chettimada
194a9674b8 tests: Bluetooth: bsim: Verify AD Data backup
Verify that AD Data when switching to Legacy Directed, and
restore it when switching back to Legacy Non-Directed
Advertising mode.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-26 15:29:55 +02:00
Kumar Gala
57690f566e tests: bluetooth: shell: Limit build only tests to native_posix
Some recent updates to the bluetooth shell test cause build failures
in CI for platforms that don't have a uart that supports interrupts
(ie ip_k66f or xmc45_relax_kit).

As these tests are build-only a single platform is sufficient to get
coverage and utilize platform_allow to limit to just one board target
intead of integration_platforms.  As this will limit to the single
platform for both PR based CI and nightly CI (integration_platforms
only is utilized for PR based CI, so we'd need other filtering for
the nightly CI and there isn't any value in building these tests
on more than the single platform so platform_allow makes the most
sense).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-23 11:29:30 -05:00
Michał Narajowski
0bca465cab Bluetooth: tester: Add Bond Lost API
In GAP/SEC/AUT/BV-22-C the IUT needs to inform the Upper Tester about a
lost bond.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-07-23 14:43:01 +03:00
Agata Ponitka
0f61c0c65f Bluetooth: tester: Add Key Refresh Procedures tests support
Add support for automatic testing of KRP.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
1dbfc40705 Bluetooth: tester: Add provisioner support
Add provisioning procedure for automatic testing.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
41024b60eb Bluetooth: tester: Add Mesh Health Client Model tests support
Add support for automatic testing of Mesh Health Client Models.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
b89003df86 Bluetooth: tester: Add Mesh Configuration Client tests support
Add support for automatic testing of Mesh Configuration Client Models.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Kumar Gala
d00b37c8dd tests: bluetooth: shell: Filter tests on dts "storage_partition"
Some of the shell tests need a devicetree "fixed-partition" and
"storage_partition" for the settings partition support.  Not all
boards support this, so filter the tests on the devicetree having
this.

Fixes #37115

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-21 13:11:03 -05:00
Vinayak Kariappa Chettimada
529bb8d863 tests: Bluetooth: bsim: Multiple central connections to peripherals
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.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Aleksandr Khromykh
632a1cb95a Bluetooth: Mesh: fix ble mesh bsim tests compile warnings
If bsim tests are built without errors then warnings are hidden.
A couple of them has sneaked in recent PRs.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-07-20 20:02:02 -04:00
Emil Gydesen
1c04a7505e Bluetooth: shell: Add bluetooth tag to shell tests
Add missing bluetooth tag for recently added tests in
the testcase.yaml file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-20 18:04:03 -04:00
Vinayak Kariappa Chettimada
82297d9245 tests: Bluetooth: bsim: Mesh test with BT_CTLR_LOW_LAT
Add tests to cover BT_CTLR_LOW_LAT options which is used by
nRF51 Series.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-20 13:35:49 +02:00
Vinayak Kariappa Chettimada
ba16f201f3 tests: Bluetooth: bsim: basic test with BT_CTLR_LOW_LAT
Add tests to cover BT_CTLR_LOW_LAT options which is used by
nRF51 Series.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-20 13:35:49 +02:00
Emil Gydesen
57b5c32e82 Bluetooth: shell: Add bt audio compile tests for the bt shell
Add a couple of compile tests for the bt shell for
BT audio, including checking that the services can be
compiled individually without error.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Vinayak Kariappa Chettimada
0cb3d31e54 tests: Bluetooth: Controller: Cover in-system tests in CI
Include the in-system tests Kconfig option in build-only and
babblesim tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-19 14:18:31 +02:00
Trond Einar Snekvik
e6000e60ee Bluetooth: Mesh: Test provisioning multiple devices
Adds a BabbleSim test for provisioning multiple devices in a row. This
scenario had a regression in #33782, which is fixed in #35405.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-07-13 19:21:17 +03:00
Ingar Kulbrandstad
3ec6411c7f Bluetooth: Mesh: Align capitalization for BT mesh
Align the capitalization of the term "Bluetooth Mesh" to Bluetooth mesh"
in the documentation. This is done to to match the new updated naming
convention done in Bluetooth SIG. In the upcoming spec versions, it its
used "Bluetooth mesh" with the lower case convention.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2021-07-13 11:23:54 -04:00
Aleksandr Khromykh
2f3a3e3b51 Bluetooth: Mesh: Tests of BLE Mesh beacon flags management
Tests check transmission, receiving beacons in situations
of IV update (with test mode on) and key refresh procedures.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-07-13 11:54:47 +03:00
Vinayak Kariappa Chettimada
ecbc17fc21 tests: Bluetooth: bsim: name adv_handle for advertising handle
Use the name adv_handle instead of index to store advertising
handle.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-12 13:19:46 +02:00
Vinayak Kariappa Chettimada
4f8b4fe143 tests: Bluetooth: bsim: ISO test with ACAD in periodic advertising
Updated ISO test to demonstrate ACAD field in periodic
advertising PDUs. Here, test changing the periodic
advertising data.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-12 13:19:46 +02:00
Lingao Meng
1447e796bc Tester: Add support ble auto-tester on native posix
The purpose of this PR is to automatically test the
host in the native environment.

It is used to simulate /dev/tty*, can replace by /dev/pts/*.
Also, device log will be output to stdio by default.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-06-28 20:14:32 -04:00
Emil Gydesen
141620519b Bluetooth: Audio: AICS client add function to get conn pointer
Add a function that returns the bluetooth connection
pointer of a given AICS client instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 11:31:04 -04:00
Emil Gydesen
7e6d927467 Bluetooth: Audio: AICS remove need for bt_conn pointer
Remove the bt_conn pointer from the AICS API, as the
instance pointer is enough to determine if it is a client
and perform client operations on the cached connection pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 11:31:04 -04:00
Emil Gydesen
5d4992ae25 Bluetooth: Audio: VCS client add function to get conn pointer
Add a function for the VCS client that gets the bluetooth
connection pointer if a given VCS client instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 12:35:07 +02:00
Emil Gydesen
0043c741a5 Bluetooth: Audio: Update VCS API to use bt_vcs
Update the VCS API to use the bt_vcs struct instead
of the bt_conn. This is create a more simple API
that uses a, remote or loca, instance pointer, rather
than a specified connection (for remote) or NULL (for
local) operations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 12:35:07 +02:00
Emil Gydesen
c7375079cc Bluetooth: Audio: VCS client return pointer to instance on discover
Add return of instance pointer in bt_vcs_discover so that a client
will get a bt_vcs pointer when doing discover, which will be
used going forward in the API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 12:35:07 +02:00
Emil Gydesen
db025e26a6 Bluetooth: Audio: VCS introduce opaque bt_vcs struct
Add a bt_vcs struct that represents a VCS instance,
either a local (server) or remote (client) instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 12:35:07 +02:00
Emil Gydesen
973e88104f Bluetooth: Audio: MICS client add function to get conn pointer
Add a function that returns the bluetooth connection
pointer of a given MICS client instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 12:34:37 +02:00
Emil Gydesen
3c9f943fa7 Bluetooth: Audio: Update MICS API to use bt_mics
Update the MICS API to use the bt_mics struct instead
of the bt_conn. This is create a more simple API
that uses a, remote or loca, instance pointer, rather
than a specified connection (for remote) or NULL (for
local) operations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 12:34:37 +02:00
Emil Gydesen
f42d6c475c Bluetooth: Audio: MICS client return pointer to instance on discover
Add return of instance pointer in bt_mics_discover so that a client
will get a bt_mics pointer when doing discover, which will be
used going forward in the API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 12:34:37 +02:00
Emil Gydesen
d6fd79f65d Bluetooth: Audio: MICS introduce opaque bt_mics struct
Add a bt_mics struct that represents a MICS instance,
either a local (server) or remote (client) instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-24 12:34:37 +02:00
Vinayak Kariappa Chettimada
7ba52d8f82 tests: Bluetooth: bsim: Minor advx test update
Minor updates to the printk's in the advx test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-14 21:50:14 -04:00
Emil Gydesen
124e2c06bb Bluetooth: Audio: Fix wrong pointer in VCS client vocs test
The call to bt_vocs_client_conn_get should use the
vcs_included pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-14 10:46:43 -05:00
Emil Gydesen
6b2cc7e57e Bluetooth: Audio: Rename bt_vcs to bt_vcs_included
Rename the struct from bt_vcs to bt_vcs_included, and
rename bt_vcs_get to bt_vcs_included_get as that is more
descriptive of the value returned.

Furthermore, this will also allow us to use bt_vcs as
an opaque pointer to a VCS service instance (local
or remote) to match the service instance pointers of
AICS and VOCS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-14 14:25:55 +02:00
Emil Gydesen
d52b4ac4bf Bluetooth: Audio: Rename bt_mics to bt_mics_included
Rename the struct from bt_mics to bt_mics_included, and
rename bt_mics_get to bt_mics_included_get as that is more
descriptive of the value returned.

Furthermore, this will also allow us to use bt_mics as
an opaque pointer to a MICS service instance (local
or remote) to match the service instance pointers of
AICS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-14 14:25:49 +02:00
Emil Gydesen
b683bea5d7 Bluetooth: Audio: VOCS client add function to get conn pointer
Add a function that returns the bluetooth connection
pointer of a given VOCS client instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-14 14:25:42 +02:00
Emil Gydesen
f500e0fb9c Bluetooth: Audio: VOCS remove need for bt_conn pointer
Remove the bt_conn pointer from the VOCS API, as the
instance pointer is enough to determine if it is a client
and perform client operations on the cached connection pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-07 12:08:10 +02:00
Emil Gydesen
0c506e5fca Bluetooth: Audio: MICS BSIM tests
Add full API test suite for MICS and MICS client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-07 12:04:28 +02:00
Emil Gydesen
2c67bafb7b Bluetooth: Audio: Microphone Input Control Service and Client
This commit implements the microphone input  control service
(MICS) and client, The implementation supports and uses the
Audio Input Control Service (AICS) secondary service.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-07 12:04:28 +02:00
Vinayak Kariappa Chettimada
c024645b36 tests: bluetooth: bsim: Updated advx test to verify previous sync data
Updated advx test to verify previous sync data when no
extended header flags are set in the PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-01 16:50:41 +02:00
Vinayak Kariappa Chettimada
a2d4aab23b tests: bluetooth: bsim: Updated advx test to verify sync data
Updated advx test to verify sync data when no extended
header flags are set in the PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-01 16:50:41 +02:00
Casper Bonde
afe469eac7 Bluetooth: ISO: Speed up BT ISO data processing
For the native posix build the sleep calls used in tasks will stall
the zephyr instance which sets an upper limit on the data processing
interval to once every 20-30 millisecond.
This change reduces the duration of the sleep calls and increases the
TICKS_PER_SECOND to allow for shorter sleeps. This is needed to
support the data rates needed for LE Audio streaming. The rate is
tuned to support up to bidirectional 5ms ISO-intervals.
This change also increases the ISO buffer count from 1 to 5 to
allow for some buffering in the controller, which is needed for
gapless playback and/or use of burst number larger than 1.

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
2021-05-27 13:16:40 +02:00
Krzysztof Kopyściński
79a3a0f40b bttester: add key-size and authorization based l2cap conn reject
In tests that expect returning error in response for l2cap
connection request we use predefined PSMs. This commit adds
check for required keysize (which will always return error,
as connection is not secure and key size will always be 0)
instead of setting security level 4 (which would return
insufficient authentication, not insufficient key size).
It also adds suport for PSM used in insufficient authorization
tests - choosing this PSM will set flag that triggers error
on channel accept.

This affects tests L2CAP/LE/CFC/BV-[10-15]-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-05-19 12:18:08 +03:00
Trond Einar Snekvik
0a49adc380 Bluetooth: Mesh: Make bsim friendship test timing more robust
The BabbleSim test for friendship has some timing requirements imposed
by the polling mechanism, which requires synchronization between
devices.

Add a synchronization message from LPN to the mesh device in the and
clear poll events for the friend in the group messaging test to remove
timing dependency. Add a large margin on the wait time between polls in
the friend messaging test for the same purpose.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-05-18 12:29:04 -05:00
Emil Gydesen
8192623263 Bluetooth: Audio: BSIM test suite for VCS
Adds a Babblesim test suite for the volume control service
and client, that exercises the entire API and most of the
VCS functionality.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-07 15:02:41 +02:00
Emil Gydesen
82a32f5ca5 Bluetooth: Audio: Volume Control Service and client
This commit implements the volume control service (VCS) and
client, The implementation supports and uses the
Audio Input Control Service (AICS) and
Volume Offset Control Service (VOCS) secondary services.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-07 15:02:41 +02:00
Rubin Gerritsen
f05ea6711a tests: bluetooth: advx: Support multiple sets and identies
This will exercise caching of the HCI_LE_Connection_Complete
event in the host.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2021-05-07 12:15:20 +03:00
Lingao Meng
4640e6e927 Tester: Add bsim auto test for bluetooth mesh provision
Add auto test for bluetooth mesh provision procedure

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-05-06 13:20:18 -04:00
Piotr Pryga
bf7bf0bec9 tests: Bluetooth: df: Add connectionless IQ sampling enable unit tests
Add unit tests for connectionless IQ sampling functionality in
controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga
c02be507fb tests: Bluetooth: df: Move UT code into connectionless_cte_tx sub dir
Before thic commit the bluetooth/df unit tests subdirectory contained
connectionless CTE TX verification. Due to the implementation of
connectionless CTE RX new set of tests will be provided.
The new functionality requires different: configuration and common
setup code. Because of that, current test code was moved to
connectionless_cte_tx subdirectory.
Code shared by all DF tests is moved to common subdirectory.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Joakim Andersson
b8c5eda2d2 Bluetooth: tester: Update tester to reserve bytes for an L2CAP SDU
Update the tester application to correctly reserve the number of bytes
needed for an L2CAP SDU.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-06 14:56:18 +02:00
Joakim Andersson
6483e12a8a Bluetooth: Refactor bluetooth buffer configuration for simplification
Refactor and simplify the bluetooth buffer configurations to improve the
easy of configurations and eliminate invalid ones.
By moving configurations out of host and controller specific
configurations and into a common one it becomes easier to configure
the host and controller separately as the same configurations can be
used as would be for a combined build.

All HCI configurations are now given exluding the matching HCI header,
which eases the configuration as the application don't have to know the
different header sizes.
The BT_RX_BUF_LEN is split into ACL and Event, as well as the suprising
use of Command size.
BT_L2CAP_RX_MTU is removed as the stack does not support reassembling of
HCI ACL data to larger L2CAP PDUs. The application will have to set
ACL RX size and account for the L2CAP PDU header itself.
BT_EATT_RX_MTU was removed as it is only used for setting a different
default value for another option which leads to the stuck kconfig symbol
problem.

The configurations can be updated according to the table below:

** New configuration         | ** Old configuration
All configurations
BT_BUF_ACL_RX_SIZE           | BT_L2CAP_RX_MTU + 4
BT_BUF_ACL_RX_SIZE           | BT_RX_BUF_LEN - 4
BT_BUF_EVT_RX_SIZE           | BT_RX_BUF_LEN - 2
BT_BUF_CMD_TX_SIZE           | BT_RX_BUF_LEN - 3
BT_BUF_CMD_TX_COUNT          | BT_HCI_CMD_COUNT
BT_BUF_EVT_RX_COUNT          | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT          | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT          | BT_ACL_RX_COUNT
BT_BUF_EVT_DISCARDABLE_SIZE  | BT_DISCARDABLE_BUF_SIZE - 2
BT_BUF_EVT_DISCARDABLE_COUNT | BT_DISCARDABLE_BUF_COUNT
Controller-build
BT_BUF_ACL_TX_SIZE           | BT_CTLR_TX_BUFFERS_SIZE
BT_BUF_ACL_TX_COUNT          | BT_CTLR_TX_BUFFER
HCI-bridge
BT_BUF_ACL_TX_SIZE           | BT_HCI_ACL_DATA_SIZE
BT_BUF_ACL_TX_COUNT          | 6

Fixed invalid configurations setting either BT_L2CAP_RX_MTU or
BT_CTLR_DATA_LENGTH_MAX larger than BT_RX_BUF_LEN could lead to buffer
overruns.

Fix advertising report max data length calculation.
This always used the BT_DISCARDABLE_BUF_SIZE macro but this feature
can be turned off and advertising reports will be allocated from the RX
buffer in that case. Also controller-build does not have this buffer
(in hci_raw.c). Also the wrong HCI header was used in the calculation,
HCI event header should have been used instead of HCI ACL header.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-06 14:56:18 +02:00
Magdalena Kasenberg
d0e0af74da Bluetooth: Add option to log btsnoops over RTT
There is a choice to log btmon logs over UART or RTT.
You can choose number of RTT buffer, set its name and size.

Replaced CONFIG_BT_DEBUG_MONITOR with CONFIG_BT_DEBUG_MONITOR_UART
for UART usage and CONFIG_BT_DEBUG_MONITOR_RTT for RTT.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2021-05-05 16:03:38 +02:00
Krzysztof Kopyściński
ae935a7a37 Bluetooth/tester: fix coverity issue in l2cap
i is of uint type, so it'll never be negative. Thus, while loop
condition i >= 0 will always be true.
This patch also fixes issue with marking unused l2cap channels
as free by freeing only these that were marked as in_use by
get_free_channel(), and not all of them.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-05-05 16:03:22 +02:00
Andrzej Kaczmarek
5652d59393 tests: Bluetooth: bsim: Add test for initaiting conn on ext adv
advx will do connectable advertising using ext adv, scanx will try
to connect.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-05-05 14:15:05 +02:00
Andrzej Kaczmarek
1d2babfa85 tests: Bluetooth: bsim: Handle consecutive connection in tests
If we want to test conn on legacy and ext adv, we need scanx to
handle connection more than once. Change local flag to global and
let it indicate whether we want scanx to initaite connection when
device is scanned.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-05-05 14:15:05 +02:00
Andrzej Kaczmarek
48735a30e9 tests: Bluetooth: bsim: Fix conn ref
'disconnected' callback always unrefs conn object, but this is only
valid if connection was created in scanx since app owns reference to
that conn object. In case of advx, app does not own any reference so
should not unref.

Basically we do not really need to hold any reference to conn object
in either scanx or advx so just drop reference immediately after conn
is created in scanx, no need to worry about it later.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-05-05 14:15:05 +02:00
Joakim Andersson
de60823d9a Bluetooth: tester: fix bt_le_oob_set_legacy_tk excluded when supported
Fix bt_le_oob_set_legacy_tk excluded when Legacy OOB pairing is
supported. We still support legacy OOB when
CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY is not defined.
It is only when we disable Legacy pairing that it is not included.

Check that the OOB data type is in fact Legacy OOB before calling
bt_le_oob_set_legacy_tk.

Log an error if the OOB type was not handled by the callback.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-03 10:00:44 +02:00
Piotr Pryga
9a14f62742 tests: Bluetooth: df: Fix undefinded symbols error
Remove undefined functions (unsued anymore).
Add missing stub implementation for new DF related radio functions.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-04-30 11:07:55 +02:00
Michał Narajowski
00681f0241 Bluetooth: tester: Implement Provisioning Node Added event
This information is useful to the automation framework when implementing
tests where the IUT is the provisioner and the test uses two PTS
instances.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-04-28 11:13:45 -04:00
Krzysztof Kopyściński
97f992c470 Bluetooth/tester: connect L2CAP using Enhanced Credit Flow Control
This change adds field to L2CAP connect command allowing to choose
ECFC in L2CAP connect() function and adds required logic to perform
such connection.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-04-16 15:32:48 -04:00
Emil Gydesen
2016509756 Bluetooth: Audio: Audio Input Control Service and client
This commit implements the secondary service
Audio Input Control Service (AICS) server and client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-04-12 11:47:00 -04:00
Emil Gydesen
42da370df5 Bluetooth: Use ATT FIRST/LAST attribute handle defines where applicable
Change to use the BT_ATT_FIRST_ATTTRIBUTE_HANDLE and
BT_ATT_LAST_ATTTRIBUTE_HANDLE instead of the literal values where
applicable.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-04-08 16:35:57 +02:00
Joakim Andersson
122320f5bd Bluetooth: tester: Revert "Fix an error response in tester"
This reverts commit 24784b1452.

The change appears to have been submitted twice in different PRs.
The correct change is: 76789883e2

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-04-07 13:54:42 +03:00
Kumar Gala
cf7e7706a1 tests: bluetooth: init: Add integration_platforms
Add integration_platforms to testcase.yaml to catch issues during CI.
With out this change these tests only get build during the nightly CI.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-07 12:18:00 +02:00
Krzysztof Kopyściński
806ca8f78d bluetooth/tester: give data buffer for each L2CAP channel
L2CAP channels are allocating buffers from common data_pool. For that
pool buffer count was hard-coded as 1. This count should be set to value
CHANNELS, allowing each channel to allocate buffer for incoming
data. Without this change, execution would stuck at l2cap_chan_le_recv()
as we give net_buf_alloc() in alloc_buf_cb() no timeout.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-04-06 15:30:47 +02:00
Jun Huang
24784b1452 Bluetooth: tester: Fix an error response in tester
In the function conn_param_update, it should send the opcode
GAP_CONN_PARAM_UPDATE, instead, it send GAP_PASSKEY_ENTRY.

Signed-off-by: Jun Huang <huangjun6@xiaomi.com>
2021-03-26 15:31:29 -04:00
Krzysztof Kopyściński
714239ba13 Bluetooth: tester: fix build with BT_SMP_SC_ONLY
bt_le_oob_set_legacy_tk is not defined with this
setting and this code is reachable only for legacy pairing

signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-03-26 15:29:31 -04:00
Ryan Chu
5c0544aa9d Bluetooth: tester: Reserve BT buffer for different HCI transports
With this change, L2CAP/LE/CFC/BV-06-C can be supported when using
BT_RPMSG and the others HCI transports.

Depending on CONFIG_BT_HCI_RESERVE, the HCI transport requires extra
headroom in a BT buffer.

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2021-03-26 08:26:21 -04:00
Emil Gydesen
ed2162c700 Bluetooth: Audio: Volume Offset Control Service and Client
This commit implements the secondary service
Volume Offset Control Service (VOCS) server and client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-22 13:05:56 -04:00
Anas Nashif
c076d94eec kernel: remove tickless idle
This feature predated the tickless kernel and has been in legacy mode
for a while. We now have no drivers or systems that do not support
tickless, so remove this option and cleanup the code to only use
tickless.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-19 11:22:17 -04:00
Trond Einar Snekvik
40a2aed778 Bluetooth: Mesh: Friendship BabbleSim tests
Adds Friendship tests to the Bluetooth Mesh BabbleSim test suite. The
friendship tests cover all basic friend establishment and message
sending scenarios, including coverage for previous regressions, such
as #29544, #32033 and #30657.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-19 11:07:31 +02:00
Andrzej Głąbek
031aeb2bd9 tests: bluetooth: tester: Remove assignment to CONFIG_LOG_MINIMAL
The LOG_MINIMAL option is no longer user-configurable, as now it has
no prompt. LOG_MODE_MINIMAL should be modified instead.
But in this case, the assignment is redundant, as this option is not
enabled by default. Remove it then, to align the configuration file
for nrf5340dk_nrf5340_cpuapp with the one for nrf52840dk_nrf52840.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-03-18 06:17:45 -04:00
Joakim Andersson
5b9a881e8f Bluetooth: tests: Add privacy configuration to init test
Add privacy configuration to init test for both central and peripheral
roles with or without extended advertising.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-17 18:58:49 +02:00
Piotr Pryga
8e0444cc17 tests: Bluetooth: df: Add missing intergration_platforms
Add intergration_plaforms entry in testcase.yaml.
Thanks to that nrf52_bsim platform will be used instead
of default platforms that do not include nrf52_bsim.
The test will be not dead as it is now (executed only
when tests code has been changed).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-03-17 11:34:26 +01:00
Joakim Andersson
9ca13ca664 Bluetooth: host: Refactor command state set handling to one function
Refactor command state state handling to one function.
When setting state outside of hci_core the cmd macro is not available,
so in order to assign the buf pointer to state the function is needed.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-15 16:51:51 +02:00
Joakim Andersson
1367220410 tests: Bluetooth: Fix compilation issue in direction finding test
Fix compilation issue in direction finding tests, undefined references
to radio_df_ant_switching_gpios_cfg and
radio_df_ant_switching_pin_sel_cfg

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-15 10:19:17 +01:00
Trond Einar Snekvik
bbc9da3d69 Bluetooth: Mesh: Add bsim tests for transport
Adds a test suite for Bluetooth Mesh in bsim_bt tests, including 10
tests for common transport behavior. This test suite includes a readme
and a simple framework for adding more mesh tests in the future.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-12 16:17:27 +02:00
Emil Gydesen
a264efbcbc Bluetooth: host: Initial support for BIS
Added initial support for BIS (broadcast ISO stream), which
adds support for creating BISes as both broadcaster and receiver,
as well as managing and creating BIGs.

Extends PA sync to handle BIGInfo adveritising reports.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-09 08:06:02 -05:00
Ayturk Duzen
99f53662dc Bluetooth: tests: Add nrf5340 support to tester
Add missing boards nrf5340dk_nrf5340_cpuapp.conf and
nrf5340dk_nrf5340_cpuapp.overlay files

Signed-off-by: Ayturk Duzen <ayturk.duzen@nordicsemi.no>
2021-03-04 13:00:04 +01:00
Alberto Escolar Piedras
59d3fba1a8 bsim_bt: tests: Fix relative paths search in scripts
The way these scripts looked for the current working directory
was not correct or reliable. With this change it should
work properly.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2021-03-04 11:37:11 +02:00
Wolfgang Puffitsch
d5a804e2ac bsim_bt: run_parallel.sh: Fix execution without explicit SEARCH_PATH
Set SEARCH_PATH to "." instead of `pwd` if not set explicitly. This
avoids the construction of paths that contain `pwd` twice in test
scripts such as ll.1.sh.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-03-03 13:21:35 +01:00
Wolfgang Puffitsch
42b083915d tests: Bluetooth: Add minimal compilation coverage for openisa
Add minimial compilation coverage for openisa Bluetooth controller to
avoid further rot.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-02-16 12:02:00 -05:00
Vinayak Kariappa Chettimada
1e9abde45e tests: Bluetooth: bsim: Fix ISO test to establish periodic sync
Fix the ISO test application to be able to establish
periodic sync.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-15 08:03:22 -05:00
Piotr Pryga
d06b8053b3 tests: Bluetooth: df: add UT for enable CTE for periodic advertising
Adds unit tests for verification of enable/disable CTE for periodic
advertiging in controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Piotr Pryga
e42334982f tests: Bluetooth: df: Move common code to separate source file
Move common code that may be used by different test units
from main.c to common.c. Main.c should be clean and responsible
for unit tests executioon only. Common functionalities should be
stored in separate file and provided to test source files by
appropriate header file.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Piotr Pryga
515f95382e Bluetooth: controller: radio: Add DF configuration to enable CTE TX
Add set of functions that will make possible to configure
radio Direction Finding Extension to transmit CTE for periodic
advertising.

Some of the new Radio API functions are provided as separate
functions changing the same Radio peripheral registers, e.g.
radio_df_mode_set_aoa, radio_df_mode_set_aod. This is done on
purpose and is related with lack of DFE in nrf52_bsim.
To avoid use of conditionally compiled constants to represent
e.g. CTE mode; separate functions were introduced.
Thanks to that DF unit tests are able to compile successfully
without changes in nrf52_bsim platform. Also if DFE is added
to nrf52_bsim there is no need to change the code until it is
desired.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Vinayak Kariappa Chettimada
483e789697 tests: Bluetooth: bsim: Enable LL/CON/INI/BV-24-C EDTT test
Enable the LL/CON/INI/BV-24-C [Network Privacy - Connection
Establishment using resolving list, initiator, Ignore
Identity Address, with address resolution disabled] EDTT
test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-14 18:17:05 -05:00
Luiz Augusto von Dentz
8df6124deb Bluetooth: ATT: Remove BT_ATT_TX_MAX
ATT channels do support queueing buffer so it no longer need to block
waiting the tx_sem besides the buffer allocation already serves the
same purpose as the application will not be able to have more requests
than there are buffers available.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2021-02-11 12:59:01 -05:00
Emil Gydesen
ecf918cadd Bluetooth: tests: Add missing dependency for CONFIG_BT_AUDIO_UNICAST
Two .conf files had enabled the CONFIG_BT_AUDIO_UNICAST config, but
without the CONFIG_BT_AUDIO which is a dependecy.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-02-06 16:20:34 -05:00
Vinayak Kariappa Chettimada
abcee4dc2b Bluetooth: controller: Fix BIG Sync Terminate command
Fix BIG Sync Terminate Command to generate Sync Established
event if Sync initiation is in progress.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-01-26 06:18:23 -05:00
Piotr Pryga
a8c18ff5f4 tests: Bluetooth: df: Fix build error, missing antenna config in DTS
The DF tests are implemented to be executed with nrf52_bsim platform.
The nrf52_bsim platform does not include Direction Finding Extenstion.
Due to that, radio_df.c compilation failed with error about missing
antenna configuration in DTS.

To solve the problem, I've changed nrf.cmake to include radio_df.c
file when CONFIG_BT_CTLR_DF is defined and CONFIG_SOC_SERIES_BSIM_NRFXX
is not definded.

Thanks to that any other platform is not affected. The file will not
build if there is no appropriate configuration or there are missing
features in a hardwared.

Unit tests have provided stub imlpementation or radio functionality.
If nrf52_bsim has implemented Direction Finding Extension, the
DF unit tests code will stil work and will not require additional
changes. Also content of the file is not affected by contional
compilation entries.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-25 21:46:34 -05:00
Thomas Ebert Hansen
704f7cdd48 tests: Bluetooth: User defined CPR intervals
Enable feature and add simple stub for compile test.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2021-01-18 19:07:06 +01:00
Michał Narajowski
b386853367 Bluetooth: tester: Implement Friend and LPN callbacks
Use these callbacks to send BTP events. They are useful for test
automation in auto-pts.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-01-15 11:14:24 -05:00
Michał Narajowski
d4247b3503 Bluetooth: tester: Set LPN Poll timeout to smaller value
Smaller poll timeout means shorter test time.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-01-15 11:14:24 -05:00
Michał Narajowski
71577b2d98 Bluetooth: tester: Use Linux Foundation Company ID
PTS now does not accept 0xffff as a company ID so set it to Linux
Foundation ID.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-01-15 11:14:24 -05:00
Pavel Vasilyev
561a8e4f0e Bluetooth: Mesh: Break up mesh settings
The mesh settings.c module is a giant piece of code responsible for
storing the mesh stack configuration. Such approach makes it difficult
to control the data to be stored, breaks the stack modules'
encapsulation by forcing them to reveal the internal kitchen, which
leads to unpleasant issues such as #19799.

This commit moves the responsibility of storing the configuration
to corresponding modules while keeping control of the moment of storing
the configuration and of starting the stack after the settingss loading
is completed.

This doesn't introduce any abstraction between the mesh settings.c and
other modules as it will add more complexity and overhead than necessary
for the actual task.

Fixes #19850

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-01-14 16:38:50 +02:00
Kumar Gala
3befd7d45f cleanup: rename sanitycheck references to twister
Cleanup references to sanitycheck that should now be twister.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-14 07:50:52 -06:00
Wolfgang Puffitsch
dc6ef26ffd tests: Check return value of settings_runtime_set in ll_settings test
Make sure errors returned by settings_runtime_set are caught.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-01-05 16:51:19 +02:00
Emil Gydesen
06ef2396c0 Bluetooth: controller: Adds initial BIG receiver test
The test currently does nothing, as it depends on the
advertiser part of the test which has not yet been implemented
properly. Also slightly modified how the test is run.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-20 13:36:50 +01:00
Emil Gydesen
9d4d6d06a0 Bluetooth: controller: Implements BIG sync commands in the ULL
Implements handling of the BIG sync commands in the ULL.
LLL support and handling of ACAD (biginfo) remaining.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-20 13:36:50 +01:00
Michał Narajowski
ead46e029f Bluetooth: tester: Fix net send command
After change 7e302979f3 some
MESH/NODE/NET/ tests would fail because we tried to send a message to a
non-unicast address using the device key. This patch fixes that by
defining and adding an app key for vendor model which is then used to
send network packets for these test cases.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-12-16 12:17:03 -05:00
Joakim Andersson
068af16e18 tests: bluetooth: Use a valid disconnect reason
Update test_connect1 test case to use a valid disconnect reason.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-12-15 11:20:34 +01:00
Piotr Pryga
c705970011 tests: bluetooth: Add unit tests for set connectionless CTE parameters
Add unit tests for Direction Finding set of connectionless TX
CTE parameters. Enable DF in nrf52_bsim board.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2020-12-14 11:23:26 +01:00
Anas Nashif
dd931f93a2 power: standarize PM Kconfigs and cleanup
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE

and use PM_ as the prefix for all PM related Kconfigs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Trond Einar Snekvik
4e0fecfdb4 Bluetooth: Mesh: Build extended advertising test
Adds a new testcase to tests/bluetooth/mesh that builds mesh with
extended advertising.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-12-09 12:57:59 +02:00
Emil Gydesen
47e716ba83 Bluetooth: controller: removed node_rx for big create/terminate
Removed the node_rx argument for the BIG create/terminate
functions. The event should not be sent right after the
command, but needs to wait for transmissions of
empty BIS packets or BIG terminate indications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen
4971ad1be6 Bluetooth: controller: Add initial basic ISO broadcast test
Adds a initial ISO broadcast test case that simply
creates, waits and terminates a BIG using the ll API.

The newly created test directory can be expanded to contain
connected ISO (CIS) tests as well in the future.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Emil Gydesen
5a512fbe2f Bluetooth: controller: Implements ULL handling for BIG create command
Implements handling of the BIG create command in the upper link layer.
Does not yet handle sending any BIS events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-12-04 17:09:33 +01:00
Jun Huang
76789883e2 Bluetooth: tester: Fix an error response in tester
In the function conn_param_update, it should send the opcode
GAP_CONN_PARAM_UPDATE, instead, it send GAP_PASSKEY_ENTRY.

Signed-off-by: Jun Huang <huangjun6@xiaomi.com>
2020-12-03 12:16:04 +02:00
Wolfgang Puffitsch
44fa773340 tests: Bluetooth: Add tests for reading codec and controller delay info
Exercise HCI commands to read codec and controller delay information.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2020-11-26 15:46:17 +01:00
Vinayak Kariappa Chettimada
f5644d4341 tests: Bluetooth: bsim: Periodic Advertising Report generation
Test the LE Periodic Advertising Report generation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-23 17:01:50 +01:00
Vinayak Kariappa Chettimada
c4cb838964 tests: Bluetooth: bsim: Set Periodic Advertising Data
Test the implementation of LE Set Periodic Advertising Data
command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-13 09:56:53 +01:00
Vinayak Kariappa Chettimada
be090f7b33 Bluetooth: controller: Fix maximum AC PDU payload size calcuation
Fix maximum Advertising Channel PDU payload size calculation
by including the Common Extended Advertising Payload Format
overload alongwith the AD data maximum size supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
b1d087f643 tests: Bluetooth: bsim: Enable 251 byte AD data PDU
Enable the test procedure that requires greater than 31 byte
PDU when AD data and Sync Info structure be present in the
Advertising channel PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Wolfgang Puffitsch
f68d7863e5 Bluetooth: controller: Create HCI stubs for CIG/CIS creation and removal
Put infrastructure for the following HCI commands/events in place:
* LE Set CIG Parameters command
* LE Remove CIG command
* LE Create CIS command
* LE Accept CIS Request command
* LE Reject CIS Request command
* LE CIS Established event
* LE CIS Request event

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2020-11-10 13:19:08 +01:00
Jordan Yates
ffab099eb9 Bluetooth: add destroy callback to indication
Adds a `destroy` callback to the `struct bt_gatt_indicate_params` which
is used to signify to the application that the indication operation has
completed and the struct instance can be freed/destroyed.

This is required as the number of indication value callbacks that will
be triggered is not known by the caller when the `conn` parameter is
`NULL`.

Tracking when this callback should be run is mananged by a private
reference counter inside the struct.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-11-10 11:21:46 +01:00
Jordan Yates
170f17e0e7 Bluetooth: indication callback signature update
Update the signature of the `bt_gatt_indicate_func_t` callback type by
replacing the attr pointer with a pointer to the
`bt_gatt_indicate_params` struct that was used to start the indication.

This allows the callback to free the `bt_gatt_indicate_params` instance
if it was allocated from storage, while still allowing the
`bt_gatt_attr` value to be accessed through `params->attr`.

Allocating the `bt_gatt_indicate_params` instance from storage is
desirable as multiple indications can be queued, however each instance
must be valid until the callback is run.

Implements API update from #29357

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-11-10 11:21:46 +01:00
Joakim Andersson
f8956cfbc7 Bluetooth: L2CAP: Enable L2CAP dynamic channels without Enhanced CBFC
Allow application to enable L2CAP dynamic channels without support
for Enhanced Credit Based Flow Control (CBFC).

Since these are separate features in the qualification it should
be possible to qualify L2CAP connection oriented channels without
also having to qualify L2CAP enhanced credit based flow control.

The L2CAP/LE/REJ/BI-02-C conformance test will fail when enhanced CBFC
has not been selected in the ICS.

The lower tester expects that since the Enhanced CBFC is not supported,
the command L2CAP_CREDIT_BASED_CONNECTION_REQ should be met with an
L2CAP_COMMAND_REJECT_RSP and not an L2CAP_CREDIT_BASED_CONNECTION_RSP.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-11-09 11:25:10 +01:00
Trond Einar Snekvik
ad2fd44d7a Bluetooth: Mesh: Encapsulate feature config
Moves mesh feature configuration to a separate module, deprecating the
bt_mesh_cfg_srv structure. The initial values for the features should
now be enabled through KConfig, where new config entries have been added
for each feature.

This removes the upward dependency on the config server from the core
stack, and makes the config server a pure frontend for the configuration
states, as all spec mandated behavior around the feature states is now
encapsulated.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-11-09 11:23:34 +02:00
Ryan Chu
385000e8d9 Bluetooth: tester: Set the required minimim security level of LE COC
With this change, these two tests can be supported:
- L2CAP/LE/CFC/BV-11-C
- L2CAP/LE/CFC/BV-14-C

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2020-10-29 20:34:21 +02:00
Ryan Chu
70a27af090 Bluetooth: tester: Clear adv_buf after sending GAP_EV_DEVICE_FOUND
Avoid sending duplicate GAP_EV_DEVICE_FOUND because adv_buf->len was
not cleared.

With this change, the following tests become more stable in a noisy
environment:
- GAP/BROB/OBSV/BV-01-C
- GAP/BROB/OBSV/BV-02-C
- GAP/BROB/OBSV/BV-05-C
- GAP/BROB/OBSV/BV-06-C
- GAP/DISC/RPA/BV-01-C

Co-authored-by: Konstantinos Sotiropoulos
                konstantinos.sotiropoulos@nordicsemi.no

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2020-10-29 20:34:21 +02:00
Ryan Chu
efc8459340 Bluetooth: tester: Support SM tests related to OOB
Support the folowing new tests related to OOB pairing:
- SM/MAS/OOB/BI-01-C
- SM/MAS/OOB/BV-01-C
- SM/MAS/OOB/BV-03-C
- SM/MAS/OOB/BV-09-C
- SM/MAS/SCOB/BI-01-C
- SM/MAS/SCOB/BI-04-C
- SM/MAS/SCOB/BV-01-C
- SM/MAS/SCOB/BV-04-C
- SM/SLA/OOB/BI-02-C
- SM/SLA/OOB/BV-02-C
- SM/SLA/OOB/BV-04-C
- SM/SLA/OOB/BV-10-C
- SM/SLA/SCOB/BI-02-C
- SM/SLA/SCOB/BI-03-C
- SM/SLA/SCOB/BV-02-C
- SM/SLA/SCOB/BV-03-C

Co-authored-by: Konstantinos Sotiropoulos
                konstantinos.sotiropoulos@nordicsemi.no
Co-authored-by: Aytürk Düzen ayturk.duzen@nordicsemi.no

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2020-10-29 20:34:21 +02:00
Vinayak Kariappa Chettimada
d0f7961283 tests: Bluetooth: init: Asserts disabled build
Disable assert checks, to build a smaller firmware and also
to uncover any unused variables and arguments.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-29 14:31:38 +02:00
Vinayak Kariappa Chettimada
53ccde835b tests: Bluetooth: bsim: Extended scanning with duration
Added test to verify Extended Scanning with duration
parameter.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-21 12:44:38 +02:00
Vinayak Kariappa Chettimada
36533d6af6 tests: Bluetooth: init: Periodic Advertising build combinations
Add build only tests to cover Periodic Advertising in
Advertising state and Periodic Advertising in
Synchronization state support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-09 11:41:34 +02:00
Vinayak Kariappa Chettimada
6901b6662a tests: Bluetooth: bsim: Fix change to Periodic Advertising API
Fix due to change to Periodic Advertising API, now requiring
callback registration.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada
cb67f36029 Bluetooth: controller: Rename to BT_CTLR_SYNC_PERIODIC
Rename Kconfig option BT_CTLR_SCAN_PERIODIC to
BT_CTLR_SYNC_PERIODIC.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada
70e5ecaf08 tests: Bluetooth: bsim: Minor print format update
Minor print format update, updated format for Periodic
Advertising Interval.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada
fbf6a71cc3 tests: Bluetooth: bsim: Test Periodic Sync Create and Terminate
Added test code to exercise the Periodic Sync Creation,
Terminate and Sync Loss.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada
adcb9eff64 tests: Bluetooth: bsim: Added test for Periodic Sync Create Cancel
Added BabbleSim test for Periodic Sync Create Cancel.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada
67dd5a61dc tests: Bluetooth: bsim: Added bsim test to cover Periodic Sync
Added test implementation for test driven development of
Periodic Sync feature support in the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada
b0cc96ec61 Bluetooth: controller: Add initial ULL Periodic Sync code
Add initial files and code for Periodic Sync feature support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-07 17:45:23 +02:00
Vinayak Kariappa Chettimada
ff1b55ab5b tests: Bluetooth: init: Remove ll_sw_split filename postfix
Remove ll_sw_split postfix in conf filenames.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-06 13:47:18 +02:00
Vinayak Kariappa Chettimada
1d24330648 tests: Bluetooth: init: test state/role combinations
Added conf files to test advertiser, broadcaster, peripheral
and central state/role build combinations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-06 13:47:18 +02:00
Xavier Chapron
824f423e54 misc: Replace assert include and calls by sys/__assert.h equivalent
Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-10-02 11:42:40 +02:00
Emil Obalski
3527b7dca1 tests: shell: Correct overlay extension
When added bluetooth over USB shell overlay, the
file was by mistake added with wrong extension.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-22 16:04:56 -05:00
Ievgenii Meshcheriakov
1375b1d332 drivers/flash/soc_flash_nrf: Remove blank lines at the end of config files
This should make CI happier.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Ievgenii Meshcheriakov
d27c32efc3 drivers/flash/soc_flash_nrf: Rename config option SOC_FLASH_NRF_RADIO_SYNC
Call it SOC_FLASH_NRF_RADIO_SYNC_TICKER so it is not too generic.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Carles Cufi
2fd929355a Bluetooth: tester: Fixes for GCC 10.x
Fix the structures so that they are compliant with the stricter checks
of GCC 10.x, and at the same time correct a bug that was present in the
handling of the GAP Start Advertising BTP command.

Fixes #28375.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-18 13:32:08 +02:00
Peter Bigot
a28f570855 tests: bluetooth: shell: add usb shell test configuration
Verify builds and execution when a CDC-ACM UART is used for the shell.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 13:32:22 -05:00
Luiz Augusto von Dentz
5c4bde55d0 Bluetooth: GATT: Rework bt_gatt_attr_func_t
Make it actually give the original pointer to the attribute and its
resolved handle so static attributes don't need an extra lookup.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-09-05 11:06:21 +02:00
Luiz Augusto von Dentz
67041a85d2 Bluetooth: shell: Add CONFIG_BT_AUDIO
This enables use of iso module with shell application.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-09-04 21:03:13 +02:00
Emil Gydesen
8d7b5ebd7a Bluetooth: Remove _gatt_ infix for Heart Rate Service (HRS)
The _gatt_ infix was determined to be unnecessary as
GATT is implied by it being a Bluetooth service.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-04 15:38:44 +02:00
Emil Gydesen
b4a8229db6 Bluetooth: Remove _gatt_ infix for Battery Service (BAS)
The _gatt_ infix was determined to be unnecessary as
GATT is implied by it being a Bluetooth service.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-04 15:38:44 +02:00
Andrzej Kaczmarek
48646e51d0 tests: Bluetooth: bsim_advx_test: Add some tests for scan response
This adds few tests for handling scan response in ext commands:
- trying to set scan response on non-scannable instance should fail
- it should be possible to create scannable instance, set scan data,
  enable and then disable set

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-09-04 14:30:21 +02:00
Tomasz Bursztyka
e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Andrzej Kaczmarek
3e7db661d1 tests: Bluetooth: bsim_test_advx: Fix adv_type parameter
The value of adv_type shall be 0x07 for extended advertising, it will
be converted to 0x05 inside ll_adv_params_set after some checks.

This did not cause any issues with tests since input parameters in
already implemented test cases do not test any code that was skipped
by invalid parameter, however obvious one side-effect is that phy_p
would be always set to 1M regardless of input parameter so any test
case using Coded on primary would fail.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-08-31 13:50:13 +02:00
Vinayak Kariappa Chettimada
819a0e3ff2 tests: Bluetooth: Update AD Data as fast as possible
Added tests to update AD data as fast as possible. This test
shall exercise any race condition assert checks in the
Zephyr BLE controller implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-08-31 13:49:13 +02:00
Vinayak Kariappa Chettimada
35f2db810d tests: Bluetooth: bsim_advx_test: Increase sim_length to 60 seconds
Increased sim_length value to 60 seconds so as to meet the
current length of 13.56 seconds and any future test timing
increases in the near future.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-08-31 13:47:36 +02:00
Vinayak Kariappa Chettimada
42ea52c39f tests: Bluetooth: bsim_test: tests periodic adv enable/disable
Update bsim test to test Periodic Advertising Enable and
Disable alongwith Extended Advertising Enable/Disable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-08-31 13:47:36 +02:00
Andrzej Głąbek
6738aec457 tests/bluetooth/ll_settings: Prevent switch-unreachable warning
After the fallthrough comments have been replaced (see commit
741ad17a37807a5396e73c10cf3e5fb425bc87bb) with a macro expanding
to the corresponding attribute, those hints became statements,
and if one happens to occur before any switch case, a warning
reporting it as an unreachable statement is generated.
Prevent the above from happening for function ll_rx_dequeue() in
ull.c by enabling an option that will make some switch case to
appear before this problematic statement.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-08-31 12:40:47 +02:00
Trond Einar Snekvik
db0e559b74 Bluetooth: Mesh: Reduce microbit memory consumption
Trims the default memory configuration for the BBC Microbit in mesh
samples to ensure that it fits.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-08-30 17:09:59 +03:00
Anas Nashif
dca317c730 sanitycheck: inclusive language
change whitelist -> allow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-27 07:04:07 -04:00
Joakim Andersson
5880f3d74f Bluetooth: UUID: Use BT_UUID_16_ENCODE to set UUIDs in adv data
Use BT_UUID_16_ENCODE to set UUIDs in advertising data.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-08-25 16:09:22 +03:00
Emil Gydesen
aea6afe3fa Bluetooth: host: Perodic advertisement synchronization
Added support for syncing to periodic advetisements.
The API and usage is heavily inspired by the extended advertisement
and connection APIs.

Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
2020-08-11 14:17:19 +02:00
Emil Gydesen
8cf01ab590 Bluetooth: host: Add periodic advertising API
Added API to set periodic adv parameters, periodic adv data
and to enable/disable periodic advertisement.

Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
2020-08-11 14:17:19 +02:00
Dag Bjarvin
e93963b719 Bluetooth: controller: Add ll_adv_aux_set_clear function
Add ll_adv_aux_set_clear, add to bsim test

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-08-05 12:52:42 +02:00
Dag Bjarvin
a82c34703c tests: Bluetooth: bsim: Add ll_adv_aux_set_remove function
Add tests for ll_adv_aux_set_remove in bsim test app

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-07-29 16:37:15 +02:00
Vinayak Kariappa Chettimada
e0613b9638 tests: Bluetooth: bsim: Added tests for adv set terminate event
Added bsim testing for Advertising Set Terminated event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Dag Bjarvin
12fdddb80d Bluetooth: controller: Add terminate event for external advertising
Add terminate event for duration timeout, max number of events and
connection.

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Emil Gydesen
5b59c002f6 Bluetooth: Gatt: Automatic discover of CCC when subscribing
Added a feature that allows an application to request
automatic discovery of the CCCD handle when subscriping
to a characteristic. In order to preserver RAM, the application
is expected to provide the discovery parameters, and it's up
to the application whether or not it wants to reuse the
discovery parameters or use one for each characteristic.

Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
2020-07-20 12:46:18 +02:00
Vinayak Kariappa Chettimada
36707cdb58 tests: Bluetooth: bsim: Disable test with long AD data
Disable test with long AD data being set, as 251 byte
Advertising PDU is not yet supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-16 14:43:46 +02:00
Joakim Andersson
a52c442fc7 Bluetooth: test: Print disconnect reason in hex value
Print the disconnect reason in hex value since the defines are in hex.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Joakim Andersson
4be66bd33d Bluetooth: Fix host RX thread deadlock
Fix host RX thread being deadlocked. The deadlock occurs because the
RX thread is stuck waiting in conn_tx_alloc with K_FOREVER but if the
connection is disconnected only the RX thread can unblock it in the
handling of the disconnect event.

This commit fixes this deadlock by splitting the processing of the
disconnected event into two parts.
The part needed to unblock the RX is to release resources held by
unack'ed TX packets and mark the connection state as not connected
anymore.
The RX thread waiting for free_tx fifo and the TX thread waiting for
the bt_dev.le.pkts semaphore will both check the connected state after
having acquired them and will abort if disconnected.
The rest of the processing will be handled at normal RX thread
priority like normal.

Move the bt_recv_prio handling to the Bluetooth host when the host
has defined its own RX thread (CONFIG_BT_RECV_IS_RX_THREAD=n).
If the HCI driver has the RX thread (CONFIG_BT_RECV_IS_RX_THREAD=y),
then the responsibility to call bt_recv and bt_recv_prio correctly
falls to the HCI driver.
The helper function bt_hci_evt_is_prio() is replaced with
bt_hci_evt_get_flags() so that the HCI driver can do this correctly.
This decision to replace was made so that existing HCI drivers
maintained out-of-tree will fail at compile time with the new system.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>

Bluetooth: host: Move bt_recv_prio to host when RX thread is defined

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Michał Narajowski
7c06f3c38e mesh: Adjust config values to pass Transport test cases
These values were derived experimentally by running PTS test cases.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Andries Kruithof
ed85577a22 Bluetooth: controller: Increase timeout for babblesim
The timeout for testing advertisement extensions in babblesim
was set to 30 seconds. Depending on the hardware used for
testing this may be too low. Increased to 120 seconds

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2020-06-29 09:27:09 +02:00
Vinayak Kariappa Chettimada
372a2e2fd3 tests: Bluetooth: bsim_test: Include advx testing in CI
Update compile.sh and added test_script, so that
bsim_test_advx bsim_test application is built and run in
CI.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada
353bb6d5cf tests: Bluetooth: make ctrl_advx a BabbleSim test
Convert the ctrl_advx application into a Babblesim test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada
0a18b7e2cb tests: Bluetooth: advx: disable periodic SYNC_IND packets
Added function call to test disable of the started periodic
SYNC_IND packets.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada
b92abf8e6a tests: Bluetooth: advx: Use 2M PHY auxiliary PDUs.
Use 2M PHY auxiliary PDUs in test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada
1bd7f26cb0 tests: Bluetooth: advx: Update data while periodic advertising
Update Aux PDU AD Data while periodic advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada
f0174527f9 tests: Bluetooth: advx: Added code to test periodic advertising
Added code to invoke starting of periodic advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada
dd0c46c371 tests: Bluetooth: advx: test application for adv. ext. development
Added a new advx test application to aid test driven
development.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Kumar Gala
a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Peter Bigot
8949680482 tests: bluetooth: ctrl_sw_privacy_unit: remove legacy timeout API
This test doesn't depend on the legacy API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-03 17:47:58 +02:00
Marc Herbert
debade9121 tests: make find_package(Zephyr...) REQUIRED
... because it is (required).

This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.

In this particular case, REQUIRED turns this harmless looking log
statement:

-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
  Cannot specify sources for target "app" which is not built by
  this project.

... into this louder, clearer, faster and (last but not least) final
error:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "Zephyr" with
  any of the following names:

    ZephyrConfig.cmake
    zephyr-config.cmake

  Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
  "Zephyr_DIR" to a directory containing one of the above files.  If
  "Zephyr" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Anas Nashif
ad82b38b8f tests: ztest: prefix tests with test_
Tests should always start with test_, otherwise detection of subtests
will not work through sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-13 18:16:07 +02:00
Carles Cufi
b67a31e411 Bluetooth: controller: Remove legacy LL
Remove the legacy Link Layer implementation.

Closes #24187.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-08 15:07:00 +02:00
Joakim Andersson
194079d5bd Bluetooth: shell: Enable extended advertising support in the shell
Enable extended advertising commands in the shell and enable the
runtime check of feature support in the controller.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-07 20:12:29 +02:00
Joakim Andersson
21a42f3b67 Bluetooth: shell: Add phy handling to the shell
Add phy update callback and command to the shell.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-07 20:12:29 +02:00
Joakim Andersson
322f70243e Bluetooth: shell: Add data length handling in the shell
Add data length callback and command to the shell.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-07 20:12:29 +02:00
Carles Cufi
9b04a99243 timeouts: Port BBC micro:bit to the new timeout API
Port the BBC micro:bit display driver to the new timeout API exposed by
the kernel.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-07 11:01:55 +02:00
Luiz Augusto von Dentz
f3116842f1 Bluetooth: EDTT: Use bt_buf_tx_get to allocate buffers
Instead of using its own buffer pool use one already available by
HCI_RAW which are accessible with bt_buf_tx_get.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-07 10:31:36 +03:00
Mariusz Skamra
f51557d0f2 tester: Adjust to recent changes in BTP API
This patch adjusts L2CAP CoC related command and responses to the
recent BTP API changes.
BTP has been extended with Enhanced CoC support, thus few L2CAP
CoC related commands have been changed.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2020-05-05 11:05:54 +03:00
Kumar Gala
59d3cc213e tests: Convert DT_ALItAS_* to new DT_ALIAS() macro
Convert DT_ALIAS_* defines to use DT_ALIAS() plus other macros from
include/devicetree.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 09:11:38 -05:00
Luiz Augusto von Dentz
70271435dd Bluetooth: shell: Enable BT_EATT
This enables BT_EATT for shell samples so it can be build test by CI and
gives user the ability of test it using shell commands.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-02 15:59:14 +03:00
Joakim Andersson
45e6921517 Bluetooth: test: Fix redefinition of BT_BUF_ACL_SIZE
Fix BT_BUF_ACL_SIZE in hci_test_app after declaration was moved to
hci_raw.h

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-02 13:08:59 +03:00
Joakim Andersson
68ce16cf86 Bluetooth: tests: Update EDTT configuration for easier debugging
Update EDTT default configuration to make it easier to debug. The
use of maximum log level to restrict default output caused some
confusion. Instead remove debug options to reduce the default log
output. Enabling debug logs is now similar to other samples and tests.

Remove options commented out, no need to keep them.
Move comment to the matching CONFIG.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-30 13:33:16 +02:00
Joakim Andersson
e1479a406f Bluetooth: test: Convert EDTT test to using k_timeout_t struct
Convert the EDTT test to use k_timeout_t struct.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-30 13:46:48 +03:00
Carles Cufi
205cf1595e boards: nrf52810_pca10040: Rename to nrf52dk_nrf52810
The board target for emulation of nRF52810 on nRF5DK, so far
known as nrf52810_pca10040, is renamed to nrf52dk_nrf52810.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Carles Cufi
6656214af2 boards: nrf52_pca10040: Rename to nrf52dk_nrf52832
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832.  Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Johan Hedberg
71eb56a34c net: buf: Move LEGACY_TIMEOUT_API selection to specific subsystems
The net_buf subsystem is now fully compatible with the new timeout
API, so move the selection of the legacy API to those specific
subsystems that use net_buf and still need converting.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-03 23:17:53 +03:00
Joakim Andersson
3baccee472 Bluetooth: tests: Add additional build configurations
Add additional build configurations to the shell to catch build errors
when enabling extended advertising.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-03 21:13:14 +03:00
Johan Hedberg
31ad7b455b Bluetooth: tests: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() macro to pass a timeout to k_sleep().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-01 20:03:15 +03:00
Joakim Andersson
f2d7b77e96 Bluetooth: host: Deprecate BT_LE_ADV defines in hci.h in favour of gap.h
Deprecate BT_LE_ADV defines in hci.h that are expected to be used by the
application in the scan received callback to identify the advertising
PDU type. These defines are mixing HCI input parameters and advertising
PDU types. Internally it is acceptable to mix these, but at the API we
should to mix in them.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-30 00:38:23 +03:00
Joakim Andersson
405ce842ab Bluetooth: host: Add new argument and return code to bt_create_conn_le
Deprecate bt_create_conn_le and rename it to in order to add return
code, new arguments and to follow the established naming convention.

Add API for the application to control the scan parameters of the
initiator role. This allows the application more scheduling control
of the initiator in multi-role scenarios. Also provides options to
configure the initiator for LE Coded PHY for long range support.
We deprecate the old way of creating connection to make the name more
consistent with the rest of the API.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-30 00:38:23 +03:00
Torsten Rasmussen
407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Andrzej Głąbek
4253eae005 boards: nrf52840_pca10056: Rename board to nrf52840dk_nrf52840
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-27 09:14:08 +01:00
Ioannis Glaropoulos
f3807f19dc boards: arm: nrf51_pca10028: rename board to nrf51dk_nrf51422
We rename the nRF51 Dev Kit board target (nrf51_pca10028)
to nrf51dk_nrf51422. We update all associated references
in the supportive documentation and all nRF51-related
cofigurations and overlay files in the samples and tests
in the tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-24 11:45:27 +01:00
Trond Einar Snekvik
824c2ebc58 Bluetooth: Mesh: Slab based segmentation handling
Allocates segmented message buffers as slabs in a common pool for RX and
TX. This reduces memory requirements for both TX and RX, as TX messages
can be stored without the network and advertising buffer overhead, and
RX can use only the slabs it needs, instead of allocating a full size
segmented message. This approach also removes the need for decrypting
the segments for each retransmission, reducing overall processing load.

Slab based segmentation for tx also introduces queuing of segmented
messages, which allows the application layer to send multiple messages
to the same destination without violating Bluetooth Mesh specification
v1.0.1, section 3.6.4.1. This mechanism is provided through a flag that
blocks segmented messages to a destination which a message is already
being sent to until the previous message finishes.

This changes the SDU size configuration to a symmetrical
RX_SEG_MAX/TX_SEG_MAX pair of configurations, plus a new segment pool
side configuration. It also removes the binding between the TX_SEG_MAX
config and the advertising buffers, reducing the minimum advertising
buffer count from 6 to 3.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-03-19 15:54:26 +02:00
Carles Cufi
02b630d494 Bluetooth: tester: Fix GATT service registration
The service registration logic was using the wrong variable to check for
a pending service to be registered, which led to the same service being
registered twice in some cases. Fix the logic so that a pending service
is only registered once.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-27 21:21:46 +02:00
Joakim Andersson
5c1963b1c5 Bluetooth: tests: shell: Add missing dependency in mesh.conf
Add missing dependency in mesh.conf.
Handles this warning: Warning: BT_MESH_SHELL was assigned the value 'y'
but got the value 'n'. Check these unsatisfied dependencies:
BT_MESH_HEALTH_CLI (=n)

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-27 13:45:18 +02:00
Joakim Andersson
98827e9f6d Bluetooth: tests: shell: Remove config not supported on native_posix
Remove CONFIG_CONSOLE_HANDLER from project configuration. When building
for native_posix this produces the following warning:

warning: CONSOLE_HANDLER was assigned the value 'y' but gotthe value 'n'
Check these unsatisfied dependencies: SERIAL_SUPPORT_INTERRUPT (=n)

The shell works without this option since this is handled by the shell
itself instead.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-27 13:45:18 +02:00
Carles Cufi
e9a416f3cd Bluetooth: tester: Add missing log_strdup
Since we enable CONFIG_ASSERT in the tester app, the logging subsystem
will assert if it detects a missing log_strdup. Add the two missing ones
that I could find to properly log transient strings.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-25 22:29:29 +02:00
Carles Cufi
2b0e9a3d6e Bluetooth: tester: Implement the GAP_SET_MITM command
Implement the BTP command to set MITM, although on Zephyr this is not
configurable at runtime. Instead print a warning instructing to use the
CONFIG_BT_SMP_ENFORCE_MITM Kconfig option instead.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi
3c69dff9a3 Bluetooth: tester: Implement the GAP_PASSKEY_CONFIRM command
Implement the BTP GAP command and event for passkey confirmation.
This also allows us to set the passkey_confirm auth callback which
enables the keyboard/display IO capabilities.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi
c3f5677672 Bluetooth: tester: Implement the GAP_SET_BONDABLE command
Implement the BTP GAP command to set bondable on or off.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi
4a59e8da59 Bluetooth: tester: Disable forcing of MITM
Since some tests require MITM to be off, disable the option that forces
the MITM flag at all times.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi
6f8dd90a83 Bluetooth: tester: Ensure the app is bondable by default
Ensure the bondable Kconfig option is set unconditionally.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi
2b48a8f37b Bluetooth: tester: Fix packet field name
Correct the name of the boolean include in the set bondable
command so it reflects the spec.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi
5cbc3e0c6c Bluetooth: tester: Tweak nRF52840 config
Disable stack measurements by default, since they pollute the log
output.
Ensure that the logging thread has enough stack.
Ensure that the UART that connects to the BTP client is
interrupt-driven.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-23 21:46:22 +02:00
Carles Cufi
613e5f541f Bluetooth: tester: Update GATT cmds/evts to the latest BTP spec
Fill in all the missing GATT commands and events in the latest BTP
specification.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-22 19:15:04 +02:00
Carles Cufi
2be22c0473 Bluetooth: tester: Update GAP cmds/evts to the latest BTP spec
Fill in all the missing commands and events in the latest BTP
specification.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-21 18:17:59 +02:00
Carles Cufi
cee1954ac3 Bluetooth: tester: Add abundant logging in GAP
Log all error conditions in GAP for easier debugging.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-21 13:42:07 +02:00
Carles Cufi
7f5ae21a6d Bluetooth: tester: Add logging in core handlers
Add warnings when something goes unhandled.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-21 13:42:07 +02:00
Carles Cufi
b01cd4c7bb Bluetooth: tests: tester: Add an init log message
Add a log message to let people running the test know that the tester
booted up correctly.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-20 21:37:33 +02:00
Carles Cufi
5af621282e tests: bluetooth: tester: Add a config for the 52840 DK
Add a configuration file for the nRF52840 DK so that it uses RTT for
debugging and enables more protection measures.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-20 21:37:33 +02:00
Carles Cufi
6de5c4b7b3 tests: bluetooth: tester: Clean up configuration
- Use the built-in mechanism for configuration overlays
  (having a boards/ folder with <board>.conf fragments)
- Clean up variables that were giving warnings

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-20 21:37:33 +02:00
Joakim Andersson
b5c02d0649 Bluetooth: EDTT: Remove ncmd and opcode from EDTT command response
Encode all types of EDTT command response with similar structure to how
it is generated from command complete when it is generated from the
command status.
This structure will be:
2 byte EDTT command response code
2 byte EDTT length field
1 byte HCI status
N bytes of command output parameters

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-17 19:03:12 +02:00
Joakim Andersson
a581443028 Bluetooth: EDTT: Enable disabled tests
Enable tests that was disabled due to test failure. Test have been
updated and are now passing.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-17 19:03:12 +02:00
Joakim Andersson
2c857f9f69 Bluetooth: EDTT: Replace printk with logging
Replace printk with logging, add additional log statements for command
handling.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-17 19:03:12 +02:00
Joakim Andersson
1c551e4835 Bluetooth: EDTT: Remove use of deprecated defines
Remove the use of BT_BUF_USER_DATA_MIN which has been deprecated.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-17 19:03:12 +02:00