Commit graph

2414 commits

Author SHA1 Message Date
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