Commit graph

2098 commits

Author SHA1 Message Date
Piotr Narajowski cf174804fb bluetooth: tester: Add CCP Tests
Adding support for remaining CCP test cases.
Also removing callback descriptions from btp files not to get confused
with header files.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2024-01-05 14:41:52 -05:00
Erik Brockhoff 5f99c36ca1 Bluetooth: controller: fix procedure collision handling
If an instant based remote procedure 'overtakes' a local ditto
the local procedure will be 'completed' by remote rejection
but collision flag would not get set ensuring that a new local
conflicting procedure cannot be started before the remote is completed.
This can thus lead to invalid local initiation.

Added unittest to cover case

Fix by ensuring collision flag is set also in the above mentioned
scenario.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2024-01-05 09:05:26 +01:00
Mariusz Skamra 4a77bdb4e8 tests: Bluetooth: tester: Add initial support for HAP
This adds initial support for Hearing Aid Profile BTP service commands.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2024-01-02 10:10:15 +01:00
Emil Gydesen cda5e58aa5 Bluetooth: CAP: Commander discovery support
Implement the CAP Commander discovery function.

Adds support for it in the shell.

This includes initial babblesim and unit testing as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-19 08:50:40 +01:00
Jonathan Rico a05a47573a Bluetooth: ATT: Internalize ATT PDU TX pool
Why?
- metadata is easier to manage as an array + index
  - less error-prone -> less memory-management bugs
- we can. because of the previous refactor
- PDU allocations are more predictable
- ATT buffer size can be optimized by app
- isolates ATT from the rest of the ACL users
  - decouples ATT PDU size from e.g. SMP w/ LESC

Drawbacks:
- higher memory usage
- kconfig change

The higher memory use is only temporary, as this will be followed-up
with more refactors that should bring it back down.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-15 17:14:56 +02:00
Mariusz Skamra 874e724492 tests: Bluetooth: ascs: Add expect_bt_bap_stream_ops_released_called
This adds the expect_bt_bap_stream_ops_released_called function that
takes an array of streams to verify as an argument. It's more versatile
approach than having expect_bt_bap_stream_ops_released_called_twice
erc. functions, that scales bad.
The function ignores the arhument list order, so that the user does not
have to predict the exact order of function calls.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:33:13 +01:00
Mariusz Skamra cb6c856d76 tests: Bluetooth: ascs: Limit the default number of ASEs
This limits the default number of ASEs available to 1.
The value can be overwritten in test case specific parameters
in testcase.yaml file.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:33:13 +01:00
Mariusz Skamra 92d5cdec75 tests: Bluetooth: ascs: Remove duplicated config setting
This removes duplicated CONFIG_BT_ISO_MAX_CHAN config setting and leaves
the default value set to 1.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:33:13 +01:00
Mariusz Skamra f58f74a091 tests: Bluetooth: ascs: Fix minor comment issue
This fixes opcode comment.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:33:13 +01:00
Mariusz Skamra e3e567ad82 tests: Bluetooth: ASCS: Add tests for invalid operations in Releasing state
This adds missing tests for invalid operations initiated by
locally or by client on ASE in Releasing state.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:33:13 +01:00
Mariusz Skamra c797f9b5f3 tests: Bluetooth: ascs: Remove redunadant tests
This removes 2 tests related to ASCS handling ACL disconnection.
c3c83c7049 modified the ACL disconection
behavior, so that ASE goes directly to idle state, not waiting in
releasing state for CIS disconnection. Thus the tests where state
machine waits for CIS disconnection can be removed now.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:33:13 +01:00
Emil Gydesen 9c8ec58beb Bluetooth: GMAP: Add GMAP shell
Add the GMAP shell module with support for running the
various audio configurations in an easy way.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-11 18:30:57 +01:00
Szymon Janc a2184305f2 bluetooth: tester: Enable Periodic Advertising support
This is required by GAP/PADV/PASM/BV-01-C and GAP/PADV/PAM/BV-01-C
qualification test cases.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-12-11 09:50:48 +01:00
Aleksandr Khromykh 450ad68ca8 tests: Bluetooth: Mesh: delayable message unit tests
Commit adds unit tests for the newly created
access delayable messages.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-12-11 09:50:18 +01:00
Andrei Emeltchenko 339d0ac4a5 tests: btp_mcp: Fix dead code warning
Remove return statement preventing to return error code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-12-08 10:05:20 +00:00
Emil Gydesen 203949c42c Bluetooth: VCP: Allow for multiple vol_ctrl cb registers
Modify the VCP volume controller callbacks to support
multiple registers by making it into a linked list.

This allow for multiple applications to get the information
from procedures or notifications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-08 10:04:31 +00:00
Lingao Meng 786b9a0ad4 Bluetooth: Host: Add const prefix for UUID
Add const prefix for service uuid and char uuid.

Since Service UUID and Char UUID should not change in the service
definition, they are most reasonably defined as rodata, also for
save some ram footprint.

The field `attr->user_data` type is `void *`, as this PR change
all Service UUID to rodata, so there must add (void *) to avoid warning.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-12-07 16:16:43 +00:00
Emil Gydesen 3fec3964e0 Bluetooth: CAP: Move initiator/commander common code to cap_common
The CAP Initiator and the CAP Commendar share quite a lot of
functionality in terms of discovery and performing set-based
procedures.

The code for handling most of this has been moved to
cap_common.c to avoid duplicating code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-07 16:14:42 +00:00
Mariusz Skamra 78a4b33e5c Bluetooth: audio: pacs: Add bt_pacs_set_available_contexts_for_conn
This adds the function that sets the available contexts value per
connection object so that API user can set different available contexts
per connection.
The lifetime of such overriden value is the same as connection lifetime,
so on reconnection or device reboot all devices return to having the
same available contexts value again.

Fixes: #64968
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-06 17:54:14 +00:00
Piotr Narajowski 1f19cc782d bluetooth: tester: MCP Client test
Adding support for one missing MCP testcase - verifying characteristic
handles during service discovery.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-12-06 17:52:49 +00:00
Emil Gydesen 92a813d28b tests: Bluetooth: Unittest of bt_bap_base API
Adds unittesting of the bt_bap_base API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-06 17:51:47 +00:00
Emil Gydesen c9daed9712 Bluetooth: BAP: Refactor bt_bap_base
This removes the fixed size bt_bap_base, which provides
2 improvements:
1) The RAM usage of the broadcast sink has been reduced.
   For the Broadcast Sink sample it is a reduction of 120
   octets, but with much better scaling for supporting
   more or larger BASEs.
2) The functions to parse BASEs now support arbitrary sized
   BASEs, where they were previously restricted by our
   local Kconfig options. This allow us to parse any BASE
   from a remote device, without encounting memory issues.
   We are still memory restricted on the devices we
   actually want to sync to.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-06 17:51:47 +00:00
