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>
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>
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>
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>
This fixes implicit declaration of function
‘bt_bap_unicast_server_disable’ compilation warning.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This adds tests for receiving ISO Data PDU.
* test_recv_in_streaming_state - test whether received ISO Data PDU is
sent to upper layers.
* test_recv_in_enabling_state - test whether received ISO Data PDu is
dropped because upper layer is not ready to receive the data yet.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
In order to have clean, self-contained HCI headers that do not have any
dependencies towards the Host or any other part of the system (except
types), reorganize the headers in the following way:
- Split out the macros and structs from hci.h to a new hci_types.h
- Merge the existing hci_err.h into the new hci_types.h
Fixes#58214.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from tests. It has
been deprecated since this PR:
https://github.com/zephyrproject-rtos/zephyr/pull/56183
The Kconfig symbols has been replaced by `CONFIG_LOG=y` on most of the
cases. Or it has been removed when not needed anymore.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Add support for long writes for the unicast client and server.
This reuses the ATT buffer for long reads.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Until now iterable sections APIs have been part of the toolchain
(common) headers. They are not strictly related to a toolchain, they
just rely on linker providing support for sections. Most files relied on
indirect includes to access the API, now, it is included as needed.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Continue test execution even if assumption failed. This won't break the
test execution prematurely and allow to perform a cleanup.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Calling bt_bap_stream_start moves the ASE to streaming state.
If the function is not called the Sink ASE stays in enabling state.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds 2 new test cases that test whether arrayed parameters are
handled properly.
This improves the existing test_codec_configure_invalid_ase_id_unavailable
test case by handling request conatining 2 ASE_ID's where the 1st is
invalid.
This reproduces the issue fixed in
419772db94238debe114dfac337f5b238a15436e.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds tests that validate the implementation handles invalid length
Control Point operations.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>