Commit graph

2414 commits

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