Jonathan Rico 20057b6564 tests: Bluetooth: add missing param to testlib
The lib was refactored, but CI didn't run the tests that used it for
some reason.
A parameter was forgotten.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-12-05 15:09:18 +01:00
Aleksander Wasaznik f6fced8ecc Bluetooth: Testlib: Add comments
This patch just adds some comments and asserts to clarify the testlibs
att read code.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-05 10:12:13 +00:00
Aleksander Wasaznik b52d59dd57 Bluetooth: testlib: Clang format fix
This reformats some code on main branch that was not clang formated. The
syntax is changed from initializer list to multiple statements because
there is a conflict in formating requirements between clang format and
checkpatch.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-05 10:12:13 +00:00
Aleksander Wasaznik bbdcf4be7a Bluetooth: testlib: att_read: Fix assert on zero-sized read
`read_data` can be NULL even on success if `read_size` is `0`.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-05 10:12:13 +00:00
Aleksander Wasaznik a29473c38e Bluetooth: Testlib: att_read allow ignoring result_size
Allow passing in NULL as `result_size` to ignore it.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-05 10:12:13 +00:00
Szymon Janc ce45c0ac57 tester: bluetooth: Add support for reporting sync status
Implements sync established and sync lost BTP events.
This was affecting GAP/PADV/PASE/BV-01-C test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-12-04 16:39:01 +00:00
Szymon Janc ae15a059a8 bluetooth: tester: Fix missing LE to CPU convertion in BTP
SYnc timeout and skip are 16 bit values and shall be converted to CPU
order before use.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-12-04 16:39:01 +00:00
Szymon Janc bc97d1ead0 bluetooth: tester: Add support for flags in BTP_GAP_PADV_CREATE_SYNC
This allows for more tuning regarding Periodic Advertising Sync
behavior.

Required by GAP/PADV/PASE/BV-01-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-12-04 16:39:01 +00:00
Henrik Eriksen 8f0b1f6424 bluetooth: tester: HAS Preset initialization done by auto-pts client.
- Removed preset initializations. Done in auto-pts client.
- Added one additional preset in overlay-le-audio.conf.

Signed-off-by: Henrik Eriksen <heri@demant.com>
2023-12-04 14:31:11 +01:00
Andries Kruithof c3e2be4314 Bluetooth: audio: host: call the stream disable callback
Even though the ASCS Sink ASE state machine does not enter the disabling
state according to ASCS spec, it still makes sense to do so.

the state transition unit tests are updated to verify calling or not
calling the disable callback, depending on the transition of the state

fixes #63230

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-12-01 10:50:04 +00:00
Szymon Janc 530e3670bc bluetooth: tester: Allow to use filter list for advertising
If there is any element on filter list it is used for advertising.
This allows to test all scenarios involving allow list (empty, peer
on list, peer not on list).

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-11-30 10:06:39 +01:00
Piotr Narajowski e91e65b5fd bluetooth: tester: GMCS Server tests
Add support for Generic Media Control Service tests

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-11-30 10:01:35 +01:00
Armin Brauns 5b1b260f80 bluetooth: add HCI driver parameter to set controller's public address
This allows HCI drivers to expose vendor-specific functions to set the
public address.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-11-29 10:44:25 +01:00
Kyra Lengfeld 07d04b0f40 Bluetooth: Host: build shell power_control_request
(Not to mistake it for the dynamic power control nor the zephyr LL
vendor-specific commands controlling local tx power) this yaml addition
will build the shell code for the LE Power Control Feature API's, acting
as verification.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2023-11-29 09:59:39 +01:00
Aleksander Wasaznik 589f3ad904 Bluetooth: testlib: Create testlib/conn.h
This header file declares the functions that rely on `bluetooth/conn.h`.

This collects `testlib/connect.h`, `conn_ref.h` and `conn_wait.h` into one.

Initial documentation for the functions in this file is also added.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-22 14:55:43 +00:00
Alberto Escolar Piedras 6c9dfe1b2c tests/bluetooth/*: Enable for native_sim
Enable all remaining bluetooth tests for native_sim
and switch from native_posix to native_sim as default
test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:10 +01:00
Alberto Escolar Piedras ed2251ae75 tests/bluetooth/hci_uart_async: Switch to native_sim
Switch from native_posix to native_sim as default test platform
And add overlays for native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:10 +01:00
Alberto Escolar Piedras 53103b9a65 tests/bluetooth/shell: Enable for native_sim
Enable these tests for native_sim and switch
the default integration platform from
native_posix to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:10 +01:00
Alberto Escolar Piedras fd6f473515 tests/bluetooth/ctrl_isoal: Remove instructions from header comment
How to run tests is described in the twister documentation,
let's not replicate that kind of instructions in all files.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:10 +01:00
Alberto Escolar Piedras c3b7159cdf tests/bluetooth/mesh: Enable for native_sim
Enable this tests for native_sim and switch
the default integration platform to be native_sim
from native_posix

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:10 +01:00
Emil Gydesen 1829cf4324 Bluetooth: Audio: Add set functions for codec meta
Add set function for all metadata types for both
codec_cfg and codec_cap.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-21 08:38:29 +00:00
Magdalena Kasenberg 17b39baa61 bluetooth: tester: Add support for BASS
Support for BAP/BASS and BASS test cases.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-11-20 11:13:54 +01:00
Pavel Vasilyev 3bc17d1d18 Bluetooth: Mesh: Fix async behavior of Private Beacon Client API
The Private Beacon Client API requires a response argument to allow to
call the API in the asynchronous manner
(https://github.com/zephyrproject-rtos/zephyr/pull/56426).

Because the removal of the EXPERIMENTAL tag for this API was not
released yet, it should be OK to change this API.
The EXPERIMENTAL tag has been removed here:
https://github.com/zephyrproject-rtos/zephyr/pull/64866

Coverity-CID: 330039
Coverity-CID: 330029
Coverity-CID: 329977

Fixes #65336
Fixes #65338
Fixes #65354

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-11-20 09:23:56 +01:00
Lingao Meng 5f1c2f199b Bluetooth: Mesh: Make element as rodata
the reason is that the Mesh Profile clearly stipulates that Mesh nodes
cannot change their own element definitions.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-11-20 09:22:55 +01:00
Lingao Meng ab08f34fd9 Bluetooth: Mesh: Make bt_mesh_model as rodata
Since model struct most of member should not change at run time,
so mark as const will be suitable and safely.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-11-16 16:52:14 +01:00
Mariusz Skamra 71494dd98f tests: bluetooth: ascs: Add test for ASE notificaion retry
This adds test for ASE state notification retry. The test verifies
whether the state transition is repeated if failed due to notification
error.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-11-15 10:03:07 +01:00
Mariusz Skamra 341e571cfb tests: audio: mocks: Add k_work_schedule mock implementation
This adds k_work_schedule mock implementation that will be used in
bluetooth audio unit tests.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-11-15 10:03:07 +01:00
Kamil Piszczek f6d6742ca1 bluetooth: id: make sharing RPA between adv sets optional
Added a Kconfig option that makes the RPA sharing feature optional. By
default, the Zephyr Bluetooth stack now uses the RPA rotation policy
that was active before the introduction of the RPA sharing functionality
in the following PR:

https://github.com/zephyrproject-rtos/zephyr/pull/55449

The new Kconfig option configures the advertising sets linked with the
same Bluetooth identity to use the same Resolvable Private Address in
a given rotation period. After the RPA timeout, the new RPA is
generated and shared between the advertising sets in the subsequent
rotation period.

When this option is disabled, the generated RPAs of the advertising
sets differ from each other in a given rotation period.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2023-11-14 09:22:51 +01:00
Alberto Escolar Piedras 327f75ec35 tests/bluetooth/tester: Enable in native_sim
Enable this test in the native_sim target.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-14 09:52:34 +02:00
Mariusz Skamra f0715fcbb3 tests: bsim: testlib: Fix compilation error
Fixes compilation error seen if CONFIG_BT_EATT is unset

testlib/src/att_read.c:179:73: error: expected expression before ‘,’ token
179 |               IF_ENABLED(CONFIG_BT_EATT, (.chan_opt = bearer)),
    |                                                               ^

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-11-13 09:45:20 +01:00
Emil Gydesen 06d5a625a6 Bluetooth: Audio: Add codec cap set functions
Add set functions for codec capability, to set all
assigned number values in the bt_audio_codec_cap
struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-13 09:42:35 +01:00
Emil Gydesen 475e067379 tests: Bluetooth: Add inval testing of bt_bap_broadcast_source_get_base
Add invalid parameter and state testing of
bt_bap_broadcast_source_get_base

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-13 09:41:56 +01:00
Emil Gydesen 1946dd829d tests: Bluetooth: Add inval testing of bt_bap_broadcast_source_get_id
Add invalid parameter and state testing of
bt_bap_broadcast_source_get_id

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-13 09:41:56 +01:00
Piotr Narajowski 7f7b097499 bluetooth: tester: MCP Client tests
Add support for Media Control Client tests

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-11-09 11:20:49 +01:00
Aleksander Wasaznik bfff0f9f4c Bluetooth: Host: Tests: Move testlib to common
This is the first patch with the goal of establishing a common library
for Bluetooth utilities that are commonly used for setup in Bluetooth
Host tests. The ultimate goal is to remove redundant (near) copies of
these utilities and other more ad-hoc solutions.

This patch moves one instance of testlib (from
tests/bsim/bluetooth/host/att/long_read) to
tests/bluetooth/common/testlib and makes it a proper CMake library.

The long_read test is updated to link to the new CMake library.

Further changes and de-duplication will come in later patches.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-07 10:09:33 +01:00
Emil Gydesen b92ac42677 Bluetooth: CAP: Commander API and skeleton
Adds the CAP Commendar API and skeleton that can
implemented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-07 09:49:41 +01:00
Alberto Escolar Piedras c914c512a0 samples/tests: Remove REQUIRES_FULL_LIBC=y due to LIBLC3
As now this is handled by the LIBLC3 kconfig

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-06 10:10:27 +01:00
Carles Cufi 9cf07bbdb5 bluetooth: Rename rpmsg HCI driver and sample to ipc
The existing driver and sample:

- drivers/bluetooth/hci/rpmsg
- samples/bluetooth/hci_rpmsg

are no longer correctly named, since they now use the IPC subsystem to
send and receive data. The IPC subsystem can use RPMsg as a transport,
but that is one of several selectable backends.

I initially wanted to deprecated both the BT_RPMSG Kconfig option as
well as the zephyr,bt-hci-rpmsg-ipc chosen node in Devicetree. However,
this proved to be undoable in the case of the Kconfig option. This is
because it's a choice option, and those have special behavior. In
particular, the only practical way to deprecate would've been to keep
the old Kconfig option outside the choice (much like it's done in this
commit) but then also add a 'depends on !BT_RPMSG' on each of the
remaining choice symbols *except* on the new BT_HCI_IPC one. This, however,
only works correctly for .conf files. If a board instead sets the
default BT_HCI_BUS_TYPE in the Kconfig.defconfig file then the Kconfig
tree parsing would fail, because it'd try to set it to a value
(BT_RPMSG) that is no longer part of the choice.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-11-02 08:32:20 +02:00
Mariusz Skamra ac3a6d3721 tests: Bluetooth: tester: Fix missing net_buf_unref
This fixes missing unreference of network buffer allocated
when there is no data to send in the ring buffer.
The code have been refactored, so that we check whether there is
anything to send first, and if there is, the TX buffer is allocated.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-10-27 10:50:30 +02:00
Keith Packard 565c9376f1 tests: Switch from NEWLIB_LIBC to REQUIRES_FULL_LIBC
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF where needed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-25 08:32:06 +02:00
Mariusz Skamra 281ffe5b4f tests: Bluetooth: tester: Fix bt_micp_mic_ctlr_mute_get invalid usage
The call to bt_micp_mic_ctlr_mute_get function will return the value of
mute state in bt_micp_mic_ctlr_cb.mute callback. This fixes invalid
function calls by storing the recent mute state value in the
application.

Fixes: MICP/CL/SPE/BI-01-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-10-20 15:13:46 +02:00
Pavel Vasilyev 5b8a9517a1 tests: bluetooth: tester: Allow to compile mesh without LPN
This can be needed to qualify features without LPN support.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-20 15:09:25 +02:00
Pavel Vasilyev 136c5a9d57 tests: bluetooth: tester: Fix BLOB server model pointer
PTS uses BLOB server model instantiated by DFD server for MBT tests as
it is the first BLOB server model in the device composition data. DFU
server, which also has BLOB server model, is instantiated after DFD
server.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-20 15:09:25 +02:00
Alperen Şener 2972341388 tests: bluetooth: tester: add page number to response
PTS requires IUT to send requests with page number with
0xFF or the highest supported page number in order to
retrieve all the composition data pages from the lower
tester.

This commit add the page number to the response, thus
the upper tester can follow the last page number and
send the next page request until page 0 is requested.

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
2023-10-20 15:08:07 +02:00
Anas Nashif 996c8457d7 ztest: remove old ztest api
Remove old Ztest API entirely. New API is the now the default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Anas Nashif 345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Alperen Şener e3b63e7baf bluetooth: tester: Enable composition data page 2
Enabling the composition data page 2 feature and
adding tester support.

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
2023-10-20 15:00:34 +02:00
Henrik Eriksen 3aeeeb746a bluetooth: tester: cas: Added support for testing Common Audio Service
- Set Member Lock
- Get Member RSI

Signed-off-by: Henrik Eriksen <heri@demant.com>
2023-10-20 14:59:39 +02:00
Emil Gydesen 9c47eb924f Bluetooth: Audio: Refactor codec_cfg_get_frame_duration_us
Refactor the codec_cfg_get_frame_duration function to return the
assigned numbers value, instead of a converted value, but with
support for converting the value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-20 14:56:13 +02:00
Lingao Meng c2b2641fc1 Bluetooth: Mesh: Move ext adv sector to vector
Obviously, it looks obscure by putting it in a sector,
so, let's move to vector.

refs: https://github.com/zephyrproject-rtos/zephyr/pull/57883

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-10-20 14:54:17 +02:00
Lingao Meng 141467a261 Bluetooth: Mesh: Rename adv relay to adv simultaneous
Since notice that simultaneous advertising is not only used
by relay message, provision over pb-adv can also be used.
so it was changed to a more general name.

refs:https://github.com/zephyrproject-rtos/zephyr/pull/48903

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-10-20 14:54:17 +02:00
Emil Gydesen 84c01bb527 Bluetooth: Audio: Add ISO test parameters to the BAP API
Add support for the ISO test parameters in the BAP API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-20 14:50:48 +02:00
Mariusz Skamra 3828f1cec2 Bluetooth: ascs: Check subscription state on ASE notification
Check whether peer is subscribed for ASE state notification before
calling bt_gatt_notify. This handles an assert thrown when the
notification failed to be sent.

Fixes: #63728
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-10-12 18:48:09 +03:00
Aleksandr Khromykh 917a3e6e64 tests: bluetooth: tester: enable proxy solicitation
Commit enables proxy solicitation functionality
(server part) for mesh proxy PTS tests.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-10-12 18:07:50 +03:00
Emil Gydesen b63d8ffb2f tests: Bluetooth: BAP: Improve validation of broadcast source reconfig
Add verification of all stream's SDU, RTN and PHY rather than
just the first.

Also add another test case where only a subset of streams are being
reconfigured, but where the above values shall be updated for
all streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-12 09:41:30 +03:00
Anas Nashif 2144d6f5e6 tests: bluetooth: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Pavel Vasilyev 1c1c5e22b7 tests: bluetooth: tester: Add Upload OOB support for mesh tester
This allow to run the following PTS test:
- DFU/SR/FD/BV-06-C
- DFU/SR/FD/BV-13-C
- DFU/SR/FD/BV-14-C
- DFU/SR/FD/BV-15-C
- DFU/SR/FD/BV-16-C
- DFU/SR/FD/BV-17-C
- DFU/SR/FD/BV-18-C
- DFU/SR/FD/BV-22-C

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-11 14:04:11 +03:00
Szymon Janc 4f57614cbd tests: bluetooth: tester: Fix GATT read multiple
Pass only speficied number of handler to read_params for GATT read
multiple. This is to avoid sending invalid (zeros) handles in
ATT_READ_MULTIPLE_REQ.

This was affecting GATT/CL/GAR/BI-18-C and GATT/CL/GAR/BI-19-C
qualification test cases.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-10-10 12:48:11 +03:00
Szymon Janc 4c269d0d61 tests: bluetooth: tester: Increase BT RX thread stack
Default stack size if not enought and was causing MPU faults.
This was affecting GATT/SR/GAW/BV-14-C qualification test case.

<dbg> bttester_gatt: gatt_db_add: handle 0x0000
<err> os: ***** MPU FAULT *****
<err> os:   Stacking error (context area might be not valid)
<err> os:   Data Access Violation
<err> os:   MMFAR Address: 0x2000aa38
<err> os: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x00000000
<err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x00000000
<err> os:  xpsr:  0x00000000
<err> os: Faulting instruction address (r15/pc): 0x00000000
<err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
<err> os: Current thread: 0x20002d28 (BT RX)
<err> os: Halting system

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-10-10 11:18:11 +02:00
Emil Gydesen ab15043b72 tests: Bluetooth: BAP Broadcast source id and BASE unit tests
Add unit test to test the get_id and get_base functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-09 16:11:05 +03:00
Pavel Vasilyev 94bd09b1f8 tests: bluetooth: tester: Fix prov ctx init in PTS tests
This fixes regression introduced in
https://github.com/zephyrproject-rtos/zephyr/pull/63556

In the PR above `bt_mesh_init()` call was moved to `BTP_MESH_INIT`
command to allow to select alternative composition data when starting
the stack. AutoPTS sends `BTP_MESH_CONFIG_PROVISIONING` command
before `BTP_MESH_INIT` to prepare the provisioning context. But
because `bt_mesh_init()` is now called after
`BTP_MESH_CONFIG_PROVISIONING` command is sent, this configuration is
reset to the default which makes PTS tests to fail.

To solve this, this commit calls introduces a new command,
`BTP_MESH_START`, which will replace the original `BTP_MESH_INIT`
command. `bt_mesh_init()` will stay in `BTP_MESH_INIT` while the stack
will be started in `BTP_MESH_START` command.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-09 14:56:58 +03:00
Pavel Vasilyev 0eb027ab7c tests: bluetooth: tester: Fix self-update test DFU/SR/FD/BV-59-C
DFU/SR/FD/BV-59-C tests Distributor self-update. Because the actuall
firmware swapping doesn't happen, we need to just simulate the swapping
by setting new Firmware ID sent by LT. We use slot to take firmware id
as by procedure, Fw Update Server doesn't know about it.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-06 16:20:14 +03:00
Henrik Eriksen f977457c07 bluetooth: tester: pacs: Added set Locations and Contexts.
- Set Locations.
- Set Available Contexts.
- Set Supported Contexts.

Signed-off-by: Henrik Eriksen <heri@demant.com>
2023-10-06 16:15:54 +03:00
Carles Cufi a5e7ba3564 Bluetooth: Controller: Remove legacy BT_CTLR_FAST_ENC option
When the legacy LLCP implementation was removed this Kconfig option was
mistakenly left over. Remove it now with all its users.

Fixes #63212.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-10-06 13:32:33 +03:00
Pavel Vasilyev 8b4994f22f tests: bluetooth: tester: Allow to pass int instead of bool in comp cmd
This will allow to choose more variants of cdp in future if needed.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-06 09:16:39 +02:00
Pavel Vasilyev bd82ff245a tests: bluetooth: tester: Remove comp_alt_set command
Remove this command as composition can only be set in bt_mesh_init call
which is called before settings are loaded.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-05 11:08:05 +02:00
Pavel Vasilyev 2445e55cd4 tests: bluetooth: tester: Move bt_mesh_init call to BTP_MESH_INIT cmd
In some RPR tests we need to pass alternative composition data when
testing CDP128. When bt_mesh_init is called from mesh service
registration callback, we can't pass any arguments. Therefore we need
to move bt_mesh_init call out from mesh service registration to
BTP_MESH_INIT command.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-05 11:08:05 +02:00
Alperen Şener 85fa412201 bluetooth: tester: add support for variable static oob size
Adding variable static auth size support to be compatible
both mesh 1.0.1 and mesh 1.1.

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
2023-10-05 09:20:33 +02:00
Emil Gydesen 6c12ed18ad tests: Bluetooth: Add inval testing of bt_bap_broadcast_source_stop
Add invalid parameter and state testing of bt_bap_broadcast_source_stop

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-03 14:28:19 +01:00
Andrei Emeltchenko ca1de2fc39 tests: btp_mesh: Check correct error code
Check actual error code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-10-03 09:21:40 +02:00
Peter Mitsis 2f003e59e4 kernel: Re-factor k_mem_slab definition
Rearranges the k_mem_slab fields so that information that describes
how much of the memory slab is used is co-located. This will allow
easier of its statistics into the object core statistics reporting
framework.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Emil Gydesen f5dd62bbec Bluetooth: Audio: Update codec_cfg_get_chan_allocation
Update the function name from codec_cfg_get_chan_allocation_val
to just codec_cfg_get_chan_allocation, and add
codec_cfg_set_chan_allocation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-29 16:29:58 +02:00
Alperen Şener a54c18ad31 tests: bluetooth: tester: fix improper large comp rsp struct init
Large composition data response struct should have a
data buffer to store the reponse data to

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
2023-09-29 16:26:42 +02:00
Alperen Şener 90fac3045d tests: bluetooth: tester: add transfer ttl to mbt inputs
adding transfer ttl ixit value to be used as input for
mbt test cases

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
2023-09-29 16:26:42 +02:00
Emil Gydesen c8a79e1fc1 Bluetooth: Audio: Add codec_cfg_set_frame_blocks_per_sdu
Add the bt_audio_codec_cfg_set_frame_blocks_per_sdu function
to set or add the frame blocks per SDU field in the
codec configuration.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-29 16:25:17 +02:00
Emil Gydesen 638316cbb5 tests: Bluetooth: Add inval test of bt_bap_broadcast_source_create
Add unit tests that tests invalid parameters for the
bt_bap_broadcast_source_create function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-29 12:59:54 +02:00
Emil Gydesen bc6962b755 tests: Bluetooth: Add inval testing of bt_bap_broadcast_source_delete
Add invalid parameter and state testing of
bt_bap_broadcast_source_delete

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-29 12:59:41 +02:00
Emil Gydesen 5656c23243 Bluetooth: Audio: Add codec_cfg_set_octets_per_frame
Add the bt_audio_codec_cfg_set_octets_per_frame function
to set or add the octets per frame field in the
codec configuration.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-29 09:46:58 +02:00
Emil Gydesen 8ab3fbf570 Bluetooth: Audio: Split bt_audio_codec_meta_get to cfg and cap
Split the bt_audio_codec_meta_get functions to cfg and cap
variants. This provides a more explicit API where users
do not need to dereference their cfg/cap structs in order
to use this functions.

Furthermore this will also make the get functions more
similar to the upcoming set functions, where the set functions
will require the use of the cfg and cap structs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-29 09:46:15 +02:00
Emil Gydesen cc5766bc4b tests: Bluetooth: Fix for btp_bap broadcast create/reconfig
This updates the struct name for the create parameter,
and fixes the call to reconfig.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-28 15:31:30 +02:00
Emil Gydesen 85bb2624bc Bluetooth: Audio: Refactor codec_cfg_get_freq
Refactor the codec_cfg_get_freq function to return the assigned
numbers value, instead of a converted value, but with
support for converting the value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-28 14:05:18 +02:00
Erik Brockhoff 551b9afe11 Bluetooth: controller: adding unittest for Central CIS Create
Adding unittests for basic Central CIS Create functionality

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-09-28 14:05:00 +02:00
Magdalena Kasenberg efb5c0902b bluetooth: tester: Add support for BAP broadcast
Support for BAP/BSRC and BAP/BSNK test cases.

Add partial support for GAP/PADV as periodic advertising is needed
for BAP/BSRC tests and they can share common code.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-09-28 13:36:46 +02:00
Pavel Vasilyev b7579065f9 tests: bluetooth: tester: Move mesh-1.1 features to a separate conf
This allows to compile mesh tester for 1.0.1 and 1.1 specs sepately.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-09-28 14:19:03 +03:00
Krzysztof Kopyściński a8334210c1 tests: Bluetooth: tester: add support for Proxy Solicitation
Adds BTP commands implemantation needed to pass tests for Proxy
Solicitation.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Michał Narajowski 2ad0eaa9ab tests: Bluetooth: tester: Add Models Metadata Page 128
Add Models Metadata Page 128 support to tester.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-09-28 14:19:03 +03:00
Krzysztof Kopyściński 26e697bd04 tests: Bluetooth: tester: enable Composition Data Page 1
This allows to tests this page using BTP protocol.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Krzysztof Kopyściński 7b69f8faf0 Tests: Bluetooth: Tester: Add BTP command to enable Private NID
This allows to advertise beacons with Private Node Identity on demand,
like was available for regular Node Identity.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Michal Narajowski 1e5eeb83f4 tests: bluetooth: tester: Add Opcodes Aggregator support
- Add entry for client and server in composition data.
- Add Client commands to aggregate and send messages.

MESH/SR/AGG/BV-02-C requires more key slots.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Krzysztof Kopyściński 51ec2462d6 Bluetooth: Tester: Add Blob, DFU and DFD tests support
Adding support for automatic testing BLOB, DFU and DFD models.

Co-authored-by: Agata Ponitka <agata.ponitka@codecoup.pl>
Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-09-28 14:19:03 +03:00
Krzysztof Kopyściński 68928e050f Tests: Bluetooth: tester: enable Remote Provisioning
This enables Remote Provisioning in tester application. Adds basic
setup and required structures/functions.

add BTP API for Remote Provisioning Client

This adds BTP commands for RPR Client API.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Michał Narajowski a73727c2fe Bluetooth: tester: Add Transport SAR Configuration models
Add support for testing the new SAR Configuration models in tester
application.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Michał Narajowski 11bdcb859e tester: Add Large Comp Data models
- Adds Large Comp Data Server and Client
- Defines some dummy metadata for Health Server

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Michał Narajowski 959e55cdc0 Bluetooth: tester: Add ttl param to Model Send CMD
Some test cases require more control over transmission parameters used
when sending access messages.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Michał Narajowski 0efc66df5e Bluetooth: tester: Use Model Receive testing callback
Send a BTP event to the automation framework that a model message has
been received.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2023-09-28 14:19:03 +03:00
Piotr Narajowski 8e5898f039 bluetooth: tester: VCP Client tests
Add support for VCP Client tests

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-09-28 13:16:23 +02:00
Emil Gydesen 4ab658be42 tests: Bluetooth: Add inval testing of bt_bap_broadcast_source_reconfigure
Add invalid parameter and state testing of
bt_bap_broadcast_source_reconfigure

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-28 13:14:49 +02:00
Aleksander Wasaznik 347ce7aa7f bluetooth: samples: Add hci_uart_async
This sample is an alternative implementation of hci_uart. The new sample
differs from the existing sample in that it uses the async UART API
instead of the interrupt driven API.

Included in this commit is a new test for HCI UART flow control. It's
enabled for hci_uart_async. The test can excercise also the existing
hci_uart sample (with some minimal changes to allow compiling in the
mock controller and test suite). The existing hci_uart sample currently
fails the flow control test.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-09-28 14:07:52 +03:00
Aleksandr Khromykh 4cf78b1e6d tests: Bluetooth: tester: fix mesh1d1 EHP pts tests
Mesh1d1 uses EHP wth SHA256 algorithm as the main one.
This mandates to use 32 bytes static oob if static oob
has been chosen.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-09-27 15:48:08 +02:00
Vinayak Kariappa Chettimada 3c2b1f952c Bluetooth: Controller: Add BT_CTLR_EVENT_OVERHEAD_RESERVE_MAX Kconfig
Add BT_CTLR_EVENT_OVERHEAD_RESERVE_MAX Kconfig to allow the
omit of EVENT_OVERHEAD_START_US and EVENT_OVERHEAD_END_US in
the time reservation calculations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-27 15:47:45 +02:00
Emil Gydesen a5384bbf1a tests: Bluetooth: BAP: Initial Broadcast reconfigure test
Add a simple initial test for the reconfigure unittest.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-27 15:44:02 +02:00
Piotr Narajowski d20c95e529 bluetooth: tester: MICP BTP event
Enhance AICS BTP events functionality for invalid behavior tests.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-09-26 16:54:20 +02:00
Piotr Narajowski 6c4b9c9933 bluetooth: tester: AICS BTP event
Enhance AICS BTP Events Functionality for invalid behavior tests.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-09-26 16:54:20 +02:00
Vinayak Kariappa Chettimada 8c9ac505db Bluetooth: Controller: nRF53: Fix sw switch single timer id regression
Fix regression in sw switch single timer id use for nRF53x
series SoC.

Regression introduced in commit cfcbe5d68e ("Bluetooth:
Controller: Remove redudant header file includes").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-25 19:47:10 +02:00
Emil Gydesen 63badb0fa7 tests: Bluetooth: Audio: bt_audio_codec_cap_get unit tests
Add unit tests for the bt_audio_codec_cap_get* functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-25 09:48:47 +02:00
Emil Gydesen 7d65c55a50 tests: Bluetooth: BAP broadcast source param name fix
The test fixture used an invalid struct for the param
due to a renaming of the struct in another commit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-21 11:52:39 +02:00
Emil Gydesen 6472054976 tests: Bluetooth: Audio: Codec meta_get unit tests
Add unit tests for the bt_audio_codec_meta_get_* functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:21:24 +01:00
Emil Gydesen c3c83c7049 Bluetooth: ASCS: Modify the ACL disconnect behavior
Instead of calling ase_release for each ASE in the ACL
disconnected callback, we now call the state_transition_work_handler
directly. This is to ensure that when the disconnected callback
returns, the bt_conn object has been properly unref'ed in
a timely manner.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:20:27 +01:00
Emil Gydesen f93caa3903 Bluetooth: Audio: BT_AUDIO_CODEC_LC3_ID -> BT_HCI_CODING_FORMAT_LC3
Replace the BT_AUDIO_CODEC_LC3_ID macro with the
BT_HCI_CODING_FORMAT_LC3 as there is no reason to
define and use the LC3 ID different than the other
allowed codec IDs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:19:50 +01:00
Emil Gydesen ddf4504bce tests: Bluetooth: Add inval test of bt_bap_broadcast_source_start
Add tests to test invalid parameters to bt_bap_broadcast_source_start.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-20 20:17:34 +01:00
Henrik Eriksen 70bdccac7f bluetooth: tester: ccp: Added support for testing Call Control client.
- Discover GTBS.
- Accept call.
- Terminate call.
- Originate call.
- Get call states.

Signed-off-by: Henrik Eriksen <heri@demant.com>
2023-09-20 08:56:15 +02:00
Vinayak Kariappa Chettimada f4e05e3e54 Bluetooth: Controller: Fix ticker to prefer ticker node started
Fix ticker implementation to prefer to keep ticker node
started in case of race condition to start and stop.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-19 15:25:21 +01:00
Nirosharn Amarasinghe 467ec2e6b7 tests: bluetooth: controller: Included kconfigs for ISO-AL logging
Included kconfigs to set the ISO-AL logging level and control debug
logging verbosity in ISO-AL unit tests.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2023-09-18 14:35:42 +02:00
Nirosharn Amarasinghe 770f435e68 tests: bluetooth: controller: Updated ISO-AL tests for length of err PDU
Updated unit tests to match changes in ISO-AL that disregard the length
of a received PDU with errors.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2023-09-18 14:35:42 +02:00
Nirosharn Amarasinghe 2260b651b6 tests: bluetooth: controller: ISO-AL selection of TX time stamps
Unit tests for TX time stamp related decisions.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2023-09-18 14:35:42 +02:00
Nirosharn Amarasinghe 05ce650c85 test: bluetooth: controller: Updated ISO-AL tests to cover endianness
Changes:
-- Changed RX tests and one TX test to cover endianness of the framed
   segment header fields
-- Updated RX debug PDU print to include framed segment details

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2023-09-18 14:35:42 +02:00
Nirosharn Amarasinghe ec20938627 tests: bluetooth: controller: Test for framed TX in consecutive events
Changes:
-- Included a test to check TX in concesecutive events irrespective of
   the input target event
-- Updated expected output of current tests for change in framed RX
   error handling which waiting for the start of an event

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2023-09-18 14:35:42 +02:00
Vinayak Kariappa Chettimada 5daa864b5e Bluetooth: Controller: Use DIV_ROUND_UP macro in HAL ticker
Use DIV_ROUND_UP macro in HAL ticker.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-18 14:25:02 +02:00
Vinayak Kariappa Chettimada 34100cb7ea Bluetooth: Controller: Use defines for femto and pico seconds
Use defines for femto and pico seconds in HAL ticker
calculations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-18 14:25:02 +02:00
Vinayak Kariappa Chettimada 333ff94e6b Bluetooth: Controller: Use HAL_TICKER_US_TO_TICKS_CEIL for ticks_slot
Use HAL_TICKER_US_TO_TICKS_CEIL for ticks_slot calculations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-18 14:25:02 +02:00
Vinayak Kariappa Chettimada 01314b2e43 Bluetooth: Controller: Make openisa and test hal ticker.h consistent
Make openisa and unit test hal ticker.h consistent with
nrf hal ticker.h.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-09-18 14:25:02 +02:00
Donatien Garnier 185a6117c0 Bluetooth: Host: Amend existing L2CAP accept callbacks
This patch amends the existing L2CAP accept callbacks to use the new
accept signature that includes a pointer to the L2CAP server structure.

Signed-off-by: Donatien Garnier <donatien.garnier@blecon.net>
2023-09-14 14:36:34 +02:00
Gerard Marull-Paretas 691facc20f include: always use <> for Zephyr includes
Double quotes "" should only be used for local headers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-14 13:49:58 +02:00
Piotr Narajowski 38c9181642 bluetooth: tester: Service init
VCS and AICS service init will be handled in auto-pts

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-09-13 17:23:13 +02:00
Piotr Narajowski a2f92bad92 bluetooth: tester: MICS Server tests
Add support for MICS Server tests

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-09-11 16:57:12 -04:00
Emil Gydesen 830aa5f7da tests: Bluetooth: Add initial BAP Broadcast Source unit tests
Adds initial BAP Broadcast Source unit tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-11 11:06:52 +02:00
Piotr Narajowski 925a8b65d5 bluetooth: tester: MICP Client tests
Add support for MICP Client tests.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-09-08 14:43:00 +02:00
Magdalena Kasenberg 4d7cef6f33 bluetooth: tester: Reenable PACS characteristics
After recent refactors some PACS characteristics have to be enabled
with CONFIG_ variables.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-09-06 17:55:26 +02:00
Mariusz Skamra 9a9855f711 tests: Bluetooth: audio: Unit test bt_audio_codec_cfg_get_* helpers
This adds unit tests for bt_audio_codec_cfg_get_* functio helpers.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-09-05 10:06:09 +02:00
Carles Cufi 8c748fd005 kernel: Modify the signature of k_mem_slab_free()
Modify the signature of the k_mem_slab_free() function with a new one,
replacing the old void **mem with void *mem as a parameter.

The following function:
void k_mem_slab_free(struct k_mem_slab *slab, void **mem);

has the wrong signature. mem is only used as a regular pointer, so there
is no need to use a double-pointer. The correct signature should be:
void k_mem_slab_free(struct k_mem_slab *slab, void *mem);

The issue with the current signature, although functional, is that it is
extremely confusing. I myself, a veteran Zephyr developer, was confused
by this parameter when looking at it recently.

All in-tree uses of the function have been adapted.

Fixes #61888.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-09-03 18:20:59 -04:00
Pavel Vasilyev 78d9ebb51d tests: Bluetooth: tester: Change mesh nrf board to nrf52840dk_nrf52840
Mesh tester doesn't fit into nrf52dk_nrf52832.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-09-01 15:09:07 +02:00
Andrei Emeltchenko 60e8d9d859 tests: btp_bap: Fix using wrong index
Fix using cig_id instead of index i

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-09-01 09:55:05 +02:00
Mariusz Skamra 17b9d11a35 tests: Bluetooth: ascs: Fix compilation warning
This fixes implicit declaration of function
‘bt_bap_unicast_server_disable’ compilation warning.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-30 17:48:52 +02:00
Mariusz Skamra d11bc6edb4 tests: Bluetooth: ascs: Fix linker warning
This fixes linker warning caused by invalid bonding of linker scripts
provided by multiple "-T" options.

mock-sections.ld contains output sections did you forget -T

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-30 17:48:52 +02:00
Fabio Baltieri a16f1cee4a bluetooth: host: fix few mismatched CONTAINER_OF
Fix a bunch of mismatched CONTAINER_OF, few missing
k_work_delayable_from_work conversions but also many
bt_l2cap_le_chan/bt_l2cap_chan and few others.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-30 10:22:37 +02:00
Thomas Ebert Hansen 00c5edd411 Bluetooth: controller: Fix LLCP enc. execution ctx
rp_enc_state_wait_ltk_reply() is executed in thread context, so
it is not allowed to move the encryption state machine forward.

Defer LTK reply handling to next prepare event by introducing a continue
state.

Update the unit test to reflect this, and remove the TODO that actually
said there was an issue in the first place.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-30 10:22:15 +02:00
Troels Nilsson 8a2a2bd613 Bluetooth: Controller: Add trpa cache for BT_CTLR_SW_DEFERRED_PRIVACY
Adds a target RPA known unknown cache; it fulfills a similar function
to the existing peer RPA cache, used for scanning of directed
advertisements

Signed-off-by: Troels Nilsson <trnn@demant.com>
2023-08-29 16:13:22 +02:00
Emil Gydesen 6ccd112c56 Bluetooth: Audio: Refactor bt_audio_codec_cfg to flat arrays
Refactor the bt_audio_codec_cfg to use flat arrays to store
metadata and codec specific configurations.

The purpose of this is to make it easier to copy the data
between layers, but also to support non-LTV data for non-LC3
codec configurations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-28 15:56:53 +02:00
Fredrik Danebjer 4c94056f74 Bluetooth: Audio: Make PACS optional notify actually optional
Added Kconfig options to make the various PACS characteristics that are
optionally notifiable selectable as notifiable. Selecting a
characteristic as notifiable will make it so for all pacs instance on
the device.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-08-28 15:56:26 +02:00
Morten Priess 83fcbfd0be Bluetooth: controller: Fixes for CIS Central error handling
- Fix masking for no coded phy
- Allow ISO_Interval < SDU_Interval for framed mode
- Change BT_HCI_ERR_INSUFFICIENT_RESOURCES to
  BT_HCI_ERR_CONN_LIMIT_EXCEEDED.
- Prevent starting same CIS twice
- Cancel an initiated CIS creation procedure if terminated before
  sending CIS_IND.
- Implement canceling of local CC procedure. Respond to CIS_RSP with
  REJECT, if canceled after CIS_REQ was sent.
- Introduce state CIG_STATE_INITIATING for central, to keep track of
  initiating CIS connection, in transition between CONFIGURABLE and
  ACTIVE.

Fixes EBQ test /HCI/CIS/BC-03-C.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2023-08-23 14:45:24 +02:00
Mariusz Skamra 043c1d8d4e tests: Bluetooth: tester: Add native_posix board to test build targets
This extends the list of build variants with native_posix variant to
build the tester application by CI.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-23 14:44:48 +02:00
Mariusz Skamra 7700c27dfc tests: Bluetooth: tester: Move DT overlays to boards directory
This moves the board DT overlays and configurations to /board
directory so that it can be automatically applied in compilation
pipeline.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-23 14:44:48 +02:00
Thomas Ebert Hansen 32b1c575fe tests: Bluetooth: Test invalid enc. pause
Add test to verify that
1) A peripheral role cannot initiate an encryption pause
2) A peripheral role rejects a LL_PAUSE_ENC_REQ while a CIS is
   established

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-22 10:53:47 +02:00
Thomas Ebert Hansen ff861304c3 tests: Bluetooth: Use FFF in ctrl_encrypt
Replace Ztest Mock with FFF.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-22 10:53:47 +02:00
Thomas Ebert Hansen 34fc97b2a0 tests: Bluetooth: Mock ISO streams with FFF
Update test_cc_create_periph_rem_host_accept to use mocked
ll_conn_iso_stream_get()

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-22 10:53:47 +02:00
Mariusz Skamra 8540682f18 tests: Bluetooth: tester: Fix missing metadata validation on Enable
This fixes missing metadata validation on Enable operation callback.

Fixes: BAP/USR/SPE/BI-04-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-22 09:59:53 +02:00
Mariusz Skamra 02f399dc1d tests: Bluetooth: ascs: Add prohibited audio context metadata test
This adds for receiving and handling Enable operation with
prohibited audio context value.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-22 09:59:53 +02:00
Mariusz Skamra d28f180473 Bluetooth: audio: ascs: Move metadata validation to stack
As the metadata has to be validated anyway, let the initial vaidation of
metadata to be done in ASCS. The application can still reject the
metadata, but the length validation and supported type validation can be
performed by the stack.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-22 09:59:53 +02:00
Mariusz Skamra 914dc408fd tests: Bluetooth: ascs: Fix improperly formatted metadata
This fixes improperly formatted metadata. The Stream Context value is 2
bytes in size.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-22 09:59:53 +02:00
Mariusz Skamra 293676a433 tests: Bluetooth: tester: Update the testcase.yaml file
This updates the testcase.yaml to include new configurations for
LeAudio, Mesh and native builds.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-17 16:49:42 +02:00
Daniel Leung 83adb55931 tests: bluetooth: rename shadow variables
Renames shadow variables found by -Wshdaow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-17 13:00:09 +02:00
Mariusz Skamra 6e38356b3c tests: Bluetooth: tester: Do not memset the streams on ACL disconnection
The streams can be deallocated once bt_bap_stream_ops.released callback
is called. Otherwise it may cause memory violation in the stack.

Fixes: ASCS/SR/ACP/BV-31-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-17 12:50:22 +02:00
Mariusz Skamra 0d49bb3d70 tests: Bluetooth: ascs: Add CIS connection retry test case
This adds test case testing whether ASE in Enabling state will accept
releated CIS Request if previous CIS establishment procedure failed.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-16 20:39:15 +02:00
Mariusz Skamra ade1a4495e tests: Bluetooth: ascs: Add CIS link loss test cases
This adds test cases testing correctness of autonomous ASE
state transitions triggered by CIS link loss.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-16 20:39:15 +02:00
Mariusz Skamra c7476fd7c9 tests: Bluetooth: ascs: Get chan pointer from test_preamble_state_disabling
This adds a possibility to get the ISO channel pointer from
test_preamble_state_disabling function that can be further used in
tests.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-16 20:39:15 +02:00
Mariusz Skamra e85a0bc572 tests: Bluetooth: ascs: Extend mock_bt_iso_disconnected with error param
This extends mock_bt_iso_disconnected function parameters with error
code that can provide the HCI error code that is the reason of CIS
disconnection.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-16 20:39:15 +02:00
Magdalena Kasenberg cce76eed24 bluetooth: tester: bap: Add support for BAP/USR tests
Extend Codec capabilities of the server.

At Codec Config operation initiated autonomously by server, all ASEs
with lower IDs than the requested one have to be initated first due
to API limitation.

In some BAP/USR (server role) test cases the PTS sends the MMI 202
to configure the Sink ASE to streaming state, in some others it does not.
For now, let's autonomously send Receiver Start Ready at ASE Enabled.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-08-16 14:48:11 +02:00
Emil Gydesen 53502cb417 Bluetooth: Audio: Make codec_cap const
There is no reason why the capabilities
should be modified by the stack after registration,
nor any reason why a the unicast client application
needs to modify the reported remote capabilities, so
all have been marked as const.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-15 11:14:29 +00:00
Emil Gydesen aa990ae6dc Bluetooth: Audio: Refactor bt_audio_codec_cap to flat arrays
Refactor the bt_audio_codec_cap to use flat arrays to store
metadata and codec specific capabilities.

The purpose of this is to make it easier to copy the data
between layers, but also to support non-LTV data for non-LC3
codec capabilities.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-15 11:14:29 +00:00
Emil Gydesen 93ce3e14bc Bluetooth: Audio: Shell: Fix Scan delegator subgroup count
The number of subgroups the scan delegator supports should
match the number of subgroups the broadcast sink supports.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-14 13:34:26 +00:00
Emil Gydesen 2390f974af tests: Bluetooth: Update audio mocs for bt_iso_chan_get_tx_sync
bt_iso_chan_get_tx_sync was missing a mock now that it is
being used by bap_stream.c

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-14 13:33:57 +00:00
Emil Gydesen d4dc55bfa4 bluetooth: tester: Modify to use bt_bap_stream_get_tx_sync
Modify audio_send_timeout to use bt_bap_stream_get_tx_sync
instead of bt_iso_chan_get_tx_sync to avoid using an internal
function to get the ISO channel from the BAP stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-14 13:33:57 +00:00
Emil Gydesen 8600356f98 Bluetooth: BAP: Add bt_bap_stream_get_tx_sync
Add bt_bap_stream_get_tx_sync to get the ISO tx info from a BAP
stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-14 13:33:57 +00:00
Henrik Eriksen 5bd46b91fd bluetooth: tester: Added support for testing CSIS.
- Initialisation of Coordinated Set Identification Service.
- Set and clear member lock.
- Get member RSI.

Signed-off-by: Henrik Eriksen <heri@demant.com>
2023-08-10 08:11:13 +00:00
Magdalena Kasenberg 03370ab22e bluetooth: tester: gap: Add support for extended advertising
Needed for LE Audio tests.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-07-26 14:33:22 +02:00
Pavel Vasilyev 4d56a318f1 bluetooth: tester: Add commands to add and delete virtual addresses
Virtual address behavior has been changed in this PR:
https://github.com/zephyrproject-rtos/zephyr/pull/57878

Now it is required to register virtual address before using it.

Corresponding PR to auto-pts:
https://github.com/auto-pts/auto-pts/pull/961

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-07-25 15:26:36 +02:00
Magdalena Kasenberg 927168fb5a bluetooth: tester: bap: Add support for AC 7(i) tests
Allow to assing end points to CISes before creating a CIG. Previously
the end points were assinged top-down, so the configuration 7(i) and
other similar were not covered.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-07-20 16:23:05 +02:00
Mariusz Skamra c09c4181cf Bluetooth: audio: tbs_client: Minor Kconfig refactor
This intoduces dedicated Kconfig option to enable TBS client,
that makes the configuration more intuitive.
While configuring GTBS only, the user does not have to explicitly set
the BT_TBS_CLIENT_MAX_TBS_INSTANCES to 0 to disable the TBS client
functionality.
This adds also `tbs_only_client` test case to test the TBS only build
option.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-18 11:06:57 +00:00
Mariusz Skamra 9fa4543994 Bluetooth: audio: ascs: Defer ASE state transition
This adds handling of ASE control point operations in separate thread
so that the notifications of ASE state changes are sent from non-BT
thread. This ensures bt_gatt_notify_cb to be blocking waiting for
available buffers to send the notifications.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-18 11:05:03 +00:00
Emil Gydesen 388af8fda4 Bluetooth: BAP: Remove stream->dir field
The BAP stream object should not have a dir field. The
dir field should be stored in the EP only (to avoid having two
fields storing the same value, causing possible issues).

The field was removed, and the places that use it has been updated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-14 16:48:41 +00:00
Aleksandr Khromykh 9b4d080419 Bluetooth: Mesh: add shell statistic commands
Commit adds commands to get and to clear
the frame statistic.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-07-07 09:20:33 +02:00
Magdalena Kasenberg a3f1f25de3 bluetooth: tester: Fix build errors
Recently there have been a few name changes in the API that caused
build errors of the tester application when LE Audio overlays applied.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-07-06 09:47:15 +00:00
Emil Gydesen 5fa793fa9d Bluetooth: Modify stream_ops->stopped to be called on leaving streaming
When a stream leaves the streaming state the `stopped` callback
will now be called, similar to how the `started` callback works.

This ensures that `stopped` is always called and not just when
the CIS disconnects.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-05 12:34:01 +00:00
Arkadiusz Kozdra 82d8f09de1 bluetooth: host: track connection type enum
The enum used for connection types gets named bt_conn_type to guard
against accidental usage of generic integers with relation to it.

The added default case in several switch statements avoids warnings
against unhandled enum values.

Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
2023-07-05 09:15:48 +02:00
Mariusz Skamra 8797e50b64 tests: Bluetooth: ascs: Swap bt_gatt_attr_read mock with real function
This refactors the code to use exact copy of bt_gatt_attr_read instead
of mock, as the implementation might call the function with stack
allocated value. Using mock would require deep copy of the value for
further verification. As the buffer where the value is about to placed
is one of the attr->read() parameters, the test may call the read()
callback with stack allocated buffer of defined size and read the value
from the buffer.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-05 09:14:37 +02:00
Mariusz Skamra 03c04fd8d7 tests: Bluetooth: ascs: Fix build warning
This fixes incompatible pointer type warning.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-04 09:32:00 +02:00
Emil Gydesen 49a70aa1bb Bluetooth: TMAP: Add TMAP shell module
Add simple TMAP shell module that supports the TMAP
discovery.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-06-30 16:10:51 +02:00
Emil Gydesen 69f7fd9cb2 Bluetooth: Audio: Rename bt_codec to bt_audio_codec_{cap, conf, data}
Rename the bt_codec struct to bt_audio_codec_conf or
to the new struct bt_audio_codec_cap.
Rename the bt_codec_data to bt_audio_codec_data.

The purpose of this is to split the codec specific configuration
and codec capabilities into seperate structs, as they do not
reflect the same values, or used for the same purpose.

This commit depends on the preset macros workings on either
type of struct (for now), but will be modified in future updates.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-06-30 12:39:50 +02:00